tx · SdbTsCAiPk8fsrHpmZBw4vnWT7PuWxbpYu8kK1Ysxim 3MsGBnTzBhrNe6w1KpLYPkzdDdxWudm4U89: -0.01400000 Waves 2019.08.21 09:36 [640528] smart account 3MsGBnTzBhrNe6w1KpLYPkzdDdxWudm4U89 > SELF 0.00000000 Waves
{ "type": 13, "id": "SdbTsCAiPk8fsrHpmZBw4vnWT7PuWxbpYu8kK1Ysxim", "fee": 1400000, "feeAssetId": null, "timestamp": 1566369422779, "version": 1, "sender": "3MsGBnTzBhrNe6w1KpLYPkzdDdxWudm4U89", "senderPublicKey": "FgbqvGasMMrXxbhwrsgEiCgJLjXPjgn8kHxsZiVmLrkb", "proofs": [ "eEcjgH8WVdveHJtyYHh3bAAKU1vHvFxFZQZXPzUA8B7KJJj2kGoEJTueYw6tnRuBXnpZ7BcyxdiU9Xqsgh1fNXN" ], "script": "base64:AAIDAAAAAAAAAAAAAAAgAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGPYmFzZTY0Ok1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBbGVtcjk1SjFqWlVzN2NKbXJtbWxONHpvN1lWc0JKekllSmRrOExERkdoVUtTSTZ5ZnMyMFp5SmUyMSs2R0p3Tm5LVVUxVXlvYzE3d1NXTUtrclowTU12WUUrWjVBaWlqdkJLNHNTSjNJZ0dqZFU4L05oSThDQkR1MEYreFJNOXEzVEIzTExiRHk1c0JkdWRZZkhmc1VPYytNVHZBRDY5bjI3ZGIyUmg4K3laUU10dWJrdVRRTnA4OXNwaEhRYUxHeVFGYU5sSy9OYTNsRng2b21xemFhMWdqb3BsVXI2cnZZS2dmQUlDVUIzelZtSlNoaUVpN3c3UjBoV2xOUkQzcWNaakNVT05TcEZvNFdiemtuR09henc4NEIrSU1JRm5JcFhXelFMOFJYMHZOY2ZzQnZMRGZNNmsyWmFjcXd5TUthTExxaWdkQmlHZEo3VyswbE9TdE9RSURBUUFCAAAAABNSQU5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TU4BQAAAAZoZWlnaHQFAAAABndpbkFtdAIAAAAABAAAAAZTRVJWRVIJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEIBQAAAAFpAAAAD2NhbGxlclB1YmxpY0tleQQAAAAOc2VydmVyVHJhbnNmZXIJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAGU0VSVkVSBQAAAApDT01NSVNTSU9OBQAAAAR1bml0BQAAAANuaWwEAAAAB2JldERhdGEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAADlJFU0VSVkFUSU9OS0VZCQEAAAAeVmFsaWRhdGVBbmRJbmNyZWFzZVJlc2VydmVkQW10AAAAAQUAAAAGd2luQW10CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAA9HQU1FU0NPVU5URVJLRVkFAAAACm5ld0dhbWVOdW0JAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAABmdhbWVJZAUAAAALZ2FtZURhdGFTdHIFAAAAA25pbAkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEFAAAAB2JldERhdGEJAQAAAAtUcmFuc2ZlclNldAAAAAEFAAAADnNlcnZlclRyYW5zZmVyAAAAAOoVkbk=", "chainId": 84, "height": 640528, "spentComplexity": 0 } View: original | compacted Prev: BNcRqiYRNYBGqzkZaopEacSxP3vhDjJzmoviHtJgFk8G Next: FZaVVwuudjyPinYPnh2twVyVoL6EezfDWF72xkYXN69a Diff:
Old | New | Differences | |
---|---|---|---|
19 | 19 | ||
20 | 20 | let i = (14 * c) | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = 10000 | |
23 | 23 | ||
24 | - | func k (l) = i | |
24 | + | let k = 39655 | |
25 | + | ||
26 | + | let l = 24600 | |
27 | + | ||
28 | + | let m = 19000 | |
29 | + | ||
30 | + | let n = 14200 | |
31 | + | ||
32 | + | let o = 11400 | |
33 | + | ||
34 | + | let p = "$GAME_NUM" | |
35 | + | ||
36 | + | let q = "$RESERVED_AMOUNT" | |
37 | + | ||
38 | + | let r = "SUBMITTED" | |
39 | + | ||
40 | + | let s = "WON" | |
41 | + | ||
42 | + | let t = "LOST" | |
43 | + | ||
44 | + | func u (v) = i | |
25 | 45 | ||
26 | 46 | ||
27 | - | func | |
28 | - | let | |
29 | - | if ( | |
47 | + | func w (x,y) = { | |
48 | + | let z = rsaVerify(SHA256, toBytes(x), y, a) | |
49 | + | if (z) | |
30 | 50 | then { | |
31 | - | let | |
32 | - | if ((0 > | |
33 | - | then (-1 * | |
34 | - | else | |
51 | + | let A = (toInt(sha256(y)) % 6) | |
52 | + | if ((0 > A)) | |
53 | + | then (-1 * A) | |
54 | + | else A | |
35 | 55 | } | |
36 | 56 | else throw("Invalid RSA signature") | |
37 | 57 | } | |
38 | 58 | ||
39 | 59 | ||
40 | - | func | |
41 | - | then drop( | |
42 | - | else | |
60 | + | func B (C) = if ((size(C) > 0)) | |
61 | + | then drop(C, 1) | |
62 | + | else C | |
43 | 63 | ||
44 | 64 | ||
45 | - | func | |
46 | - | let | |
47 | - | if (( | |
65 | + | func D (C) = { | |
66 | + | let E = size(C) | |
67 | + | if ((E > 0)) | |
48 | 68 | then { | |
49 | - | let | |
50 | - | let | |
51 | - | let | |
52 | - | let | |
53 | - | [ | |
69 | + | let F = parseIntValue(take(C, 2)) | |
70 | + | let G = take(drop(C, 2), F) | |
71 | + | let H = drop(C, (F + 2)) | |
72 | + | let I = B(H) | |
73 | + | [G, I] | |
54 | 74 | } | |
55 | 75 | else throw("Empty string was passed into parseNextAttribute func") | |
56 | 76 | } | |
57 | 77 | ||
58 | 78 | ||
59 | - | func | |
60 | - | let | |
61 | - | let | |
62 | - | let | |
63 | - | let | |
64 | - | let | |
65 | - | [ | |
79 | + | func J (K) = { | |
80 | + | let L = D(K) | |
81 | + | let v = D(L[1]) | |
82 | + | let M = D(v[1]) | |
83 | + | let N = D(M[1]) | |
84 | + | let O = D(N[1]) | |
85 | + | [L[0], v[0], M[0], N[0], O[0]] | |
66 | 86 | } | |
67 | 87 | ||
68 | 88 | ||
69 | - | func | |
70 | - | let | |
71 | - | let | |
72 | - | if ($isInstanceOf( | |
89 | + | func P (x) = { | |
90 | + | let Q = { | |
91 | + | let R = getString(this, x) | |
92 | + | if ($isInstanceOf(R, "String")) | |
73 | 93 | then { | |
74 | - | let | |
75 | - | | |
94 | + | let S = R | |
95 | + | S | |
76 | 96 | } | |
77 | - | else throw(("Couldn't find game by " + | |
97 | + | else throw(("Couldn't find game by " + x)) | |
78 | 98 | } | |
79 | - | | |
99 | + | J(Q) | |
80 | 100 | } | |
81 | 101 | ||
82 | 102 | ||
83 | - | func | |
84 | - | let | |
85 | - | if ($isInstanceOf( | |
103 | + | func T () = { | |
104 | + | let R = getInteger(this, q) | |
105 | + | if ($isInstanceOf(R, "Int")) | |
86 | 106 | then { | |
87 | - | let | |
88 | - | | |
107 | + | let U = R | |
108 | + | U | |
89 | 109 | } | |
90 | 110 | else 0 | |
91 | 111 | } | |
92 | 112 | ||
93 | 113 | ||
94 | - | @Callable(L) | |
95 | - | func bet (l) = { | |
96 | - | let M = toBase58String(L.caller.bytes) | |
97 | - | let N = k(l) | |
98 | - | let O = L.payment | |
99 | - | let P = wavesBalance(this) | |
100 | - | let Q = [DataEntry((M + " это Ставка Игрока"), l), DataEntry("Ответ Сервера", N), DataEntry("Текущий баланс игры", P), DataEntry("Номер текущего блока", height), DataEntry("Bytes блокчейн игры", this.bytes)] | |
101 | - | let R = Address(L.caller.bytes) | |
102 | - | let S = [ScriptTransfer(R, 10, unit)] | |
103 | - | ScriptResult(WriteSet(Q), TransferSet(S)) | |
114 | + | func V (O) = { | |
115 | + | let W = (T() + O) | |
116 | + | let X = wavesBalance(this) | |
117 | + | if ((W > X)) | |
118 | + | then throw("Insufficient funds on Russian Roulette account. Transaction was rejected for your safety.") | |
119 | + | else W | |
104 | 120 | } | |
105 | 121 | ||
106 | 122 | ||
107 | - | ||
108 | - | @Callable(L) | |
109 | - | func withdraw (O) = { | |
110 | - | let T = toBase58String(L.caller.bytes) | |
111 | - | let U = { | |
112 | - | let H = getInteger(this, T) | |
113 | - | if ($isInstanceOf(H, "Int")) | |
123 | + | func Y () = { | |
124 | + | let Z = { | |
125 | + | let R = getInteger(this, p) | |
126 | + | if ($isInstanceOf(R, "Int")) | |
114 | 127 | then { | |
115 | - | let | |
116 | - | | |
128 | + | let aa = R | |
129 | + | aa | |
117 | 130 | } | |
118 | 131 | else 0 | |
119 | 132 | } | |
120 | - | let V = (U - O) | |
121 | - | if ((0 > O)) | |
122 | - | then throw("Can't withdraw negative amount") | |
123 | - | else if ((0 > V)) | |
124 | - | then throw("Not enough balance") | |
125 | - | else ScriptResult(WriteSet([DataEntry(T, V)]), TransferSet([ScriptTransfer(L.caller, O, unit)])) | |
133 | + | (Z + 1) | |
126 | 134 | } | |
127 | 135 | ||
128 | 136 | ||
129 | - | @Verifier(W) | |
130 | - | func X () = if (sigVerify(W.bodyBytes, W.proofs[0], W.senderPublicKey)) | |
131 | - | then { | |
132 | - | let H = W | |
133 | - | if ($isInstanceOf(H, "TransferTransaction")) | |
134 | - | then { | |
135 | - | let Y = H | |
136 | - | ((wavesBalance(this) - Y.amount) >= J()) | |
137 | - | } | |
138 | - | else if ($isInstanceOf(H, "SetScriptTransaction")) | |
139 | - | then { | |
140 | - | let Z = H | |
141 | - | true | |
137 | + | func ab (ac) = { | |
138 | + | let E = size(ac) | |
139 | + | if ((E == 0)) | |
140 | + | then throw("Parameter size must be greater then 0") | |
141 | + | else if ((E > 99)) | |
142 | + | then throw("Parameter size must be less then 100") | |
143 | + | else if ((10 > E)) | |
144 | + | then (("0" + toString(E)) + ac) | |
145 | + | else (toString(E) + ac) | |
146 | + | } | |
147 | + | ||
148 | + | ||
149 | + | func ad (L,v,M,N,O,ae) = { | |
150 | + | let af = ((((((((ab(L) + "_") + ab(v)) + "_") + ab(M)) + "_") + ab(toString(N))) + "_") + ab(toString(O))) | |
151 | + | if ((ae == "")) | |
152 | + | then af | |
153 | + | else ((af + "_") + ab(ae)) | |
154 | + | } | |
155 | + | ||
156 | + | ||
157 | + | func ag (ah,v) = { | |
158 | + | let ai = if (if (if (if (if ((ah == (e + d))) | |
159 | + | then true | |
160 | + | else (ah == (f + d))) | |
161 | + | then true | |
162 | + | else (ah == (g + d))) | |
163 | + | then true | |
164 | + | else (ah == (h + d))) | |
165 | + | then true | |
166 | + | else (ah == (i + d))) | |
167 | + | then true | |
168 | + | else false | |
169 | + | if (ai) | |
170 | + | then { | |
171 | + | let aj = size(v) | |
172 | + | let ak = (ah - d) | |
173 | + | if ((aj == 5)) | |
174 | + | then ((ak * k) / j) | |
175 | + | else if ((aj == 4)) | |
176 | + | then ((ak * l) / j) | |
177 | + | else if ((aj == 3)) | |
178 | + | then ((ak * m) / j) | |
179 | + | else if ((aj == 2)) | |
180 | + | then ((ak * n) / j) | |
181 | + | else if ((aj == 1)) | |
182 | + | then ((ak * o) / j) | |
183 | + | else throw("Invalid bullets in player's choice") | |
184 | + | } | |
185 | + | else throw("Bet amount is not in range") | |
186 | + | } | |
187 | + | ||
188 | + | ||
189 | + | @Callable(al) | |
190 | + | func bet (v) = { | |
191 | + | let am = Y() | |
192 | + | let x = toBase58String(al.transactionId) | |
193 | + | let an = extract(al.payment) | |
194 | + | let ao = isDefined(an.assetId) | |
195 | + | let ap = isDefined(an.assetId) | |
196 | + | let O = ag(an.amount, v) | |
197 | + | let aq = isDefined(getString(this, x)) | |
198 | + | if (ao) | |
199 | + | then throw("Bet amount must be in Waves") | |
200 | + | else if (ap) | |
201 | + | then throw("Transaction's fee must be in Waves") | |
202 | + | else if (aq) | |
203 | + | then throw("Passed txId had been used before. Game aborted.") | |
204 | + | else { | |
205 | + | let M = toBase58String(al.callerPublicKey) | |
206 | + | let ar = ad(r, v, M, height, O, "") | |
207 | + | let as = addressFromPublicKey(al.callerPublicKey) | |
208 | + | let at = [ScriptTransfer(as, d, unit)] | |
209 | + | let au = [DataEntry(q, V(O)), DataEntry(p, am), DataEntry(x, ar)] | |
210 | + | ScriptResult(WriteSet(au), TransferSet(at)) | |
142 | 211 | } | |
143 | - | else false | |
144 | - | } | |
145 | - | else false | |
212 | + | } | |
213 | + | ||
146 | 214 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlemr95J1jZUs7cJmrmmlN4zo7YVsBJzIeJdk8LDFGhUKSI6yfs20ZyJe21+6GJwNnKUU1Uyoc17wSWMKkrZ0MMvYE+Z5AiijvBK4sSJ3IgGjdU8/NhI8CBDu0F+xRM9q3TB3LLbDy5sBdudYfHfsUOc+MTvAD69n27db2Rh8+yZQMtubkuTQNp89sphHQaLGyQFaNlK/Na3lFx6omqzaa1gjoplUr6rvYKgfAICUB3zVmJShiEi7w7R0hWlNRD3qcZjCUONSpFo4WbzknGOazw84B+IMIFnIpXWzQL8RX0vNcfsBvLDfM6k2ZacqwyMKaLLqigdBiGdJ7W+0lOStOQIDAQAB") | |
5 | 5 | ||
6 | 6 | let b = 4320 | |
7 | 7 | ||
8 | 8 | let c = ((100 * 1000) * 1000) | |
9 | 9 | ||
10 | 10 | let d = ((5 * c) / 1000) | |
11 | 11 | ||
12 | 12 | let e = (1 * c) | |
13 | 13 | ||
14 | 14 | let f = (2 * c) | |
15 | 15 | ||
16 | 16 | let g = (4 * c) | |
17 | 17 | ||
18 | 18 | let h = (8 * c) | |
19 | 19 | ||
20 | 20 | let i = (14 * c) | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = 10000 | |
23 | 23 | ||
24 | - | func k (l) = i | |
24 | + | let k = 39655 | |
25 | + | ||
26 | + | let l = 24600 | |
27 | + | ||
28 | + | let m = 19000 | |
29 | + | ||
30 | + | let n = 14200 | |
31 | + | ||
32 | + | let o = 11400 | |
33 | + | ||
34 | + | let p = "$GAME_NUM" | |
35 | + | ||
36 | + | let q = "$RESERVED_AMOUNT" | |
37 | + | ||
38 | + | let r = "SUBMITTED" | |
39 | + | ||
40 | + | let s = "WON" | |
41 | + | ||
42 | + | let t = "LOST" | |
43 | + | ||
44 | + | func u (v) = i | |
25 | 45 | ||
26 | 46 | ||
27 | - | func | |
28 | - | let | |
29 | - | if ( | |
47 | + | func w (x,y) = { | |
48 | + | let z = rsaVerify(SHA256, toBytes(x), y, a) | |
49 | + | if (z) | |
30 | 50 | then { | |
31 | - | let | |
32 | - | if ((0 > | |
33 | - | then (-1 * | |
34 | - | else | |
51 | + | let A = (toInt(sha256(y)) % 6) | |
52 | + | if ((0 > A)) | |
53 | + | then (-1 * A) | |
54 | + | else A | |
35 | 55 | } | |
36 | 56 | else throw("Invalid RSA signature") | |
37 | 57 | } | |
38 | 58 | ||
39 | 59 | ||
40 | - | func | |
41 | - | then drop( | |
42 | - | else | |
60 | + | func B (C) = if ((size(C) > 0)) | |
61 | + | then drop(C, 1) | |
62 | + | else C | |
43 | 63 | ||
44 | 64 | ||
45 | - | func | |
46 | - | let | |
47 | - | if (( | |
65 | + | func D (C) = { | |
66 | + | let E = size(C) | |
67 | + | if ((E > 0)) | |
48 | 68 | then { | |
49 | - | let | |
50 | - | let | |
51 | - | let | |
52 | - | let | |
53 | - | [ | |
69 | + | let F = parseIntValue(take(C, 2)) | |
70 | + | let G = take(drop(C, 2), F) | |
71 | + | let H = drop(C, (F + 2)) | |
72 | + | let I = B(H) | |
73 | + | [G, I] | |
54 | 74 | } | |
55 | 75 | else throw("Empty string was passed into parseNextAttribute func") | |
56 | 76 | } | |
57 | 77 | ||
58 | 78 | ||
59 | - | func | |
60 | - | let | |
61 | - | let | |
62 | - | let | |
63 | - | let | |
64 | - | let | |
65 | - | [ | |
79 | + | func J (K) = { | |
80 | + | let L = D(K) | |
81 | + | let v = D(L[1]) | |
82 | + | let M = D(v[1]) | |
83 | + | let N = D(M[1]) | |
84 | + | let O = D(N[1]) | |
85 | + | [L[0], v[0], M[0], N[0], O[0]] | |
66 | 86 | } | |
67 | 87 | ||
68 | 88 | ||
69 | - | func | |
70 | - | let | |
71 | - | let | |
72 | - | if ($isInstanceOf( | |
89 | + | func P (x) = { | |
90 | + | let Q = { | |
91 | + | let R = getString(this, x) | |
92 | + | if ($isInstanceOf(R, "String")) | |
73 | 93 | then { | |
74 | - | let | |
75 | - | | |
94 | + | let S = R | |
95 | + | S | |
76 | 96 | } | |
77 | - | else throw(("Couldn't find game by " + | |
97 | + | else throw(("Couldn't find game by " + x)) | |
78 | 98 | } | |
79 | - | | |
99 | + | J(Q) | |
80 | 100 | } | |
81 | 101 | ||
82 | 102 | ||
83 | - | func | |
84 | - | let | |
85 | - | if ($isInstanceOf( | |
103 | + | func T () = { | |
104 | + | let R = getInteger(this, q) | |
105 | + | if ($isInstanceOf(R, "Int")) | |
86 | 106 | then { | |
87 | - | let | |
88 | - | | |
107 | + | let U = R | |
108 | + | U | |
89 | 109 | } | |
90 | 110 | else 0 | |
91 | 111 | } | |
92 | 112 | ||
93 | 113 | ||
94 | - | @Callable(L) | |
95 | - | func bet (l) = { | |
96 | - | let M = toBase58String(L.caller.bytes) | |
97 | - | let N = k(l) | |
98 | - | let O = L.payment | |
99 | - | let P = wavesBalance(this) | |
100 | - | let Q = [DataEntry((M + " это Ставка Игрока"), l), DataEntry("Ответ Сервера", N), DataEntry("Текущий баланс игры", P), DataEntry("Номер текущего блока", height), DataEntry("Bytes блокчейн игры", this.bytes)] | |
101 | - | let R = Address(L.caller.bytes) | |
102 | - | let S = [ScriptTransfer(R, 10, unit)] | |
103 | - | ScriptResult(WriteSet(Q), TransferSet(S)) | |
114 | + | func V (O) = { | |
115 | + | let W = (T() + O) | |
116 | + | let X = wavesBalance(this) | |
117 | + | if ((W > X)) | |
118 | + | then throw("Insufficient funds on Russian Roulette account. Transaction was rejected for your safety.") | |
119 | + | else W | |
104 | 120 | } | |
105 | 121 | ||
106 | 122 | ||
107 | - | ||
108 | - | @Callable(L) | |
109 | - | func withdraw (O) = { | |
110 | - | let T = toBase58String(L.caller.bytes) | |
111 | - | let U = { | |
112 | - | let H = getInteger(this, T) | |
113 | - | if ($isInstanceOf(H, "Int")) | |
123 | + | func Y () = { | |
124 | + | let Z = { | |
125 | + | let R = getInteger(this, p) | |
126 | + | if ($isInstanceOf(R, "Int")) | |
114 | 127 | then { | |
115 | - | let | |
116 | - | | |
128 | + | let aa = R | |
129 | + | aa | |
117 | 130 | } | |
118 | 131 | else 0 | |
119 | 132 | } | |
120 | - | let V = (U - O) | |
121 | - | if ((0 > O)) | |
122 | - | then throw("Can't withdraw negative amount") | |
123 | - | else if ((0 > V)) | |
124 | - | then throw("Not enough balance") | |
125 | - | else ScriptResult(WriteSet([DataEntry(T, V)]), TransferSet([ScriptTransfer(L.caller, O, unit)])) | |
133 | + | (Z + 1) | |
126 | 134 | } | |
127 | 135 | ||
128 | 136 | ||
129 | - | @Verifier(W) | |
130 | - | func X () = if (sigVerify(W.bodyBytes, W.proofs[0], W.senderPublicKey)) | |
131 | - | then { | |
132 | - | let H = W | |
133 | - | if ($isInstanceOf(H, "TransferTransaction")) | |
134 | - | then { | |
135 | - | let Y = H | |
136 | - | ((wavesBalance(this) - Y.amount) >= J()) | |
137 | - | } | |
138 | - | else if ($isInstanceOf(H, "SetScriptTransaction")) | |
139 | - | then { | |
140 | - | let Z = H | |
141 | - | true | |
137 | + | func ab (ac) = { | |
138 | + | let E = size(ac) | |
139 | + | if ((E == 0)) | |
140 | + | then throw("Parameter size must be greater then 0") | |
141 | + | else if ((E > 99)) | |
142 | + | then throw("Parameter size must be less then 100") | |
143 | + | else if ((10 > E)) | |
144 | + | then (("0" + toString(E)) + ac) | |
145 | + | else (toString(E) + ac) | |
146 | + | } | |
147 | + | ||
148 | + | ||
149 | + | func ad (L,v,M,N,O,ae) = { | |
150 | + | let af = ((((((((ab(L) + "_") + ab(v)) + "_") + ab(M)) + "_") + ab(toString(N))) + "_") + ab(toString(O))) | |
151 | + | if ((ae == "")) | |
152 | + | then af | |
153 | + | else ((af + "_") + ab(ae)) | |
154 | + | } | |
155 | + | ||
156 | + | ||
157 | + | func ag (ah,v) = { | |
158 | + | let ai = if (if (if (if (if ((ah == (e + d))) | |
159 | + | then true | |
160 | + | else (ah == (f + d))) | |
161 | + | then true | |
162 | + | else (ah == (g + d))) | |
163 | + | then true | |
164 | + | else (ah == (h + d))) | |
165 | + | then true | |
166 | + | else (ah == (i + d))) | |
167 | + | then true | |
168 | + | else false | |
169 | + | if (ai) | |
170 | + | then { | |
171 | + | let aj = size(v) | |
172 | + | let ak = (ah - d) | |
173 | + | if ((aj == 5)) | |
174 | + | then ((ak * k) / j) | |
175 | + | else if ((aj == 4)) | |
176 | + | then ((ak * l) / j) | |
177 | + | else if ((aj == 3)) | |
178 | + | then ((ak * m) / j) | |
179 | + | else if ((aj == 2)) | |
180 | + | then ((ak * n) / j) | |
181 | + | else if ((aj == 1)) | |
182 | + | then ((ak * o) / j) | |
183 | + | else throw("Invalid bullets in player's choice") | |
184 | + | } | |
185 | + | else throw("Bet amount is not in range") | |
186 | + | } | |
187 | + | ||
188 | + | ||
189 | + | @Callable(al) | |
190 | + | func bet (v) = { | |
191 | + | let am = Y() | |
192 | + | let x = toBase58String(al.transactionId) | |
193 | + | let an = extract(al.payment) | |
194 | + | let ao = isDefined(an.assetId) | |
195 | + | let ap = isDefined(an.assetId) | |
196 | + | let O = ag(an.amount, v) | |
197 | + | let aq = isDefined(getString(this, x)) | |
198 | + | if (ao) | |
199 | + | then throw("Bet amount must be in Waves") | |
200 | + | else if (ap) | |
201 | + | then throw("Transaction's fee must be in Waves") | |
202 | + | else if (aq) | |
203 | + | then throw("Passed txId had been used before. Game aborted.") | |
204 | + | else { | |
205 | + | let M = toBase58String(al.callerPublicKey) | |
206 | + | let ar = ad(r, v, M, height, O, "") | |
207 | + | let as = addressFromPublicKey(al.callerPublicKey) | |
208 | + | let at = [ScriptTransfer(as, d, unit)] | |
209 | + | let au = [DataEntry(q, V(O)), DataEntry(p, am), DataEntry(x, ar)] | |
210 | + | ScriptResult(WriteSet(au), TransferSet(at)) | |
142 | 211 | } | |
143 | - | else false | |
144 | - | } | |
145 | - | else false | |
212 | + | } | |
213 | + | ||
146 | 214 |
github/deemru/w8io/169f3d6 115.00 ms ◑