Annex Docs
Search…
State
Gets the proposal state for the specified proposal. The return value, ProposalState is an enumerated type defined in the Governor Alpha contract.
Governor Alpha
1
function state(uint proposalId) returns (ProposalState)
Copied!
  • proposalId: ID of a proposal in which to get its state.
  • RETURN: Enumerated type ProposalState. The types are Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, andExecuted.
Solidity
1
GovernorAlpha gov = GovernorAlpha(0x123...); // contract address
2
GovernorAlpha.ProposalState state = gov.state(123);
Copied!
Web3 1.2.6
1
const proposalStates = ['Pending', 'Active', 'Canceled', 'Defeated', 'Succeeded', 'Queued', 'Expired', 'Executed'];
2
const proposalId = 123;
3
result = await gov.methods.state(proposalId).call();
4
const proposalState = proposalStates[result];
Copied!
Last modified 4mo ago
Copy link