Annex Docs
Search…
Cast Vote
Cast a vote on a proposal. The account's voting weight is determined by the number of votes the account had delegated to it at the time the proposal state became active.
Governor Alpha
1
function castVote(uint proposalId, bool support)
Copied!
  • proposalId: ID of a proposal in which to cast a vote.
  • support: A boolean of true for 'yes' or false for 'no' on the proposal vote.
  • RETURN: No return, reverts on error.
Solidity
1
GovernorAlpha gov = GovernorAlpha(0x123...); // contract address
2
gov.castVote(proposalId, true);
Copied!
Web3 1.2.6
1
const tx = gov.methods.castVote(proposalId, false).send({ from: sender });
Copied!
Last modified 4mo ago
Copy link