Vote.hasVoted() method
Check If Wallet Voted
Example
// The proposal ID of the proposal you want to check
const proposalId = "0";
// The address of the wallet you want to check to see if they voted
const address = "{{wallet_address}}";
await contract.hasVoted(proposalId, address);
Signature:
hasVoted(proposalId: string, account?: string): Promise<boolean>;
Parameters
Parameter | Type | Description |
---|---|---|
proposalId | string | The unique identifier of a proposal . |
account | string | (Optional) (optional) wallet account address. Defaults to connected signer. |
Returns:
Promise<boolean>
- True if the account has already voted on the proposal.
Remarks
Check if a specified wallet has voted a specific proposal