thirdweb

Explore

Docs

Support

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.

OpenSea Creator Fees?

OpenSea does not distribute royalties / creator fees on smart contracts by default. You can find the OpenSea compatible version of this contract at this link: https://thirdweb.com/deployer.thirdweb.eth/Pack_OSRoyaltyFilter

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

Learn more about this contract on our portal

    WRITE


  • READ

DEFAULT_ADMIN_ROLE

view

Released by

thirdweb.eth

View all contracts

Details

  • Release Date

    Nov 16, 2022

  • Audit Report

    View Audit Report

  • Licenses

    MIT, Apache-2.0


  • Extensions

  • ERC1155


  • Share


    Learn about Release

    thirdweb © 2022

    FeedbackPrivacy PolicyTerms of ServiceGas Estimator