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

Remove pointsownedby from azimuth to save gas #50

Open
abliss opened this issue Oct 27, 2021 · 1 comment · May be fixed by #55
Open

Remove pointsownedby from azimuth to save gas #50

abliss opened this issue Oct 27, 2021 · 1 comment · May be fixed by #55

Comments

@abliss
Copy link

abliss commented Oct 27, 2021

Spawning/transferring an azimuth point currently costs tens of USD. Some of that gas[1] goes to keeping the pointsownedby mapping up-to-date. If we imagine all 4 billion points being spawned, that's quite a lot of value. (even just moving all 65k stars onto Layer 2 will cost a good chunk of change.)

It seems that the only use for this mapping is the balanceOf function in the ecliptic's ERC721 interface. I doubt that's called by any contract, or ever really will be. It doesn't seem that useful. It's probably called lots by off-chain clients (token trackers and wallets). I propose that we either (a) abandon the ERC721 interface; or (b) return balance=0, and let those clients just be wrong; or (c) implement balanceOf by iterating through all 4 billion points and counting how many have owners that match the given address. This would be slow, but it's better for off-chain clients to be slow for a cosmetic function than for on-chain contracts to be charged gas for essential functions.

[1] I don't know what proportion, but someone could and should estimate it.

@philipcmonk
Copy link
Contributor

philipcmonk commented Oct 27, 2021 via email

@calvinmccarter calvinmccarter linked a pull request Apr 21, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants