Campaign Manager

The campaign manager contract manages the shared settings of the campaign and the fees incurred in depositing and withdrawing campaign rewards.

Some of the fees are burned at a set rate, and some are paid as rewards to the governance stakers. The burn rate and non-burn volume collection wallet can be changed through governance voting.

All native tokens, cw20 tokens deposited into the campaign manager contract are considered fees. Tokens that can be exchanged for VKR are frequently exchanged for VKR and burned/transferred.

InstantiateMsg

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InstantiateMsg {
    pub governance: String,
    pub terraswap_router: String,
    pub code_id: u64,
    pub add_pool_fee_rate: Decimal,
    pub add_pool_min_referral_reward_rate: Decimal,
    pub remove_pool_fee_rate: Decimal,
    pub fee_burn_ratio: Decimal,
    pub fee_recipient: String,
    pub deactivate_period: u64,
    pub key_denom: Denom,
    pub valkyrie_token: String,
    pub referral_reward_limit_option: ReferralRewardLimitOptionMsg,
}

CampaignInstantiateMsg

This message is shown through ExecuteMsg::CreateCampaign when a campaign is created. We do not recommend creating a campaign contract without the assistance of the Campaign Manager.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct CampaignInstantiateMsg {
    pub governance: String,
    pub campaign_manager: String,
    pub admin: String,
    pub creator: String,
    pub config_msg: Binary,
    pub deposit_denom: Option<Denom>,
    pub deposit_amount: Uint128,
    pub deposit_lock_period: u64
    pub qualifier: Option<String>,
    pub qualification_description: Option<String>,
    pub executions: Vec<ExecutionMsg>,
    pub referral_reward_token: String,
}

* = optional

ExecuteMsg

Receive

Can be called during a CW20 token transfer when the Campaign Manager contract is the recipient.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    Receive {
        amount: Uint128,
        sender: Addr,
        msg: Option<Binary>,
    }
}

* = optional

UpdateConfig

Updates the configuration

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    UpdateConfig {
        governance: Option<String>,
        valkyrie_token: Option<String>,
        terraswap_router: Option<String>,
        code_id: Option<u64>,
        add_pool_fee_rate: Option<Decimal>,
        add_pool_min_referral_reward_rate: Option<Decimal>,
        remove_pool_fee_rate: Option<Decimal>,
        fee_burn_ratio: Option<Decimal>,
        fee_recipient: Option<String>,
        deactivate_period: Option<u64>,
        key_denom: Option<Denom>,
    }
}

* = optional

UpdateReferralRewardLimitOption

Updates the referral reward limit option

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    UpdateReferralRewardLimitOption {
        overflow_amount_recipient: Option<String>,
        base_count: Option<u8>,
        percent_for_governance_staking: Option<u16>,
    },
}

* = optional

SetReuseOverflowAmount

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    SetReuseOverflowAmount {}
}

CreateCampaign

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    CreateCampaign {
        config_msg: Binary,
        deposit_denom: Option<Denom>,
        deposit_amount: Option<Uint128>,
        deposit_lock_period: Option<u64>,
        qualifier: Option<String>,
        qualification_description: Option<String>,
        executions: Vec<ExecutionMsg>,
    },
}

* = optional

Spend Fee

When this message is executed, it is burned by the ratio of fee_burn_ratio among the set values, and the remaining amount is sent to fee_recipient.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    SpendFee {
        amount: Option<Uint128>,
    },
}

Swap Fee

Swap the native token or cw20 token that the campaign manager has for VKR using terraswap. Therefore, the token (or denom-VKR pair) specified in route must be registered in terraswap.

route means token swap route. For example, if you want to swap uluna to VKR without an uluna-VKR pair, enter [uluna, uusd] in route in the order. This will swap uluna to uusd and again swap uusd to VKR.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    SwapFee {
        denom: Denom,
        amount: Option<Uint128>,
        route: Option<Vec<Denom>>,
    },
}

QueryMsg

Config

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

Response

#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema)]
pub struct ConfigResponse {
    pub governance: String,
    pub valkyrie_token: String,
    pub terraswap_router: String,
    pub code_id: u64,
    pub add_pool_fee_rate: Decimal,
    pub add_pool_min_referral_reward_rate: Decimal,
    pub remove_pool_fee_rate: Decimal,
    pub fee_burn_ratio: Decimal,
    pub fee_recipient: String,
    pub deactivate_period: u64,
    pub key_denom: Denom,
}

ReferralRewardLimitOption

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    ReferralRewardLimitOption {}
}

Response

#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema)]
pub struct ReferralRewardLimitOptionResponse {
    pub overflow_amount_recipient: Option<String>,
    pub base_count: u8,
    pub percent_for_governance_staking: u16,
}

* = optional

Campaign

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    Campaign {
        address: String,
    }
}

Response

pub struct CampaignResponse {
    pub code_id: u64,
    pub address: String,
    pub creator: String,
    pub created_height: u64,
}

Campaigns

QueryMsg

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    Campaigns {
        start_after: Option<String>,
        limit: Option<u32>,
        order_by: Option<OrderBy>,
    }
}

* = optional

Response

#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema)]
pub struct CampaignsResponse {
    pub campaigns: Vec<CampaignResponse>
}

Last updated