# mintRollovers should require entitledShares >= relayerFee

Y2K Carousel mintRollovers skips rollover when queue[index].assets < relayerFee, ignoring entitledShares, preventing rollover for profitable users.

- Payout: Contest reward
- Severity: medium
- Program: Y2K
- Credited: cccz
- Disclosed: 2023-03-06
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-03-Y2K-judging/issues/293
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-03-Y2K%3AM-8
- Tags: domain:web3 impact:dos kind:contest platform:sherlock sev:medium tech:solidity vuln:business-logic

**Target:** Carousel.sol mintRollovers function
**Root cause:** The check uses queue[index].assets instead of entitledShares to determine if the user can cover the relayer fee, and later subtracts relayerFee from queue[index].assets instead of entitledShares.
**Steps:**
1. User deposits assets into an epoch and queues them for rollover.
2. Epoch ends with profit, so entitledShares > queue[index].assets.
3. If queue[index].assets < relayerFee but entitledShares >= relayerFee, mintRollovers skips the rollover.
4. User cannot rollover despite having sufficient assets.
**How found:** Manual review of mintRollovers logic, noticing that entitledShares (user's assets) is compared to queue[index].assets and that the fee check uses the wrong variable.
**Insight:** When a function computes a user's entitled shares and then checks against a fee, ensure the check uses the entitled amount, not the original deposit, especially when profits accrue.
