Can you optimise gas in a smart contract better than ERC-721A?
Can you optimise gas in a smart contract better than ERC-721A?
To post an answer, please !
2 answers
36 views
It is definitely possible to find something more gas optimized! Developers and projects are coming out with better contracts that save their community on a ton of fees! OBI created their own contract that saved money for their community with on-chain NFTs making the fee only $2!! Alongside with the ERC-721A contract, with the storing of owners per NFT. It will just take time for developers to find short cuts and ways to store less on chain and in the contract which will continue to bring down gas fees
Really great question! In short - absolutely, there are ways to continue optimizing! One thing to note is that there are generally tradeoffs in optimization - ERC-721A, for instance, optimizes for reducing the cost of minting multiple NFTs in a single transaction, but this can come at a cost of making certain transfers of those NFTs more expensive later.
Alchemy has a good explanation of this here: https://www.alchemy.com//blog/erc721-vs-erc721a-batch-minting-nfts
And here's a good comparison between ERC721A and a few other gas optimized ERC721 standards.
You can see while ERC721A is way cheaper than the standard OpenZeppelin contract to multi-mint:
For transfers, it performs way worse than OpenZeppelin in a ton of cases:
In short, there's no one size fits all gas optimization!
And there are plenty of gas optimizations you can do beyond just the raw minting cost alone. For instance, this is a great series on a ton of additional ways you can save gas for people minting, such as with optimizations around how you do allowlists in presales:
Hardcore Gas Savings in NFT Minting (Part 1)
Hardcore Gas Savings in NFT Minting (Part 2)
Hardcore Gas Savings in NFT Minting (Part 3)
Hope that helps! Amazing question!
Not the answer you're looking for? Browse other questions tagged #NFTs or ask your own question.