๐Ÿ’ฐReserve Contract

The Reserve Contract contains logic for holding the funds of the casino. Initially, the funds are received from the ICO and later on increased (or decreased) by the games managed by the reserve. The reserve fund decreases by: Deficient games: Games that donโ€™t have enough funds to pay back the winners withdraw from the reserve to payback the winners Daily stakers dividends The reserve fund increases by: Winning games: Game contracts that get their balance above a certain threshold will send the extra funds to the reserve ICO Anchor deposit yield.

This contract is managed by the governance contract. Many of its execute messages are only allowed to be called from the governance contract

InstantiateMsg

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InstantiateMsg {
    pub anchor_market_address: String,
    pub gov_contract_address: String,
    pub anchor_token_address: String,
    pub threshold: Uint128,
    pub native_denom: String,
}

ExecuteMsg

ChangeThreshold

Changes the UST amount above which we deposit to Anchor

AddGame

Whitelists a game contract. That game would be able to request funds from the reserve contract

RemoveGame

Delists a game contract. That game would not be able to request funds from the reserve anymore

RequestFunds

A game contracts execute this to request funds from the reserve contract

DepositFunds

A game contracts execute this to deposit funds to the reserve contract

QueryMsg

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

CurrentBalance

The current balance in the reserve contract. The calculation takes into account the uusd and the aUST with the current aUST price

GetThreshold

Returns the current maximum amount of UST above which we deposit to Anchor

ListGames

Lists all whitelisted games that are allowed to request funds from the reserve contract

Last updated