Skip to content

@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

@governor:proposalState(governor proposalId)
NameTypeDescription
governoraddressGovernor address
proposalIdnumberProposal id
load governor
set $governor 0x44fA8E6f47987339850636F88629646662444217
set $proposalId 42
print @governor:proposalState($governor $proposalId)
  • Returns the state name: Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired or Executed.

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.

load governor
set $governor 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
set $proposalId 42
# Succeeded = 4
assert @proposalState!($governor $proposalId) == 4 "proposal not succeeded"