Skip to main content

Overview

The Governance precompile provides comprehensive access to the Cosmos SDK’s x/gov module, enabling smart contracts to participate in on-chain governance. It allows for submitting and canceling proposals, depositing funds, and casting votes. Additionally, it offers extensive query capabilities to retrieve information about proposals, votes, deposits, and overall governance parameters. Precompile Address: 0x0000000000000000000000000000000000000805 Related Module: x/gov

Gas Costs

Gas costs are approximated and may vary based on proposal complexity and chain settings.

Transaction Methods

submitProposal

Submits a new governance proposal.

vote

Casts a single vote on an active proposal.

voteWeighted

Casts a weighted vote, splitting voting power across multiple options.

deposit

Adds funds to a proposal’s deposit during the deposit period.

cancelProposal

Cancels a proposal that is still in its deposit period.

Query Methods

getProposal

Retrieves detailed information about a specific proposal.

getProposals

Retrieves a filtered and paginated list of proposals.

getTallyResult

Retrieves the current or final vote tally for a proposal.

getVote

Retrieves the vote cast by a specific address on a proposal.

getVotes

Retrieves all votes cast on a proposal, with pagination.

getDeposit

Retrieves deposit information for a specific depositor on a proposal.

getDeposits

Retrieves all deposits made on a proposal, with pagination.

getParams

Retrieves current governance parameters.

getConstitution

Retrieves the current governance constitution.

Full Solidity Interface & ABI

Governance Solidity Interface
Governance ABI