Skip to main content
added 82 characters in body
Source Link
Rob Hitchens
  • 55.6k
  • 11
  • 91
  • 146

when I run this code I get the error "call to Voting.candidates errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="", code=INVALID_ARGUMENT, version=bignumber/5.0.8)" anybody know how to fix this or what is means??

contract Voting {

contract Voting {
    
    ///@dev keeps track of the voter candidates' info
    struct VoterCandidate {
        string voterName;
        uint voterAge;
    }
    
    ///@dev keeps track of all the candidates
    VoterCandidate[] public candidates;

    ///@dev creates a new "VoterCandidate" and adds a the candidate to the array of candidates
    function candidateRegistration(string memory _voterName, uint _voterAge) public {
        VoterCandidate memory newCandidate;
        newCandidate.voterName = _voterName;
        newCandidate.voterAge = _voterAge;
        candidates.push(newCandidate);
    }
    
}

}

when I run this code I get the error "call to Voting.candidates errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="", code=INVALID_ARGUMENT, version=bignumber/5.0.8)" anybody know how to fix this or what is means??

contract Voting {

///@dev keeps track of the voter candidates' info
struct VoterCandidate {
    string voterName;
    uint voterAge;
}

///@dev keeps track of all the candidates
VoterCandidate[] public candidates;

///@dev creates a new "VoterCandidate" and adds a the candidate to the array of candidates
function candidateRegistration(string memory _voterName, uint _voterAge) public {
    VoterCandidate memory newCandidate;
    newCandidate.voterName = _voterName;
    newCandidate.voterAge = _voterAge;
    candidates.push(newCandidate);
}

}

when I run this code I get the error "call to Voting.candidates errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="", code=INVALID_ARGUMENT, version=bignumber/5.0.8)" anybody know how to fix this or what is means??

contract Voting {
    
    ///@dev keeps track of the voter candidates' info
    struct VoterCandidate {
        string voterName;
        uint voterAge;
    }
    
    ///@dev keeps track of all the candidates
    VoterCandidate[] public candidates;

    ///@dev creates a new "VoterCandidate" and adds a the candidate to the array of candidates
    function candidateRegistration(string memory _voterName, uint _voterAge) public {
        VoterCandidate memory newCandidate;
        newCandidate.voterName = _voterName;
        newCandidate.voterAge = _voterAge;
        candidates.push(newCandidate);
    }
    
}
Source Link
Jabari Brown
  • 147
  • 1
  • 1
  • 5

Getting an error when running this code

when I run this code I get the error "call to Voting.candidates errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="", code=INVALID_ARGUMENT, version=bignumber/5.0.8)" anybody know how to fix this or what is means??

contract Voting {

///@dev keeps track of the voter candidates' info
struct VoterCandidate {
    string voterName;
    uint voterAge;
}

///@dev keeps track of all the candidates
VoterCandidate[] public candidates;

///@dev creates a new "VoterCandidate" and adds a the candidate to the array of candidates
function candidateRegistration(string memory _voterName, uint _voterAge) public {
    VoterCandidate memory newCandidate;
    newCandidate.voterName = _voterName;
    newCandidate.voterAge = _voterAge;
    candidates.push(newCandidate);
}

}