BAYC shut down its highly anticipated metaverse project The Otherside two days ago. And the NFT drop crashed Etherscan. In total, NFT buyers have spent more than $70 million in Ethereum gas fees just to mint some of these exclusive land NFTs. With gas prices insane, many took to Twitter to share how the BAYC team could have improved their land purchase agreement and minting mechanics.

10 ways the BAYC team could have improved their land purchase agreement and embossing mechanics
Needless to say, many agreed that the high gas fees were unnecessary as the BAYC team could have easily tweaked the property purchase agreement and coin mechanics with a few tweaks. So, in this article, we’ve gathered some useful suggestions from the top Web3 developers. This includes suggestions from Twitter users like @CaptainDefi2, @iamarkdev and more. Let’s take a look!
Optimize BAYC land contract in ERC721 format

- First, the BAYC team was able to simply remove the “SafeTransferForm” feature from the land contract. According to @CaptainDefi2 they don’t need this feature at all as BAYC transfers funds back to the same contract. This would save them a call function for the same contract.

- Next, according to @CaptainDefi2, if all KYC addresses are non-contracts, the BAYC team could simply remove the “nonReentrant” feature. A revision in “msg.sender == tx.origin” is sufficient.

- Since we knew that the previous addresses were not contracts, BAYC was also able to simply remove the “safeMint” function. This would reduce multiple checks when executing the entire contract. According to @WillPapper, they can also switch from _safeMint() to _mint().

- If we know that the sum of a variable will always remain in the safe range, using unchecked sums would suffice. @CaptainDefi2 also suggested using “unchecked {i++}” in the BAYC land sale contract to save gas on each check.
- On the other hand, @iamarkdev suggested that the BAYC developers should avoid using ERC721Enumerable in the contract. This would save around 70% of gas fees.
Apply the ERC721A standard in the BAYC land purchase agreement

- Well, using the ERC721A contract to mint would also save us a ton of gas. This type of ERC standard allows you to mint multiple NFTs for the same cost as minting a single NFT. Based on the table above, we were able to save up to 86% on gas charges when the number of mints was increased to 5 on an ERC721A contract.

- However, in the original land sale agreement, BAYC used areas to distribute the land NFTs to BAYC and MAYC holders. For example, lot number 0-9999 goes to BAYC holders and lot number 10000-29999 to MAYC holders. Because of this, the ERC721A format was not suitable for the original smart contract. But if the BAYC team avoided using ranges, they could save users a lot on gas fees according to the table above.
Better embossing mechanics
- According to Syndicate’s @WillPapper, gas optimization is only part of the equation. The BAYC team would also need to come up with better imprint mechanics to avoid imprinting everyone at the same time. For example, opt for batch minting by allowinglisting a certain number of wallet addresses to mint NFTs at the same time.
- According to @ether_dr, the BAYC team can also use the raffle method to avoid a large number of NFT buyers minting at the same time. In fact, this mechanism can also ensure some kind of fair distribution to the NFT buyers.
- Finally, @ether_dr also suggested limiting the number of mints using off-chain methods. The way it works is that a well-coded, secure server issues codes based on specific coin rates. Then the server will put you in the next position to be minted. Next, the server passes these codes to the smart contract with Merkle Proof for verification before minting the NFTs.
Final Thoughts
All in all, the BAYC team could have done gas optimization in so many ways on their land purchase agreement. Not to mention the team could have used some sort of batch minting or allow list to avoid gas wars.
But instead, the team blamed the lack of scalability of the Ethereum network and suggested migrating APEcoin to its own blockchain. In light of this, speculation abounded on Twitter that the poorly written smart contract was part of the team’s plan to release its own blockchain. Whether or not this is the case is at your discretion.
Are you tired of important NFT drops are missing?
Just check out our NFT calendar!
Get the day’s biggest NFT news and recommendations in our Daily newsletter.
All investment/financial opinions expressed by NFTevening.com are not recommendations.
This article is educational material.
As always, do your own research before making any type of investment.