thirdweb

⌘K

DocsSupport
Pack

Pack

Pack multiple tokens into ERC1155 NFTs that act as randomized loot boxes


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

  • Technical Design Doc

  • Full reference

Learn more about this contract on our portal

5.0.3 Release Notes


Official patch for Multicall disclosed in https://blog.thirdweb.com/vulnerability-report/


DEFAULT_ADMIN_ROLE

(DEFAULT_ADMIN_ROLE)

view

Published by

thirdweb.eth

View all contracts

Details

  • Publish Date

    Dec 18, 2023

  • Licenses

    MIT, Apache-2.0


  • Extensions

  • Extension detected

    ERC1155


  • Share


    Learn about Publish

    Feedback

    Privacy Policy

    Terms of Service

    Gas Estimator

    Chainlist

    thirdweb © 2024