Voucher to redeem an NFT

I would like to use one NFT as a voucher for another NFT contract and am wondering the best solution gas wise to accomplish this. I want users to be able to redeem this token for the same id and in doing so burn the voucher token.
I am already Using OZ ERC721 contracts for the main token and just wondering if I should maybe transfer the token and then have the main NFT contract burn it once it owns it. Or should I use access control to allow the main contract to call a redeem function to burn a token?

1 Like

Hi @Skyler_Fly,

If I understand correctly, you have a voucher NFT and a main NFT.
A voucher NFT can be redeemed for the main NFT with the same token ID.

As an aside, if you are doing this on mainnet, then the value of the main NFT needs to be significantly more than the cost of the redemption to make this worthwhile for a user.

If redemption is short term functionality (i.e. not for the entire life of the main NFT), then I would look at having a specific redemption contract. This redemption contract could then either hold main NFTs, be an approved operator or have rights to mint (depending on whether you have preminted or are minting on demand) and could have a redeem function that either holds, burns or changes the state of the voucher NFT to redeemed.

Taking a step back, there may be other solutions to redeeming an NFT, depending on your requirements.

1 Like

Hey @abcoathup,

Thanks for the reply! This is for TinyBoxes and I am trying to launch tomorrow. :sweat_smile:
Have a basic PromoToken solution working but its not the best for gas.
here is an example tx
promo token redeem example tx

Yes, that is right. The tokens need to be redeemable for the entire life of the main NFT(forever).
The Promo NFTs use a different id space counting down from 2**256 (aka negatives read as signed ints) than the normally mintable tokens on the main contract counting up from 0. As limited editions the gas should be fine, seeing as we will be paying for the promo NFTs mint and the promo gets special features when minting (Limited Editions with the RNG seed set by them for full designability).

I want to be able to make new Promo NFTs up to the 100 cap as well as giving out a set of about 50 to the beta testers.
BTW, send me your address as a DM and I will add you to the list for your help!!!

I saw this solution for doing a Merkel-Airdrop for an ERC20 but wasn’t sure I will have the time to make that work for this now.

1 Like

We are minting on demand for the main NFTs by the way.
You mention changing the state of the NFT to redeemed. I bet minting the NFTs once and setting some redeem flag once it is actually set to the data for producing the art, would be less gas and less complexity. Plus the limited editions would always be under the same token contract even before redeeming.

1 Like

I guess for ultimate gas efficiency we could use token data that is otherwise invalid, to represent unredeemed tokens. The count of shapes has to be > 0 for example and anything unset is 0. That is perfect as default minted tokens with no data (unredeemed) would be recognized that way easily

1 Like

Hi @Skyler_Fly,

Current Ether price and gas fee make that transaction > $10. Ouch.

I think a Merkel airdrop could be a lower cost solution, though you would need to test this, but it would take time to get the setup correctly.

Thank you for the kind offer. I don’t accept gifts as it is part of my job (unless its merch, I :heart: socks or size 2XL hoodies for anyone else reading this).

Assuming I found the POC artwork, it looks very cool.

As an aside, do your token holders have any rights to making physical items?

Good luck with the launch.

Yes! Token holders may print or frame digitally the tokens. I am using the Nifty license like art blocks and would like to make a print registry eventually!

here is the latest art from the beta test tokens

I changed it so the promo tokens are just tokens on the main contract with the data still unset in the mapping until they are redeemed.

1 Like

Love that article thanks for the link!

1 Like