thirdweb's Pack contract
The pack contract lets you bundle ERC20, ERC721 and, ERC1155 tokens together into ERC1155 NFTs that act as randomized loot boxes. The packs are ERC1155 NFTs themselves, which can have the metadata you'd expect of an NFT, such as a name, image, description, etc.
When a pack is opened, a pre-defined quantity of tokens are randomly selected from the ones that were used to create the packs (that haven't already been selected), and awarded to the opener. The pack NFT is burned as it's opened.
You can configure how many tokens get selected for the pack:
How many tokens are in each "unit" (for ERC20 & ERC1155 tokens - one unit could be multiple tokens). How many units are in each pack.
Use Cases & Examples
You could use the Pack contract to:
Create randomized NFT loot boxes
Run a randomized raffle where some users open a winning ticket
Reward your community with token gift boxes
Resources
2.0.8 Release Notes
Fix reward unit issue introduced in v2.0.6 (https://github.com/thirdweb-dev/contracts/pull/484)
DEFAULT_ADMIN_ROLE
(DEFAULT_ADMIN_ROLE)
view
Details
Publish Date
Aug 24, 2023
Audit Report
Licenses
MIT, Apache-2.0