The Gov Contract contains logic for holding polls and Mirror Token (MIR) staking, and allows the Mirror Protocol to be governed by its users in a decentralized manner. After the initial bootstrapping of Mirror Protocol contracts, the Gov Contract is assigned to be the owner of itself and Mirror Factory.
New proposals for change are submitted as polls, and are voted on by MIR stakers through the voting procedure. Polls can contain messages that can be executed directly without changing the Mirror Protocol code.
The Gov Contract keeps a balance of MIR tokens, which it uses to reward stakers with funds it receives from trading fees sent by the Mirror Collector and user deposits from creating new governance polls. This balance is separate from the Community Pool, which is held by the Community contract (owned by the Gov contract).
Config
Key
Type
Description
mirror_token
HumanAddr
Contract address of Mirror Token (MIR)
quorum
Decimal
Minimum percentage of participation required for a poll to pass
threshold
Decimal
Minimum percentage of yes votes required for a poll to pass
voting_period
u64
Number of seconds during which votes can be cast
proposal_deposit
Uint128
MIR deposit required for a new poll to be submitted
effective_delay
u64
Number of seconds after a poll passes to apply changes
voter_weight
Decimal
Ratio of protocol fee which will be distributed among the governance poll voters
snapshot_period
u64
Minimum number of blocks before the end of voting period which snapshot could be taken to lock the current quorum for a poll
admin_manager
String
Address of the admin manager contract
poll_gas_limit
u64
Maximum amount of gas which a poll can consume during its execution
Minimum percentage of participation required for a poll to pass
default_poll_config
PollConfig
PollConfig for default poll types
migration_poll_config
PollConfig
PollConfig for migration poll types
auth_admin_poll_config
PollConfig
PollConfig for governance configuration change and admin key transfer polls
effective_delay
u64
Number of blocks after a poll passes to apply changes
voter_weight
Decimal
Ratio of protocol fee which will be distributed among the governance poll voters
snapshot_period
u64
Minimum number of blocks before the end of voting period which snapshot could be taken to lock the current quorum for a poll
admin_manager
String
Address of the admin manager contract
poll_gas_limit
u64
Maximum amount of gas which a poll can consume during its execution
PollConfig
Key
Type
Description
proposal_deposit
Uint128
MIR deposit required for new polls to be submitted
voting_period
u64
Number of seconds during which votes can be cast
quorum
Decimal
Minimum percentage of participation required for a poll to pass
threshold
Decimal
Minimum percentage of yes votes required for a poll to pass
ExecuteMsg
Receive
Can be called during a CW20 token transfer when the Gov contract is the recipient. Allows the token transfer to execute a Receive Hook as a subsequent action within the same transaction.
Minimum percentage of participation required for a poll to pass
threshold*
Decimal
Minimum percentage of yes votes required for a poll to pass
voting_period*
u64
Number of blocks during which votes can be cast
effective_delay*
u64
Number of blocks after a poll passes to apply changes
expiration_period*
u64
Number of blocks after a poll's voting period during which the poll can be executed
proposal_deposit*
Uint128
Minimum MIR deposit required for a new poll to be submitted
voter_weight*
Decimal
Ratio of protocol fee which will be distributed among the governance poll voters
snapshot_period*
u64
Minimum number of blocks before end of voting period which snapshot could be taken to lock the current quorum for a poll
* = optional
CastVote
Submits a user's vote for an active poll. Once a user has voted, they cannot change their vote with subsequent messages (increasing voting power, changing vote option, cancelling vote, etc.)
Can be issued by anyone to end the voting for an active poll. Triggers tally the results to determine whether the poll has passed. The current block height must exceed the end height of voting phase.
Can be issued by anyone to implement into action the contents of a passed poll. The current block height must exceed the end height of the poll's effective delay.
If you send MIR tokens to the Gov contract without issuing this hook, they will not be staked and will be irrevocably donated to the reward pool for stakers.
Issued when sending MIR tokens to the Gov contract to add them to their MIR staking position.
Issued when sending MIR tokens to the Gov contract to create a new poll. Will only succeed if the amount of tokens sent meets the configuredproposal_depositamount. Contains a generic message to be issued by the Gov contract if it passes (can invoke messages in other contracts it owns).