@governor:proposalState
Current state of a Governor proposal: Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired or Executed.
On-chain (@governor:proposalState!): Returns the raw uint8 enum (0 Pending, 1 Active, 2 Canceled, 3 Defeated, 4 Succeeded, 5 Queued, 6 Expired, 7 Executed), not the name.
⚗️ Experimental — available at next.evmcrispr.com.
Returns: string
Syntax
Section titled “Syntax”@governor:proposalState(governor proposalId)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
governor | address | Governor address |
proposalId | number | Proposal id |
Examples
Section titled “Examples”load governor
set $governor 0x44fA8E6f47987339850636F88629646662444217set $proposalId 42
print @governor:proposalState($governor $proposalId)- Returns the state name:
Pending,Active,Canceled,Defeated,Succeeded,Queued,ExpiredorExecuted.
See Also
Section titled “See Also”On-chain face (@proposalState!)
Section titled “On-chain face (@proposalState!)”Read state(proposalId) at assertion time as the RAW uint8 enum value: 0 Pending, 1 Active, 2 Canceled, 3 Defeated, 4 Succeeded, 5 Queued, 6 Expired, 7 Executed. The string mapping of the plain face stays off-chain — compare against the numeric value.
Examples
Section titled “Examples”load governor
set $governor 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2set $proposalId 42
# Succeeded = 4assert @proposalState!($governor $proposalId) == 4 "proposal not succeeded"