合约返回array类型

function getUserTx(address _addr) public view returns (uint[] calldata) {
    return  usersTx[_addr];
}

 mapping (address=>uint[]) public usersTx;

报错

TypeError: Return argument type struct Auction.Tx storage ref[] storage ref is not implicitly convertible to expected type (type of first return variable) struct Auction.Tx calldata[] calldata.

返回数组不是这样操作的吗?

请先 登录 后评论

1 个回答

Tiny熊 - 布道者
  擅长:智能合约,以太坊
请先 登录 后评论
  • 1 关注
  • 0 收藏,1722 浏览
  • 王二小 提出于 2021-04-22 14:22

相似问题