pub struct InstantiateMsg {Show 15 fields
pub admin: Option<String>,
pub membership: String,
pub min_points: u64,
pub max_validators: u32,
pub epoch_length: u64,
pub epoch_reward: Coin,
pub initial_keys: Vec<OperatorInitInfo>,
pub scaling: Option<u32>,
pub fee_percentage: Decimal,
pub auto_unjail: bool,
pub double_sign_slash_ratio: Decimal,
pub distribution_contracts: UnvalidatedDistributionContracts,
pub validator_group_code_id: u64,
pub verify_validators: bool,
pub offline_jail_duration: Duration,
}Fields§
§admin: Option<String>Address allowed to jail, meant to be a OC voting contract. If None, then jailing is
impossible in this contract.
membership: StringAddress of a cw4 contract with the raw membership used to feed the validator set
min_points: u64Minimum points needed by an address in membership to be considered for the validator set.
0-point members are always filtered out.
(use points for cw4, power for Tendermint)
max_validators: u32The maximum number of validators that can be included in the Tendermint validator set. If there are more validators than slots, we select the top N by membership points descending. (In case of ties at the last slot, select by “first” Tendermint pubkey, lexicographically sorted).
epoch_length: u64Number of seconds in one epoch. We update the Tendermint validator set only once per epoch. Epoch # is env.block.time/epoch_length (round down). The first block with a new epoch number will trigger a new validator calculation.
epoch_reward: CoinTotal reward paid out at each epoch. This will be split among all validators during the last epoch. (epoch_reward.amount * 86_400 * 30 / epoch_length) is the amount of reward tokens to mint each month. Ensure this is sensible in relation to the total token supply.
initial_keys: Vec<OperatorInitInfo>Initial operators and validator keys registered. If you do not set this, the validators need to register themselves before making this privileged/calling the EndBlockers, so that we have a non-empty validator set
scaling: Option<u32>A scaling factor to multiply cw4-group points to produce the Tendermint validator power
fee_percentage: DecimalPercentage of total accumulated fees that is subtracted from tokens minted as rewards. 50% by default. To disable this feature just set it to 0 (which effectively means that fees don’t affect the per-epoch reward).
auto_unjail: boolFlag determining if validators should be automatically unjailed after the jailing period; false by default.
double_sign_slash_ratio: DecimalValidators who are caught double signing are jailed forever and their bonded tokens are slashed based on this value.
distribution_contracts: UnvalidatedDistributionContractsAddresses where part of the reward for non-validators is sent for further distribution. These are
required to handle the Distribute {} message (eg. tg4-engagement contract) which would
distribute the funds sent with this message.
The sum of ratios here has to be in the [0, 1] range. The remainder is sent to validators via the rewards contract.
Note that the particular algorithm this contract uses calculates token rewards for distribution
contracts by applying decimal division to the pool of reward tokens, and then passes the remainder
to validators via the contract instantiated from rewards_code_is. This will cause edge cases where
indivisible tokens end up with the validators. For example if the reward pool for an epoch is 1 token
and there are two distribution contracts with 50% ratio each, that token will end up with the
validators.
validator_group_code_id: u64Code id of the contract which would be used to distribute the rewards of this token, assuming
tg4-engagement. The contract will be initialized with the message:
{
"admin": "valset_addr",
"denom": "reward_denom",
}This contract has to support all the RewardsDistribution messages
verify_validators: boolWhen a validator joins the valset, verify they sign the first block since joining or jail them for a period otherwise.
The verification happens every time the validator becomes an active validator, including when they are unjailed or when they just gain enough power to participate.
offline_jail_duration: DurationThe duration to jail a validator for in case they don’t sign their first epoch boundary block. After the period, they have to pass verification again, ad infinitum.
Implementations§
Source§impl InstantiateMsg
impl InstantiateMsg
pub fn validate(&self) -> Result<(), ContractError>
Trait Implementations§
Source§impl Clone for InstantiateMsg
impl Clone for InstantiateMsg
Source§fn clone(&self) -> InstantiateMsg
fn clone(&self) -> InstantiateMsg
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InstantiateMsg
impl Debug for InstantiateMsg
Source§impl<'de> Deserialize<'de> for InstantiateMsg
impl<'de> Deserialize<'de> for InstantiateMsg
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for InstantiateMsg
impl JsonSchema for InstantiateMsg
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for InstantiateMsg
impl PartialEq for InstantiateMsg
Source§fn eq(&self, other: &InstantiateMsg) -> bool
fn eq(&self, other: &InstantiateMsg) -> bool
self and other values to be equal, and is used by ==.