Reputation: 465
I am writing contract for voting and facing few declartion error as quoted DeclarationError: Identifier not found or not unique.
Voter[] public voters;
^---^
This is my complete code below. I am not sure what I am doing wrong.
contract Ballot {
int public majorityVotes;
Candidate[] public candidates;
mapping (address => uint) public voterId;
Voter[] public voters;
event CandidateAdded (uint candidateId, uint amount, string description);
event Voted (uint candidateId, int result, address voter);
event Tallyvotes (uint candidateId, int result, uint tally, bool active);
for more detail code visit here
I am trying to create ballot for first past post voting style, However compilation fails. I hope someone can go through and point out some obvious mistakes.
Upvotes: 1
Views: 1298
Reputation: 151
The error says that it is not able to find the data type Voter since it is not defined.
From the git link you have posted, the structure name is Vote not Voter.
Upvotes: 1