Study NFT minting code — Azuki, the ancestor of ERC721A
I primarily review the overall workflow of minting NFT and the Azuki code. I won’t dive into how ERC721A works and why it saves the gas of minting in this article.
- The Azuki contract address I study and the imported ERC721A is : 0xED5AF388653567Af2F388E6224dC7C4b3241C544
- On Etherscan: https://etherscan.io/address/0xed5af388653567af2f388e6224dc7c4b3241c544#code
- ERC721A updates: https://github.com/chiru-labs/ERC721A
- Why and how ERC721A saves you lots of gas minting: https://www.azuki.com/erc721a
The selling logic of minting NFT (ideally)
- Set up a bunch of sale information at least before the auction mint.
- The sale info can be updated anytime.
- Set whitelisted addresses at least before the allowlist mint.
- Whitelists can be added later.
Split the code of Azuki
Some configuration and modifier
Constructor
maxBatchSize
- defining the maximum NFT a minter can mint in
_safeMint()
inERC721A
- using in
ownershipOf()
to check tokenId of the owner inERC721A
- amount of
devMint()
needed to be a multiply of it - the maximum of NFT every address when auction mint and public sale