Skip to content

Commit

Permalink
👷 getHasVoted
Browse files Browse the repository at this point in the history
  • Loading branch information
cmontecoding committed Sep 14, 2023
1 parent 3636b46 commit 6ff58b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/AutomatedVoting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ contract AutomatedVoting is IAutomatedVoting {
return elections[_election].isNominated[nominee];
}

/// @inheritdoc IAutomatedVoting
function getHasVoted(uint256 _election, address voter) public view override returns (bool hasVoted) {
return elections[_election].hasVoted[voter];
}

/// @notice gets the current council
/// @return address[] the current council
function getCouncil() public view override returns (address[] memory) {
Expand Down
6 changes: 6 additions & 0 deletions src/interfaces/IAutomatedVoting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ interface IAutomatedVoting {
/// @return isNominated if the address is nominated in an election
function getIsNominated(uint256 _election, address nominee) external view returns (bool);

/// @notice returns if an address has voted in an election
/// @param _election the election to check
/// @param voter the voter to check
/// @return hasVoted if the address has voted in an election
function getHasVoted(uint256 _election, address voter) external view returns (bool);

/// @notice returns the current council
function getCouncil() external view returns (address[] memory);

Expand Down

0 comments on commit 6ff58b7

Please sign in to comment.