这样调用接口里面struct不行吗

pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
interface IPeople {

    struct Student {
        uint status;

    }
      function getStudent(address _productAddr) external view returns (Student memory) ;
}

pragma solidity >=0.6.0;

contract Want  {

IPeople public _people =IPeople(0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC) ;   

function hi()external {
    address _pAddr = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB;
    IPeople.Student memory _p = _people.getStudent(_pAddr);

}

}

请教一下代码里面的IPeople.Student 不能这样用吗,合约部署没问题,但是函数调用会失败

请先 登录 后评论

2 个回答

Tiny熊
  擅长:智能合约,以太坊
请先 登录 后评论
xgocn
请先 登录 后评论
  • 2 关注
  • 0 收藏,2720 浏览
  • 二毛 提出于 2020-12-28 22:39