Omniscia Parabola Finance Audit
MultiStakingRewards Code Style Findings
MultiStakingRewards Code Style Findings
MSR-01C: Inexistent Error Messages
Type | Severity | Location |
---|---|---|
Code Style | Informational | MultiStakingRewards.sol:L149, L162, L397, L418, L419 |
Description:
The linked require
checks have no error messages explicitly defined.
Example:
141// Add a new reward token to be distributed to stakers142function addReward(143 address _rewardsToken,144 address _distributor145)146public147onlyOwner148{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
Type | Severity | Location |
---|---|---|
Code Style | Informational | MultiStakingRewards.sol:L85, L87, L88 |
Description:
The linked variables have no visibility specifier explicitly set.
Example:
84// Private mappings for balance data85mapping(address => Balances) balances;86// user -> week -> balance87mapping(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
Type | Severity | Location |
---|---|---|
Gas Optimization | Informational | MultiStakingRewards.sol:L103 |
Description:
The linked variable is assigned to only once during the contract's constructor
.
Example:
100constructor(101 address _stakingToken102) public Ownable() {103 stakingToken = IERC20(_stakingToken);104 // First reward MUST be the staking token or things will break105 // related to the 50% penalty and distribution to locked balances106 rewardTokens.push(_stakingToken);107 rewardData[_stakingToken].lastUpdateTime = block.timestamp;108
109 // 0 week -> 1x110 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.