diff --git a/src/AutomatedVoting.sol b/src/AutomatedVoting.sol index d1805d59..13467f8e 100644 --- a/src/AutomatedVoting.sol +++ b/src/AutomatedVoting.sol @@ -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) { diff --git a/src/interfaces/IAutomatedVoting.sol b/src/interfaces/IAutomatedVoting.sol index 9e382697..c829e99c 100644 --- a/src/interfaces/IAutomatedVoting.sol +++ b/src/interfaces/IAutomatedVoting.sol @@ -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);