function getLogisticsInfo(address goods) public returns(LogisticsData[] memory _goodsLogisticsData) {
LogisticsData[] memory _goodsLogisticsData = new LogisticsData[](2);
for (uint i=0; i < 2; i++) {
if (_logisticsData[i].goods == goods) {
// _logisticsData[i].queryCount = _logisticsData[i].queryCount + 1;
_goodsLogisticsData[i] = _logisticsData[i];
}
}
return _goodsLogisticsData;
}
solidity 版本 0.6.10 。以上代码可以编译通过,但是运行时报错 Bad Instruction
其中_logisticsData 为全局 storage struct 数组
1
passon 2022-04-11 12:53:14 +08:00
写合约好找工作吗
|
2
samohyes 2022-04-11 13:18:41 +08:00
_logisticsData 看下是咋定义的
|