# The attacker will prevent eligible users from claiming the liquidated balance

Attacker re-votes after shutdown execution and re-registers collection with lower denomination to cancel shutdown, deleting claim state and blocking users' ETH claims.

- Payout: Audit contest
- Severity: high
- Program: Flayer
- Found by: 0x37
- Disclosed: 2024-08-06
- Write-up quality: 8/10
- Original: https://github.com/sherlock-audit/2024-08-flayer-judging/issues/742
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-08-flayer%3AH-25
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high technique:chained technique:source-review vuln:access-control vuln:business-logic vuln:dos

**Target:** CollectionShutdown contract
**Root cause:** vote() lacks a check preventing voting after execution, allowing canExecute to be re-flagged; cancel() uses locker.collectionToken(_collection).denomination() instead of params.collectionToken.denomination(), so re-registering with a lower denomination bypasses the total supply check.
**Steps:**
1. Setup: collection token total supply 4 CTs, denomination 4; Lewis holds 2 CTs, Max holds 2 CTs.
2. Lewis calls `CollectionShutdown::start(collection)`; quorumVotes = 2 CTs, shutdownVotes = 2 CTs, canExecute = true.
3. Owner executes shutdown; NFTs liquidated on SudoSwap; collection sunset; canExecute = false; availableClaim set.
4. Max transfers most CTs to another wallet, keeps 1 wei CT.
5. Max calls `CollectionShutdown::vote(collection)`; since shutdownVotes (2 CTs) >= quorumVotes (2 CTs), canExecute becomes true again.
6. Max calls `locker.createCollection(address(erc721b), 'Test Collection', 'TEST', 0)` to re-register with denomination 0.
7. Max calls `CollectionShutdown::cancel(collection)`; check `params.collectionToken.totalSupply() <= MAX_SHUTDOWN_TOKENS * 10 ** locker.collectionToken(collection).denomination()` becomes `(4 * 1e18 * 10 ** 4) <= (4 * 1e18 * 10 ** 0)` which is false, so it passes; all params deleted including availableClaim.
8. Lewis attempts `CollectionShutdown::claim(collection, Lewis)` and reverts; ETH from SudoSwap is locked.
**How found:** Auditor noticed that vote() does not restrict voting after execution and that cancel() uses the current locker token denomination instead of the stored params.collectionToken denomination, enabling a bypass via re-registration.
**Exploitation:** Attacker holds a small amount of collection tokens, waits for shutdown execution and NFT liquidation, then votes to re-flag canExecute, re-registers the collection with a lower denomination, and calls cancel to delete the claim state, preventing legitimate users from claiming their share of the liquidated ETH.
**Insight:** When a contract stores a token reference in params, always use that stored reference for denomination/supply checks rather than re-fetching from a registry that can be re-initialized; also ensure state-changing functions like vote() are disabled after execution to prevent re-triggering flags.

## Proof of concept (copied exactly from the original report)

**Forge command to run PoC**

```
forge test --mt test_CanBlockEligibleUsersToClaim -vvv
```

