SC CODE: /*dReam Tables
Baccarat table# 2
In memory of table #1, you served us well.
*/
Function InitializePrivate() Uint64
10 IF SIGNER() == address_raw("dero1qy8jhspnvu8n5tuy0470ja0pnsz5jwjyhgfvqj93jaaxllx2ep3fsqgz0kggh") THEN GOTO 30
20 RETURN 1
30 STORE("owner", SIGNER())
40 STORE("TotalHandsPlayed:", 0)
50 STORE("tokenSCID", HEXDECODE("ad2e7b37c380cc1aed3a6b27224ddfc92a2d15962ca1f4d35e530dba0f9575a9"))
60 STORE("Player Wins:", 0)
70 STORE("Banker Wins:", 0)
80 STORE("Ties:", 0)
90 STORE("Open", 1)
100 STORE("Max Bet:", 15000000)
110 STORE("Min Bet:", 100000)
120 RETURN 0
End Function
Function IssueChips() Uint64 /// Convert DERO to dReams (1 Dero = 333 dReams)
10 IF IS_ADDRESS_VALID(SIGNER()) THEN GOTO 30
20 RETURN 1
30 SEND_ASSET_TO_ADDRESS(SIGNER(), DEROVALUE()*333, LOAD("tokenSCID"))
40 RETURN 0
End Function
Function ConvertChips() Uint64 /// Convert dReams to DERO (1 Dero = 333 dReams)
10 IF IS_ADDRESS_VALID(SIGNER()) THEN GOTO 30
20 RETURN 1
30 SEND_DERO_TO_ADDRESS(SIGNER(),ASSETVALUE(LOAD("tokenSCID"))/333)
40 RETURN 0
End Function
/// Game Functions
Function baccaratPlayerDeal() Uint64 /// Draws players first two cards
10 DIM player_x, player_y, player_total, player_draw as Uint64
20 LET player_x = 1+ RANDOM(13)
30 LET player_y = 1+ RANDOM(13)
35 LET player_total = player_x + player_y
40 MAPSTORE("player_total", player_total)
50 MAPSTORE("player_x", player_x)
60 MAPSTORE("player_y", player_y)
70 IF MAPGET("player_x") >= 10 THEN GOTO 80 ELSE GOTO 110
80 MAPSTORE("player_x", 0)
110 IF MAPGET("player_y") >= 10 THEN GOTO 120 ELSE GOTO 150
120 MAPSTORE("player_y", 0)
150 MAPSTORE("player_total", MAPGET("player_x") + MAPGET("player_y"))
160 IF MAPGET("player_total") >= 10 THEN GOTO 170 ELSE GOTO 180
170 MAPSTORE("player_total", MAPGET("player_total") - 10)
180 RETURN 0
End Function
Function baccaratBankerDeal() Uint64 /// Draws bankers first two cards
10 DIM banker_x, banker_y, banker_total, banker_draw as Uint64
20 LET banker_x = 1+ RANDOM(13)
30 LET banker_y = 1+ RANDOM(13)
40 LET banker_total = banker_x + banker_y
50 MAPSTORE("banker_x", banker_x)
60 MAPSTORE("banker_y", banker_y)
70 IF MAPGET("banker_x") >= 10 THEN GOTO 80 ELSE GOTO 110
80 MAPSTORE("banker_x", 0)
110 IF MAPGET("banker_y") >= 10 THEN GOTO 120 ELSE GOTO 150
120 MAPSTORE("banker_y", 0)
150 MAPSTORE("banker_total", MAPGET("banker_x") + MAPGET("banker_y"))
160 IF MAPGET("banker_total") >= 10 THEN GOTO 170 ELSE GOTO 180
170 MAPSTORE("banker_total", MAPGET("banker_total") - 10)
180 RETURN 0
End Function
Function playerNaturalCheck() Uint64 /// If player has natural banker does not draw
20 MAPGET("player_x")
30 MAPGET("player_y")
40 MAPSTORE("playerCheckTotal", MAPGET("player_x") + MAPGET("player_y"))
50 IF MAPGET("playerCheckTotal") >= 10 THEN GOTO 60 ELSE GOTO 70
60 MAPSTORE("playerCheckTotal", MAPGET("playerCheckTotal") - 10)
70 IF MAPGET("playerCheckTotal") >= 8 THEN GOTO 90
80 RETURN 0
90 RETURN 1
End Function
Function bankerNaturalCheck() Uint64 /// If banker has natural player does not draw
20 MAPGET("banker_x")
30 MAPGET("banker_y")
40 MAPSTORE("bankerCheckTotal", MAPGET("banker_x") + MAPGET("banker_y"))
50 IF MAPGET("bankerCheckTotal") >= 10 THEN GOTO 60 ELSE GOTO 70
60 MAPSTORE("bankerCheckTotal", MAPGET("bankerCheckTotal") - 10)
70 IF MAPGET("bankerCheckTotal") >= 8 THEN GOTO 90
80 RETURN 0
90 RETURN 1
End Function
Function PlayBaccarat(betOn String) Uint64 /// Play a hand of baccarat, betOn is player or dealer or tie, NO combination bet
4 IF LOAD("Open") == 0 THEN GOTO 600
5 IF ASSETVALUE(LOAD("tokenSCID")) > LOAD("Max Bet:") THEN GOTO 600
6 IF ASSETVALUE(LOAD("tokenSCID")) < LOAD("Min Bet:") THEN GOTO 600
10 MAPSTORE( "betOn", betOn)
12 DIM player_z, banker_z as Uint64
20 baccaratPlayerDeal()
30 baccaratBankerDeal()
40 IF bankerNaturalCheck() THEN GOTO 160
/// Player draw starts
50 IF MAPGET("player_total") <= 5 THEN GOTO 60 ELSE GOTO 160
60 LET player_z = 1+ RANDOM(13)
70 MAPSTORE("player_draw", player_z)
80 MAPSTORE("player_z", player_z)
90 IF MAPGET("player_z") >= 10 THEN GOTO 100 ELSE GOTO 120
100 MAPSTORE("player_z", 0)
120 MAPSTORE("player_total", MAPGET("player_total") + MAPGET("player_z"))
130 IF MAPGET("player_total") >= 10 THEN GOTO 140 ELSE GOTO 160
140 MAPSTORE("player_total", MAPGET("player_total") - 10)
160 MAPSTORE("player_z", player_z)
180 IF playerNaturalCheck() THEN GOTO 400
//// Banker draw starts
200 IF MAPGET("player_total") == 9 THEN GOTO 210 ELSE GOTO 220
210 IF MAPGET("banker_total") <= 3 THEN GOTO 320 ELSE GOTO 400
220 IF MAPGET("player_total") == 8 THEN GOTO 230 ELSE GOTO 240
230 IF MAPGET("banker_total") <= 2 THEN GOTO 320 ELSE GOTO 400
240 IF MAPGET("player_total") >= 6 THEN GOTO 250 ELSE GOTO 260
250 IF MAPGET("banker_total") <= 6 THEN GOTO 320 ELSE GOTO 400
260 IF MAPGET("player_total") >= 4 THEN GOTO 270 ELSE GOTO 280
270 IF MAPGET("banker_total") <= 5 THEN GOTO 320 ELSE GOTO 400
280 IF MAPGET("player_total") >= 2 THEN GOTO 290 ELSE GOTO 300
290 IF MAPGET("banker_total") <= 4 THEN GOTO 320 ELSE GOTO 400
300 IF MAPGET("player_total") >= 0 THEN GOTO 310 ELSE GOTO 400
310 IF MAPGET("banker_total") <= 3 THEN GOTO 320 ELSE GOTO 400
320 LET banker_z = 1+ RANDOM(13)
330 MAPSTORE("banker_draw", banker_z)
340 MAPSTORE("banker_z", banker_z)
350 IF MAPGET("banker_z") >= 10 THEN GOTO 360 ELSE GOTO 370
360 MAPSTORE("banker_z", 0)
370 MAPSTORE("banker_total", MAPGET("banker_total") + MAPGET("banker_z"))
380 IF MAPGET("banker_total") >= 10 THEN GOTO 390 ELSE GOTO 400
390 MAPSTORE("banker_total", MAPGET("banker_total") - 10)
400 MAPSTORE("banker_z", banker_z)
410 MAPGET("player_total")
420 MAPGET("banker_total")
430 showHandResult()
440 IF MAPGET("player_total") == MAPGET("banker_total") THEN GOTO 450 ELSE GOTO 500
450 STORE("Ties:", LOAD("Ties:")+1)
455 IF MAPGET("betOn") == "tie" THEN GOTO 460 ELSE GOTO 480
460 SEND_ASSET_TO_ADDRESS(SIGNER(), ASSETVALUE(LOAD("tokenSCID"))*9, LOAD("tokenSCID")) /// Tie pays out 8:1
470 RETURN 0
/// Tie
480 SEND_ASSET_TO_ADDRESS(SIGNER(), ASSETVALUE(LOAD("tokenSCID"))*1, LOAD("tokenSCID")) /// If tie occurs banker and player push bet
490 RETURN 0
/// Player Win
500 IF MAPGET("player_total") > MAPGET("banker_total") THEN GOTO 510 ELSE GOTO 540
510 STORE("Player Wins:", LOAD("Player Wins:")+1)
515 IF MAPGET("betOn") == "player" THEN GOTO 520 ELSE GOTO 530
520 SEND_ASSET_TO_ADDRESS(SIGNER(), ASSETVALUE(LOAD("tokenSCID"))*2, LOAD("tokenSCID")) /// Player pays out 1:1
530 RETURN 0
///Banker Win
540 STORE("Banker Wins:", LOAD("Banker Wins:")+1)
545 IF MAPGET("betOn") == "banker" THEN GOTO 550 ELSE GOTO 560
550 SEND_ASSET_TO_ADDRESS(SIGNER(), 1950*ASSETVALUE(LOAD("tokenSCID"))/1000, LOAD("tokenSCID")) /// Banker bet pays out 95:100 house takes 5% commission
560 RETURN 0
600 RETURN 1
End Function
Function showHandResult() Uint64 /// Displays last 21 hands then deletes oldest entry
10 STORE("TotalHandsPlayed:", LOAD("TotalHandsPlayed:")+1)
20 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Hand#TXID:", TXID())
30 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Player x:", MAPGET("player_x"))
40 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Player y:", MAPGET("player_y"))
50 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Player z:", MAPGET("player_z"))
60 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"============", "")
70 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Player total:", MAPGET("player_total"))
80 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Banker x:", MAPGET("banker_x"))
90 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Banker y:", MAPGET("banker_y"))
100 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Banker z:", MAPGET("banker_z"))
110 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Banker total:", MAPGET("banker_total"))
130 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Hand#TXID:")
140 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Player x:")
150 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Player y:")
160 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Player z:")
165 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"============")
170 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Player total:")
190 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Banker x:")
200 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Banker y:")
210 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Banker z:")
220 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Banker total:")
240 RETURN 0
End Function
///Owner Functions
Function Deposit() Uint64
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 RETURN 0
End Function
Function SetTableInfo(min Uint64, max Uint64, open Uint64, asset String) Uint64 /// Set limits, close table, change asset
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 STORE("Open", open)
40 STORE("Max Bet:", max)
50 STORE("Min Bet:", min)
60 STORE("tokenSCID", asset)
70 RETURN 0
End Function
Function OwnerTokenWithdraw(amount Uint64, asset String) Uint64
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 SEND_ASSET_TO_ADDRESS(SIGNER(), amount, asset)
40 RETURN 0
End Function
Function Withdraw(amount Uint64) Uint64
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 SEND_DERO_TO_ADDRESS(SIGNER(),amount)
40 RETURN 0
End Function
Function TransferOwnership(newowner String) Uint64
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 STORE("tmpowner",ADDRESS_RAW(newowner))
40 RETURN 0
End Function
Function ClaimOwnership() Uint64
10 IF LOAD("tmpowner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 STORE("owner",SIGNER())
40 RETURN 0
End Function
Function UpdateCode(code String) Uint64 /// Update SC
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 UPDATE_SC_CODE(code)
40 RETURN 0
End Function
|
SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'/*dReam Tables
Baccarat table# 2
In memory of table #1, you served us well.
*/
Function InitializePrivate() Uint64
10 IF SIGNER() == address_raw("dero1qy8jhspnvu8n5tuy0470ja0pnsz5jwjyhgfvqj93jaaxllx2ep3fsqgz0kggh") THEN GOTO 30
20 RETURN 1
30 STORE("owner", SIGNER())
40 STORE("TotalHandsPlayed:", 0)
50 STORE("tokenSCID", HEXDECODE("ad2e7b37c380cc1aed3a6b27224ddfc92a2d15962ca1f4d35e530dba0f9575a9"))
60 STORE("Player Wins:", 0)
70 STORE("Banker Wins:", 0)
80 STORE("Ties:", 0)
90 STORE("Open", 1)
100 STORE("Max Bet:", 15000000)
110 STORE("Min Bet:", 100000)
120 RETURN 0
End Function
Function IssueChips() Uint64 /// Convert DERO to dReams (1 Dero = 333 dReams)
10 IF IS_ADDRESS_VALID(SIGNER()) THEN GOTO 30
20 RETURN 1
30 SEND_ASSET_TO_ADDRESS(SIGNER(), DEROVALUE()*333, LOAD("tokenSCID"))
40 RETURN 0
End Function
Function ConvertChips() Uint64 /// Convert dReams to DERO (1 Dero = 333 dReams)
10 IF IS_ADDRESS_VALID(SIGNER()) THEN GOTO 30
20 RETURN 1
30 SEND_DERO_TO_ADDRESS(SIGNER(),ASSETVALUE(LOAD("tokenSCID"))/333)
40 RETURN 0
End Function
/// Game Functions
Function baccaratPlayerDeal() Uint64 /// Draws players first two cards
10 DIM player_x, player_y, player_total, player_draw as Uint64
20 LET player_x = 1+ RANDOM(13)
30 LET player_y = 1+ RANDOM(13)
35 LET player_total = player_x + player_y
40 MAPSTORE("player_total", player_total)
50 MAPSTORE("player_x", player_x)
60 MAPSTORE("player_y", player_y)
70 IF MAPGET("player_x") >= 10 THEN GOTO 80 ELSE GOTO 110
80 MAPSTORE("player_x", 0)
110 IF MAPGET("player_y") >= 10 THEN GOTO 120 ELSE GOTO 150
120 MAPSTORE("player_y", 0)
150 MAPSTORE("player_total", MAPGET("player_x") + MAPGET("player_y"))
160 IF MAPGET("player_total") >= 10 THEN GOTO 170 ELSE GOTO 180
170 MAPSTORE("player_total", MAPGET("player_total") - 10)
180 RETURN 0
End Function
Function baccaratBankerDeal() Uint64 /// Draws bankers first two cards
10 DIM banker_x, banker_y, banker_total, banker_draw as Uint64
20 LET banker_x = 1+ RANDOM(13)
30 LET banker_y = 1+ RANDOM(13)
40 LET banker_total = banker_x + banker_y
50 MAPSTORE("banker_x", banker_x)
60 MAPSTORE("banker_y", banker_y)
70 IF MAPGET("banker_x") >= 10 THEN GOTO 80 ELSE GOTO 110
80 MAPSTORE("banker_x", 0)
110 IF MAPGET("banker_y") >= 10 THEN GOTO 120 ELSE GOTO 150
120 MAPSTORE("banker_y", 0)
150 MAPSTORE("banker_total", MAPGET("banker_x") + MAPGET("banker_y"))
160 IF MAPGET("banker_total") >= 10 THEN GOTO 170 ELSE GOTO 180
170 MAPSTORE("banker_total", MAPGET("banker_total") - 10)
180 RETURN 0
End Function
Function playerNaturalCheck() Uint64 /// If player has natural banker does not draw
20 MAPGET("player_x")
30 MAPGET("player_y")
40 MAPSTORE("playerCheckTotal", MAPGET("player_x") + MAPGET("player_y"))
50 IF MAPGET("playerCheckTotal") >= 10 THEN GOTO 60 ELSE GOTO 70
60 MAPSTORE("playerCheckTotal", MAPGET("playerCheckTotal") - 10)
70 IF MAPGET("playerCheckTotal") >= 8 THEN GOTO 90
80 RETURN 0
90 RETURN 1
End Function
Function bankerNaturalCheck() Uint64 /// If banker has natural player does not draw
20 MAPGET("banker_x")
30 MAPGET("banker_y")
40 MAPSTORE("bankerCheckTotal", MAPGET("banker_x") + MAPGET("banker_y"))
50 IF MAPGET("bankerCheckTotal") >= 10 THEN GOTO 60 ELSE GOTO 70
60 MAPSTORE("bankerCheckTotal", MAPGET("bankerCheckTotal") - 10)
70 IF MAPGET("bankerCheckTotal") >= 8 THEN GOTO 90
80 RETURN 0
90 RETURN 1
End Function
Function PlayBaccarat(betOn String) Uint64 /// Play a hand of baccarat, betOn is player or dealer or tie, NO combination bet
4 IF LOAD("Open") == 0 THEN GOTO 600
5 IF ASSETVALUE(LOAD("tokenSCID")) > LOAD("Max Bet:") THEN GOTO 600
6 IF ASSETVALUE(LOAD("tokenSCID")) < LOAD("Min Bet:") THEN GOTO 600
10 MAPSTORE( "betOn", betOn)
12 DIM player_z, banker_z as Uint64
20 baccaratPlayerDeal()
30 baccaratBankerDeal()
40 IF bankerNaturalCheck() THEN GOTO 160
/// Player draw starts
50 IF MAPGET("player_total") <= 5 THEN GOTO 60 ELSE GOTO 160
60 LET player_z = 1+ RANDOM(13)
70 MAPSTORE("player_draw", player_z)
80 MAPSTORE("player_z", player_z)
90 IF MAPGET("player_z") >= 10 THEN GOTO 100 ELSE GOTO 120
100 MAPSTORE("player_z", 0)
120 MAPSTORE("player_total", MAPGET("player_total") + MAPGET("player_z"))
130 IF MAPGET("player_total") >= 10 THEN GOTO 140 ELSE GOTO 160
140 MAPSTORE("player_total", MAPGET("player_total") - 10)
160 MAPSTORE("player_z", player_z)
180 IF playerNaturalCheck() THEN GOTO 400
//// Banker draw starts
200 IF MAPGET("player_total") == 9 THEN GOTO 210 ELSE GOTO 220
210 IF MAPGET("banker_total") <= 3 THEN GOTO 320 ELSE GOTO 400
220 IF MAPGET("player_total") == 8 THEN GOTO 230 ELSE GOTO 240
230 IF MAPGET("banker_total") <= 2 THEN GOTO 320 ELSE GOTO 400
240 IF MAPGET("player_total") >= 6 THEN GOTO 250 ELSE GOTO 260
250 IF MAPGET("banker_total") <= 6 THEN GOTO 320 ELSE GOTO 400
260 IF MAPGET("player_total") >= 4 THEN GOTO 270 ELSE GOTO 280
270 IF MAPGET("banker_total") <= 5 THEN GOTO 320 ELSE GOTO 400
280 IF MAPGET("player_total") >= 2 THEN GOTO 290 ELSE GOTO 300
290 IF MAPGET("banker_total") <= 4 THEN GOTO 320 ELSE GOTO 400
300 IF MAPGET("player_total") >= 0 THEN GOTO 310 ELSE GOTO 400
310 IF MAPGET("banker_total") <= 3 THEN GOTO 320 ELSE GOTO 400
320 LET banker_z = 1+ RANDOM(13)
330 MAPSTORE("banker_draw", banker_z)
340 MAPSTORE("banker_z", banker_z)
350 IF MAPGET("banker_z") >= 10 THEN GOTO 360 ELSE GOTO 370
360 MAPSTORE("banker_z", 0)
370 MAPSTORE("banker_total", MAPGET("banker_total") + MAPGET("banker_z"))
380 IF MAPGET("banker_total") >= 10 THEN GOTO 390 ELSE GOTO 400
390 MAPSTORE("banker_total", MAPGET("banker_total") - 10)
400 MAPSTORE("banker_z", banker_z)
410 MAPGET("player_total")
420 MAPGET("banker_total")
430 showHandResult()
440 IF MAPGET("player_total") == MAPGET("banker_total") THEN GOTO 450 ELSE GOTO 500
450 STORE("Ties:", LOAD("Ties:")+1)
455 IF MAPGET("betOn") == "tie" THEN GOTO 460 ELSE GOTO 480
460 SEND_ASSET_TO_ADDRESS(SIGNER(), ASSETVALUE(LOAD("tokenSCID"))*9, LOAD("tokenSCID")) /// Tie pays out 8:1
470 RETURN 0
/// Tie
480 SEND_ASSET_TO_ADDRESS(SIGNER(), ASSETVALUE(LOAD("tokenSCID"))*1, LOAD("tokenSCID")) /// If tie occurs banker and player push bet
490 RETURN 0
/// Player Win
500 IF MAPGET("player_total") > MAPGET("banker_total") THEN GOTO 510 ELSE GOTO 540
510 STORE("Player Wins:", LOAD("Player Wins:")+1)
515 IF MAPGET("betOn") == "player" THEN GOTO 520 ELSE GOTO 530
520 SEND_ASSET_TO_ADDRESS(SIGNER(), ASSETVALUE(LOAD("tokenSCID"))*2, LOAD("tokenSCID")) /// Player pays out 1:1
530 RETURN 0
///Banker Win
540 STORE("Banker Wins:", LOAD("Banker Wins:")+1)
545 IF MAPGET("betOn") == "banker" THEN GOTO 550 ELSE GOTO 560
550 SEND_ASSET_TO_ADDRESS(SIGNER(), 1950*ASSETVALUE(LOAD("tokenSCID"))/1000, LOAD("tokenSCID")) /// Banker bet pays out 95:100 house takes 5% commission
560 RETURN 0
600 RETURN 1
End Function
Function showHandResult() Uint64 /// Displays last 21 hands then deletes oldest entry
10 STORE("TotalHandsPlayed:", LOAD("TotalHandsPlayed:")+1)
20 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Hand#TXID:", TXID())
30 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Player x:", MAPGET("player_x"))
40 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Player y:", MAPGET("player_y"))
50 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Player z:", MAPGET("player_z"))
60 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"============", "")
70 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Player total:", MAPGET("player_total"))
80 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Banker x:", MAPGET("banker_x"))
90 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Banker y:", MAPGET("banker_y"))
100 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Banker z:", MAPGET("banker_z"))
110 STORE(ITOA(LOAD("TotalHandsPlayed:"))+"-Banker total:", MAPGET("banker_total"))
130 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Hand#TXID:")
140 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Player x:")
150 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Player y:")
160 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Player z:")
165 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"============")
170 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Player total:")
190 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Banker x:")
200 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Banker y:")
210 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Banker z:")
220 DELETE(ITOA(LOAD("TotalHandsPlayed:")-21)+"-Banker total:")
240 RETURN 0
End Function
///Owner Functions
Function Deposit() Uint64
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 RETURN 0
End Function
Function SetTableInfo(min Uint64, max Uint64, open Uint64, asset String) Uint64 /// Set limits, close table, change asset
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 STORE("Open", open)
40 STORE("Max Bet:", max)
50 STORE("Min Bet:", min)
60 STORE("tokenSCID", asset)
70 RETURN 0
End Function
Function OwnerTokenWithdraw(amount Uint64, asset String) Uint64
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 SEND_ASSET_TO_ADDRESS(SIGNER(), amount, asset)
40 RETURN 0
End Function
Function Withdraw(amount Uint64) Uint64
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 SEND_DERO_TO_ADDRESS(SIGNER(),amount)
40 RETURN 0
End Function
Function TransferOwnership(newowner String) Uint64
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 STORE("tmpowner",ADDRESS_RAW(newowner))
40 RETURN 0
End Function
Function ClaimOwnership() Uint64
10 IF LOAD("tmpowner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 STORE("owner",SIGNER())
40 RETURN 0
End Function
Function UpdateCode(code String) Uint64 /// Update SC
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 UPDATE_SC_CODE(code)
40 RETURN 0
End Function
'] |