Skip to main content

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

ParameterTypeDescription
proposalIdstringThe unique identifier of a proposal .
accountstring(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