Governance Precompile
Address: 0x0000000000000000000000000000000000001006
This precompile enables participation in Sei’s governance process through the EVM, allowing EVM users and contracts to submit proposals, vote, and query governance information.
Functions
Transactions
-
vote
: Allows a user to cast a vote on a governance proposal/// Cast a vote on the specified proposal. /// @param proposalId The ID of the proposal to vote on. /// @param option The option to vote for. (Refer to the governance module for allowed options) /// @return Whether the vote was successfully cast. function vote( uint64 proposalID, int32 option ) external returns (bool success);
-
voteWeighted
: Allows a user to cast a weighted vote on a governance proposalstruct WeightedVoteOption { int32 option; // Vote option (1=Yes, 2=Abstain, 3=No, 4=NoWithVeto) string weight; // Weight as decimal string (e.g., "0.7") } /// Cast a weighted vote on a governance proposal (vote splitting) /// @param proposalID The ID of the proposal to vote on /// @param options Array of weighted vote options, weights must sum to 1.0 /// @return success Whether the vote was successfully cast /// /// Example: /// WeightedVoteOption[] memory options = new WeightedVoteOption[](2); /// options[0] = WeightedVoteOption({option: 1, weight: "0.7"}); // 70% Yes /// options[1] = WeightedVoteOption({option: 2, weight: "0.3"}); // 30% Abstain /// GOV_CONTRACT.voteWeighted(proposalID, options); function voteWeighted( uint64 proposalID, WeightedVoteOption[] calldata options ) external returns (bool success);
-
deposit
: Enables a user to deposit tokens into a governance proposal/// Deposit funds into the specified proposal. /// @param proposalId The ID of the proposal to vote on. /// @return Whether the tokens were successfully deposit cast. function deposit( uint64 proposalID, ) payable external returns (bool success);
-
submitProposal
: Allows a user to submit a new governance proposal/// Submit a new governance proposal. Deposit should be provided via msg.value /// @param proposalJSON JSON string containing proposal details e.g.: /// { /// "title": "Proposal Title", /// "description": "Proposal Description", /// "type": "Text", // Optional, defaults to "Text" if empty /// "is_expedited": false // Optional /// } /// @return proposalID The ID of the created proposal function submitProposal( string calldata proposalJSON ) payable external returns (uint64 proposalID);
View the Governance precompile source code and the contract ABI here .
Last updated on