Omniscia Parabola Finance Audit

MultiStakingRewards Code Style Findings

MultiStakingRewards Code Style Findings

MSR-01C: Inexistent Error Messages

TypeSeverityLocation
Code StyleInformationalMultiStakingRewards.sol:L149, L162, L397, L418, L419

Description:

The linked require checks have no error messages explicitly defined.

Example:

contracts/MultiStakingRewards.sol
141// Add a new reward token to be distributed to stakers
142function addReward(
143 address _rewardsToken,
144 address _distributor
145)
146public
147onlyOwner
148{
149 require(rewardData[_rewardsToken].lastUpdateTime == 0);
150 rewardTokens.push(_rewardsToken);
151 rewardData[_rewardsToken].lastUpdateTime = block.timestamp;
152 rewardData[_rewardsToken].periodFinish = block.timestamp;
153 rewardDistributors[_rewardsToken][_distributor] = true;
154}

Recommendation:

We advise them to be set so to aid in the validation of the require's condition as well as the legibility of the codebase.

Alleviation:

The Parabola team opted not to apply a remediation for this finding in the current iteration of the codebase.

MSR-02C: Inexistent Visibility Specifiers

TypeSeverityLocation
Code StyleInformationalMultiStakingRewards.sol:L85, L87, L88

Description:

The linked variables have no visibility specifier explicitly set.

Example:

contracts/MultiStakingRewards.sol
84// Private mappings for balance data
85mapping(address => Balances) balances;
86// user -> week -> balance
87mapping(address => mapping(uint256 => LockedBalance[])) userLocks;
88mapping(address => LockedBalance[]) userEarnings;

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 Parabola team opted not to apply a remediation for this finding in the current iteration of the codebase.

MSR-03C: Variable Mutability Specifier

TypeSeverityLocation
Gas OptimizationInformationalMultiStakingRewards.sol:L103

Description:

The linked variable is assigned to only once during the contract's constructor.

Example:

contracts/MultiStakingRewards.sol
100constructor(
101 address _stakingToken
102) public Ownable() {
103 stakingToken = IERC20(_stakingToken);
104 // First reward MUST be the staking token or things will break
105 // related to the 50% penalty and distribution to locked balances
106 rewardTokens.push(_stakingToken);
107 rewardData[_stakingToken].lastUpdateTime = block.timestamp;
108
109 // 0 week -> 1x
110 supportWeek.push(0);
111 weekMultiplier[0] = PRICE_PRECISION;
112}

Recommendation:

We advise it to be set as immutable greatly optimizing the codebase.

Alleviation:

The Parabola team opted not to apply a remediation for this finding in the current iteration of the codebase.