current position:Home>The contract I wrote has been compiled and deployed on the local gangche, but this error will be reported when setting the value to the fourth and fifth structures. Can you help me see the reason?

The contract I wrote has been compiled and deployed on the local gangche, but this error will be reported when setting the value to the fourth and fifth structures. Can you help me see the reason?

2022-02-03 23:02:15 Q & A of Denglian community

Part of the code :

struct Attribute {    address owner;  //  The donor       string name;      //  Property name       string date;      //  date       string desc;      //  Description information   } //  Add logistics transit information   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;      }  }

error message :

truffle(development)> c.putLogistics("0x4E61D98688917077c49B4CaD21eaF5c2089aAe80","2020.07.03 04:48:12",6," Wuhan transfer station has issued , Next Station   Wuhan Central Hospital ");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:





Other answers 1:


Other answers 2:


Other answers 3:

copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202032302128095.html

Random recommended