I am a newbie. I almost copied the codes from Lesson1 video and when I deployed and input "string name" and "favoriteNumber" in "addPerson" button box and tested it. Well, the "people" changed nothing and showed below error:
call to SimpleStorage.people errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="", code=INVALID_ARGUMENT, version=bignumber/5.5.0)
can anyone help me out? It's my first day on solidity, thx, fams
raw codes are here:
///////////////////////////////////////
//SPDX-License-Identifier: MIT
pragma solidity ^0.6.8;
contract SimpleStorage {
//initial will be zero
uint256 favoriteNumber;
struct People{
uint256 favoriteNumber;
string name;
}
//People public person = People({favoriteNumber:2, name:"Patrick"});
People[] public people;
function store(uint256 _favoriteNumber) public {
favoriteNumber = _favoriteNumber;
}
//view,pure only read off the chain
function retrieve() public view returns(uint256){
return favoriteNumber;
}
function addPerson(string memory _name,uint256 _favoriteNumber) public {
people.push(People(_favoriteNumber,_name));
}
I am a newbie. I almost copied the codes from Lesson1 video and when I deployed and input "string name" and "favoriteNumber" in "addPerson" button box and tested it. Well, the "people" changed nothing and showed below error: call to SimpleStorage.people errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="", code=INVALID_ARGUMENT, version=bignumber/5.5.0)
can anyone help me out? It's my first day on solidity, thx, fams
raw codes are here: /////////////////////////////////////// //SPDX-License-Identifier: MIT
pragma solidity ^0.6.8;
contract SimpleStorage { //initial will be zero uint256 favoriteNumber;
}