CollectionShutdown
Contracts/src/contracts/utils/CollectionShutdown.sol
The full quorum-based shutdown lifecycle. See Shutdowns journey for the lifecycle narrative; this page is the field-level reference.
State views
| Function | Returns |
|---|---|
collectionParams(_collection) | CollectionShutdownParams (votes, sweeperPool, quorum, canExecute, collectionToken, availableClaim, sweeperPoolTokenIds) |
shutdownVoters(_collection, _user) | Vote weight currently held by _user against _collection |
sweeperPoolCollection(_pool) | Reverse lookup from a SudoSwap pair to its collection |
pairFactory() | The ILSSVMPairFactoryLike used for liquidation pools |
curve() | The ICurve used for SudoSwap linear curves |
locker() | The owning ILocker |
MAX_SHUTDOWN_TOKENS() | Hard cap on _tokenIds.length in execute |
SHUTDOWN_QUORUM_PERCENT() | Quorum threshold (typically 50) |
collectionLiquidationComplete(_collection) | True once the SudoSwap pair has fully drained |
Structs
struct CollectionShutdownParams {
uint96 shutdownVotes;
address sweeperPool;
uint88 quorumVotes;
bool canExecute;
ICollectionToken collectionToken;
uint availableClaim;
uint[] sweeperPoolTokenIds;
}Public surface
Lifecycle
| Function | Caller | Description |
|---|---|---|
start(_collection) | Holder | Begin a shutdown |
vote(_collection) | Holder | Lock CT into the shutdown’s tally |
voteAndClaim(_collection) | Holder | Vote + claim atomically when execute-ready |
reclaimVote(_collection) | Holder | Withdraw vote and CT |
execute(_collection, _tokenIds) | Owner | Liquidate locker NFTs into a SudoSwap pair |
claim(_collection, _claimant) | Anyone | Pay out _claimant’s share post-execute |
cancel(_collection) | Anyone | Cancel an in-progress shutdown when supply has grown back |
preventShutdown(_collection, _prevent) | Owner | Permanently lock a collection out of shutdown |
Admin
| Function | Description |
|---|---|
pause(_paused) | Pauses the contract |
Errors
| Error | Cause |
|---|---|
LockerIsZeroAddress | constructor |
ShutdownPrevented | start while opted out |
ShutdownProcessAlreadyStarted / ShutdownProccessNotStarted | Lifecycle mismatch |
ShutdownNotReachedQuorum | execute before quorum |
ShutdownNotExecuted | claim before execute |
ShutdownQuorumHasPassed | reclaimVote after execute |
TooManyItems | _tokenIds.length > MAX_SHUTDOWN_TOKENS |
UserHoldsNoTokens | start from zero-balance wallet |
NoNFTsSupplied | execute with empty _tokenIds |
ListingsExist | execute while liquid/dutch listings remain |
NoTokensAvailableToClaim / NotAllTokensSold | claim invariants |
FailedToClaim | Downstream ETH transfer failed |
NoVotesPlacedYet | reclaimVote from a non-voter |
InsufficientTotalSupplyToCancel | cancel when supply still below threshold |
CollectionNotShutdownCompatible(_collection) | start for an opted-out collection |
Events
| Event | Notes |
|---|---|
CollectionShutdownStarted(_collection) | New shutdown |
CollectionShutdownCancelled(_collection) | Cancelled |
CollectionShutdownExecuted(_collection, _pool, _tokenIds) | Liquidation kicked off |
CollectionShutdownVote(_collection, _voter, _vote) | Cast |
CollectionShutdownVoteReclaim(_collection, _voter, _vote) | Reclaimed |
CollectionShutdownQuorumReached(_collection) | Quorum gate flipped |
CollectionShutdownClaim(_collection, _claimant, _tokenAmount, _ethAmount) | Holder claimed |
CollectionShutdownTokenLiquidated(_collection, _ethAmount) | SudoSwap pair sold an NFT |
CollectionShutdownPrevention(_collection, _prevented) | Opt-out toggled |
Inherited surface
Pausable,Ownable,ReentrancyGuard.- The
_token-receiving leg of every shutdown flow is escrowed via the Locker’sCollectionTokendirectly, not viaTokenEscrow.