-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrating to ERC721A #29
Conversation
Bless you @liarco this is fantastic! |
Continuation from previous thread discussion:
Thanks Marco. |
Thank you @gitrevo, I think we should wait for chiru-labs/ERC721A#66 to be merged and released so I can use the new I'm gonna get the code ready so it should work as soon as I can update the dependencies. |
Can I ask a couple questions about this? (2) My limited understanding is extra work on the smart contract could lead to additional gas. Is it possible by making this change it will offset some of the gas savings we're expecting by moving to 721A? I guess I'm wondering if this additional feature is really necessary given that starting at token #0 is really not that big of a deal. |
@joven1555 thank you for your feedback, here are my thoughts:
Also:
That's not so easy to know wether this can be a big deal or not, everything may look fine until you encounter some issues (see chiru-labs/ERC721A#45 where the staking contract is not working properly because of the token with ID = |
Brilliant, you sold me! Particularly the part about most users and third-party expectations. I'm going to continue working off the ERC721 version until everything is finalized for ERC721A, hopefully I can contribute by testing for the ERC721A version. Can't express how grateful I am for you and the community. It's clear ERC721A is the cutting edge, most gas efficient solution right now and our community having access to that because of you is unbelievable! |
I saw Vectorized commented the above.
I will test this again on next test after chiru-labs merged/released. Thanks Marco |
@liarco I found this discussion by the actual OpenZeppelin team interesting. They talk about Azuki's ERC721A pros and cons. You might already know all of this, but thought I'd share. https://forum.openzeppelin.com/t/erc721enumerable-gas-optimization/22795 |
Hi @spike-hue, thank you for your feedback. I must admit that our current implementation is based on the same exact principle as the one from the Azuki team, so what you see there as main concerns can be applied to my version as well. Despite the fact I don't see some of those concerns as real problems for most collection types (some people may actually need the |
Great update Marco, many thanks! l’ll run a test soonest as I can. Is this included with the burn token feature I saw they implementing? |
It includes everything from https://github.com/chiru-labs/ERC721A/releases/tag/v3.0.0 (but this doesn't mean that the burning feature is enabled by default, you have to add your own logic for it). |
3ca0109
to
5568058
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May inquire why the double quote marks have been changed to single quote marks?
Yes @DEXExchange, of course! This was done for code consistency across the whole project (the rest of the codebase is using single-quotes, the Solidity source was erroneously kept with double-quotes from the old repository). The |
How can we currently test this contract out? Also kindly specify on which ( Remix or through VS Code terminal )? |
Hi @BlueGreninja,
Everything will work, this branch now also includes the feature I showed on my latest YouTube video, you can take a look at #49 to see how to use that and avoid using private keys. |
Thanks, just want to verify that this contract is for testing right now, right? It's not yet officially useable? |
@BlueGreninja nothing on this repo is to be considered "ready for production" until it's released with a new version 😉 |
There are multiple projects on opensea which have adapted ERC721A contract. I think referring that can help speed up the testing and would be great for using it as a feedback. |
Hi @dhararughani, we don't need to test A good example were the issues introduced by my first migration attempt: the different token ID management was causing the collection to be corrupted. |
Any chance that you review this Marco? Sometime owner would like to mint for the team say 100 NFTs, tested with 3 nfts and it cost 0.2 gas fee. Imagine if it’s 100 :( |
@gitrevo the bigger the whitelist, the more it's gonna cost to verify the proof. The Merkle Tree library works fine with thousands of addresses, it might just take longer in order to calculate the proof, but you should run some tests locally to verify the gas cost of the
Please take a look at #50, it might help. |
Do you mean, in order for an “owner” to mint without a cost; we need to use “mintForAddress” instead of “mint” right? i.e: Since “mint” will produce error “likely to fail” and huge gas, we need to use “mintForAddress” in order to achieve this correct? |
@gitrevo please stick to the topic, you should open another issue for unrelated questions. Thank you |
How does it compare with ERC1155? ERC1155 is considered to be a newer more efficient standard than ERC721, right? So it would be interesting to now compare ERC1155 with ERC721A. |
@tab00 please do some research about |
@liarco yes I had read comparisons before, and they mostly describe how ERC1155 is superior. e.g. from https://www.web3.university/article/comparing-erc-721-to-erc-1155:
Also, there is some built-in metadata functionality in ERC1155, saving some code:
You set the uri as |
@tab00 thank you for the references, there is no doubt that there are advantages using As you can see this project is called |
+1 for implementation of EIP-1155: Multi Token Standard 🙋♂️ It would be great to see configuration files for an ERC1155 contract, similar to this project 😎 |
This PR integrates the ERC721A contract discussed in #24.
The implementation is purely for testing/research purposes. The main goal would be to merge this into the main branch, but this code should not be considered "stable" until then.
I encourage people testing this version and providing feedback to speed up the adoption process. Thank you.
What to expect from this PR
We should get a great improvements in gas efficiency when minting multiple tokens with a single transaction. Minting just one token is the same.
Gas report BEFORE this PR
Gas report AFTER this PR
Run transactions
The test I run is making 12 transaction:
Comparison
The difference is huge (
8.99%
gas usage compared to the original version), but that's because of the high mint amounts (1k tokens per TX). In a more realistic situation (3 tokens per TX) theERC721A
implementation is using69%
gas compared to the original version. This is still pretty good.