kujira_pilot/
execute.rs

1use cosmwasm_schema::cw_serde;
2use cosmwasm_std::{Addr, Coin, Decimal, Timestamp, Uint128};
3use kujira_std::{CallbackMsg, Denom};
4
5#[cw_serde]
6pub enum ExecuteMsg {
7    /// Creates a new pilot sale
8    Create {
9        sale: CreateSale,
10        orca: CreateOrca,
11    },
12    /// Executes a pilot sale
13    Execute {
14        idx: Uint128,
15    },
16    /// Retracts a pilot sale
17    Retract {
18        idx: Uint128,
19    },
20    Orca {
21        sale: Uint128,
22        msg: kujira_orca::ExecuteMsg,
23    },
24    UpdateConfig {
25        owner: Option<Addr>,
26        orca_code_id: Option<u64>,
27        orca_admin: Option<Addr>,
28        orca_owner: Option<Addr>,
29        sale_fee: Option<Decimal>,
30        withdrawal_fee: Option<Decimal>,
31        deposit: Option<Coin>,
32        fee_address: Option<Addr>,
33    },
34    /// Updates the sale description
35    UpdateSaleDescription {
36        idx: Uint128,
37        description: String,
38    },
39    Callback(CallbackMsg),
40}
41
42#[cw_serde]
43pub struct CreateSale {
44    pub title: String,
45
46    pub description: String,
47
48    pub url: String,
49
50    /// The address that the raise will be sent to
51    pub beneficiary: Addr,
52
53    /// Base price of the token at sale
54    pub price: Decimal,
55
56    pub opens: Timestamp,
57
58    /// The time after which the sale can be executed
59    pub closes: Timestamp,
60}
61
62#[cw_serde]
63pub struct CreateOrca {
64    /// The raise token, that the price is quoted in
65    pub bid_denom: Denom,
66
67    /// The threshold under which bids are automatically activated when placed
68    pub bid_threshold: Uint128,
69
70    /// The total number of pools in this queue
71    pub max_slot: u8,
72
73    /// The incremental discount offered per-pool
74    pub premium_rate_per_slot: Decimal,
75
76    /// The amount of time in seconds that a bid must wait until it can be activated
77    pub waiting_period: u64,
78}
79
80#[cw_serde]
81pub enum Status {
82    /// The sale is live and can be executed
83    Live { closes_at: Timestamp },
84    /// The sale has been retracted
85    Retracted(Timestamp),
86    /// The sale has been executed
87    Executed {
88        at: Timestamp,
89        raise_total: Uint128,
90        raise_fee: Uint128,
91        raise_amount: Uint128,
92    },
93}
94
95#[cw_serde]
96pub enum CallbackType {
97    LiquidationCallback { idx: Uint128 },
98}