7
solidity的struct中包含了mapping,在使用中报内存初始化错误
source link: https://learnblockchain.cn/question/2896
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
solidity的struct中包含了mapping,在使用中报内存初始化错误 | 登链社区 | 技术问答
solidity的struct中包含了mapping,在使用中报内存初始化错误
错误提示:struct contraining a (nested) mapping cannot be constructed
请教该怎么处理?
找了一下文档:https://docs.soliditylang.org/en/v0.7.1/070-breaking-changes.html#mappings-outside-storage
文档的意思是0.7版本后优化了这些不安全的写法,解决办法难道只有把mapping从struct中独立出来吗???
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK