Developer - Redeem a Capsule NFT

Users have the option to store tokens within a Capsule NFT at the time of mint and embed the Capsule NFT with artwork. The Capsule NFT can be redeemed at any time to retrieve the tokens stored inside. Redemption of a Capsule NFT requires an already minted Capsule NFT, which you can create here.

Below are some examples of redeeming a Capsule NFT.

Note: Redemption of the Capsule NFT requires burning of the Capsule NFT in return for acquiring the stored tokens. Thus, methods below are named burnXYZ.

Methodology

In order to redeem a Capsule NFT you must:

  • know the address of the Capsule Collection from which your Capsule NFT resides (this is the same as getting the address of your NFT, which can be found on Etherscan, OpenSea, or Metamask)

  • know the ID of your Capsule NFT (the NFT ID, is the unique identification number given to your NFT. It can also be found on Etherscan, OpenSea, or Metamask)

Capsule NFT Redemption Types and Methods

More information on the methods below can be found at the CapsuleMinter.sol page. Depending on the type of Capsule NFT you are redeeming, you will call either:

Simple Capsule NFT

function burnSimpleCapsule(address _capsule, uint256 _id) external

ERC-20 Capsule NFT or Multi ERC-20 Capsule NFT

function burnSingleERC20Capsule(address _capsule, uint256 _id) external
function burnMultiERC20Capsule(address _capsule, uint256 _id) external

ERC-721 Capsule NFT or Multi ERC-721 Capsule NFT

function burnSingleERC721Capsule(address _capsule, uint256 _id) external
function burnMultiERC721Capsule(address _capsule, uint256 _id) external

ERC-1155 Capsule

Given that only mintMultiERC1155Capsule is available to users, burnMultiERC1155Capsule must be used.

function burnMultiERC1155Capsule(address _capsule, uint256 _id) external

Example Capsule NFT Redemption Call

Methods for redeeming a Capsule NFT are largely the same - the only difference lying in the type of Capsule (method) called.

Note: Burning a Simple Capsule NFT will not return any stored tokens (as none are placed inside), and thus has no special effect unless your application has built logic for such. An example has been shown for clarity.

Some example calls to redeem (burn) any type of Capsule NFT are shown here:

burnSimpleCapsule(
    "0x1a0a69a267b3e72d22dEB970b2Cc6296aC31A80c", // Capsule Collection (NFT) address
    1, // Capsule NFT ID
);

burnSingleERC20Capsule(
    "0x1a0a69a267b3e72d22dEB970b2Cc6296aC31A80c", // Capsule Collection (NFT) address
    2, // Capsule NFT ID
);

burnMultiERC721Capsule(
    "0x1a0a69a267b3e72d22dEB970b2Cc6296aC31A80c", // Capsule Collection (NFT) address
    3, // Capsule NFT ID
);

These calls will redeem any Capsule NFT:

  • From the Capsule Collection at address 0x1a0a69a267b3e72d22dEB970b2Cc6296aC31A80c

  • Depending on the method above - with the ID 1, 2, or 3

While the redemption parameters are the same for each Capsule NFT type, the method call differs for each.

You must use the same redemption method call as was used to mint the Capsule NFT (for example, a Single ERC-721 Capsule must be redeemed using the burnSingleERC721Capsule method).

Last updated