ERC1155Pack contract extends ERC1155Items to add a pack-opening flow powered by a commit-reveal scheme.
Step 1: Open your ERC1155Pack contract
From your project dashboard, select the PACK contract you want to configure, then open thePack tab to manage its contents. Confirm you are on the correct network and linked collection before editing.

Step 2: Choose or add a pack to edit
Use the pack selector to pick the pack you want to update, or clickAdd new pack to create another pack entry. The table lists each pack’s underlying token address, type, IDs, and amounts that will be included when a pack is opened.

Step 3: Upload pack contents via CSV
ClickAdd New Pack or Update Pack Contents to open the CSV uploader. Enter the Pack ID you want to modify, set the Supply for how many packs can be opened, and upload a CSV with one row per pack content.
Each row must include:
Pack Content ID- For each item:
Token Address,Token Type(1155/721),Token IDs, andAmounts

Step 4: Give the pack contract a Minter role on your item collection
For packs to mint items when opened, grant the ERC1155Pack contract address theMinter role on the ERC1155 collection you’re using for pack contents. Open that item contract’s Settings > Permissions, add the pack contract address, and assign Minter, then sign the transaction.
Step 5: Review and publish
After the CSV is processed you will see a preview of the parsed Pack Content rows. Verify the token addresses, IDs, amounts, and totals, then clickCreate Pack Contents to save. Your pack is now ready to be opened by players.

How ERC1155Pack works
Pack contents are managed by addresses withPACK_ADMIN_ROLE using setPacksContent(bytes32 _merkleRoot, uint256 _supply, uint256 packId). The merkle root encodes every possible pack content, and supply defines how many packs can be opened for that ID. Builder handles the root creation from your CSV so you can focus on content.
Flow (on-chain):
- User calls
commit(packId)to burn their pack and create a commitment. - After at least one block, anyone can call
reveal(user, packContent, proof, packId)with a merkle proof for the selected content; the contract verifies and mints the items. The Sequence API will do this automatically. - If reveal is not called before the commitment block hash expires (30 minutes),
refundPack(user, packId)returns the pack.
- Commitment records
block.number + 1for randomness. - Reveal derives
randomSeed = keccak256(abi.encode(blockHash, user)). - The contract picks
randomSeed % remainingSupply[packId], using a Fisher–Yates-style_availableIndicesmap so each content can only be revealed once and stays uniformly random. - The merkle leaf is
keccak256(abi.encode(revealIdx, packContent)), matched by the supplied proof.