我是Solidity的新手。当我尝试读取people数组的值时,出现了错误:
调用SimpleStorage.people出错:错误编码参数: 错误: 无效的BigNumber字符串 (argument="value" value="" code=INVALID_ARGUMENT version=bignumber/5.4.2)
我的编译器版本是0.6.6,不确定怎么回事?有什么建议吗?
// SPD-License_Identifier: MIT
pragma solidity ^0.6.0;
contract SimpleStorage {
uint256 favNum;
struct People {
uint256 favNum;
string name;
}
People[] public people;
function store(uint256 _favNum) public {
favNum = _favNum;
}
function retrieve() public view returns(uint256) {
return favNum;
}
function addPerson(string memory _name, uint256 _favNum) public {
people.push(People(_favNum, _name));
}
}
acc_id
或_balance
。 - Petr Hejda