# Stale shutdown params can be reused to drain all funds from `CollectionShutdown` contract

Stale CollectionShutdown params keyed by ERC-721 address let an attacker restart shutdown with a new collection token and over-claim, draining all contract funds.

- Payout: Audit contest
- Severity: high
- Program: Flayer
- Found by: 0xc0ffEE
- Disclosed: 2024-08-06
- Write-up quality: 8/10
- Original: https://github.com/sherlock-audit/2024-08-flayer-judging/issues/173
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-08-flayer%3AH-5
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** CollectionShutdown contract (Solidity)
**Root cause:** reclaimVote is callable after shutdown execution and start leaves stale CollectionShutdownParams; params are keyed by ERC-721 address, so a recreated collection mixes old sale proceeds with the new collection token balance.
**Steps:**
1. Create collection for ERC-721, deposit NFT, get 1 ether collectionToken
2. Call `collectionShutdown.start(erc721)` from address(1)
3. Execute shutdown; NFTs sold on Sudoswap yielding 100 ether
4. Call `collectionShutdown.reclaimVote(erc721)` to zero shutdownVotes
5. `locker.createCollection(erc721,...)` creates new collectionToken2
6. Deposit NFT, get 1 ether collectionToken2; call `start(erc721)` again, redirecting params to collectionToken2
7. Mint 11 ether collectionToken2 to address(2); call `voteAndClaim(erc721)`
8. Claim pays 100 ether * 11 = 1100 ether, stealing 1000 ether
**How found:** Code review of CollectionShutdown: noticed reclaimVote lacks a post-execution guard and start only checks shutdownVotes==0 while leaving stale params; observed params indexed by ERC-721 address so a recreated collection collides with old state.
**Exploitation:** Attacker reuses stale shutdown params after a completed shutdown: reclaims vote to reset shutdownVotes to 0, recreates the collection to obtain a fresh collection token, restarts shutdown so params point to the new token, then votes with an inflated new-token balance to claim against the old Sudoswap sale proceeds, extracting far more than deposited.
**Escalation:** Amplify claim by minting large balance of new collection token (11 ether) against 100 ether old proceeds to drain entire contract balance.
**Insight:** When state is keyed by a mutable/recreatable identifier (ERC-721 address) rather than the token instance, check whether lifecycle functions (reclaim/reset) can re-open a completed flow and mix old proceeds with new balances; key by the token contract instead.

