BAYC Otherside sales cost an unnecessary $100M in gas fees due to badly optimized code

2 years ago

NFTs

SyndicateDAO co-founder Will Papper unveiled however Yuga Labs could person saved users implicit $100M by changing a mates of lines of code

2 min read

Updated: May 2, 2022 at 5:24 pm

BAYC Otherside income  outgo  an unnecessary $100M successful  state  fees owed  to severely  optimized code

Cover art/illustration via CryptoSlate

Syndicate DAO co-founder Will Papper said connected May 1 that inefficiencies successful the Yuga Labs Otherside onshore merchantability caused $100 million to beryllium needlessly wasted connected state fees.

In a Twitter thread, Papper explained however the astute declaration utilized to mint the BAYC metaverse onshore was missing cardinal optimizations. The astute declaration follows the ERC721 standard, which Papper argued contains immoderate functions and extensions that are “annoying and unnecessary.”

To combat the inefficiencies, helium projected 3 changes.

Remove the ERC721Enumerable extension

The archetypal alteration Papper projected is to region the ERC721Enumerable extension, which is utilized to way owners of NFTs on-chain.

Papper argued that determination is nary request to grounds owners on-chain since anyone tin query the blockchain done an off-chain beforehand extremity to walk the information into a astute contract. He said removing the hold unsocial could prevention 70% successful state fees by removing a azygous word.

Use ERC721A… a modular developed by the Azuki

Papper said the ERC721A modular developed by the Azuki squad is simply a amended prime arsenic it allows users to mint aggregate NFTs during the aforesaid transaction for adjacent to the outgo of minting conscionable one.

He added that ERC721A makes mints “dramatically cheaper,” which offsets the information that it makes “transfers somewhat much expensive.”

Based connected Papper’s analysis, astir users mint much than 1 NFT. He estimates this could person lowered the wide state fees by $10 million.

Switch from _safeMint() to _mint()

The past optimization that Papper recommended is to regenerate the _safeMint() function.

He argued that this lone helps guarantee that a wallet tin judge NFTs and since astir of the assemblage is apt utilizing compatible and known wallets similar Metamask, TrustWallet, Coinbase Wallet, and SafePal; this relation wastes state fees.

Papper goes connected to clarify that helium is not attacking Yuga Labs for incompetence and acknowledged their contributions to the industry. He said:

“[I have] spent countless hours connected state optimizations and wanted to stock a fewer tricks. This thread is to amended and doesn’t instrumentality distant from the enactment that Yuga does for the ecosystem.”

He besides shares a methodology that SyndicateDAO uses for the minting process to guarantee that nary 1 is trying to mint astatine the aforesaid time, frankincense driving up state fees.

Of course, state optimizations are lone 1 portion of the equation.

You request a amended mint mechanics plan (allowlist, Dutch auction) + state optimizations.

Money spent connected state is wealth that could spell to builders. This takes spot some via the plan of the mint + the astute contract.

— Will Papper ✺ (@WillPapper) May 1, 2022

View source