tx · 71bAeZXJKHVw8VATmnqsfXWPbpJ8FsWr6j6swtPXvfHP 3N6yFJ5Z8NUUQvfGGMLp5efmevRRtTgQuun: -0.01400000 Waves 2019.09.17 04:06 [679543] smart account 3N6yFJ5Z8NUUQvfGGMLp5efmevRRtTgQuun > SELF 0.00000000 Waves
{ "type": 13, "id": "71bAeZXJKHVw8VATmnqsfXWPbpJ8FsWr6j6swtPXvfHP", "fee": 1400000, "feeAssetId": null, "timestamp": 1568682420856, "version": 1, "sender": "3N6yFJ5Z8NUUQvfGGMLp5efmevRRtTgQuun", "senderPublicKey": "7uRSDXQUkUS7719CDA4wXghhzsWrF22gb18FGDPZyA6P", "proofs": [ "4xZTjUqZ91fwu2XC6nfnAp4Ac8MM19iNntWdedoF1yBSETYfWmDS96PtyUfJjHP4AvvsyHVssAoFdkz4FFB2qwoo" ], "script": "base64:AAIDAAAAAAAAAAAAAAASAAAAAAlXaW5TZXJ2ZXIJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQIAAAAjM045WG55UHBXeFlvaEtIN3o1ZEV1cThycG5vYnB5elByekUAAAAAB1dBVkVMRVQJAABoAAAAAgkAAGgAAAACAAAAAAAAAABkAAAAAAAAAAPoAAAAAAAAAAPoAAAAAApDT01NSVNTSU9OCQAAaQAAAAIJAABoAAAAAgAAAAAAAAAABQUAAAAHV0FWRUxFVAAAAAAAAAAD6AAAAAAOVGlja2V0c1BlcldhdmUAAAAAAAAAAGQAAAAAC0NVUlJFTlRHQU1FAgAAAA0kQ1VSUkVOVF9HQU1FAAAAAA9HQU1FU0NPVU5URVJLRVkCAAAACSRHQU1FX05VTQAAAAAKTEFTVFRJQ0tFVAIAAAAMJExBU1RfVElDS0VUAAAAAARCQU5LAgAAAAokR0FNRV9CQU5LAQAAAA5nZXRQbGF5ZXJzTGlzdAAAAAIAAAAGZ2FtZUlkAAAADWN1cnJlbnRQbGF5ZXIEAAAAEHBsYXllcnNQcmVzZW50ZWQJAQAA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AASwAAAACBQAAAAZnYW1lSWQCAAAAAV8FAAAAEHBsYXllckFkZHJlc3NTdHICAAAACl9iZXRzQ291bnQJAABkAAAAAgkBAAAAEmdldFBsYXllckJldHNDb3VudAAAAAIFAAAABmdhbWVJZAUAAAAQcGxheWVyQWRkcmVzc1N0cgAAAAAAAAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgUAAAAGZ2FtZUlkAgAAAAFfBQAAABBwbGF5ZXJBZGRyZXNzU3RyAgAAAA1fdG90YWxCZXRzQW10BQAAABVuZXdUb3RhbFBsYXllckJldHNBbXQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAAGZ2FtZUlkAgAAAAhfcGxheWVycwkBAAAADmdldFBsYXllcnNMaXN0AAAAAgUAAAAGZ2FtZUlkBQAAABBwbGF5ZXJBZGRyZXNzU3RyCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgUAAAAGZ2FtZUlkAgAAAAFfBQAAAARCQU5LBQAAAA5uZXdCYW5rQmFsYW5jZQUAAAADbmlsBAAAAAt0b1dpblNlcnZlcgkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAlXaW5TZXJ2ZXIFAAAACnBheW1lbnRBbXQFAAAABHVuaXQFAAAAA25pbAkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEFAAAAB2JldERhdGEJAQAAAAtUcmFuc2ZlclNldAAAAAEFAAAAC3RvV2luU2VydmVyAAAAAAJmzWg=", "chainId": 84, "height": 679543, "spentComplexity": 0 } View: original | compacted Prev: 5Art3AvCP9Y6E6JTsguRqCBLVCh1Hem5XJrTdwnvF7g1 Next: 4UF2aAB8sUf8ueTmvxf7LGSBmdhBWR9G6W2JyaDU684m Diff:
Old | New | Differences | |
---|---|---|---|
146 | 146 | ||
147 | 147 | @Callable(R) | |
148 | 148 | func resetGameData (j) = { | |
149 | - | let S = toBase58String(R.callerPublicKey) | |
150 | - | let T = addressFromPublicKey(fromBase58String(S)) | |
151 | - | let p = toString(T) | |
152 | - | let U = [DataEntry(e, ""), DataEntry(f, 0), DataEntry((((j + "_") + p) + "_tickets"), ""), DataEntry((((j + "_") + p) + "_betsCount"), 0), DataEntry((((j + "_") + p) + "_totalBetsAmt"), 0), DataEntry(((j + "_") + h), 0), DataEntry((j + "_players"), ""), DataEntry(g, 0)] | |
153 | - | WriteSet(U) | |
149 | + | let S = [DataEntry(e, ""), DataEntry(g, 0)] | |
150 | + | WriteSet(S) | |
154 | 151 | } | |
155 | 152 | ||
156 | 153 | ||
160 | 157 | let H = toBase58String(R.transactionId) | |
161 | 158 | let j = L(H) | |
162 | 159 | let I = G(j, H) | |
163 | - | let | |
164 | - | let u = ( | |
165 | - | let | |
166 | - | let | |
167 | - | let | |
168 | - | let | |
169 | - | if ( | |
160 | + | let T = extract(R.payment) | |
161 | + | let u = (T.amount - c) | |
162 | + | let U = isDefined(T.assetId) | |
163 | + | let V = isDefined(T.assetId) | |
164 | + | let W = toBase58String(R.callerPublicKey) | |
165 | + | let X = addressFromPublicKey(fromBase58String(W)) | |
166 | + | if (U) | |
170 | 167 | then throw("Bet amount must be in Waves") | |
171 | - | else if ( | |
168 | + | else if (V) | |
172 | 169 | then throw("Transaction's fee must be in Waves") | |
173 | 170 | else { | |
174 | - | let p = toString( | |
171 | + | let p = toString(X) | |
175 | 172 | let Y = N(j, u) | |
176 | 173 | let Z = P(j, p, u) | |
177 | 174 | let aa = [DataEntry(e, j), DataEntry(f, I), DataEntry(g, F(u)), DataEntry((((j + "_") + p) + "_tickets"), t(j, p, u)), DataEntry((((j + "_") + p) + "_betsCount"), (o(j, p) + 1)), DataEntry((((j + "_") + p) + "_totalBetsAmt"), Z), DataEntry((j + "_players"), i(j, p)), DataEntry(((j + "_") + h), Y)] |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = addressFromStringValue("3N9XnyPpWxYohKH7z5dEuq8rpnobpyzPrzE") | |
5 | 5 | ||
6 | 6 | let b = ((100 * 1000) * 1000) | |
7 | 7 | ||
8 | 8 | let c = ((5 * b) / 1000) | |
9 | 9 | ||
10 | 10 | let d = 100 | |
11 | 11 | ||
12 | 12 | let e = "$CURRENT_GAME" | |
13 | 13 | ||
14 | 14 | let f = "$GAME_NUM" | |
15 | 15 | ||
16 | 16 | let g = "$LAST_TICKET" | |
17 | 17 | ||
18 | 18 | let h = "$GAME_BANK" | |
19 | 19 | ||
20 | 20 | func i (j,k) = { | |
21 | 21 | let l = isDefined(getString(this, (j + "_players"))) | |
22 | 22 | if (!(l)) | |
23 | 23 | then k | |
24 | 24 | else if (isDefined(getString(this, (((j + "_") + k) + "_tickets")))) | |
25 | 25 | then getStringValue(this, (j + "_players")) | |
26 | 26 | else ((getStringValue(this, (j + "_players")) + "_") + k) | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func m () = { | |
31 | 31 | let n = isDefined(getInteger(this, g)) | |
32 | 32 | if (!(n)) | |
33 | 33 | then 0 | |
34 | 34 | else getIntegerValue(this, g) | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func o (j,p) = { | |
39 | 39 | let q = { | |
40 | 40 | let r = getInteger(this, (((j + "_") + p) + "_betsCount")) | |
41 | 41 | if ($isInstanceOf(r, "Int")) | |
42 | 42 | then { | |
43 | 43 | let s = r | |
44 | 44 | s | |
45 | 45 | } | |
46 | 46 | else 0 | |
47 | 47 | } | |
48 | 48 | q | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func t (j,p,u) = { | |
53 | 53 | let v = m() | |
54 | 54 | let w = (u / b) | |
55 | 55 | let x = (v + 1) | |
56 | 56 | let y = ((x + (w * d)) - 1) | |
57 | 57 | let z = toString(x) | |
58 | 58 | let A = toString(y) | |
59 | 59 | let B = isDefined(getString(this, (((j + "_") + p) + "_tickets"))) | |
60 | 60 | if (B) | |
61 | 61 | then { | |
62 | 62 | let C = getStringValue(this, (((j + "_") + p) + "_tickets")) | |
63 | 63 | let D = o(j, p) | |
64 | 64 | let E = split(C, "_") | |
65 | 65 | if ((D == 1)) | |
66 | 66 | then (((((((E[0] + "_") + E[1]) + "_") + z) + "_") + A) + "_0_0_0_0") | |
67 | 67 | else if ((D == 2)) | |
68 | 68 | then (((((((((((E[0] + "_") + E[1]) + "_") + E[2]) + "_") + E[3]) + "_") + z) + "_") + A) + "_0_0") | |
69 | 69 | else if ((D == 3)) | |
70 | 70 | then ((((((((((((((E[0] + "_") + E[1]) + "_") + E[2]) + "_") + E[3]) + "_") + E[4]) + "_") + E[5]) + "_") + z) + "_") + A) | |
71 | 71 | else throw("Error, bid limit exceeded") | |
72 | 72 | } | |
73 | 73 | else (((z + "_") + A) + "_0_0_0_0_0_0") | |
74 | 74 | } | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func F (u) = { | |
78 | 78 | let v = m() | |
79 | 79 | let w = (u / b) | |
80 | 80 | (v + (w * d)) | |
81 | 81 | } | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func G (j,H) = { | |
85 | 85 | let I = { | |
86 | 86 | let r = getInteger(this, f) | |
87 | 87 | if ($isInstanceOf(r, "Int")) | |
88 | 88 | then { | |
89 | 89 | let s = r | |
90 | 90 | s | |
91 | 91 | } | |
92 | 92 | else 0 | |
93 | 93 | } | |
94 | 94 | if ((j == H)) | |
95 | 95 | then (I + 1) | |
96 | 96 | else I | |
97 | 97 | } | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func J (H) = { | |
101 | 101 | let K = isDefined(getString(this, e)) | |
102 | 102 | if (!(K)) | |
103 | 103 | then H | |
104 | 104 | else if ((getStringValue(this, e) == "")) | |
105 | 105 | then H | |
106 | 106 | else getStringValue(this, e) | |
107 | 107 | } | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func L (H) = { | |
111 | 111 | let j = J(H) | |
112 | 112 | let M = isDefined(getString(this, (j + "_result"))) | |
113 | 113 | if (M) | |
114 | 114 | then H | |
115 | 115 | else j | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func N (j,u) = { | |
120 | 120 | let O = { | |
121 | 121 | let r = getInteger(this, ((j + "_") + h)) | |
122 | 122 | if ($isInstanceOf(r, "Int")) | |
123 | 123 | then { | |
124 | 124 | let s = r | |
125 | 125 | s | |
126 | 126 | } | |
127 | 127 | else 0 | |
128 | 128 | } | |
129 | 129 | (O + u) | |
130 | 130 | } | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func P (j,p,u) = { | |
134 | 134 | let Q = { | |
135 | 135 | let r = getInteger(this, (((j + "_") + p) + "_totalBetsAmt")) | |
136 | 136 | if ($isInstanceOf(r, "Int")) | |
137 | 137 | then { | |
138 | 138 | let s = r | |
139 | 139 | s | |
140 | 140 | } | |
141 | 141 | else 0 | |
142 | 142 | } | |
143 | 143 | (Q + u) | |
144 | 144 | } | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | @Callable(R) | |
148 | 148 | func resetGameData (j) = { | |
149 | - | let S = toBase58String(R.callerPublicKey) | |
150 | - | let T = addressFromPublicKey(fromBase58String(S)) | |
151 | - | let p = toString(T) | |
152 | - | let U = [DataEntry(e, ""), DataEntry(f, 0), DataEntry((((j + "_") + p) + "_tickets"), ""), DataEntry((((j + "_") + p) + "_betsCount"), 0), DataEntry((((j + "_") + p) + "_totalBetsAmt"), 0), DataEntry(((j + "_") + h), 0), DataEntry((j + "_players"), ""), DataEntry(g, 0)] | |
153 | - | WriteSet(U) | |
149 | + | let S = [DataEntry(e, ""), DataEntry(g, 0)] | |
150 | + | WriteSet(S) | |
154 | 151 | } | |
155 | 152 | ||
156 | 153 | ||
157 | 154 | ||
158 | 155 | @Callable(R) | |
159 | 156 | func bet () = { | |
160 | 157 | let H = toBase58String(R.transactionId) | |
161 | 158 | let j = L(H) | |
162 | 159 | let I = G(j, H) | |
163 | - | let | |
164 | - | let u = ( | |
165 | - | let | |
166 | - | let | |
167 | - | let | |
168 | - | let | |
169 | - | if ( | |
160 | + | let T = extract(R.payment) | |
161 | + | let u = (T.amount - c) | |
162 | + | let U = isDefined(T.assetId) | |
163 | + | let V = isDefined(T.assetId) | |
164 | + | let W = toBase58String(R.callerPublicKey) | |
165 | + | let X = addressFromPublicKey(fromBase58String(W)) | |
166 | + | if (U) | |
170 | 167 | then throw("Bet amount must be in Waves") | |
171 | - | else if ( | |
168 | + | else if (V) | |
172 | 169 | then throw("Transaction's fee must be in Waves") | |
173 | 170 | else { | |
174 | - | let p = toString( | |
171 | + | let p = toString(X) | |
175 | 172 | let Y = N(j, u) | |
176 | 173 | let Z = P(j, p, u) | |
177 | 174 | let aa = [DataEntry(e, j), DataEntry(f, I), DataEntry(g, F(u)), DataEntry((((j + "_") + p) + "_tickets"), t(j, p, u)), DataEntry((((j + "_") + p) + "_betsCount"), (o(j, p) + 1)), DataEntry((((j + "_") + p) + "_totalBetsAmt"), Z), DataEntry((j + "_players"), i(j, p)), DataEntry(((j + "_") + h), Y)] | |
178 | 175 | let ab = [ScriptTransfer(a, u, unit)] | |
179 | 176 | ScriptResult(WriteSet(aa), TransferSet(ab)) | |
180 | 177 | } | |
181 | 178 | } | |
182 | 179 | ||
183 | 180 |
github/deemru/w8io/026f985 33.24 ms ◑