Omniscia Alliance Block Audit
Treasury Code Style Findings
Treasury Code Style Findings
TRE-01C: Variable Mutability Specifier
Type | Severity | Location |
---|---|---|
Gas Optimization | Informational | Treasury.sol:L18, L21, L26, L27 |
Description:
The linked variables are only assigned to once during the constructor
of the contract.
Example:
contracts/V2/Treasury.sol
23constructor(address _uniswapRouter, address _externalRewardToken) public {24 require(_uniswapRouter != address(0x0), "Treasury:: Uniswap router cannot be 0");25 require(_externalRewardToken != address(0x0), "Treasury:: External reward token not set");26 uniswapRouter = IUniswapV2Router(_uniswapRouter);27 externalRewardToken = _externalRewardToken;28}
Recommendation:
As a result, we advise the immutable
mutability specifier to be introduced to them greatly optimizing the gas cost involved in interacting with them.
Alleviation:
The linked variables were properly set to immutable
greatly optimizing all segments they are utilized in.