-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix keccak256(abi.encodePacked(addr, index)) => keccak256(abi.encode(… #786
Conversation
@LingYe-WEB3 能提供你的参考资料吗? |
The value corresponding to a mapping key k is located at keccak256(h(k) . p) where . is concatenation and h is a function that is applied to the key depending on its type:
ref: https://docs.soliditylang.org/en/v0.8.28/internals/layout_in_storage.html |
可能需要把这个重新整理一下 进入教程 |
好的,那我更新一下这个分支,把这些信息写入教程。 |
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.
"Update the method for reading the storage location of mappings."
@XdpCs 我根据Solidity官方的文档更新了mapping数据存储位置的计算方式。希望能够教程有所帮助。 |
ref: https://docs.soliditylang.org/en/v0.8.28/internals/layout_in_storage.html |
…addr, index))
What type of PR is this (这是什么类型的PR)
Which issue(s) this PR fixes(Optional) (这个PR 修复了什么问题 (可选择))
What this PR does / why we need it (这个PR 做了什么/ 我们为什么需要这个PR)
在solidity的mapping计算插槽位置的计算方式错误,由abi.encodePacked更新为abi.encode