Open code423n4 opened 2 years ago
L1 Agree with "typo" as well as with avoiding magic numbers This is the one instance of Code != Comment that I've bumped to Low
L2 Personally disagree as withdrawal could be left always open (up to sponsor implementation)
N3 Agree with convention
L4 Agree with need to check
L5 Agree with usage of constants over magic numbers
N6 Agree on oddity I belive the interface combines the booster with the BaseRewardPool
3++
Overall
There are 3 Non-critical issues and 3 Low severity issues found.
[L1]
USDMPegRecovery.sol
implementation is not spec compliantPer to README:
https://github.com/code-423n4/2022-02-concur/tree/72b5216bfeaa7c52983060ebfc56e72e0aa8e3b0#-usdmpegrecovery
In the implementation:
The actual threshold is
4m
. Only 1/10 of the expected40m
;https://github.com/code-423n4/2022-02-concur/blob/72b5216bfeaa7c52983060ebfc56e72e0aa8e3b0/contracts/USDMPegRecovery.sol#L90-L108
Recommendation
Consider adding a new constant:
And change:
to:
[L2] Certain methods should be disabled when paused
Based on common practices,
pause
is used for preventing loss of value in emergency situations, which should disable certain methods that can change essential states and transfer funds.Therefore, we believe the following methods should be disabled when the contract is paused.
Recommendation
Consider adding
whenNotPaused
to the methods above, or if the intention is to pause deposit only, consider adding a new storage variable calleddepositPaused
.[N3] Code Style: constants should be named in all caps
Here are some examples that the code style does not follow the best practices:
https://github.com/code-423n4/2022-02-concur/blob/72b5216bfeaa7c52983060ebfc56e72e0aa8e3b0/contracts/ConvexStakingWrapper.sol#L28-L36
[L4] Unchecked return value for
token.transfer
callIt is usually good to add a require-statement that checks the return value or to use something like safeTransfer; unless one is sure the given token reverts in case of a failure.
Instances include:
https://github.com/code-423n4/2022-02-concur/blob/72b5216bfeaa7c52983060ebfc56e72e0aa8e3b0/contracts/ConvexStakingWrapper.sol#L182-L182
Recommendation
Consider adding a require-statement or using
safeTransfer
of SafeERC20.[N5] Constants are not explicitly declared
It's a best practice to use constant variables rather than literal values to make the code easier to understand and maintain.
Consider defining a constant variable for the literal value used and giving it a clear and self-explanatory name.
Instances include:
https://github.com/code-423n4/2022-02-concur/blob/72b5216bfeaa7c52983060ebfc56e72e0aa8e3b0/contracts/StakingRewards.sol#L67-L71
https://github.com/code-423n4/2022-02-concur/blob/72b5216bfeaa7c52983060ebfc56e72e0aa8e3b0/contracts/StakingRewards.sol#L75-L79
Consider changing
1e18
toREWARD_PER_TOKEN_MULTIPLIER
constant.[N6] Interface
IRewardStaking
mismatch implementationshttps://github.com/code-423n4/2022-02-concur/blob/72b5216bfeaa7c52983060ebfc56e72e0aa8e3b0/contracts/external/ConvexInterfaces.sol#L12-L34
The
IRewardStaking
interface above is:withdrawAndUnwrap()
on Booster.sol)A misleading interface can cause issues like [WP-H2].
Recommendation
Consider changing the type declaring for addresses.
For example:
-
-