docs
Searchโ€ฆ
๐Ÿ’ฐ
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
โ€‹
Key
Type
Description
anchor_market_address
CanonicalAddr
Address of anchor market contract
gov_contract_address
CanonicalAddr
Address of the gov contract to be able to change parameters through voting
anchor_token_address
CanonicalAddr
Address of anchor token ANC contract
threshold
Decimal
maximum amount of UST above which we deposit to Anchor
games
vec
Whitelisted games that are allowed to send and receive funds

InstantiateMsg

1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
pub struct InstantiateMsg {
3
pub anchor_market_address: String,
4
pub gov_contract_address: String,
5
pub anchor_token_address: String,
6
pub threshold: Uint128,
7
pub native_denom: String,
8
}
Copied!
Key
Type
Description
anchor_market_address
CanonicalAddr
Address of anchor market contract
gov_contract_address
CanonicalAddr
Address of the gov contract to be able to change parameters through voting
anchor_token_address
CanonicalAddr
Address of anchor token ANC contract
threshold
Decimal
maximum amount of UST above which we deposit to Anchor
games
vec
Whitelisted games that are allowed to send and receive funds

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

1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
#[serde(rename_all = "snake_case")]
3
pub enum QueryMsg {
4
CurrentBalance {},
5
GetThreshold {},
6
ListGames {},
7
BalanceHistory {},
8
}
Copied!

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
โ€‹