tx · 4bHKND1FAGGeVvp12T25hd9P3TsgePqhi3JToEsM1C1C 3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd: -0.10000000 Waves 2021.12.01 02:18 [1814423] smart account 3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd > SELF 0.00000000 Waves
{ "type": 13, "id": "4bHKND1FAGGeVvp12T25hd9P3TsgePqhi3JToEsM1C1C", "fee": 10000000, "feeAssetId": null, "timestamp": 1638314428752, "version": 1, "sender": "3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd", "senderPublicKey": "7Hi4o6vBstRs79NMVMjEove52dmP87RAcvNDAXN8C4Wi", "proofs": [ "3e1vFJoRoCD3m9w8sjUQgqaN8JLXrEZpqVR2d1jbeQG6LHXEGMhJ6yAWN18VUeAAJQijzsJ9HY1BLB8dZC2kuqzk" ], "script": "base64:AAIFAAAAAAAAA+cIAhIDCgEIEgMKAQgaDAoCYTESBmNhc2lubxoLCgJhMhIFV0FWRVMaDAoCYTMSBm1heEJldBoPCgJhNBIJc2VwYXJhdG9yGhAKAmE1EgpnZXROZXdEZWNrGhQKAmE2Eg5nZXRTaXhOZXdEZWNrcxoNCgJhNxIHZ2V0RGVjaxoKCgJhOBIEZGVjaxoVCgJhORIPZ2V0UmFuZG9tTnVtYmVyGgsKAmIxEgVzYWx0MRoLCgJiMhIFc2FsdDIaEgoCYjMSDGFuc3dlcnNDb3VudBoKCgJiNBIEaGFzaBoLCgJiNRIFaW5kZXgaCgoCYjYSBHJhbmQaHQoCYjcSF2dldFByZXZpb3VzUmFuZG9tTnVtYmVyGg0KAmI4EgdhZGRyZXNzGg0KAmI5EgckbWF0Y2gwGhUKAmMxEg9nZXRBbW91bnRPclplcm8aCgoCYzISBHRoaXMaCQoCYzMSA2tleRoQCgJjNBIKZ2V0UGF5bWVudBoJCgJjNRIDcG10GhIKAmM2EgxnZXRDYXJkVmFsdWUaEAoCYzcSCnN0cmluZ0NhcmQaDwoCYzgSCWdld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AAMwN0MJAARMAAAAAgIAAAADMDhDCQAETAAAAAICAAAAAzA5QwkABEwAAAACAgAAAAMxMEMJAARMAAAAAgIAAAADMTFDCQAETAAAAAICAAAAAzEyQwkABEwAAAACAgAAAAMxM0MJAARMAAAAAgIAAAADMDFECQAETAAAAAICAAAAAzAyRAkABEwAAAACAgAAAAMwM0QJAARMAAAAAgIAAAADMDRECQAETAAAAAICAAAAAzA1RAkABEwAAAACAgAAAAMwNkQJAARMAAAAAgIAAAADMDdECQAETAAAAAICAAAAAzA4RAkABEwAAAACAgAAAAMwOUQJAARMAAAAAgIAAAADMTBECQAETAAAAAICAAAAAzExRAkABEwAAAACAgAAAAMxMkQJAARMAAAAAgIAAAADMTNECQAETAAAAAICAAAAAzAxSAkABEwAAAACAgAAAAMwMkgJAARMAAAAAgIAAAADMDNICQAETAAAAAICAAAAAzA0SAkABEwAAAACAgAAAAMwNUgJAARMAAAAAgIAAAADMDZICQAETAAAAAICAAAAAzA3SAkABEwAAAACAgAAAAMwOEgJAARMAAAAAgIAAAADMDlICQAETAAAAAICAAAAAzEwSAkABEwAAAACAgAAAAMxMUgJAARMAAAAAgIAAAADMTJICQAETAAAAAICAAAAAzEzSAkABEwAAAACAgAAAAMwMVMJAARMAAAAAgIAAAADMDJTCQAETAAAAAICAAAAAzAzUwkABEwAAAACAgAAAAMwNFMJAARMAAAAAgIAAAADMDVTCQAETAAAAAICAAAAAzA2UwkABEwAAAACAgAAAAMwN1MJAARMAAAAAgIAAAADMDhTCQAETAAAAAICAAAAAzA5UwkABEwAAAACAgAAAAMxMFMJAARMAAAAAgIAAAADMTFTCQAETAAAAAICAAAAAzEyUwkABEwAAAACAgAAAAMxM1MFAAAAA25pbAEAAAACYTYAAAAACQAETgAAAAIJAAROAAAAAgkABE4AAAACCQAETgAAAAIJAAROAAAAAgkBAAAAAmE1AAAAAAkBAAAAAmE1AAAAAAkBAAAAAmE1AAAAAAkBAAAAAmE1AAAAAAkBAAAAAmE1AAAAAAkBAAAAA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W5nIHRoaXMgcm91bmQDAwkAAAAAAAACBQAAAAJmNwUAAAACZDIJAAAAAAAAAgUAAAACZjcFAAAAAmExBwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACBQAAAAJmOAkAAaQAAAABBQAAAAJnMQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAAAmcxBQAAAAR1bml0BQAAAANuaWwDAwkAAAAAAAACBQAAAAJmNwUAAAACZDIJAAAAAAAAAgUAAAACZjcFAAAAAmY5BwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACBQAAAAJmOAkAAaQAAAABCQAAaAAAAAIFAAAAAmcxAAAAAAAAAAACCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgkAAGgAAAACBQAAAAJnMQAAAAAAAAAAAgUAAAAEdW5pdAUAAAADbmlsCQAAAgAAAAECAAAAFllvdSBhcmUgbm90IHRoZSB3aW5uZXIAAAABAAAAAnR4AQAAAAJnMgAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5zxq/jA==", "chainId": 84, "height": 1814423, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8DmR7fMpJpr8AjtWvktZVTHYktvguFRPBxRLjsi34sHS Next: 9o1a7zFpmGsNr6sudj4UnE65WzvjqBksAbaGXfwgNBMY Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let casino = "3MtaCL4v1bjTabUqs7oU4ofS8fbai34WM1i" | |
5 | 5 | ||
6 | 6 | let WAVES = 1000000000 | |
7 | 7 | ||
8 | 8 | let maxBet = (100 * WAVES) | |
9 | 9 | ||
10 | 10 | let separator = "," | |
11 | 11 | ||
12 | 12 | func getNewDeck () = ["01C", "02C", "03C", "04C", "05C", "06C", "07C", "08C", "09C", "10C", "11C", "12C", "13C", "01D", "02D", "03D", "04D", "05D", "06D", "07D", "08D", "09D", "10D", "11D", "12D", "13D", "01H", "02H", "03H", "04H", "05H", "06H", "07H", "08H", "09H", "10H", "11H", "12H", "13H", "01S", "02S", "03S", "04S", "05S", "06S", "07S", "08S", "09S", "10S", "11S", "12S", "13S"] | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func getSixNewDecks () = (((((getNewDeck() ++ getNewDeck()) ++ getNewDeck()) ++ getNewDeck()) ++ getNewDeck()) ++ getNewDeck()) | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func getDeck (deck) = if ((0 >= size(deck))) | |
19 | 19 | then getSixNewDecks() | |
20 | 20 | else deck | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func getRandomNumber (salt1,salt2,answersCount) = { | |
24 | 24 | let hash = sha256(toBytes((salt1 + salt2))) | |
25 | 25 | let index = toInt(hash) | |
26 | 26 | let rand = (index % answersCount) | |
27 | 27 | if ((0 > rand)) | |
28 | 28 | then ((-1 * rand) + 1) | |
29 | 29 | else (rand + 1) | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func getPreviousRandomNumber (address) = match getInteger(this, (address + "_LastRandonNumber")) { | |
34 | 34 | case n: Int => | |
35 | 35 | toString(n) | |
36 | 36 | case _ => | |
37 | 37 | address | |
38 | 38 | } | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func getAmountOrZero (this,key) = match getInteger(this, key) { | |
42 | 42 | case a: Int => | |
43 | 43 | a | |
44 | 44 | case _ => | |
45 | 45 | 0 | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func getPayment (i) = if ((size(i.payments) == 0)) | |
50 | 50 | then throw("Payment must be attached") | |
51 | 51 | else { | |
52 | 52 | let pmt = i.payments[0] | |
53 | 53 | if (isDefined(pmt.assetId)) | |
54 | 54 | then throw("This function accepts WAVES tokens only") | |
55 | 55 | else pmt.amount | |
56 | 56 | } | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func getCardValue (stringCard) = { | |
60 | 60 | let p = parseIntValue(take(stringCard, 2)) | |
61 | 61 | if ((p == 1)) | |
62 | 62 | then 20 | |
63 | 63 | else p | |
64 | 64 | } | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func getWinner (cardPlayer,cardCasino,callerAddress,casino) = { | |
68 | 68 | let p = getCardValue(cardPlayer) | |
69 | 69 | let o = getCardValue(cardCasino) | |
70 | 70 | if ((p > o)) | |
71 | 71 | then callerAddress | |
72 | 72 | else casino | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func getAvailableDeck (this,availableProp) = if (isDefined(getString(this, availableProp))) | |
77 | 77 | then { | |
78 | 78 | let stringDeck = getStringValue(this, availableProp) | |
79 | 79 | let deck = split(stringDeck, separator) | |
80 | 80 | getDeck(deck) | |
81 | 81 | } | |
82 | 82 | else getSixNewDecks() | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func getPlayerCardAndPositionAndUpdateDeck (meKey,callerAddress,deck) = { | |
86 | 86 | let avDeck2 = getDeck(deck) | |
87 | 87 | let cardPosition = getRandomNumber(((meKey + makeString(avDeck2, separator)) + callerAddress), getPreviousRandomNumber(callerAddress), size(avDeck2)) | |
88 | 88 | let card = avDeck2[(cardPosition % size(avDeck2))] | |
89 | 89 | let avDeck3 = removeByIndex(avDeck2, (cardPosition % size(avDeck2))) | |
90 | 90 | $Tuple3(card, cardPosition, avDeck3) | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | @Callable(i) | |
95 | 95 | func bet (round) = { | |
96 | 96 | let callerAddress = toBase58String(i.caller.bytes) | |
97 | 97 | let meKey = round | |
98 | 98 | let p = getPayment(i) | |
99 | 99 | let roundBetsKey = (round + "_sumBets") | |
100 | 100 | let curSumBets = getAmountOrZero(c2, roundBetsKey) | |
101 | 101 | let currentDraws = match getInteger(c2, (round + "_drawSequence")) { | |
102 | 102 | case a: Int => | |
103 | 103 | (a + 1) | |
104 | 104 | case _ => | |
105 | 105 | 0 | |
106 | 106 | } | |
107 | 107 | let currentPlayer = match getString(c2, (round + "_player")) { | |
108 | 108 | case a: String => | |
109 | 109 | a | |
110 | 110 | case _ => | |
111 | 111 | unit | |
112 | 112 | } | |
113 | 113 | let initialBet = match getInteger(c2, (round + "_initialBet")) { | |
114 | 114 | case a: Int => | |
115 | 115 | a | |
116 | 116 | case _ => | |
117 | 117 | p | |
118 | 118 | } | |
119 | 119 | let availableProp = (meKey + "_available") | |
120 | 120 | let newSumBets = (curSumBets + p) | |
121 | 121 | if (if (isDefined(getBoolean(c2, (round + "_stop")))) | |
122 | 122 | then true | |
123 | 123 | else isDefined(getString(c2, round))) | |
124 | 124 | then throw("This round is already played") | |
125 | 125 | else if (if (isDefined(getString(c2, (round + "_player")))) | |
126 | 126 | then (currentPlayer != callerAddress) | |
127 | 127 | else false) | |
128 | 128 | then throw("This is not your game") | |
129 | 129 | else if ((newSumBets > maxBet)) | |
130 | 130 | then throw(((("Maximum amount of bets for round " + toString(maxBet)) + ". With your bet it's ") + toString(newSumBets))) | |
131 | 131 | else if ((initialBet != p)) | |
132 | 132 | then throw(((("Initial bet not maching original:" + toString(initialBet)) + ", actual:") + toString(p))) | |
133 | 133 | else { | |
134 | 134 | let avDeck = getAvailableDeck(c2, availableProp) | |
135 | 135 | let $t040074122 = getPlayerCardAndPositionAndUpdateDeck(meKey, callerAddress, avDeck) | |
136 | 136 | let cardPlayer = $t040074122._1 | |
137 | 137 | let cardPositionPlayer = $t040074122._2 | |
138 | 138 | let avDeck1 = $t040074122._3 | |
139 | 139 | let $t041274243 = getPlayerCardAndPositionAndUpdateDeck(meKey, callerAddress, avDeck1) | |
140 | 140 | let cardCasino = $t041274243._1 | |
141 | 141 | let cardPositionCasino = $t041274243._2 | |
142 | 142 | let avDeck2 = $t041274243._3 | |
143 | 143 | if ((getCardValue(cardPlayer) == getCardValue(cardCasino))) | |
144 | 144 | then [StringEntry(availableProp, makeString(avDeck2, separator)), StringEntry((round + "_player"), callerAddress), IntegerEntry((round + "_initialBet"), initialBet), StringEntry((meKey + "_salt_debug"), meKey), IntegerEntry((meKey + "_LastRandonNumber"), cardPositionCasino), IntegerEntry((round + "_sumBets"), newSumBets), StringEntry((meKey + "_playerCard"), cardPlayer), StringEntry((meKey + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), (currentDraws + 1))] | |
145 | 145 | else { | |
146 | 146 | let winner = getWinner(cardPlayer, cardCasino, callerAddress, casino) | |
147 | 147 | [StringEntry(availableProp, makeString(avDeck2, separator)), StringEntry((round + "_player"), callerAddress), IntegerEntry((round + "_initialBet"), initialBet), StringEntry((meKey + "_salt_debug"), meKey), IntegerEntry((meKey + "_LastRandonNumber"), cardPositionCasino), IntegerEntry((round + "_sumBets"), newSumBets), StringEntry((meKey + "_playerCard"), cardPlayer), StringEntry((meKey + "_casinoCard"), cardCasino), BooleanEntry((round + "_stop"), true), StringEntry((round + "_winner"), winner)] | |
148 | 148 | } | |
149 | 149 | } | |
150 | 150 | } | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | ||
154 | 154 | @Callable(i) | |
155 | 155 | func withdraw (round) = { | |
156 | 156 | let callerAddress = toBase58String(i.caller.bytes) | |
157 | 157 | let meKey = ((round + "_") + callerAddress) | |
158 | 158 | let withdrawKey = (round + "_withdraw") | |
159 | 159 | if (isDefined(getString(c2, withdrawKey))) | |
160 | 160 | then throw("You have already got your prize") | |
161 | 161 | else if (!(isDefined(getString(c2, (round + "_winner"))))) | |
162 | 162 | then throw("There is no winner, it was a draw") | |
163 | 163 | else { | |
164 | 164 | let winner = getStringValue(c2, (round + "_winner")) | |
165 | 165 | let player = getStringValue(c2, (round + "_player")) | |
166 | 166 | let curSumBet = getIntegerValue(c2, (round + "_sumBets")) | |
167 | 167 | if ((curSumBet == 0)) | |
168 | 168 | then throw("You won nothing this round") | |
169 | 169 | else if (if ((winner == callerAddress)) | |
170 | 170 | then (winner == casino) | |
171 | 171 | else false) | |
172 | 172 | then [StringEntry(withdrawKey, toString(curSumBet)), ScriptTransfer(i.caller, curSumBet, unit)] | |
173 | 173 | else if (if ((winner == callerAddress)) | |
174 | 174 | then (winner == player) | |
175 | 175 | else false) | |
176 | 176 | then [StringEntry(withdrawKey, toString((curSumBet * 2))), ScriptTransfer(i.caller, (curSumBet * 2), unit)] | |
177 | 177 | else throw("You are not the winner") | |
178 | 178 | } | |
179 | 179 | } | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | @Verifier(tx) | |
183 | 183 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
184 | 184 |
github/deemru/w8io/026f985 43.72 ms ◑