-
Notifications
You must be signed in to change notification settings - Fork 1
cccz - mintRollovers should require entitledShares >= relayerFee #293
Comments
fix PR: Y2K-Finance/Earthquake#136 |
Needs additional changes. L423 doesn't make sense to me. queue[index].assets is in shares and entitledAmount isn't but they are subtracted directly. |
@IAm0x52 thx for your comment, basically since |
Bringing in some Discord discussion: 0x52
3xHarry
0x52
|
Fix looks good. Fee is no longer converted since epoch in which fee is removed is always 1:1 |
cccz
medium
mintRollovers should require entitledShares >= relayerFee
Summary
mintRollovers should require entitledShares >= relayerFee
Vulnerability Detail
In mintRollovers, the rollover is only not skipped if queue[index].assets >= relayerFee,
In fact, since the user is already profitable, entitledShares is the number of assets of the user, which is greater than queue[index].assets, so it should check that entitledShares >= relayerFee, and use entitledShares instead of queue[index].assets to subtract relayerFee when calculating assetsToMint later.
Impact
This will prevent rollover even if the user has more assets than relayerFee
Code Snippet
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Carousel/Carousel.sol#L401-L406
Tool used
Manual Review
Recommendation
Change to
The text was updated successfully, but these errors were encountered: