Skip to main content

Vote.vote() method

Vote

Example

// The proposal ID of the proposal you want to vote on
const proposalId = "0";
// The vote type you want to cast, can be VoteType.Against, VoteType.For, or VoteType.Abstain
const voteType = VoteType.For;
// The (optional) reason for the vote
const reason = "I like this proposal!";

await contract.vote(proposalId, voteType, reason);

Signature:

vote(proposalId: string, voteType: VoteType, reason?: string): Promise<TransactionResult>;

Parameters

ParameterTypeDescription
proposalIdstringThe proposal to cast a vote on.
voteTypeVoteTypeThe position the voter is taking on their vote.
reasonstring(Optional) (optional) The reason for the vote.

Returns:

Promise<TransactionResult>

Remarks

Vote on an active proposal