Final Thoughts on WAX Smart Contracts

idmontie

Ivan Montiel

Posted on August 6, 2023

Final Thoughts on WAX Smart Contracts

Introduction

Throughout this tutorial, we’ve focused on using Smart Contracts on the WAX Blockchain to create interactive experiences. And while we’ve only scratched the surface on what is possible in WAX, we have seen how powerful the WAX Ecosystem is.

AtomicAssets has enabled us to create rich NFTs without dealing with the infrastructure needed to let users interact with them.

AtomicHub lets us organize and present our NFTs to a wide audience that normally wouldn’t be able to interact with our assets.

The WAX RNG Oracle bakes in a standard way for us to generate guaranteed randomness that our Smart Contracts can use and rely on.

All of this is good, but there are a lot of alternatives that this tutorial didn’t cover.

Alternative Minting Methods

Throughout the tutorials above, we focused on minting NFTs when an action is run. This is extremely useful if you want each NFT to have some unique attributes. In Dark Emblem NFT, we generate a unique image each time an NFT is minted as an example.

However you may have noticed when following along that our Smart Contract needed to have RAM purchased in order to mint those NFTs. The worst thing that could happen to a user is that they try to hatch a BabyChick and the asynchronous mint action fails when trying to mint a BabyChick.

To get around this issue you can take an alternative approach: pre-mint all the NFTs you want, and then just transfer them from the Smart Contract account to the new account owner in your actions.

This is a very common approach when doing large NFT drops. All you have to do is change any mint actions to transfers:

action(
    permission_level{get_self(), name("active")},
    atomicassets::ATOMICASSETS_ACCOUNT,
    name("transfer"),
    make_tuple(
        get_self(), from, (vector<uint64_t>){asset_id}, memo
    )
)
    .send();
Enter fullscreen mode Exit fullscreen mode

And to pre-mint, you can just add onto the existing scripts we used to test minting a single NFT.

Each NFT project is unique, so you will need to think about the pros and cons of each approach before you implement your Smart Contract.

The WAX Ecosystem

Throughout your NFT journey, you may have additional questions, thoughts, or ideas beyond what we covered in this tutorial. Here are some useful places to reach out to in order to continue to learn and promote your NFTs:

  • The official WAX discord - https://discord.com/servers/wax-blockchain-785124017430331392. The WAX Discord server is a place for NFTs collectors worldwide to chat with each other, discuss the future of WAX, and promote projects.
  • The official AtomicHub discord - https://discord.com/invite/atomichub. The AtomicHub discord is a great place to discuss Smart Contract code, ask questions, give input into the future of AtomicAssets, and share your AtomicAssets projects.
  • The official Dark Emblem discord - https://discord.com/invite/v6GDsjuFNa. This is the Dark Emblem NFT discord which a lot of this tutorial is based on. The NFT project and work we do there gives us the knowledge to continue to write and update these tutorials. Come check it out!

There are a few more resources that you may find useful, including the EOSIO documentation since the WAX blockchain is based on EOSIO. Be warned that the documentation has a lot of parity with WAX, but the WAX C++ framework provides additional utilities and macros to make contract writing easier.

And finally, the WAX Developer portal has come a lot way in 2023 - https://developer.wax.io/. When I started worked on Dark Emblem NFT, this was probably the least helpful of all the links mentioned about, but now it has a lot of quality documentation to get started with WAX.

Don’t Forget

Lastly, I want to mention again that all the code we’ve gone through in the tutorials and examples can be found on our Github: https://github.com/CapsuleCat/wax-nft-tutorial.

The repository contains full working examples that were deployed to the WAX testnet.

E-book

Get this entire WAX tutorial as an e-book on Amazon.

Additional links

💖 💪 🙅 🚩
idmontie
Ivan Montiel

Posted on August 6, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related