ContractsCollectionShutdown

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

FunctionReturns
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

FunctionCallerDescription
start(_collection)HolderBegin a shutdown
vote(_collection)HolderLock CT into the shutdown’s tally
voteAndClaim(_collection)HolderVote + claim atomically when execute-ready
reclaimVote(_collection)HolderWithdraw vote and CT
execute(_collection, _tokenIds)OwnerLiquidate locker NFTs into a SudoSwap pair
claim(_collection, _claimant)AnyonePay out _claimant’s share post-execute
cancel(_collection)AnyoneCancel an in-progress shutdown when supply has grown back
preventShutdown(_collection, _prevent)OwnerPermanently lock a collection out of shutdown

Admin

FunctionDescription
pause(_paused)Pauses the contract

Errors

ErrorCause
LockerIsZeroAddressconstructor
ShutdownPreventedstart while opted out
ShutdownProcessAlreadyStarted / ShutdownProccessNotStartedLifecycle mismatch
ShutdownNotReachedQuorumexecute before quorum
ShutdownNotExecutedclaim before execute
ShutdownQuorumHasPassedreclaimVote after execute
TooManyItems_tokenIds.length > MAX_SHUTDOWN_TOKENS
UserHoldsNoTokensstart from zero-balance wallet
NoNFTsSuppliedexecute with empty _tokenIds
ListingsExistexecute while liquid/dutch listings remain
NoTokensAvailableToClaim / NotAllTokensSoldclaim invariants
FailedToClaimDownstream ETH transfer failed
NoVotesPlacedYetreclaimVote from a non-voter
InsufficientTotalSupplyToCancelcancel when supply still below threshold
CollectionNotShutdownCompatible(_collection)start for an opted-out collection

Events

EventNotes
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’s CollectionToken directly, not via TokenEscrow.