joke-and-checker
Step 2: Interacting with JokeVote using VoteChecker
The VoteChecker contract interacts with JokeVote to verify whether an address has cast its vote.
A. Setting Up the Interaction
We need to set up the VoteChecker contract to interact with the JokeVote contract using an interface.
interface VotingContract {
function addressTotalVotesVerified() external view returns (bool);
}
B. Implementing the Vote Verification
We utilize the function activate
to interact with the JokeVote contract and check the voting status of an address.
function activate() public view returns (bool) {
VotingContract votingContract = VotingContract(votingContractAddress);
return votingContract.addressTotalVotesVerified();
}