Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/contracts/Election.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ contract VotingForPurpose{
mapping(address=>Voter) public voters;

address[] voterslist;
uint public candidatesCount;
uint public electionCount;
uint public totalregisteredvoters;

Expand All @@ -56,4 +57,7 @@ contract VotingForPurpose{
_;
}

function isAdmin(address user) public view returns(bool){
return owner==msg.sender || owner == user;
}
}
32 changes: 32 additions & 0 deletions src/utils/election.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "candidatesCount",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "electionCount",
Expand Down Expand Up @@ -94,6 +107,25 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "user",
"type": "address"
}
],
"name": "isAdmin",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalregisteredvoters",
Expand Down
Loading