Governance can execute any arbitrary message whose proposals have a minimum voting period of 7 days
Voting power per proposal is based on power when the proposal was created.
Expedited Proposals can be called by Addresses w/ a vested allocation & should be used only for time-sensitive emergencies
Proposals can be aligned with by stakers to pass the active threshold, any pending proposal can be deleted within 1 day
Staker's vote doesn't override the Delegate's vote
InstantiateMsg
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InstantiateMsg {
pub mbrn_staking_contract: String,
pub vesting_contract_addr: String,
pub vesting_voting_power_multiplier: Decimal,
pub proposal_voting_period: u64,
pub expedited_proposal_voting_period: u64,
pub proposal_effective_delay: u64,
pub proposal_expiration_period: u64,
pub proposal_required_stake: Uint128,
pub proposal_required_quorum: String,
pub proposal_required_threshold: String,
pub whitelisted_links: Vec<String>,
}
Key Type Description vesting_voting_power_multipler
Vesting voting power ratio
expedited_proposal_voting_period
Expedited Proposal voting period
proposal_expiration_period
Proposal expiration period
proposal_required_threshold
Proposal required threshold
ExecuteMsg
SubmitProposal
Submit a new proposal in the Governance contract
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
SubmitProposal {
title: String,
description: String,
link: Option<String>,
messages: Option<Vec<ProposalMessage>>,
receiver: Option<String>,
expedited: bool,
}
}
Key Type Description Proposal whitelisted link
Proposal executeble messages
If from vesting contract, add Receiver address
Expedited Proposal toggle
* = optional
CastVote
Cast vote on an active proposal
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
CastVote {
proposal_id: u64,
vote: ProposalVoteOption,
receiver: Option<String>,
}
}
pub enum ProposalVoteOption {
For,
Against,
Amend,
Remove,
Align,
}
Key Type Description If from vesting contract, add Receiver address
* = optional
EndProposal
Set the status of a proposal that has expired
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
EndProposal {
proposal_id: u64,
}
}
CheckMessages
Check messages execution
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
CheckMessages {
messages: Vec<ProposalMessage>,
msg_switch: Option<u64>
}
}
//If passed you'll get returned 'ContractError::MessagesCheckPassed {}'
#[error("Messages check passed. Nothing was committed to the blockchain")]
MessagesCheckPassed {}
Key Type Description Switch to choose executable msgs to check after the above messages are executed
* = optional
CheckMessagesPassed
The last endpoint which is executed only if all proposal messages have been passed. Called by the contract at the end of CheckMessages.
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
CheckMessagesPassed { error: Option<bool> }
}
ExecuteProposal
Execute a successful proposal
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
ExecuteProposal{
proposal_id: u64,
}
}
RemoveCompletedProposal
Remove a proposal that was already executed (or failed/expired)
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
RemoveCompletedProposal {
proposal_id: u64,
}
}
UpdateConfig
Update parameters in the Governance contract. Only the Governance contract is allowed to update its own parameters through a successful proposal.
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
UpdateConfig( UpdateConfig )
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct UpdateConfig {
pub mbrn_denom: Option<String>,
pub minimum_total_stake: Option<Uint128>,
pub staking_contract: Option<String>,
pub vesting_contract_addr: Option<String>,
pub vesting_voting_power_multiplier: Option<Decimal>,
pub proposal_voting_period: Option<u64>,
pub expedited_proposal_voting_period: Option<u64>,
pub proposal_effective_delay: Option<u64>,
pub proposal_expiration_period: Option<u64>,
pub proposal_required_stake: Option<u128>,
pub proposal_required_quorum: Option<String>,
pub proposal_required_threshold: Option<String>,
pub whitelist_remove: Option<Vec<String>>,
pub whitelist_add: Option<Vec<String>>,
}
Key Type Description MBRN native token fulldenom
Minimum total stake to submit proposals
*vesting_voting_power_multipler
Vesting voting power ratio
*expedited_proposal_voting_period
Expedited Proposal voting period
*proposal_effective_delay
*proposal_expiration_period
Proposal expiration period
*proposal_required_quorum
*proposal_required_threshold
Proposal required threshold
Links to remove from whitelist
Links to add to whitelist
* = optional
CreateOsmosisGauge
Use osmosis-std to create a gauge with assets in this contract
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
CreateOsmosisGauge {
gauge_msg: MsgCreateGauge
}
}
pub struct MsgCreateGauge {
pub is_perpetual: bool,
pub owner: ::prost::alloc::string::String,
pub distribute_to: ::core::option::Option<super::lockup::QueryCondition>,
pub coins: ::prost::alloc::vec::Vec<super::super::cosmos::base::v1beta1::Coin>,
pub start_time: ::core::option::Option<crate::shim::Timestamp>,
pub num_epochs_paid_over: u64,
pub pool_id: u64,
}
pub struct QueryCondition {
/// LockQueryType is a type of lock query, ByLockDuration | ByLockTime
pub lock_query_type: i32,
/// Denom represents the token denomination we are looking to lock up
pub denom: ::prost::alloc::string::String,
/// Duration is used to query locks with longer duration than the specified
/// duration. Duration field must not be nil when the lock query type is
/// `ByLockDuration`.
pub duration: ::core::option::Option<crate::shim::Duration>,
/// Timestamp is used by locks started before the specified duration.
/// Timestamp field must not be nil when the lock query type is `ByLockTime`.
/// Querying locks with timestamp is currently not implemented.
pub timestamp: ::core::option::Option<crate::shim::Timestamp>,
}
pub struct Duration {
pub seconds: i64,
pub nanos: i32,
}
pub struct Timestamp {
pub seconds: i64,
pub nanos: i32,
}
pub struct Coin {
pub denom: ::prost::alloc::string::String,
pub amount: ::prost::alloc::string::String,
}
Key Type Description Osmosis-std gauge creation msg
AddToOsmosisGauge
Use osmosis-std to add to a gauge, owned by this contract, with assets in this contract
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
AddToOsmosisGauge {
gauge_msg: MsgAddToGauge
}
}
pub struct MsgAddToGauge {
pub owner: ::prost::alloc::string::String,
pub gauge_id: u64,
pub rewards: ::prost::alloc::vec::Vec<super::super::cosmos::base::v1beta1::Coin>,
}
pub struct Coin {
pub denom: ::prost::alloc::string::String,
pub amount: ::prost::alloc::string::String,
}
Key Type Description Osmosis-std add to gauge msg
QueryMsg
Config
Return the contract's configuration
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Config {}
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct Config {
pub mbrn_denom: String,
pub minimum_total_stake: Uint128,
pub staking_contract_addr: Addr,
pub vesting_contract_addr: Addr,
pub vesting_voting_power_multiplier: Decimal,
pub proposal_voting_period: u64,
pub expedited_proposal_voting_period: u64,
pub proposal_effective_delay: u64,
pub proposal_expiration_period: u64,
pub proposal_required_stake: Uint128,
pub proposal_required_quorum: Decimal,
pub proposal_required_threshold: Decimal,
pub whitelisted_links: Vec<String>,
}
PendingProposals
Return the current list of pending proposals
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
PendingProposals {
start: Option<u64>,
limit: Option<u32>,
}
}
pub struct ProposalResponse {
pub voting_power: Vec<(Addr, Uint128)>,
pub proposal_id: Uint64,
pub submitter: Addr,
pub status: ProposalStatus,
pub aligned_power: Uint128,
pub for_power: Uint128,
pub against_power: Uint128,
pub amendment_power: Uint128,
pub removal_power: Uint128,
pub start_block: u64,
pub start_time: u64,
pub end_block: u64,
pub delayed_end_block: u64,
pub expiration_block: u64,
pub title: String,
pub description: String,
pub messages: Option<Vec<ProposalMessage>>,
pub link: Option<String>,
}
Key Type Description Id from which to start querying
Proposals
Return the current list of proposals
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Proposals {
start: Option<u64>,
limit: Option<u32>,
}
}
pub struct ProposalResponse {
pub voting_power: Vec<(Addr, Uint128)>,
pub proposal_id: Uint64,
pub submitter: Addr,
pub status: ProposalStatus,
pub aligned_power: Uint128,
pub for_power: Uint128,
pub against_power: Uint128,
pub amendment_power: Uint128,
pub removal_power: Uint128,
pub start_block: u64,
pub start_time: u64,
pub end_block: u64,
pub delayed_end_block: u64,
pub expiration_block: u64,
pub title: String,
pub description: String,
pub messages: Option<Vec<ProposalMessage>>,
pub link: Option<String>,
}
Key Type Description Id from which to start querying
* = optional
ProposalVoters
Return proposal voters of specified proposal
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
ProposalVoters {
proposal_id: u64,
vote_option: ProposalVoteOption,
start: Option<u64>,
limit: Option<u32>,
specific_user: Option<String>,
}
}
Returns Vec<Addr>
Key Type Description Id from which to start querying
The amount of proposals to return
Specific user to query vote option for
* = optional
Proposal
Return information about a specific proposal
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Proposal { proposal_id: u64 }
}
pub struct ProposalResponse {
pub voting_power: Vec<(Addr, Uint128)>,
pub proposal_id: Uint64,
pub submitter: Addr,
pub status: ProposalStatus,
pub aligned_power: Uint128,
pub for_power: Uint128,
pub against_power: Uint128,
pub amendment_power: Uint128,
pub removal_power: Uint128,
pub start_block: u64,
pub start_time: u64,
pub end_block: u64,
pub delayed_end_block: u64,
pub expiration_block: u64,
pub title: String,
pub description: String,
pub messages: Option<Vec<ProposalMessage>>,
pub link: Option<String>,
}
ProposalVotes
Return information about the votes cast on a specific proposal
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
ProposalVotes { proposal_id: u64 }
}
pub struct ProposalVotesResponse {
pub proposal_id: u64,
pub for_power: Uint128,
pub against_power: Uint128,
pub amendment_power: Uint128,
pub removal_power: Uint128,
pub aligned_power: Uint128,
}
UserVotingPower
Return user voting power for a specific proposal
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
UserVotingPower {
user: String,
proposal_id: u64,
builders: bool,
}
}
Returns Uint128
Key Type Description User's voting power to query
If user is a receiver from Builder's contract
TotalVotingPower
Return total voting power for a specific proposal
Copy #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
TotalVotingPower { proposal_id: u64 }
}
Returns Uint128