-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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 EIP: Efficient Default Lockable Tokens #6982
Conversation
✅ All reviewers have approved. |
@sullof |
EIPS/eip-6982.md
Outdated
|
||
## Rationale | ||
|
||
This standard aims to minimize gas usage by reducing the emission of events. The **DefaultLocked** event sets the initial lock status for all tokens, thus eliminating the need for an event upon the minting of each token. Some tokens may change their behavior (for example, after a reveal), in that case, the **DefaultLocked** event may be emitted again to set up the new default behavior when no token-specific event has been emitted yet. |
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.
Looks like you're defining a requirement here:
the DefaultLocked event may
Requirements should go in the specification section.
Plus I believe this is directly contradicting the comment above the DefaultLocked
event definition.
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.
Thanks, I will move that requirements it the specification section.
About the apparent contradiction, there are tokens that are locked during the pre-reveal phase and so would emit a DefaultLocked(true) event, that will be unlocked after the reveal. In that case, forcing the contract to emit a Locked(tokenId, false) for every tokenId would go against the primary goal behind this proposal, i.e., saving gas when a locked/unlocked status is applicable to all the tokens. I think that if that happens, emitting a single DefaultLocked(false) event would be better.
…efficient-lockable-nft
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.
All Reviewers Have Approved; Performing Automatic Merge...
We suggest a solution that is applicable in most scenarios, saving gas.
The primary limit in existing proposal like EIP-5192 is that
it has 2 events for Locked and Unlocked, which is not optimal.
To make a comparison, it's like in the ERC721 instead of Transfer(from, to, id) used for mints, transfers and burns, there were Transfer(from, to, id), Mint(to, id), Burn(from, id), etc.
it forces you to emit an event even when the token is minted, causing a waste of gas when a token borns with a status and dies with it.
Take for example most soulbounds and non-transferable badges. They will be locked forever and it does not make sense to emit an extra event for all the tokens.