【发布时间】:2021-12-27 17:54:00
【问题描述】:
我正在使用solidity solc^0.8.0构建智能合约,我遇到了以下问题:
// some lines of code
oracleResponses[key] = ResponseInfo({
requester: msg.sender,
isOpen: true}); // here the compiler complains about a the construction of a struct that contains a mapping
// some lines of code
struct ResponseInfo {
address requester;
bool isOpen;
mapping(uint8 => address[]) responses; // I think this what causes the problem
}
mapping(bytes32 => ResponseInfo) private oracleResponses;
第一行给了我两个错误:
无法分配包含(嵌套)映射的存储类型。
无法构造包含(嵌套)映射的结构。
使这两个错误消失的正确模式是什么?
【问题讨论】:
标签: ethereum solidity smartcontracts truffle