tx · 5KbfW38uAFfkfcoTMFretetMS43dYkLjVH6a4p6XfXGU 3MtvuEjxdPnrrTdFAsnDqfkwcTUj2CnBT4U: -0.01000000 Waves 2018.11.12 17:07 [372489] smart account 3MtvuEjxdPnrrTdFAsnDqfkwcTUj2CnBT4U > SELF 0.00000000 Waves
{ "type": 13, "id": "5KbfW38uAFfkfcoTMFretetMS43dYkLjVH6a4p6XfXGU", "fee": 1000000, "feeAssetId": null, "timestamp": 1542031719245, "version": 1, "sender": "3MtvuEjxdPnrrTdFAsnDqfkwcTUj2CnBT4U", "senderPublicKey": "2FdRFXEAjhHyEhfCXoD7WTaeGP3hwv3M5D1sfYhbYC1b", "proofs": [ "tbXhSQiEtcnmyrf8roaE6WWCyxZLMJ67bEpU9i6TsXdfrixkvfFNK5JKuuow1Cse5nHVQYat6t5WcgcGCNuMsDG" ], "script": "base64:AQQAAAAKcGxheWVyQWRkcgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVGn3krpaDTc+j3YI5REPQQIdPTpGX/43ZAQAAAAMcGxheWVyUHViS2V5AQAAACDLp0RpVCULejfAo54x+7hkLm7IuSlV5e+7DIA+iWH4RQQAAAAKY2FzaW5vQWRkcgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVGn3krpaDTc+j3YI5REPQQIdPTpGX/43ZAQAAAAMY2FzaW5vUHViS2V5AQAAACDLp0RpVCULejfAo54x+7hkLm7IuSlV5e+7DIA+iWH4RQQAAAAMcGxheWVyU2lnbmVkCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAMcGxheWVyUHViS2V5BAAAAAxjYXNpbm9TaWduZWQJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAxjYXNpbm9QdWJLZXkEAAAAAm1lCAUAAAACdHgAAAAGc2VuZGV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WtlVHVybgkAAAAAAAACCAUAAAADdHR4AAAACXJlY2lwaWVudAUAAAAKcGxheWVyQWRkcgcEAAAAEmNhc2lub0NhblRha2VQcml6ZQMDBQAAAAlwcml6ZVR1cm4FAAAACWNhc2lub1dpbgcJAAAAAAAAAggFAAAAA3R0eAAAAAlyZWNpcGllbnQFAAAACmNhc2lub0FkZHIHBAAAAA1jYXNpbm9DYW5UYWtlAwMFAAAAEmNhc2lub0NhblRha2VQcml6ZQYFAAAAGmNhc2lub0NhbkVtZXJnZW5jeVRha2VUdXJuCQAAAAAAAAIIBQAAAAN0dHgAAAAJcmVjaXBpZW50BQAAAApjYXNpbm9BZGRyBwMDBQAAAA1wbGF5ZXJDYW5UYWtlBgUAAAANY2FzaW5vQ2FuVGFrZQUAAAAPd2l0aGRyYXdDb3JyZWN0BwaX5T4k", "chainId": 84, "height": 372489, "spentComplexity": 0 } View: original | compacted Prev: none Next: 4C6TCBpacsYBPSv1gexwFpX7aFtRRYfKZbhjVrhaotKS Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 1 #-} | |
2 | + | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | + | let playerAddr = Address(base58'3MyaPJkHmZy4u57uKcHXgzQxsk9wAP9LTZ5') | |
4 | + | let playerPubKey = base58'EhyhHkMbyNu8PwHoiJVCq2SciN9FmM5KvBeSN2NkTmeL' | |
5 | + | let casinoAddr = Address(base58'3MyaPJkHmZy4u57uKcHXgzQxsk9wAP9LTZ5') | |
6 | + | let casinoPubKey = base58'EhyhHkMbyNu8PwHoiJVCq2SciN9FmM5KvBeSN2NkTmeL' | |
7 | + | let playerSigned = sigVerify(tx.bodyBytes, tx.proofs[0], playerPubKey) | |
8 | + | let casinoSigned = sigVerify(tx.bodyBytes, tx.proofs[0], casinoPubKey) | |
9 | + | let me = tx.sender | |
10 | + | let casinoBet = 50000000 | |
11 | + | let playerBet = 10000000 | |
12 | + | let gameBalance = (casinoBet + playerBet) | |
13 | + | let start = 372489 | |
14 | + | let balance = wavesBalance(me) | |
15 | + | let casinoChoiceHash = base58'GgDo7Z6z89EnYQiNdT1ZvzLxjgKSGZ5MP4RWK236bov4' | |
16 | + | let dice1 = extract(getInteger(me, "dice1")) | |
17 | + | let dice2 = extract(getInteger(me, "dice2")) | |
18 | + | let dice3 = extract(getInteger(me, "dice3")) | |
19 | + | let dice4 = extract(getInteger(me, "dice4")) | |
20 | + | let dice5 = extract(getInteger(me, "dice5")) | |
21 | + | let dice6 = extract(getInteger(me, "dice6")) | |
22 | + | let diceSum = (((((dice1 + dice2) + dice3) + dice4) + dice5) + dice6) | |
23 | + | let casinoDice = extract(getInteger(me, "casinoDice")) | |
24 | + | let isDice1 = if ((dice1 > 0)) | |
25 | + | then 1 | |
26 | + | else 0 | |
27 | + | let isDice2 = if ((dice2 > 0)) | |
28 | + | then 1 | |
29 | + | else 0 | |
30 | + | let isDice3 = if ((dice3 > 0)) | |
31 | + | then 1 | |
32 | + | else 0 | |
33 | + | let isDice4 = if ((dice4 > 0)) | |
34 | + | then 1 | |
35 | + | else 0 | |
36 | + | let isDice5 = if ((dice5 > 0)) | |
37 | + | then 1 | |
38 | + | else 0 | |
39 | + | let isDice6 = if ((dice6 > 0)) | |
40 | + | then 1 | |
41 | + | else 0 | |
42 | + | let dicesNum = (((((isDice1 + isDice2) + isDice3) + isDice4) + isDice5) + isDice6) | |
43 | + | let playerPlacedBet = (diceSum > 0) | |
44 | + | let casinoOpenedBet = (casinoDice > 0) | |
45 | + | let playerDepositOk = (balance >= (casinoBet + playerBet)) | |
46 | + | let playerDepositTurn = if (if (((start + 50) > height)) | |
47 | + | then (balance >= casinoBet) | |
48 | + | else false) | |
49 | + | then !(playerDepositOk) | |
50 | + | else false | |
51 | + | let playerBetOk = (diceSum > 0) | |
52 | + | let playerBetTurn = if (if (((start + 100) > height)) | |
53 | + | then playerDepositOk | |
54 | + | else false) | |
55 | + | then !(playerBetOk) | |
56 | + | else false | |
57 | + | let casinoBetOk = (casinoDice > 0) | |
58 | + | let casinoBetTurn = if (if (((start + 200) > height)) | |
59 | + | then playerBetOk | |
60 | + | else false) | |
61 | + | then !(casinoBetOk) | |
62 | + | else false | |
63 | + | let prizeTurn = casinoBetOk | |
64 | + | let playerEmergencyTakeTurn = if ((height >= (start + 300))) | |
65 | + | then !(casinoBetOk) | |
66 | + | else false | |
67 | + | let casinoCanEmergencyTakeTurn = if ((height >= (start + 100))) | |
68 | + | then if (!(playerDepositOk)) | |
69 | + | then true | |
70 | + | else !(playerBetOk) | |
71 | + | else false | |
72 | + | match tx { | |
73 | + | case dtx: DataTransaction => | |
74 | + | let num = size(dtx.data) | |
75 | + | let choice1 = extract(getInteger(dtx.data, "dice1")) | |
76 | + | let choice2 = extract(getInteger(dtx.data, "dice2")) | |
77 | + | let choice3 = extract(getInteger(dtx.data, "dice3")) | |
78 | + | let choice4 = extract(getInteger(dtx.data, "dice4")) | |
79 | + | let choice5 = extract(getInteger(dtx.data, "dice5")) | |
80 | + | let choice6 = extract(getInteger(dtx.data, "dice6")) | |
81 | + | let casinoChoice = extract(getInteger(dtx.data, "casinoDice")) | |
82 | + | let salt = extract(getString(dtx.data, "salt")) | |
83 | + | let playerDicesInRange = if (if (if (if (if (if ((choice1 >= 0)) | |
84 | + | then (6 >= choice1) | |
85 | + | else false) | |
86 | + | then if ((choice2 >= 0)) | |
87 | + | then (6 >= choice2) | |
88 | + | else false | |
89 | + | else false) | |
90 | + | then if ((choice3 >= 0)) | |
91 | + | then (6 >= choice3) | |
92 | + | else false | |
93 | + | else false) | |
94 | + | then if ((choice4 >= 0)) | |
95 | + | then (6 >= choice4) | |
96 | + | else false | |
97 | + | else false) | |
98 | + | then if ((choice5 >= 0)) | |
99 | + | then (6 >= choice5) | |
100 | + | else false | |
101 | + | else false) | |
102 | + | then if ((choice6 >= 0)) | |
103 | + | then (6 >= choice6) | |
104 | + | else false | |
105 | + | else false | |
106 | + | let playerChoiceSum = (((((choice1 + choice2) + choice3) + choice4) + choice5) + choice6) | |
107 | + | let playerChoiceMul = (((((choice1 * choice2) * choice3) * choice4) * choice5) * choice6) | |
108 | + | let playerDicesNumberCorrect = if ((playerChoiceSum > 0)) | |
109 | + | then (playerChoiceMul == 0) | |
110 | + | else false | |
111 | + | let casinoDicesInRange = if ((casinoChoice >= 1)) | |
112 | + | then (6 >= casinoChoice) | |
113 | + | else false | |
114 | + | let newHash = keccak256(toBytes((toString(casinoChoice) + salt))) | |
115 | + | let casinoVerified = (newHash == casinoChoiceHash) | |
116 | + | let playerInputCorrect = if (if (playerDicesInRange) | |
117 | + | then playerDicesNumberCorrect | |
118 | + | else false) | |
119 | + | then (num == 6) | |
120 | + | else false | |
121 | + | let casinoInputCorrect = if (if (casinoDicesInRange) | |
122 | + | then casinoVerified | |
123 | + | else false) | |
124 | + | then (num == 2) | |
125 | + | else false | |
126 | + | if (if (if (casinoSigned) | |
127 | + | then casinoBetTurn | |
128 | + | else false) | |
129 | + | then casinoInputCorrect | |
130 | + | else false) | |
131 | + | then true | |
132 | + | else if (if (playerSigned) | |
133 | + | then playerBetTurn | |
134 | + | else false) | |
135 | + | then playerInputCorrect | |
136 | + | else false | |
137 | + | case ttx: TransferTransaction => | |
138 | + | let dicesMatch = if (if (if (if (if ((dice1 == casinoDice)) | |
139 | + | then true | |
140 | + | else (dice2 == casinoDice)) | |
141 | + | then true | |
142 | + | else (dice3 == casinoDice)) | |
143 | + | then true | |
144 | + | else (dice4 == casinoDice)) | |
145 | + | then true | |
146 | + | else (dice5 == casinoDice)) | |
147 | + | then true | |
148 | + | else (dice6 == casinoDice) | |
149 | + | let withdrawCorrect = if ((ttx.amount >= 10000000)) | |
150 | + | then (1000000 >= ttx.fee) | |
151 | + | else false | |
152 | + | let playerWin = if (casinoBetOk) | |
153 | + | then dicesMatch | |
154 | + | else false | |
155 | + | let casinoWin = if (if (casinoBetOk) | |
156 | + | then !(dicesMatch) | |
157 | + | else false) | |
158 | + | then (ttx.recipient == casinoAddr) | |
159 | + | else false | |
160 | + | let playerTakeOnlyPrize = ((balance - ttx.amount) >= (gameBalance - (gameBalance / dicesNum))) | |
161 | + | let playerCanTakePrize = if (if (prizeTurn) | |
162 | + | then playerWin | |
163 | + | else false) | |
164 | + | then playerTakeOnlyPrize | |
165 | + | else false | |
166 | + | let playerCanTake = if (if (playerCanTakePrize) | |
167 | + | then true | |
168 | + | else playerEmergencyTakeTurn) | |
169 | + | then (ttx.recipient == playerAddr) | |
170 | + | else false | |
171 | + | let casinoCanTakePrize = if (if (prizeTurn) | |
172 | + | then casinoWin | |
173 | + | else false) | |
174 | + | then (ttx.recipient == casinoAddr) | |
175 | + | else false | |
176 | + | let casinoCanTake = if (if (casinoCanTakePrize) | |
177 | + | then true | |
178 | + | else casinoCanEmergencyTakeTurn) | |
179 | + | then (ttx.recipient == casinoAddr) | |
180 | + | else false | |
181 | + | if (if (playerCanTake) | |
182 | + | then true | |
183 | + | else casinoCanTake) | |
184 | + | then withdrawCorrect | |
185 | + | else false | |
186 | + | case _ => | |
187 | + | true | |
188 | + | } |
github/deemru/w8io/169f3d6 33.26 ms ◑