-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add EIP: Token Mapping Slot Retrieval Extension #6823
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
Merged
eth-bot
merged 1 commit into
ethereum:eipbot/6823
from
qd-qd:eip6823-token-mapping-slot-retrieval
Apr 4, 2023
Merged
Add EIP: Token Mapping Slot Retrieval Extension #6823
eth-bot
merged 1 commit into
ethereum:eipbot/6823
from
qd-qd:eip6823-token-mapping-slot-retrieval
Apr 4, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🛑 |
d907714
to
6d93f84
Compare
6d93f84
to
e08e079
Compare
This proposal suggests an extension to the ERC-20/ERC-721/ERC-1155 standards that allows retrieving the reserved storage slot of the mapping responsible for tracking ownership of compliant tokens. The proposed extension enables accurate off-chain simulations, eliminates the reliance on events, and enhances the precision of data access from storage. The proposed extension is a single function named getTokenLocationRoot() that returns the reserved storage slot for the mapping type in any ERC-20/ERC-721/ERC-1155 compliant smart-contract implementation. The proposed extension does not have any additional cost for the caller, and there is a negligible increase in the deployment cost of the contract.
e08e079
to
bcfce53
Compare
@eth-bot rerun |
The commit bcfce53 (as a parent of 9125bb3) contains errors. |
Pandapip1
added a commit
that referenced
this pull request
Apr 4, 2023
@qd-qd sorry for the issues with the bot. Feel free to create a new PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This proposal suggests an approach to improving the accuracy of off-chain transaction simulations that involve contracts that comply with the
ERC-20
/ERC-721
/ERC-1155
standards. The proposal provides a standardized entry point to obtain the reserved storage slot of a mapping responsible for tracking ownership of tokens in a contract. This approach not only helps capture state changes more precisely but also enables external tools and services to do so without requiring expertise in specific implementation details.Due to the unique storage layout for different contracts, it is challenging to simulate transactions that involve smart contracts, specifically due to the use of mappings. The storage location of a value in a mapping depends on a specific storage slot, which can only be determined through knowledge of the contract’s implementation. This prevents external platforms and tools from capturing/validating changes made to a contract’s state with certainty.
This proposal introduces a function named getTokenLocationRoot as an extension to
ERC-20
/ERC-721
/ERC-1155
contracts, allowing off-chain callers to retrieve the reserved storage slot for the mapping type. This approach eliminates the reliance on events, enhances the precision of data access from storage, and improves the accuracy of off-chain simulations.