-
Notifications
You must be signed in to change notification settings - Fork 6
dany.armstrong90 - Total LUM rewards may be distributed for exeeding the _lumPerSecond
.
#90
Comments
_lumPerSecond
._lumPerSecond
.
Escalate |
You've created a valid escalation! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
I think this report is missing key information like POC and evidence from docs as well as code. For this reason it should not be considered a duplicate. |
Impact of #107 (the target issue): Impact of #175 (another duplicate of #107): |
Can you show me POC? |
I agree this is indeed the duplicate of #107 and not #177. And as correctly mentioned above, POC is not mandatory for each issue and I don’t think it’s mandatory for this issue. Additionally, this report has a textual POC which is also sufficient. Hence, planning to accept the escalation and duplicate with #107 |
Result: |
Escalations have been resolved successfully! Escalation status:
|
dany.armstrong90
High
Total LUM rewards may be distributed for exeeding the
_lumPerSecond
.Summary
LUM rewards for a pool are calculated by elapsed time from
lastUpdateTimestamp
andweights[pid]
.Voter.sol#setTopPoolIdsWithWeights
function updates theweights[pid]
but not update thelastUpdateTimestamp
of the pool to theblock.timestamp
.Therefore, the total LUM rewards may exceed the
_lumPerSecond
due to the inflation of elapsed time fromlastUpdateTime
.Vulnerability Detail
Scenario:
poolA
with weight100%
at timeT0
.poolA
at timeT1
( >T0
), thus the LUM rewards are distributed_lumPerSecond
(100%
) per second topoolA
for time[T0, T1]
and thelastUpdateTimestamp
ofpoolA
isT1
.poolB
during the time[T0, T1]
, thus thelastUpdateTimestamp
ofpoolB
isT0
.poolA
's weight to0%
andpoolB
's weight to100%
at timeT2
( >T1
).poolB
at timeT3
( >T2
). Since thelastUpdateTimestamp
ofpoolB
isT0
, the Total LUM rewards are distributed_lumPerSecond
(100%
) per second for the time[T0, T1]
._lumPerSecond * 2
(200%
) per second for the time[T0, T1]
.Impact
Total LUM rewards may be distributed for exeeding the
_lumPerSecond
.Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/tree/main/magicsea-staking/src/Voter.sol#L260-L298
Tool used
Manual Review
Recommendation
Modify the
Voter.sol#setTopPoolIdsWithWeights
function as follows.Duplicate of #107
The text was updated successfully, but these errors were encountered: