Governance
The Gov Contract contains logic for holding polls and Valkyrie Token (VKR) staking, and allows the Valkyrie Protocol to be governed by its users in a decentralized manner.
New proposals for change are submitted as polls, and are voted on by VKR stakers through the Poll Lifecycle. Polls can contain messages that can be executed directly without changing the Valkyrie Protocol code.
InstantiateMsg
Key
Type
Description
contract_config
ContractConfigInitMsg
Contract init configuration message
poll_config
PollConfigInitMsg
Poll init configuration message
ContractConfigInitMsg
.
Key
Type
Description
governanace_token
String
Contract address of Valkyrie Token (VKR)
PollConfigInitMsg
.
Key
Type
Description
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 blocks during which votes can be cast
execution_delay_period
u64
Number of blocks after a poll's voting period during which the poll can be executed.
proposal_deposit
Uint128
Minimum VKR deposit required for a new poll to be submitted
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
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.
Key
Type
Description
Cw20ReceiveMsg
Uint128
Amount of tokens received
sender
Addr
Sender of token transfer
msg
*
Binary
Base64-encoded JSON of receive hook
* = optional
UpdatePollConfig
Updates the configuration for the Gov contract.
Key
Type
Description
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 blocks during which votes can be cast
execution_delay_period*
u64
Number of blocks after a poll passes to apply changes
proposal_deposit*
Uint128
Minimum VKR deposit required for a new poll to be submitted
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
* = 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.)
Key
Type
Description
amount
Uint128
Amount of voting power (staked VKR) to allocate
poll_id
u64
Poll ID
vote
VoteOption
Could be one of yes
, no
, abstain
UnstakeGovernanceToken
Removes deposited VKR tokens from a staking position and returns them to a user's balance.
Key
Type
Description
amount*
Uint128
Amount of VKR tokens to withdraw. If empty, all staked VKR tokens are withdrawn.
* = optional
EndPoll
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.
Key
Type
Description
poll_id
u64
Poll ID
ExecutePoll
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.
Key
Type
Description
poll_id
u64
Poll ID
SnapshotPoll
Snapshot of poll’s current quorum
status is saved when the block height enters snapshot_period
.
Key
Type
Description
poll_id
u64
Poll ID
RunExecution
This ExecuteMsg is only used as sub messages to ExecutePoll
To execute or roll back all ExecutionMsgs together, ExecuteMsg executes executions of Poll through RunExecution.
Key
Type
Description
executions
Vec<ExecutionMsg>
Execution messages
Receive Hooks
StakeGovernanceToken
WARNING
If you send VKR 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 VKR tokens to the Gov contract to add them to their VKR staking position.
CreatePoll
Issued when sending VKR tokens to the Gov contract to create a new poll. Will only succeed if the amount of tokens sent meets the configured proposal_deposit
amount. Contains a generic message to be issued by the Gov contract if it passes (can invoke messages in other contracts it owns).
Key
Type
Description
title
String
Poll title
description
String
Poll description
link*
String
URL to external post about poll (forum, PDF, etc.)
executions
Vec(ExecutionMsg)
Message to be executed by Gov contract
* = optional
QueryMsg
ContractConfig
Response
Key
Type
Description
governance_token
String
Contract address of governance token
PollConfig
Response
Key
Type
Description
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 blocks during which votes can be cast
execution_delay_period
u64
Number of blocks after a poll passes to apply changes
proposal_deposit
Uint128
Minimum VKR deposit required for a new poll to be submitted
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
* = optional
PollState
Response
Key
Type
Description
poll_count
u64
Total number of polls that have been created on Valkyrie Protocol
total_deposit
Uint128
Amount of locked VKR to governance polls
Poll
Key
Type
Description
poll_id
u64
Poll ID
Response
Key
Type
Description
id
u64
Poll ID
title
String
Title of the poll
description
String
Description submitted by the creator
link*
String
URL link
executions
Vec(ExecutionMsg)
Message to be executed by Gov contract
creator
String
Address of the poll creator
deposit_amount
Uint128
Initial VKR deposit at poll creation
yes_votes
Uint128
Amount of yes
votes
no_votes
Uint128
Amount of no
votes
abstain_vote
Uint128
Amount of abstain
votes
end_height
u64
Amount of voting rewards that are not claimed yet
status
PollStatus
Could be one of in progress
, rejected
, passed
, executed
, expired
staked_amount*
Uint128
Total number of VKR staked on governance contract (used when Snapshot Poll has been taken)
total_balance_at_end_poll*
Uint128
Total balanced used as yes, no, or abstain votes at the end of the poll
*=optional
Polls
Key
Type
Description
filter*
PollStatus
Could be one of in progress
, rejected
, passed
, executed
, expired
start_after*
String
Begins search query at specific ID
limit*
u32
Limit of results to fetch
order_by*
OrderBy
Order to make query
*=optional
Response
Key
Type
Description
polls
Vec<PollResponse>
Array of poll query responses
Voters
Key
Type
Description
poll_id
u64
Poll ID
start_after*
String
Begins search query at specific ID
limit*
u32
Limit of results to fetch
order_by*
OrderBy
Order to make query
*=optional
Response
Key
Type
Description
voters
Vec<VoteInfoMsg>
List of vote info Msg
StakingState
Response
Key
Type
Description
total_share
Uint128
Amount of staked VKR to governance contract
StakerState
Key
Type
Description
address
String
Address of staker wallet
Response
Key
Type
Description
balance
Uint128
Amount of staked VKR used for voting
share
Uint128
Weight of the user's staked VKR
votes
Vec<(u64, VoteInfoMsg)>
Could be one of yes
, no
, abstain
VotingPower
Key
Type
Description
address
String
Address of voter wallet
Response
Key
Type
Description
voting_power
Decimal
The number of votes voted on poll
Last updated