Omniscia Dapp Radar Audit
StakingRewardsController Static Analysis Findings
StakingRewardsController Static Analysis Findings
SRC-01S: Inexistent Visibility Specifier
Type | Severity | Location |
---|---|---|
Code Style | StakingRewardsController.sol:L31 |
Description:
The linked variable has no visibility specifier explicitly set.
Example:
31mapping(uint16 => uint256) supplyPerChain;
Recommendation:
We advise one to be set so to avoid potential compilation discrepancies in the future as the current behaviour is for the compiler to assign one automatically which may deviate between pragma
versions.
Alleviation:
The public
visibility specifier has been introduced to the referenced variable thereby alleviating this exhibit.
SRC-02S: Literal Equality of bool
Variable
Type | Severity | Location |
---|---|---|
Gas Optimization | StakingRewardsController.sol:L172 |
Description:
The linked bool
comparison is performed between a variable and a bool
literal.
Example:
172require(nonceRegistry[_nonce] == false, "This nonce was already processed");
Recommendation:
We advise the bool
variable to be utilized directly either in its negated (!
) or original form.
Alleviation:
The bool
variable is now utilized directly instead of the comparison statement in its negated form as required.
SRC-03S: Redundant Variable Assignment
Type | Severity | Location |
---|---|---|
Gas Optimization | StakingRewardsController.sol:L45 |
Description:
The linked variable is assigned to redundantly to the default value of the relevant data type (i.e. uint256
assigned to 0
, address
assigned to address(0)
etc.).
Example:
45PoolInfo public poolInfo = PoolInfo(0, 0);
Recommendation:
We advise the assignment to be safely omitted optimizing the codebase.
Alleviation:
The redundant assignment has been safely omitted from the codebase.