Omniscia Mantissa Finance Audit
Rewarder Code Style Findings
Rewarder Code Style Findings
RRE-01C: Ineffectual Usage of Safe Arithmetics
Type | Severity | Location |
---|---|---|
Language Specific | Rewarder.sol:L78, L139 |
Description:
The linked mathematical operations are guaranteed to be performed safely by surrounding conditionals evaluated in either require
checks or if-else
constructs.
Example:
contracts/Rewarder.sol
74if (block.number > pool.lastRewardBlock) {75 uint256 lpSupply = lpToken.balanceOf(masterMantis);76
77 if (lpSupply > 0) {78 uint256 blocks = block.number - pool.lastRewardBlock;
Recommendation:
Given that safe arithmetics are toggled on by default in pragma
versions of 0.8.X
, we advise the linked statements to be wrapped in unchecked
code blocks thereby optimizing their execution cost.
Alleviation (418ee413ad8e26f7eea383764c19953ff31b2bf3):
Both statements have been safely wrapped in an unchecked
code block, optimizing their execution cost.
RRE-02C: Redundant Casting Operation
Type | Severity | Location |
---|---|---|
Code Style | Rewarder.sol:L150 |
Description:
The msg.sender
value is being cast to an address
type in the referenced statement when it already is of the said type.
Example:
contracts/Rewarder.sol
150rewardToken.safeTransfer(address(msg.sender), rewardToken.balanceOf(address(this)));
Recommendation:
We advise the redundant casting operation to be omitted.
Alleviation (418ee413ad8e26f7eea383764c19953ff31b2bf3):
The redundant casting operation has been safely omitted from the codebase.