contract NoteContract {//合约声明 //字典类型: mapping,notes是一个键值对,其Key为发布者地址,类型为address,值为每个发布者发布的内容,类型为string[] mapping(address => NoteRecord) public notes;
//constructor() public { }
event NewNote(address spender, NoteRecord note); // event NewNote(address, string note); event ModifyNote(address spender, uint256 index); // event ModifyNote(address, uint index);
struct NoteRecord { uint256 noteId; string noteContent; uint256 chainTime; }
}
收到如下提示:
===========================
> Compiling .\contracts\Migrations.sol
> Compiling .\contracts\NoteContract.sol
> Compiling .\contracts\NoteContract.sol
project:/contracts/NoteContract.sol:10:36: TypeError: This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature.
event NewNote(address spender, NoteRecord noteDE);