Skip to main content

pylon_token/
distributor.rs

1use cosmwasm_std::Uint128;
2use schemars::JsonSchema;
3use serde::{Deserialize, Serialize};
4
5#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
6pub struct InstantiateMsg {
7    pub gov_contract: String,   // pylon gov contract
8    pub pylon_token: String,    // pylon token address
9    pub whitelist: Vec<String>, // whitelisted contract addresses to spend distributor
10    pub spend_limit: Uint128,   // spend limit per each `spend` request
11}
12
13#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
14#[serde(rename_all = "snake_case")]
15pub enum ExecuteMsg {
16    UpdateConfig { spend_limit: Option<Uint128> },
17    Spend { recipient: String, amount: Uint128 },
18    AddDistributor { distributor: String },
19    RemoveDistributor { distributor: String },
20}
21
22/// We currently take no arguments for migrations
23#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
24pub struct MigrateMsg {}
25
26#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
27#[serde(rename_all = "snake_case")]
28pub enum QueryMsg {
29    Config {},
30}
31
32// We define a custom struct for each query response
33#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
34pub struct ConfigResponse {
35    pub gov_contract: String,
36    pub pylon_token: String,
37    pub whitelist: Vec<String>,
38    pub spend_limit: Uint128,
39}