# Unable To Get Rewards If Admin Withdraws \$VE3D tokens From VeTokenMinter Contract

VeTokenMinter.mint computes payout from maxSupply constant, not actual token balance, so admin withdrawal of pre-minted VE3D makes mint revert and bricks reward claims.

- Payout: Contest reward
- Severity: medium
- Program: veToken Finance
- Credited: xiaoming90
- Disclosed: 2022-10-25
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-05-vetoken-findings/issues/202
- Library page: https://bugbountylibrary.com/r/c4%3A2022-05-vetoken%3AM-10
- Tags: domain:web3 impact:dos impact:funds-loss kind:contest platform:code4rena sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:dos

**Target:** VeTokenMinter / Booster / BaseRewardPool reward flow
**Root cause:** mint() sizes transfers against the maxSupply constant and internal totalSupply, assuming the full 30M pre-minted VE3D always sits in the contract; withdraw() transfers tokens out without adjusting accounting, so safeTransfer can exceed the real balance.
**Steps:**
1. Deploy: 30M VE3D pre-minted to VeTokenMinter; maxSupply=30M, totalSupply=0.
2. Admin calls `VeTokenMinter.withdraw(dest, 29M)`; contract balance now 1M, totalSupply unchanged.
3. Operator calls `mint(0x001, 10M)`; supply=20M, cliff=666, reduction=334, _amount=3.34M, amtTillMax=10M so no cap.
4. `veToken.safeTransfer(0x001, 3.34M)` reverts: balance 1M < 3.34M.
5. Revert cascades Booster.rewardClaimed -> BaseRewardPool.getReward, blocking all reward claims.
**How found:** Read deployment script showing 30M pre-mint to minter, then compared withdraw() (no state update) against mint()'s maxSupply-based math to spot the balance/accounting desync.
**Escalation:** Single shared VeTokenMinter serves all integrated projects (Curve, Pickle, Ribbon, Idle, Angle, Balancer), so one revert blocks reward claims protocol-wide.
**Insight:** When a contract pre-mints a fixed supply and pays users by transfer rather than on-demand minting, check every path that moves tokens out (admin withdraw, rescue) against the mint math's assumptions about balance; a constant like maxSupply is not the real balance.
