This repository has been archived by the owner on Oct 1, 2023. It is now read-only.
ck - mintRollovers
should remove rollovers after successful execution
#380
Labels
Escalation Resolved
This issue's escalations have been approved/rejected
Excluded
Excluded by the judge without consulting the protocol or the senior
Non-Reward
This issue will not receive a payout
ck
medium
mintRollovers
should remove rollovers after successful executionSummary
mintRollovers
should remove rollovers after successful executionVulnerability Detail
After a successful rollover, the
mintRollovers
just replaces theassets
andepochId
of a user with new values.The issue is that after a successful rollover that a user had enrolled for has succeeded, they remain in the queue with new values and their old index.
Let's say they want to enroll some more assets. Since they still exist in the
rolloverQueue
, their index in the queue will remain the same:Now going back to the
mintRollovers
function, their index has already been recorded as successful:This means, that when the starting index of the
mintRollovers
function will be a value higher than the user's position in the queue and no rollover will happen for their additional assets.Impact
Users who enlist for rollover of additional assets will not have it executed.
Code Snippet
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Carousel/Carousel.sol#L361-L459
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Carousel/Carousel.sol#L253-L257
Tool used
Manual Review
Recommendation
Remove a user from the
rolloverQueue
after a successful rollover so that when they enlist again, they are pushed to the end of the queue.The text was updated successfully, but these errors were encountered: