我编写的合约通过已通过编译,部署在本地的gangche上了,但是在设置值的时候 设置到第四五个结构体的时候会报这个错误 您能帮我看下是啥原因吗?

部分代码:

struct Attribute {
    address owner;  // 捐赠者
      string name;      // 属性的名字
      string date;      // 日期
      string desc;      // 描述信息

  }

 // 增加物流中转信息
  function putLogistics(address _owner,string memory _date, State _status, string memory _message ) public{
      if(close == false){
          Logistics memory node = Logistics(_owner,_date,_status,_message);
          stations[number] = node;
          number = number + 1;
          lock = true;
      }
      if (_status == State.Received) {
          close = true;
      }
  }

错误信息:

truffle(development)> c.putLogistics("0x4E61D98688917077c49B4CaD21eaF5c2089aAe80","2020.07.03 04:48:12",6,"武汉中转站已发出,下一
站 武汉市中心医院");
Thrown:
Error: Returned error: VM Exception while processing transaction: invalid opcode    at PromiEvent (C:\Users\12173\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\contract\lib\promievent.js:9:1)
    at TruffleContract.putLogistics (C:\Users\12173\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\contract\lib\execute.js:169:1)
    at evalmachine.<anonymous>:0:3
    at sigintHandlersWrap (vm.js:269:15)
    at Script.runInContext (vm.js:124:14)
    at runScript (C:\Users\12173\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\console.js:222:1)
    at Console.interpret (C:\Users\12173\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\console.js:237:1)
    at ReplManager.interpret (C:\Users\12173\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\repl.js:131:1)
    at bound (domain.js:419:14)
    at REPLServer.runBound [as eval] (domain.js:432:12)
    at REPLServer.onLine (repl.js:716:10)
    at REPLServer.emit (events.js:223:5)
    at REPLServer.EventEmitter.emit (domain.js:475:20)
    at REPLServer.Interface._onLine (readline.js:315:10)
    at REPLServer.Interface._line (readline.js:692:8)
    at REPLServer.Interface._ttyWrite (readline.js:1017:14)
    at REPLServer.self._ttyWrite (repl.js:793:7)
    at ReadStream.onkeypress (readline.js:191:10)
    at ReadStream.emit (events.js:223:5)
    at ReadStream.EventEmitter.emit (domain.js:475:20)
    at emitKeys (internal/readline/utils.js:433:14)
    at emitKeys.next (<anonymous>) {
  hijackedStack:
请先 登录 后评论

3 个回答

影无双
请先 登录 后评论
李松柏
请先 登录 后评论
影无双
请先 登录 后评论
  • 1 关注
  • 0 收藏,3239 浏览
  • 提出于 2020-07-15 12:15