-
Notifications
You must be signed in to change notification settings - Fork 842
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
Gas fees very high on safeTransfer Method #145
Comments
When you are transferring a token, contract checks the owner of the token using ownershipOf function. Lines 202 to 208 in 8e836e5
You could use small batch size like 5 or 10. |
Could
Could you explain better about use small batch size? it's abbout small batch in mint? so the transfer will be more cheaper? |
Yes, you are right in both questions. uint256 private constant maxBatchSize = 5;
function mint(quantity) external payable {
require(quantity <= maxBatchSize, "quantity to mint too high");
.
.
.
_safeMint(msg.sender, quantity);
} By setting a small |
Just transfer from lowest id to highest id. The fees will be as low as possible. Some suggestions if you want to circumvent this:
We didn’t include those by default to give projects the flexibility to balance between _mint and _transfer costs. For example, power users or teams can do a _mint for hundreds of tokens at a very low cost and choose to slowly release their tokens in ascending order. |
Closing this, as users have several options to reduce the first-time transfer gas usage to reasonable levels. Please refer to the documentation for tips. |
I minted 5000 NFTs at once, which doesn't seem like the intended use of this contract.. I'm supposed to batch them in groups of 8? Since I batch minted them all, transferring token 1 is about $10 while transferring token 4000 is $700-800. Any ideas or insights on how to fix my scenario? |
@basememara What you can do now is to batch transfer every 10th NFT to some wallet you own. (1,11,21,…4991) Do that when the gwei is like less than 10. You can use some tool like https://nft.life/batch-transfer. Do call setApprovalForAll on Etherscan first to approve the batch transfer contract to transfer your NFTs. |
I minted 310 tokens at a single transaction.
Eg: 0 to 310
Safetransfering Token ID is around $8
Safetransfering Token ID 300 is around $300
Wonder whats caused the price change for high index tokens.
This only happens for higher transactions
The text was updated successfully, but these errors were encountered: