Add Deck claims extension for ERC1155 #112
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
Add a new Deck claim extension that enables creators to initialize claims with multiple token variations (card deck-style distribution), where a designated signer can deliver mints to specified recipients.
Summary of Changes
New contracts:
contracts/deckClaims/IDeck.sol- Base interface with shared types (StorageProtocol enum, ClaimMint struct, VariationMint struct) and error definitionscontracts/deckClaims/Deck.sol- Abstract base contract with admin controls, signer validation, and withdraw functionalitycontracts/deckClaims/IERC1155Deck.sol- ERC1155-specific interface extending IDeckcontracts/deckClaims/ERC1155Deck.sol- Full implementation with claim initialization, token URI handling, and batch mint deliveryTest coverage:
test/deck/ERC1155Deck.t.sol- Comprehensive Foundry tests (25 test cases) covering access control, claim initialization, mint delivery, token URI generation, and edge casesDocumentation:
CLAUDE.md- AI assistant guidelines for the projectKey Flows
Claim Initialization: Creator admin calls
initializeClaim()with storage protocol, token variations count, and metadata location. This mints the initial token variations to the caller.Mint Delivery: Designated signer calls
deliverMints()with array of ClaimMint structs specifying recipients, variation indices, and amounts. Tokens are minted to recipients viamintExtensionExisting().Token URI Resolution: URIs are constructed from storage protocol prefix (ARWEAVE/IPFS/NONE) + location + variation index.
Test Plan
🤖 Generated with Claude Code