0

call to SimpleStorage.people errored: Error encoding arguments: Error: invalid BigNumber string (argument="value" value="" code=INVALID_ARGUMENT version=bignumber/5.5.0)

Thank you anyone for their time.

pragma solidity ^0.6.0;

contract SimpleStorage {

// 0 is fav number.
uint256 favoriteNumber;
bool favoriteBool;

struct People {
    uint256 favoriteNumber;
    string name;
}

People[] public people;

function store(uint256 _favoriteNumber) public {
    favoriteNumber = _favoriteNumber;
}

function retrieve() public view returns(uint256) {
    return favoriteNumber;
}

function addPerson(string memory _name, uint256 _favoriteNumber) public{
    
    people.push(People(_favoriteNumber, _name));
}

}

QNTQNT
  • 1
  • Does this answer your question? [Solidity - Invalid BigNumber string (argument="value" value="" code=INVALID\_ARGUMENT version=bignumber/5.4.2)](https://stackoverflow.com/questions/70011183/solidity-invalid-bignumber-string-argument-value-value-code-invalid-argu) – Petr Hejda Dec 27 '21 at 09:59

1 Answers1

0

People is an array, so you need to specify the index of the array first. So if you want to access the first person, you have to specify 0 (index begins with 0) in the input box next to the person button.

Example picture

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77