Omniscia Alliance Block Audit

LimitedAutoStake Code Style Findings

LimitedAutoStake Code Style Findings

LAS-01C: Variable Mutability Specifier

TypeSeverityLocation
Gas OptimizationInformationalLimitedAutoStake.sol:L11, L15

Description:

The linked stakeLimit variable is assigned to only once during the constructor of the contract.

Example:

contracts/autostake-features/LimitedAutoStake.sol
13constructor(address token, uint256 _throttleRoundBlocks, uint256 _throttleRoundCap, uint256 stakeEnd, uint _stakeLimit) public AutoStake(token, _throttleRoundBlocks, _throttleRoundCap, stakeEnd) {
14 require(_stakeLimit != 0 , "LimitedAutoStake:constructor::stake limit should not be 0");
15 stakeLimit = _stakeLimit;
16}

Recommendation:

We advise that the immutable mutability specifier is introduced to the stakeLimit variable greatly optimizing the gas cost involved in utilizing it.

Alleviation:

The linked variable was properly set to immutable greatly optimizing the gas cost involved in utilizing it.