tx · EPMpHrbGh5EBXXjXR73zsJDT76zqWryQvP4juczHoz3r 3MqQ9ihYKGehfUnXYf5WmkYSZUD71ByeCQe: -0.01400000 Waves 2020.04.06 11:04 [942100] smart account 3MqQ9ihYKGehfUnXYf5WmkYSZUD71ByeCQe > SELF 0.00000000 Waves
{ "type": 13, "id": "EPMpHrbGh5EBXXjXR73zsJDT76zqWryQvP4juczHoz3r", "fee": 1400000, "feeAssetId": null, "timestamp": 1586160288618, "version": 1, "sender": "3MqQ9ihYKGehfUnXYf5WmkYSZUD71ByeCQe", "senderPublicKey": "HcUXEkA9JTGp78LcTKsu4FmEpbDmnqntL4aMNLx1BHMB", "proofs": [ "5MrYit6oY7CPDBimuf3XFMUNf73NnZNkYjvsKNv54ySEBhFzn7c2KqwLqgYrBPdhw3A5hHA3frMUdaBPMF4ME61e" ], "script": "base64:AAIDAAAAAAAAABIIARIDCgEEEgMKAQgSBAoCCAIAAAAzAAAAAAdXQVZFTEVUCQAAaAAAAAIJAABoAAAAAgAAAAAAAAAAZAAAAAAAAAAD6AAAAAAAAAAD6AAAAAAKQ09NTUlTU0lPTgkAAGkAAAACCQAAaAAAAAIAAAAAAAAAAAUFAAAAB1dBVkVMRVQAAAAAAAAAA+gAAAAACVJTQVBVQkxJQwkAAlsAAAABAgAAAY9iYXNlNjQ6TUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUFtcHVYY0kvbzRwSUI1eXd2OURPT0dhcFRCVXdSVmxNLzYrSDZoRmVsT1h0a3J3WS9ZSXRtUHhFRHB6N3JBZXJRUFFlOXREUEVhQXYvR25sRXp0eWJPRlhndTlEekRlOFlvTVJEMXZha2dvQWNvZ21iWTU4UUQ2S01qNUhrb1ZqL3lUTkljOXN6ajVxaElsckFkbWIzS0xMNmhRVTd5OCtKajY5QldWUHNhUWdrc3BTZGVZdGIxdEhRYzd0OTVuN09aNTZyMkE3RzMrYlFmNm5TTWtQa0FoSXJFcGJDbT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AEAAAACdHgBAAAABnZlcmlmeQAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAA3R0eAUAAAAHJG1hdGNoMAkAAGcAAAACCQAAZQAAAAIJAQAAAAx3YXZlc0JhbGFuY2UAAAABBQAAAAR0aGlzCAUAAAADdHR4AAAABmFtb3VudAkBAAAAEkV4dHJhY3RSZXNlcnZlZEFtdAAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAANzdHgFAAAAByRtYXRjaDADCQAAAAAAAAIJAQAAAAhJc0RBcHBVcAAAAAAHCQAAAAAAAAIJAQAAABJFeHRyYWN0UmVzZXJ2ZWRBbXQAAAAAAAAAAAAAAAAABwcHlo1jbw==", "chainId": 84, "height": 942100, "spentComplexity": 0 } View: original | compacted Prev: B5sh5eCzMdCK9paWDLCYPuA5K58YRVhyZedKNwx1fbiW Next: none Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let WAVELET = ((100 * 1000) * 1000) | |
5 | + | ||
6 | + | let COMMISSION = ((5 * WAVELET) / 1000) | |
7 | + | ||
4 | 8 | let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmpuXcI/o4pIB5ywv9DOOGapTBUwRVlM/6+H6hFelOXtkrwY/YItmPxEDpz7rAerQPQe9tDPEaAv/GnlEztybOFXgu9DzDe8YoMRD1vakgoAcogmbY58QD6KMj5HkoVj/yTNIc9szj5qhIlrAdmb3KLL6hQU7y8+Jj69BWVPsaQgkspSdeYtb1tHQc7t95n7OZ56r2A7G3+bQf6nSMkPkAhIrEpbCm58oiGBczdTd/LqFSVotZsbL7Yh6SHLfnHeD+QgcfJrnam8OHMGJEJTRXjILeHGjlRCP8oVpioHry1S2xPx5sVzIm2MM+CzYenAGlo0j26atBhiULoTulwD3pQIDAQAB") | |
5 | 9 | ||
6 | 10 | let SERVER = addressFromStringValue("3NCiG28LmWyTigWG13E5QnvdHBsZFYXSS2j") | |
7 | 11 | ||
8 | 12 | let RANDORACLETIMEFRAME = 4320 | |
9 | 13 | ||
10 | - | let WAVELET = ((100 * 1000) * 1000) | |
11 | - | ||
12 | - | let COMMISSION = ((5 * WAVELET) / 1000) | |
14 | + | let MAXBALANCEDIFF = 100000000 | |
13 | 15 | ||
14 | 16 | let BET1 = (1 * WAVELET) | |
15 | 17 | ||
33 | 35 | ||
34 | 36 | let RATE5 = 11400 | |
35 | 37 | ||
38 | + | let RATES = [RATE1, RATE2, RATE3, RATE4, RATE5] | |
39 | + | ||
40 | + | let BETS = [BET1, BET2, BET4, BET8, BET14] | |
41 | + | ||
36 | 42 | let IdxGameState = 0 | |
37 | 43 | ||
38 | 44 | let IdxPlayerChoice = 1 | |
49 | 55 | ||
50 | 56 | let GAMESCOUNTERKEY = "$GAME_NUM" | |
51 | 57 | ||
58 | + | let DAPPUPKEY = "$DAPP_UP" | |
59 | + | ||
60 | + | let MAXBALANCEKEY = "$MAX_BALANCE" | |
61 | + | ||
52 | 62 | let STATESUBMITTED = "SUBMITTED" | |
53 | 63 | ||
54 | 64 | let STATEWON = "WON" | |
55 | 65 | ||
56 | 66 | let STATELOST = "LOST" | |
57 | 67 | ||
58 | - | func | |
59 | - | | |
60 | - | | |
61 | - | ||
62 | - | ||
63 | - | ||
64 | - | ||
65 | - | ||
66 | - | ||
68 | + | func getIntOr (key,default) = if (isDefined(getInteger(this, key))) | |
69 | + | then getIntegerValue(this, key) | |
70 | + | else default | |
71 | + | ||
72 | + | ||
73 | + | func setInt (key,value) = DataEntry(key, value) | |
74 | + | ||
75 | + | ||
76 | + | func incrementInt (key) = setInt(key, (getIntOr(key, -1) + 1)) | |
67 | 77 | ||
68 | 78 | ||
69 | 79 | func ExtractReservedAmt () = match getInteger(this, RESERVATIONKEY) { | |
102 | 112 | then true | |
103 | 113 | else (betAmt == (BET14 + COMMISSION)) | |
104 | 114 | if (betAmtValid) | |
105 | - | then { | |
115 | + | then throw("Bet amount is not in range") | |
116 | + | else { | |
106 | 117 | let dicesCount = size(playerChoice) | |
107 | 118 | let bet = (betAmt - COMMISSION) | |
108 | 119 | if ((dicesCount == 1)) | |
117 | 128 | then ((bet * RATE5) / RATEMULT) | |
118 | 129 | else throw("Invalid dices count in player's choice") | |
119 | 130 | } | |
120 | - | else throw("Bet amount is not in range") | |
121 | 131 | } | |
122 | 132 | ||
123 | 133 | ||
151 | 161 | ||
152 | 162 | func IsPlayerWin (playerChoice,randStr) = { | |
153 | 163 | let s = size(playerChoice) | |
154 | - | | |
164 | + | if (if (if (if (if ((s >= 1)) | |
155 | 165 | then (take(drop(playerChoice, 0), 1) == randStr) | |
156 | 166 | else false) | |
157 | 167 | then true | |
167 | 177 | then (take(drop(playerChoice, 3), 1) == randStr) | |
168 | 178 | else false) | |
169 | 179 | then true | |
170 | - | else if ((s | |
180 | + | else if ((s == 5)) | |
171 | 181 | then (take(drop(playerChoice, 4), 1) == randStr) | |
172 | - | else false) | |
173 | - | then true | |
174 | - | else if ((s >= 6)) | |
175 | - | then (take(drop(playerChoice, 5), 1) == randStr) | |
176 | 182 | else false | |
177 | 183 | } | |
178 | 184 | ||
253 | 259 | } | |
254 | 260 | ||
255 | 261 | ||
262 | + | func IsDAppUp () = { | |
263 | + | let dAppUpOpt = getBoolean(this, DAPPUPKEY) | |
264 | + | if (isDefined(dAppUpOpt)) | |
265 | + | then extract(dAppUpOpt) | |
266 | + | else false | |
267 | + | } | |
268 | + | ||
269 | + | ||
270 | + | func monitorMaxBalance () = { | |
271 | + | let maxBalanceOpt = getInteger(this, MAXBALANCEKEY) | |
272 | + | let maxBalance = if (isDefined(maxBalanceOpt)) | |
273 | + | then extract(maxBalanceOpt) | |
274 | + | else 0 | |
275 | + | let currBalance = wavesBalance(this) | |
276 | + | if ((currBalance > maxBalance)) | |
277 | + | then currBalance | |
278 | + | else { | |
279 | + | let diff = (maxBalance - currBalance) | |
280 | + | if ((diff > MAXBALANCEDIFF)) | |
281 | + | then throw("dApp is temporary disabled") | |
282 | + | else maxBalance | |
283 | + | } | |
284 | + | } | |
285 | + | ||
286 | + | ||
287 | + | @Callable(i) | |
288 | + | func dAppUp (dAppUp) = if ((i.caller != SERVER)) | |
289 | + | then throw("Only Server can manage dAppUp attribute") | |
290 | + | else if ((IsDAppUp() == dAppUp)) | |
291 | + | then throw("dAppUp must be different with actual value") | |
292 | + | else WriteSet([DataEntry(DAPPUPKEY, dAppUp)]) | |
293 | + | ||
294 | + | ||
295 | + | ||
256 | 296 | @Callable(i) | |
257 | 297 | func bet (playerChoice) = { | |
258 | - | let newGameNum = IncrementGameNum() | |
259 | 298 | let gameId = toBase58String(i.transactionId) | |
260 | - | let pmt = extract(i.payment) | |
261 | - | let betNotInWaves = isDefined(pmt.assetId) | |
262 | - | let feeNotInWaves = isDefined(pmt.assetId) | |
263 | - | let winAmt = ValidateBetAndDefineWinAmt(pmt.amount, playerChoice) | |
264 | - | let txIdUsed = isDefined(getString(this, gameId)) | |
265 | - | if (betNotInWaves) | |
266 | - | then throw("Bet amount must be in Waves") | |
267 | - | else if (feeNotInWaves) | |
268 | - | then throw("Transaction's fee must be in Waves") | |
269 | - | else if (txIdUsed) | |
270 | - | then throw("Passed txId had been used before. Game aborted.") | |
271 | - | else { | |
272 | - | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
273 | - | let gameDataStr = FormatGameDataStr(STATESUBMITTED, playerChoice, playerPubKey58, height, winAmt, "") | |
274 | - | ScriptResult(WriteSet([DataEntry(RESERVATIONKEY, ValidateAndIncreaseReservedAmt(winAmt)), DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet([ScriptTransfer(SERVER, COMMISSION, unit)])) | |
275 | - | } | |
299 | + | if (!(IsDAppUp())) | |
300 | + | then throw("DApp is under maintenance") | |
301 | + | else if (isDefined(getString(this, gameId))) | |
302 | + | then throw((("Bet for: " + gameId) + " was already made.")) | |
303 | + | else { | |
304 | + | let pmt = extract(i.payment) | |
305 | + | let betNotInWaves = isDefined(pmt.assetId) | |
306 | + | let winAmt = ValidateBetAndDefineWinAmt(pmt.amount, playerChoice) | |
307 | + | let txIdUsed = isDefined(getString(this, gameId)) | |
308 | + | if (betNotInWaves) | |
309 | + | then throw("Bet amount must be in Waves") | |
310 | + | else { | |
311 | + | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
312 | + | let gameDataStr = FormatGameDataStr(STATESUBMITTED, playerChoice, playerPubKey58, height, winAmt, "") | |
313 | + | ScriptResult(WriteSet([DataEntry(RESERVATIONKEY, ValidateAndIncreaseReservedAmt(winAmt)), incrementInt(GAMESCOUNTERKEY), DataEntry(MAXBALANCEKEY, monitorMaxBalance()), DataEntry(gameId, gameDataStr)]), TransferSet([ScriptTransfer(SERVER, COMMISSION, unit)])) | |
314 | + | } | |
315 | + | } | |
276 | 316 | } | |
277 | 317 | ||
278 | 318 | ||
298 | 338 | } | |
299 | 339 | else { | |
300 | 340 | let randStr = RandToStr(GenerateRandInt(gameId, rsaSign)) | |
301 | - | if (IsPlayerWin(playerChoice, randStr)) | |
302 | - | then { | |
303 | - | let newGameDataStr = FormatGameDataStr(STATEWON, playerChoice, playerPubKey58, startedHeight, winAmt, randStr) | |
304 | - | WinScriptSet(gameId, playerAddress, winAmt, newGameDataStr, winByTimeout, decreasedReserves) | |
305 | - | } | |
306 | - | else { | |
307 | - | let newGameDataStr = FormatGameDataStr(STATELOST, playerChoice, playerPubKey58, startedHeight, winAmt, randStr) | |
308 | - | WriteSet([DataEntry(gameId, newGameDataStr), decreasedReserves]) | |
309 | - | } | |
341 | + | if ((i.caller != SERVER)) | |
342 | + | then throw("Regular withdraw can be done by server only") | |
343 | + | else if (IsPlayerWin(playerChoice, randStr)) | |
344 | + | then { | |
345 | + | let newGameDataStr = FormatGameDataStr(STATEWON, playerChoice, playerPubKey58, startedHeight, winAmt, randStr) | |
346 | + | WinScriptSet(gameId, playerAddress, winAmt, newGameDataStr, winByTimeout, decreasedReserves) | |
347 | + | } | |
348 | + | else { | |
349 | + | let newGameDataStr = FormatGameDataStr(STATELOST, playerChoice, playerPubKey58, startedHeight, winAmt, randStr) | |
350 | + | WriteSet([DataEntry(gameId, newGameDataStr), decreasedReserves]) | |
351 | + | } | |
310 | 352 | } | |
311 | 353 | } | |
312 | 354 | ||
317 | 359 | case ttx: TransferTransaction => | |
318 | 360 | ((wavesBalance(this) - ttx.amount) >= ExtractReservedAmt()) | |
319 | 361 | case stx: SetScriptTransaction => | |
320 | - | true | |
362 | + | if ((IsDAppUp() == false)) | |
363 | + | then (ExtractReservedAmt() == 0) | |
364 | + | else false | |
321 | 365 | case _ => | |
322 | 366 | false | |
323 | 367 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let WAVELET = ((100 * 1000) * 1000) | |
5 | + | ||
6 | + | let COMMISSION = ((5 * WAVELET) / 1000) | |
7 | + | ||
4 | 8 | let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmpuXcI/o4pIB5ywv9DOOGapTBUwRVlM/6+H6hFelOXtkrwY/YItmPxEDpz7rAerQPQe9tDPEaAv/GnlEztybOFXgu9DzDe8YoMRD1vakgoAcogmbY58QD6KMj5HkoVj/yTNIc9szj5qhIlrAdmb3KLL6hQU7y8+Jj69BWVPsaQgkspSdeYtb1tHQc7t95n7OZ56r2A7G3+bQf6nSMkPkAhIrEpbCm58oiGBczdTd/LqFSVotZsbL7Yh6SHLfnHeD+QgcfJrnam8OHMGJEJTRXjILeHGjlRCP8oVpioHry1S2xPx5sVzIm2MM+CzYenAGlo0j26atBhiULoTulwD3pQIDAQAB") | |
5 | 9 | ||
6 | 10 | let SERVER = addressFromStringValue("3NCiG28LmWyTigWG13E5QnvdHBsZFYXSS2j") | |
7 | 11 | ||
8 | 12 | let RANDORACLETIMEFRAME = 4320 | |
9 | 13 | ||
10 | - | let WAVELET = ((100 * 1000) * 1000) | |
11 | - | ||
12 | - | let COMMISSION = ((5 * WAVELET) / 1000) | |
14 | + | let MAXBALANCEDIFF = 100000000 | |
13 | 15 | ||
14 | 16 | let BET1 = (1 * WAVELET) | |
15 | 17 | ||
16 | 18 | let BET2 = (2 * WAVELET) | |
17 | 19 | ||
18 | 20 | let BET4 = (4 * WAVELET) | |
19 | 21 | ||
20 | 22 | let BET8 = (8 * WAVELET) | |
21 | 23 | ||
22 | 24 | let BET14 = (14 * WAVELET) | |
23 | 25 | ||
24 | 26 | let RATEMULT = 10000 | |
25 | 27 | ||
26 | 28 | let RATE1 = 39655 | |
27 | 29 | ||
28 | 30 | let RATE2 = 24600 | |
29 | 31 | ||
30 | 32 | let RATE3 = 19000 | |
31 | 33 | ||
32 | 34 | let RATE4 = 14200 | |
33 | 35 | ||
34 | 36 | let RATE5 = 11400 | |
35 | 37 | ||
38 | + | let RATES = [RATE1, RATE2, RATE3, RATE4, RATE5] | |
39 | + | ||
40 | + | let BETS = [BET1, BET2, BET4, BET8, BET14] | |
41 | + | ||
36 | 42 | let IdxGameState = 0 | |
37 | 43 | ||
38 | 44 | let IdxPlayerChoice = 1 | |
39 | 45 | ||
40 | 46 | let IdxPlayerPubKey58 = 2 | |
41 | 47 | ||
42 | 48 | let IdxStartedHeight = 3 | |
43 | 49 | ||
44 | 50 | let IdxWinAmt = 4 | |
45 | 51 | ||
46 | 52 | let IdxRandOrEmpty = 5 | |
47 | 53 | ||
48 | 54 | let RESERVATIONKEY = "$RESERVED_AMOUNT" | |
49 | 55 | ||
50 | 56 | let GAMESCOUNTERKEY = "$GAME_NUM" | |
51 | 57 | ||
58 | + | let DAPPUPKEY = "$DAPP_UP" | |
59 | + | ||
60 | + | let MAXBALANCEKEY = "$MAX_BALANCE" | |
61 | + | ||
52 | 62 | let STATESUBMITTED = "SUBMITTED" | |
53 | 63 | ||
54 | 64 | let STATEWON = "WON" | |
55 | 65 | ||
56 | 66 | let STATELOST = "LOST" | |
57 | 67 | ||
58 | - | func | |
59 | - | | |
60 | - | | |
61 | - | ||
62 | - | ||
63 | - | ||
64 | - | ||
65 | - | ||
66 | - | ||
68 | + | func getIntOr (key,default) = if (isDefined(getInteger(this, key))) | |
69 | + | then getIntegerValue(this, key) | |
70 | + | else default | |
71 | + | ||
72 | + | ||
73 | + | func setInt (key,value) = DataEntry(key, value) | |
74 | + | ||
75 | + | ||
76 | + | func incrementInt (key) = setInt(key, (getIntOr(key, -1) + 1)) | |
67 | 77 | ||
68 | 78 | ||
69 | 79 | func ExtractReservedAmt () = match getInteger(this, RESERVATIONKEY) { | |
70 | 80 | case a: Int => | |
71 | 81 | a | |
72 | 82 | case _ => | |
73 | 83 | 0 | |
74 | 84 | } | |
75 | 85 | ||
76 | 86 | ||
77 | 87 | func ValidateAndIncreaseReservedAmt (winAmt) = { | |
78 | 88 | let newReservedAmount = (ExtractReservedAmt() + winAmt) | |
79 | 89 | let balance = wavesBalance(this) | |
80 | 90 | if ((newReservedAmount > balance)) | |
81 | 91 | then throw("Insufficient funds on Dice Roller account. Transaction was rejected for your safety.") | |
82 | 92 | else newReservedAmount | |
83 | 93 | } | |
84 | 94 | ||
85 | 95 | ||
86 | 96 | func DecreaseReservedAmt (gameId,winAmt) = { | |
87 | 97 | let newReservedAmount = (ExtractReservedAmt() - winAmt) | |
88 | 98 | if ((0 > newReservedAmount)) | |
89 | 99 | then throw("Invalid Dice Roller account state - reserved amount is less than 0") | |
90 | 100 | else DataEntry(RESERVATIONKEY, newReservedAmount) | |
91 | 101 | } | |
92 | 102 | ||
93 | 103 | ||
94 | 104 | func ValidateBetAndDefineWinAmt (betAmt,playerChoice) = { | |
95 | 105 | let betAmtValid = if (if (if (if ((betAmt == (BET1 + COMMISSION))) | |
96 | 106 | then true | |
97 | 107 | else (betAmt == (BET2 + COMMISSION))) | |
98 | 108 | then true | |
99 | 109 | else (betAmt == (BET4 + COMMISSION))) | |
100 | 110 | then true | |
101 | 111 | else (betAmt == (BET8 + COMMISSION))) | |
102 | 112 | then true | |
103 | 113 | else (betAmt == (BET14 + COMMISSION)) | |
104 | 114 | if (betAmtValid) | |
105 | - | then { | |
115 | + | then throw("Bet amount is not in range") | |
116 | + | else { | |
106 | 117 | let dicesCount = size(playerChoice) | |
107 | 118 | let bet = (betAmt - COMMISSION) | |
108 | 119 | if ((dicesCount == 1)) | |
109 | 120 | then ((bet * RATE1) / RATEMULT) | |
110 | 121 | else if ((dicesCount == 2)) | |
111 | 122 | then ((bet * RATE2) / RATEMULT) | |
112 | 123 | else if ((dicesCount == 3)) | |
113 | 124 | then ((bet * RATE3) / RATEMULT) | |
114 | 125 | else if ((dicesCount == 4)) | |
115 | 126 | then ((bet * RATE4) / RATEMULT) | |
116 | 127 | else if ((dicesCount == 5)) | |
117 | 128 | then ((bet * RATE5) / RATEMULT) | |
118 | 129 | else throw("Invalid dices count in player's choice") | |
119 | 130 | } | |
120 | - | else throw("Bet amount is not in range") | |
121 | 131 | } | |
122 | 132 | ||
123 | 133 | ||
124 | 134 | func RandToStr (r) = if ((r == 0)) | |
125 | 135 | then "1" | |
126 | 136 | else if ((r == 1)) | |
127 | 137 | then "2" | |
128 | 138 | else if ((r == 2)) | |
129 | 139 | then "3" | |
130 | 140 | else if ((r == 3)) | |
131 | 141 | then "4" | |
132 | 142 | else if ((r == 4)) | |
133 | 143 | then "5" | |
134 | 144 | else if ((r == 5)) | |
135 | 145 | then "6" | |
136 | 146 | else throw(("Unsupported r parameter passed: expected=[0,...,5] actual=" + toString(r))) | |
137 | 147 | ||
138 | 148 | ||
139 | 149 | func GenerateRandInt (gameId,rsaSign) = { | |
140 | 150 | let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC) | |
141 | 151 | if (rsaSigValid) | |
142 | 152 | then { | |
143 | 153 | let rand = (toInt(sha256(rsaSign)) % 6) | |
144 | 154 | if ((0 > rand)) | |
145 | 155 | then (-1 * rand) | |
146 | 156 | else rand | |
147 | 157 | } | |
148 | 158 | else throw("Invalid RSA signature") | |
149 | 159 | } | |
150 | 160 | ||
151 | 161 | ||
152 | 162 | func IsPlayerWin (playerChoice,randStr) = { | |
153 | 163 | let s = size(playerChoice) | |
154 | - | | |
164 | + | if (if (if (if (if ((s >= 1)) | |
155 | 165 | then (take(drop(playerChoice, 0), 1) == randStr) | |
156 | 166 | else false) | |
157 | 167 | then true | |
158 | 168 | else if ((s >= 2)) | |
159 | 169 | then (take(drop(playerChoice, 1), 1) == randStr) | |
160 | 170 | else false) | |
161 | 171 | then true | |
162 | 172 | else if ((s >= 3)) | |
163 | 173 | then (take(drop(playerChoice, 2), 1) == randStr) | |
164 | 174 | else false) | |
165 | 175 | then true | |
166 | 176 | else if ((s >= 4)) | |
167 | 177 | then (take(drop(playerChoice, 3), 1) == randStr) | |
168 | 178 | else false) | |
169 | 179 | then true | |
170 | - | else if ((s | |
180 | + | else if ((s == 5)) | |
171 | 181 | then (take(drop(playerChoice, 4), 1) == randStr) | |
172 | - | else false) | |
173 | - | then true | |
174 | - | else if ((s >= 6)) | |
175 | - | then (take(drop(playerChoice, 5), 1) == randStr) | |
176 | 182 | else false | |
177 | 183 | } | |
178 | 184 | ||
179 | 185 | ||
180 | 186 | func FormatGameDataParam (p) = { | |
181 | 187 | let s = size(p) | |
182 | 188 | if ((s == 0)) | |
183 | 189 | then throw("Parameter size must be greater then 0") | |
184 | 190 | else if ((s > 99)) | |
185 | 191 | then throw("Parameter size must be less then 100") | |
186 | 192 | else if ((10 > s)) | |
187 | 193 | then (("0" + toString(s)) + p) | |
188 | 194 | else (toString(s) + p) | |
189 | 195 | } | |
190 | 196 | ||
191 | 197 | ||
192 | 198 | func FormatGameDataStr (gameState,playerChoice,playerPubKey58,startedHeight,winAmt,randOrEmpty) = { | |
193 | 199 | let fullStateStr = ((((((((FormatGameDataParam(gameState) + "_") + FormatGameDataParam(playerChoice)) + "_") + FormatGameDataParam(playerPubKey58)) + "_") + FormatGameDataParam(toString(startedHeight))) + "_") + FormatGameDataParam(toString(winAmt))) | |
194 | 200 | if ((randOrEmpty == "")) | |
195 | 201 | then fullStateStr | |
196 | 202 | else ((fullStateStr + "_") + FormatGameDataParam(randOrEmpty)) | |
197 | 203 | } | |
198 | 204 | ||
199 | 205 | ||
200 | 206 | func RemoveUnderscoreIfPresent (remaining) = if ((size(remaining) > 0)) | |
201 | 207 | then drop(remaining, 1) | |
202 | 208 | else remaining | |
203 | 209 | ||
204 | 210 | ||
205 | 211 | func ParseNextAttribute (remaining) = { | |
206 | 212 | let s = size(remaining) | |
207 | 213 | if ((s > 0)) | |
208 | 214 | then { | |
209 | 215 | let nn = parseIntValue(take(remaining, 2)) | |
210 | 216 | let v = take(drop(remaining, 2), nn) | |
211 | 217 | let tmpRemaining = drop(remaining, (nn + 2)) | |
212 | 218 | let remainingState = RemoveUnderscoreIfPresent(tmpRemaining) | |
213 | 219 | [v, remainingState] | |
214 | 220 | } | |
215 | 221 | else throw("Empty string was passed into parseNextAttribute func") | |
216 | 222 | } | |
217 | 223 | ||
218 | 224 | ||
219 | 225 | func ParseGameRawDataStr (rawStateStr) = { | |
220 | 226 | let gameState = ParseNextAttribute(rawStateStr) | |
221 | 227 | let playerChoice = ParseNextAttribute(gameState[1]) | |
222 | 228 | let playerPubKey58 = ParseNextAttribute(playerChoice[1]) | |
223 | 229 | let startedHeight = ParseNextAttribute(playerPubKey58[1]) | |
224 | 230 | let winAmt = ParseNextAttribute(startedHeight[1]) | |
225 | 231 | [gameState[0], playerChoice[0], playerPubKey58[0], startedHeight[0], winAmt[0]] | |
226 | 232 | } | |
227 | 233 | ||
228 | 234 | ||
229 | 235 | func ExtractGameDataList (gameId) = { | |
230 | 236 | let rawDataStr = match getString(this, gameId) { | |
231 | 237 | case str: String => | |
232 | 238 | str | |
233 | 239 | case _ => | |
234 | 240 | throw(("Couldn't find game by " + gameId)) | |
235 | 241 | } | |
236 | 242 | ParseGameRawDataStr(rawDataStr) | |
237 | 243 | } | |
238 | 244 | ||
239 | 245 | ||
240 | 246 | func WinScriptSet (gameId,playerAddress,winAmt,newGameDataStr,winByTimeout,decreasedReserves) = { | |
241 | 247 | let wSetCommonData = [decreasedReserves] | |
242 | 248 | let tSetCommonData = [ScriptTransfer(playerAddress, winAmt, unit)] | |
243 | 249 | if (winByTimeout) | |
244 | 250 | then { | |
245 | 251 | let newGameDataStrAdjusted = ((newGameDataStr + "_") + FormatGameDataParam("TIMEOUT")) | |
246 | 252 | let gameData = DataEntry(gameId, newGameDataStrAdjusted) | |
247 | 253 | ScriptResult(WriteSet(gameData :: wSetCommonData), TransferSet(tSetCommonData)) | |
248 | 254 | } | |
249 | 255 | else { | |
250 | 256 | let gameData = DataEntry(gameId, newGameDataStr) | |
251 | 257 | ScriptResult(WriteSet(gameData :: wSetCommonData), TransferSet(tSetCommonData)) | |
252 | 258 | } | |
253 | 259 | } | |
254 | 260 | ||
255 | 261 | ||
262 | + | func IsDAppUp () = { | |
263 | + | let dAppUpOpt = getBoolean(this, DAPPUPKEY) | |
264 | + | if (isDefined(dAppUpOpt)) | |
265 | + | then extract(dAppUpOpt) | |
266 | + | else false | |
267 | + | } | |
268 | + | ||
269 | + | ||
270 | + | func monitorMaxBalance () = { | |
271 | + | let maxBalanceOpt = getInteger(this, MAXBALANCEKEY) | |
272 | + | let maxBalance = if (isDefined(maxBalanceOpt)) | |
273 | + | then extract(maxBalanceOpt) | |
274 | + | else 0 | |
275 | + | let currBalance = wavesBalance(this) | |
276 | + | if ((currBalance > maxBalance)) | |
277 | + | then currBalance | |
278 | + | else { | |
279 | + | let diff = (maxBalance - currBalance) | |
280 | + | if ((diff > MAXBALANCEDIFF)) | |
281 | + | then throw("dApp is temporary disabled") | |
282 | + | else maxBalance | |
283 | + | } | |
284 | + | } | |
285 | + | ||
286 | + | ||
287 | + | @Callable(i) | |
288 | + | func dAppUp (dAppUp) = if ((i.caller != SERVER)) | |
289 | + | then throw("Only Server can manage dAppUp attribute") | |
290 | + | else if ((IsDAppUp() == dAppUp)) | |
291 | + | then throw("dAppUp must be different with actual value") | |
292 | + | else WriteSet([DataEntry(DAPPUPKEY, dAppUp)]) | |
293 | + | ||
294 | + | ||
295 | + | ||
256 | 296 | @Callable(i) | |
257 | 297 | func bet (playerChoice) = { | |
258 | - | let newGameNum = IncrementGameNum() | |
259 | 298 | let gameId = toBase58String(i.transactionId) | |
260 | - | let pmt = extract(i.payment) | |
261 | - | let betNotInWaves = isDefined(pmt.assetId) | |
262 | - | let feeNotInWaves = isDefined(pmt.assetId) | |
263 | - | let winAmt = ValidateBetAndDefineWinAmt(pmt.amount, playerChoice) | |
264 | - | let txIdUsed = isDefined(getString(this, gameId)) | |
265 | - | if (betNotInWaves) | |
266 | - | then throw("Bet amount must be in Waves") | |
267 | - | else if (feeNotInWaves) | |
268 | - | then throw("Transaction's fee must be in Waves") | |
269 | - | else if (txIdUsed) | |
270 | - | then throw("Passed txId had been used before. Game aborted.") | |
271 | - | else { | |
272 | - | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
273 | - | let gameDataStr = FormatGameDataStr(STATESUBMITTED, playerChoice, playerPubKey58, height, winAmt, "") | |
274 | - | ScriptResult(WriteSet([DataEntry(RESERVATIONKEY, ValidateAndIncreaseReservedAmt(winAmt)), DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet([ScriptTransfer(SERVER, COMMISSION, unit)])) | |
275 | - | } | |
299 | + | if (!(IsDAppUp())) | |
300 | + | then throw("DApp is under maintenance") | |
301 | + | else if (isDefined(getString(this, gameId))) | |
302 | + | then throw((("Bet for: " + gameId) + " was already made.")) | |
303 | + | else { | |
304 | + | let pmt = extract(i.payment) | |
305 | + | let betNotInWaves = isDefined(pmt.assetId) | |
306 | + | let winAmt = ValidateBetAndDefineWinAmt(pmt.amount, playerChoice) | |
307 | + | let txIdUsed = isDefined(getString(this, gameId)) | |
308 | + | if (betNotInWaves) | |
309 | + | then throw("Bet amount must be in Waves") | |
310 | + | else { | |
311 | + | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
312 | + | let gameDataStr = FormatGameDataStr(STATESUBMITTED, playerChoice, playerPubKey58, height, winAmt, "") | |
313 | + | ScriptResult(WriteSet([DataEntry(RESERVATIONKEY, ValidateAndIncreaseReservedAmt(winAmt)), incrementInt(GAMESCOUNTERKEY), DataEntry(MAXBALANCEKEY, monitorMaxBalance()), DataEntry(gameId, gameDataStr)]), TransferSet([ScriptTransfer(SERVER, COMMISSION, unit)])) | |
314 | + | } | |
315 | + | } | |
276 | 316 | } | |
277 | 317 | ||
278 | 318 | ||
279 | 319 | ||
280 | 320 | @Callable(i) | |
281 | 321 | func withdraw (gameId,rsaSign) = { | |
282 | 322 | let gameDataList = ExtractGameDataList(gameId) | |
283 | 323 | let gameState = gameDataList[IdxGameState] | |
284 | 324 | let playerChoice = gameDataList[IdxPlayerChoice] | |
285 | 325 | let startedHeight = parseIntValue(gameDataList[IdxStartedHeight]) | |
286 | 326 | let winAmt = parseIntValue(gameDataList[IdxWinAmt]) | |
287 | 327 | let playerPubKey58 = gameDataList[IdxPlayerPubKey58] | |
288 | 328 | let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58)) | |
289 | 329 | let winByTimeout = ((height - startedHeight) > RANDORACLETIMEFRAME) | |
290 | 330 | let decreasedReserves = DecreaseReservedAmt(gameId, winAmt) | |
291 | 331 | if ((gameState != STATESUBMITTED)) | |
292 | 332 | then throw("Invalid game state for passed gameId") | |
293 | 333 | else if (winByTimeout) | |
294 | 334 | then { | |
295 | 335 | let randStr = take(playerChoice, 1) | |
296 | 336 | let newGameDataStr = FormatGameDataStr(STATEWON, playerChoice, playerPubKey58, startedHeight, winAmt, randStr) | |
297 | 337 | WinScriptSet(gameId, playerAddress, winAmt, newGameDataStr, winByTimeout, decreasedReserves) | |
298 | 338 | } | |
299 | 339 | else { | |
300 | 340 | let randStr = RandToStr(GenerateRandInt(gameId, rsaSign)) | |
301 | - | if (IsPlayerWin(playerChoice, randStr)) | |
302 | - | then { | |
303 | - | let newGameDataStr = FormatGameDataStr(STATEWON, playerChoice, playerPubKey58, startedHeight, winAmt, randStr) | |
304 | - | WinScriptSet(gameId, playerAddress, winAmt, newGameDataStr, winByTimeout, decreasedReserves) | |
305 | - | } | |
306 | - | else { | |
307 | - | let newGameDataStr = FormatGameDataStr(STATELOST, playerChoice, playerPubKey58, startedHeight, winAmt, randStr) | |
308 | - | WriteSet([DataEntry(gameId, newGameDataStr), decreasedReserves]) | |
309 | - | } | |
341 | + | if ((i.caller != SERVER)) | |
342 | + | then throw("Regular withdraw can be done by server only") | |
343 | + | else if (IsPlayerWin(playerChoice, randStr)) | |
344 | + | then { | |
345 | + | let newGameDataStr = FormatGameDataStr(STATEWON, playerChoice, playerPubKey58, startedHeight, winAmt, randStr) | |
346 | + | WinScriptSet(gameId, playerAddress, winAmt, newGameDataStr, winByTimeout, decreasedReserves) | |
347 | + | } | |
348 | + | else { | |
349 | + | let newGameDataStr = FormatGameDataStr(STATELOST, playerChoice, playerPubKey58, startedHeight, winAmt, randStr) | |
350 | + | WriteSet([DataEntry(gameId, newGameDataStr), decreasedReserves]) | |
351 | + | } | |
310 | 352 | } | |
311 | 353 | } | |
312 | 354 | ||
313 | 355 | ||
314 | 356 | @Verifier(tx) | |
315 | 357 | func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
316 | 358 | then match tx { | |
317 | 359 | case ttx: TransferTransaction => | |
318 | 360 | ((wavesBalance(this) - ttx.amount) >= ExtractReservedAmt()) | |
319 | 361 | case stx: SetScriptTransaction => | |
320 | - | true | |
362 | + | if ((IsDAppUp() == false)) | |
363 | + | then (ExtractReservedAmt() == 0) | |
364 | + | else false | |
321 | 365 | case _ => | |
322 | 366 | false | |
323 | 367 | } | |
324 | 368 | else false | |
325 | 369 |
github/deemru/w8io/026f985 58.59 ms ◑