đ˛Dice Game Contract
Last updated
Last updated
The Dice Game Contract contains the logic of the double dice game with the betting and distribution of the rewards to the players, the interaction with the reserve contract to handle the funds, and checking up the randomness from the terrand smart contract. This contract also handles the taxes on player wins and the casino advantage.
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 |
---|---|---|
Changes the advantage ratio of the casino against the player
chenages the maximum amount of UST to keep in the contract above which we send to the reserve contract
To be called by a player to bet on a Live round. or to start a new round if some conditions are met.
To be called by a player to claim their accumulated rewards from the previous round(s) if they have any
Sends all the contract balance to the reserve contract
Halts the game so no player can bet anymore
Returns the winning multiplier per dice roll bet. it is a vector that depends on the distribution of probability of the double dice and the casino advantage.
Returns the wins of the player who calls this function.
Returns the current dice game round.
Returns the outcome history of the dice. based on what terrand has generated.
Returns all the bets of a specific wallet for a specific dice round.
returns the dice game contract config
Returns the maximum betting amount per round. This value is calculated every round based on how much money the reserve holds. This parameter is there to prevent players from betting higher than what the casino holds. The ratio is calculated based on some simulations the terra-vegas team has conducted.
Key | Type | Description |
---|---|---|
gov_contract_address
CanonicalAddr
Address of the gov contract to be able to change parameters through voting
reserve_address
CanonicalAddr
Address of the terra-vegas reserve contract
terrand_address
CanonicalAddr
Address of the terrand contract to pull the randomness from
max_cashflow
Decimal
maximum amount of UST to keep in the contract above which we send to the reserve contract
max_number_of_bets
Decimal
Maximum number of bets per player per round
win_tax
Decimal
tax to be applied on the players rewards after the round bets are settled
native_denom
String
the native coin to use for the bets
round_duration
vec
duration of the round in seconds
gov_contract_address
CanonicalAddr
Address of the gov contract to be able to change parameters through voting
reserve_address
CanonicalAddr
Address of the terra-vegas reserve contract
terrand_address
CanonicalAddr
Address of the terrand contract to pull the randomness from
max_cashflow
Decimal
maximum amount of UST to keep in the contract above which we send to the reserve contract
max_number_of_bets
Decimal
Maximum number of bets per player per round
win_tax
Decimal
tax to be applied on the players rewards after the round bets are settled
native_denom
String
the native coin to use for the bets
round_duration
vec
duration of the round in seconds