Omniscia Alliance Block Audit
CompoundingRewardsPoolFactory Code Style Findings
CompoundingRewardsPoolFactory Code Style Findings
CRF-01C: Variable Mutability Specifier
Type | Severity | Location |
---|---|---|
Gas Optimization | Informational | CompoundingRewardsPoolFactory.sol:L13, L14, L26, L27 |
Description:
The linked variables are only assigned to once during the constructor
of the contract.
Example:
contracts/V2/factories/CompoundingRewardsPoolFactory.sol
16constructor(address _treasury, address _externalRewardToken) public {17 require(18 _treasury != address(0),19 "CompoundingRewardsPoolFactory:: Treasury address can't be zero address"20 );2122 require(23 _externalRewardToken != address(0),24 "CompoundingRewardsPoolFactory:: External reward address can't be zero address"25 );26 treasury = _treasury;27 externalRewardToken = _externalRewardToken;28}
Recommendation:
As a result, we advise that they are set as immutable
to greatly optimize the gas cost involved in utilizing them.
Alleviation:
Both linked variables were set to immutable
greatly optimizing the gas cost in the functions they are utilized in.