VM error : Invalid opcode.怎么解决

写合约的时候遇到了如标题的这个问题,自己找不出问题,想问一下怎么解决

 function Shapley_A1_VS_rest() public view returns (uint[] memory m){
        uint len;
        uint temp=0;
        uint temp_VS;
        uint temp_VS_A1;
        for(len=0;len<VS_A1.length;len++){
            temp_VS=VS[len];
            temp_VS_A1=VS_A1[len];
            temp=temp_VS-temp_VS_A1;
            VS_A1_rest.push(temp);
        }
        m =  new uint[](VS_A1_rest.length);
        for(uint i = 0; i < VS_A1_rest.length; i++){
            m[i] = VS_A1_rest[i];
        }
    }
请先 登录 后评论

最佳答案 2020-08-27 19:00

这个提示通常是数组访问超过长度了。

请先 登录 后评论

其它 0 个回答

  • 1 关注
  • 0 收藏,3909 浏览
  • 徐文宣 提出于 2020-08-27 18:27

相似问题