code-423n4 / 2023-03-mute-findings

2 stars 1 forks source link

Upgraded Q -> 2 from #17 [1680620718364] #47

Closed c4-judge closed 1 year ago

c4-judge commented 1 year ago

Judge has assessed an item in Issue #17 as 2 risk. The relevant finding follows:

[L-05] Check that staking cannot occur when endTime is reached The MuteAmplifier.stake function should require that the current timestamp is smaller than endTime even when the call to stake is the first that ever occurred. Currently the check is only made in the case that the call to stake is not the first. The check should be made in both cases. This is because when staking occurs when block.timestamp >= endTime, no rewards will be paid out. Additionally the user needs to pay the management fee on his LP token stake. So there is really no point in allowing users to do it because it only hurts them.

Fix:

diff --git a/contracts/amplifier/MuteAmplifier.sol b/contracts/amplifier/MuteAmplifier.sol index 9c6fcb5..460c408 100644 --- a/contracts/amplifier/MuteAmplifier.sol +++ b/contracts/amplifier/MuteAmplifier.sol @@ -202,13 +202,12 @@ contract MuteAmplifier is Ownable{ */ function stake(uint256 lpTokenIn) external virtual update nonReentrant { require(lpTokenIn > 0, "MuteAmplifier::stake: missing stake");

c4-judge commented 1 year ago

Picodes marked the issue as duplicate of #23

c4-judge commented 1 year ago

Picodes marked the issue as satisfactory