Skip to main content

Cluster Factory

note

The Cluster Factory contract is responsible for distributing NEB token rewards.

InstantiateMsg#

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]pub struct InstantiateMsg {    pub token_code_id: u64, // code ID to create new cluster token    pub cluster_code_id: u64, // code ID to create new clusters    pub base_denom: String, // TerraUSD    pub protocol_fee_rate: String, // has to FPDecimal    pub distribution_schedule: Vec<(u64, u64, Uint128)>, // [[start_time, end_time, distribution_amount], [], ...]}
KeyTypeDescription
token_code_idu64(address) owner of the contract
cluster_code_idu64(address) Nebula factory contract
base_denomStringcluster name / title
protocol_fee_rateStringshort explanation of cluster strategy
distribution_scheduleVec\<(u64, u64, Uint128)>NEB token inflation rewards distribution schedule

ExecuteMsg#

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]#[serde(rename_all = "snake_case")]pub enum ExecuteMsg {    ///////////////////    /// Owner Operations    ///////////////////    PostInitialize { // called after initialize to C&E prob        owner: String,        terraswap_factory: String,        nebula_token: String,        staking_contract: String,        commission_collector: String,    },    UpdateConfig {        owner: Option<String>,        token_code_id: Option<u64>,        cluster_code_id: Option<u64>,        distribution_schedule: Option<Vec<(u64, u64, Uint128)>>,    },    UpdateRewardWeight {        asset_token: String,        weight: u32,    },    CreateCluster {        /// used to create all necessary contract or register asset        params: Params,    },    DecommissionCluster {        cluster_contract: String,        cluster_token: String,    },    PassCommand {        contract_addr: String,        msg: Binary,    },    DistributeReward {},}

PostInitialize#

KeyTypeDescription
ownerString(address) owner of the contract
terraswap_factoryString(address) Nebula factory contract
nebula_tokenStringcluster name / title
staking_contractStringcluster name / title
commission_collectorStringshort explanation of cluster strategy

UpdateConfig#

KeyTypeDescription
token_code_idu64(address) owner of the contract
cluster_code_idu64(address) Nebula factory contract
base_denomStringcluster name / title
protocol_fee_rateStringshort explanation of cluster strategy
distribution_scheduleVec\<(u64, u64, Uint128)>NEB token inflation rewards distribution schedule

UpdateRewardWeight#

KeyTypeDescription
asset_tokenString(address) owner of the contract
weightu32(address) Nebula factory contract

CreateCluster#

KeyTypeDescription
paramsParamscluster creation parameters

DecommissionCluster#

KeyTypeDescription
cluster_contractString(address) cluster contract
cluster_tokenu32(address) cluster token contract

PassCommand#

KeyTypeDescription
contract_addrString(address) contract to call
msgBinarymessage to execute on contract_addr

DistributeReward#

KeyTypeDescription
This message takes no arguments.

QueryMsg#

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]#[serde(rename_all = "snake_case")]pub enum QueryMsg {    Config {},    ClusterExists { contract_addr: String },    ClusterList {},    DistributionInfo {},}

Config#

Request#

KeyTypeDescription
This message takes no arguments.

Response#

ClusterExists#

Request#

KeyTypeDescription
contract_addrString(address) contract to check if cluster

Response#

ClusterList#

Request#

KeyTypeDescription
This message takes no arguments.

Response#

DistributionInfo#

Request#

KeyTypeDescription
This message takes no arguments.

Response#