Omniscia Dapp Radar Audit

StakingRewardsController Static Analysis Findings

StakingRewardsController Static Analysis Findings

SRC-01S: Inexistent Visibility Specifier

Description:

The linked variable has no visibility specifier explicitly set.

Example:

contracts/StakingRewardsController.sol
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

Description:

The linked bool comparison is performed between a variable and a bool literal.

Example:

contracts/StakingRewardsController.sol
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

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:

contracts/StakingRewardsController.sol
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.