Omniscia Dapp Radar Audit
StakingRewardsProxy Code Style Findings
StakingRewardsProxy Code Style Findings
SRP-01C: Variable Mutability Specifiers (Immutable)
Type | Severity | Location |
---|---|---|
Gas Optimization | StakingRewardsProxy.sol:L23, L24 |
Description:
The linked variables are assigned to only once during the contract's constructor
.
Example:
contracts/StakingRewardsProxy.sol
48constructor(address _endpoint, address _fund, address _controller, address _stakingToken) NonblockingLzApp(_endpoint) {49 require(_controller != address(0), "RadarStakingProxy: invalid controller address");50 require(_stakingToken != address(0), "RadarStakingProxy: invalid staking token address");51 require(_fund != address(0), "RadarStakingProxy: invalid fund address");52
53 controller = _controller;54 fund = _fund;55 stakingToken = IERC20(_stakingToken);56}
Recommendation:
We advise them to be set as immutable
greatly optimizing their read-access gas cost.
Alleviation:
The Dapp Radar team considered this exhibit but opted not to apply a remediation for it in the current iteration of the codebase.