-
Notifications
You must be signed in to change notification settings - Fork 843
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
Add transferFrom gas estimates for various situations #83
Comments
Here's a start https://twitter.com/fulldecent/status/1491506122565595141 Did this manually, we can make good tooling for this. |
The more popular the project, the more gas ERC721A can save. The gas savings during mint (high BASEFEE period) can be way more than A general rule-of-thumb to minimize gas is to transfer in ascending tokenId order. Also, it has the indirect effect of discouraging dumping (promoting hodling), especially for those who mint large batches. ;) |
@fulldecent @Vectorized check this issue, if we good with the proposal I can do |
Hello, I made a benchmark that is more precise than the one showing here and compares gas usage with other implementations. It compares not only Feel free to grab the results or link the codebase, I think it's more trustworthy than the one showing on README since all comparisons are made using the same process, and by someone not involved in this project (so no bias in favor of this proj). https://github.com/alephao/solidity-benchmarks |
I wonder how it scales in the future? Most of the benchmarks are only interested in 100 tokens; but when Ethereum NFT is the base for (m)etaverse, and we need collections of billions NFTs, some people owning millions of them, how many gas transfer will eat? Even if the block gas limit is raised to 100_000_000 gas, is it possible to being "locked out" of your tokens? |
@caffeinum If you mint at the block gas limit (about 16K tokens for now on ETH), you won’t be able to directly transfer the last token in the batch. This is because the LOG4 opcode (1875 gas) emitted per mint costs less than a SLOAD opcode (2100 gas). You can however, transfer a token in the middle of the batch to initialize it so that the token at the end can be transferred within the block gas limit. In an upcoming PR #272, we will have a function to directly initialize a token without transferring it. |
This is an important consideration of whether to use this implementation.
The text was updated successfully, but these errors were encountered: