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
Parameter | Type | Description |
---|---|---|
proposalId | string | The proposal to cast a vote on. |
voteType | VoteType | The position the voter is taking on their vote. |
reason | string | (Optional) (optional) The reason for the vote. |
Returns:
Promise<TransactionResult>
Remarks
Vote on an active proposal