Omniscia Altura Audit

ALTUVesting Code Style Findings

ALTUVesting Code Style Findings

ALU-01C: Ineffectual Usage of Safe Arithmetics

TypeSeverityLocation
Language SpecificALTUVesting.sol:
I-1: L72
I-2: L109
I-3: L118

Description:

The linked mathematical operations are guaranteed to be performed safely by surrounding conditionals evaluated in either require checks or if-else constructs.

Example:

contracts/ALTUVesting.sol
71uint256 immediate = grossAmount.mulDiv(IMMEDIATE_BPS, BPS_DENOM);
72uint256 vesting = grossAmount - immediate;

Recommendation:

Given that safe arithmetics are toggled on by default in pragma versions of 0.8.X, we advise the linked statements to be wrapped in unchecked code blocks thereby optimizing their execution cost.

ALU-02C: Inefficient Usage of Mapping Entries

TypeSeverityLocation
Gas OptimizationALTUVesting.sol:
I-1: L100, L101
I-2: L125, L126, L127

Description:

The referenced statements will load a mapping entry into memory inefficiently.

Example:

contracts/ALTUVesting.sol
100AccountState memory a = _accounts[beneficiary];
101uint256 principal = uint256(a.vestingPrincipal);

Recommendation:

As a memory declaration will copy all fields into memory even if they are not needed, we advise storage pointers to be utilized instead which are more optimal.