Skip to content
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

Deployer wallet Transfer fee too high? #422

Open
R-qanawati opened this issue Sep 9, 2022 · 5 comments
Open

Deployer wallet Transfer fee too high? #422

R-qanawati opened this issue Sep 9, 2022 · 5 comments

Comments

@R-qanawati
Copy link

Sorry for the noob question but curious why the deployer wallet is paying about 40$ gas fee vs everyone else paying a 5$ gas fee to make a safeTransfer.

Is there any solution to it?

@R-qanawati
Copy link
Author

Gas usage for users: 95,970
Gas usage for deployer: 973,534

@ItsCuzzo
Copy link

ItsCuzzo commented Sep 13, 2022

@R-qanawati

How many tokens does the deployer wallet hold? If the deployer wallet minted a relatively large amount of tokens, upon calling safeTransferFrom, the ownerOf lookup may be quite expensive assuming I understand your issue correctly.

@R-qanawati
Copy link
Author

Minted about 350 total

@dievardump
Copy link
Contributor

Minted about 350 total

if you didn't create any "bundle" mechanism (forcing ownership to actually be written every X items minted) this is totally normal to have that kind of costs.

When transfering item 349, the contract will have to do a lookup that goes through all items until the first minted (so reading 349, 348, 347, 346, ... 3, 2, 1) in order to find the ownership.

@pagameba
Copy link

This is the biggest downside to ERC721A, the "algorithm" for finding the owner of a given token searches linearly backward until if finds the owner. This makes it highly inefficient for "selling" tokens on something like OpenSea where someone can purchase any item in the collection. We ended up transferring every 50th token to normalize the gas cost for selling tokens across the whole collection.

What this really needs is a more efficient algorithm for determining the ownership of a given token, probably at the expense of more storage and higher upfront cost I would guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants