tx · DLxWEvxiwsUidWEArdj6diuL3GM88UxGnfEoHdM4jDsh 3NAxsbHxS63azdAicVvLGsxjAQ9DsK6L4NL: -0.01400000 Waves 2019.08.23 18:20 [643952] smart account 3NAxsbHxS63azdAicVvLGsxjAQ9DsK6L4NL > SELF 0.00000000 Waves
{ "type": 13, "id": "DLxWEvxiwsUidWEArdj6diuL3GM88UxGnfEoHdM4jDsh", "fee": 1400000, "feeAssetId": null, "timestamp": 1566573607315, "version": 1, "sender": "3NAxsbHxS63azdAicVvLGsxjAQ9DsK6L4NL", "senderPublicKey": "FbEMepLNcZb6VBpsH5JJg4j43UEV27dMRqv1Pq6JFLgy", "proofs": [ "43PxVPkNRuTMeVNBfXq5y528FCMZCurWXznB48HeS1kMnCJmmW4iy36zkmV8x6AGNcSiwPUyKg3LvkndB5eXVWaS" ], "script": "base64:AAIDAAAAAAAAAAAAAAAUAAAAAApiZXRBc3NldElkAQAAACAea7QCZF/XAXMBPEnDQ5kqHUHyOfWmXu9KHDHL6zcNNwAAAAAGbWF4RmVlAAAAAAAATEtAAAAAAAZtaW5CZXQAAAAAAABMS0AAAAAAD21pbk1hdGNoTm9taW5hbAAAAAAAAExLQAAAAAAGbGV2ZWwxAAAAAAAAAAD6AAAAAAZsZXZlbDIAAAAAAAAAAJYAAAAABmxldmVsMwAAAAAAAAAAZAAAAAAIY2FzaEJhY2sAAAAAAAAAAfQAAAAACHRvdGFsUmVmAAAAAAAAAAAKAAAAAA1jaGFuZ2VBZGRyZXNzAgAAACMzTkF4c2JIeFM2M2F6ZEFpY1Z2TEdzeGpBUTlEc0s2TDROTAAAAAALbWluV2l0aGRyYXcAAAAAAAAPQkABAAAAE2dldENhbGxlckJ5RGVsZWdhdGUAAAACAAAAAWkAAAAIZnVuY3Rpb24EAAAABmNhbGxlcgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAxjYWxsZXJQcmVmaXgJAAEsAAAAAgIAAAAJZGVsZWdhdGVfB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: 65XvzpAzJNNnLF7vxdtD65GvYvbM7CoHtzzBqvJSGHJe Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | ||
10 | 10 | let d = 5000000 | |
11 | 11 | ||
12 | - | let e = | |
12 | + | let e = 250 | |
13 | 13 | ||
14 | - | let f = | |
14 | + | let f = 150 | |
15 | 15 | ||
16 | - | let g = | |
16 | + | let g = 100 | |
17 | 17 | ||
18 | - | let h = | |
18 | + | let h = 500 | |
19 | 19 | ||
20 | - | let i = | |
20 | + | let i = 10 | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = "3NAxsbHxS63azdAicVvLGsxjAQ9DsK6L4NL" | |
23 | 23 | ||
24 | - | func k (l,m) = { | |
25 | - | let n = toBase58String(l.caller.bytes) | |
26 | - | let o = ("delegate_" + n) | |
27 | - | if ((getBoolean(this, ((o + "_") + m)) == true)) | |
24 | + | let k = 1000000 | |
25 | + | ||
26 | + | func l (m,n) = { | |
27 | + | let o = toBase58String(m.caller.bytes) | |
28 | + | let p = ("delegate_" + o) | |
29 | + | if ((getBoolean(this, ((p + "_") + n)) == true)) | |
28 | 30 | then { | |
29 | - | let | |
30 | - | if ($isInstanceOf( | |
31 | + | let q = getString(this, (p + "_address")) | |
32 | + | if ($isInstanceOf(q, "String")) | |
31 | 33 | then { | |
32 | - | let | |
33 | - | | |
34 | + | let r = q | |
35 | + | r | |
34 | 36 | } | |
35 | - | else | |
37 | + | else o | |
36 | 38 | } | |
37 | - | else | |
39 | + | else o | |
38 | 40 | } | |
39 | 41 | ||
40 | 42 | ||
41 | - | func | |
43 | + | func s (m) = if ((m.fee > b)) | |
42 | 44 | then throw("unreasonable large fee") | |
43 | - | else if (( | |
45 | + | else if ((m.feeAssetId != unit)) | |
44 | 46 | then throw("fee must be in WAVES") | |
45 | 47 | else true | |
46 | 48 | ||
47 | 49 | ||
48 | - | func | |
49 | - | then if (if (( | |
50 | - | then isDefined( | |
50 | + | func t (m,u,v,w) = if (s(m)) | |
51 | + | then if (if ((v > 0)) | |
52 | + | then isDefined(w) | |
51 | 53 | else false) | |
52 | - | then ScriptResult( | |
53 | - | else ScriptResult( | |
54 | + | then ScriptResult(u, TransferSet([ScriptTransfer(m.caller, m.fee, unit), ScriptTransfer(extract(w), v, a)])) | |
55 | + | else ScriptResult(u, TransferSet([ScriptTransfer(m.caller, m.fee, unit)])) | |
54 | 56 | else throw("error") | |
55 | 57 | ||
56 | 58 | ||
57 | - | func | |
59 | + | func x (m,y) = (getString(this, (y + "_owner")) == toBase58String(m.caller.bytes)) | |
58 | 60 | ||
59 | 61 | ||
60 | - | func | |
62 | + | func z (y) = (extract(getInteger(this, (y + "_amount"))) - extract(getInteger(this, (y + "_spent")))) | |
61 | 63 | ||
62 | 64 | ||
63 | - | func | |
64 | - | let | |
65 | - | if (( | |
65 | + | func A (y) = { | |
66 | + | let B = getInteger(this, (y + "_defeat")) | |
67 | + | if ((B == 1)) | |
66 | 68 | then true | |
67 | - | else ( | |
69 | + | else (B == 3) | |
68 | 70 | } | |
69 | 71 | ||
70 | 72 | ||
71 | - | func | |
73 | + | func C (D) = getString(this, (D + "_referer")) | |
72 | 74 | ||
73 | 75 | ||
74 | - | func | |
75 | - | let | |
76 | - | DataEntry( | |
77 | - | let | |
78 | - | if ($isInstanceOf( | |
76 | + | func E (F,G) = { | |
77 | + | let H = (F + "_balance") | |
78 | + | DataEntry(H, (G + { | |
79 | + | let q = getInteger(this, H) | |
80 | + | if ($isInstanceOf(q, "Int")) | |
79 | 81 | then { | |
80 | - | let | |
81 | - | | |
82 | + | let I = q | |
83 | + | I | |
82 | 84 | } | |
83 | 85 | else 0 | |
84 | 86 | })) | |
85 | 87 | } | |
86 | 88 | ||
87 | 89 | ||
88 | - | func | |
90 | + | func J (F,K,G,L,M,N) = DataEntry(((("fund_" + F) + "_") + M), ((((((K + ":") + toString(G)) + ":") + L) + ":") + N)) | |
89 | 91 | ||
90 | 92 | ||
91 | - | @Callable( | |
92 | - | func bet ( | |
93 | - | let | |
94 | - | let | |
95 | - | if (( | |
93 | + | @Callable(m) | |
94 | + | func bet (O,P,Q,R) = { | |
95 | + | let K = toBase58String(m.caller.bytes) | |
96 | + | let S = extract(m.payment) | |
97 | + | if ((S.assetId != a)) | |
96 | 98 | then throw(("bet must be in asset " + toBase58String(a))) | |
97 | - | else if ((c > | |
99 | + | else if ((c > S.amount)) | |
98 | 100 | then throw(("minimum allowed bet is " + toString(c))) | |
99 | - | else if (if (( | |
100 | - | then ( | |
101 | + | else if (if ((Q != "for")) | |
102 | + | then (Q != "against") | |
101 | 103 | else false) | |
102 | 104 | then throw("unexpected side") | |
103 | 105 | else { | |
104 | - | let | |
105 | - | let | |
106 | - | let | |
107 | - | let | |
108 | - | if ($isInstanceOf( | |
106 | + | let y = (((((("bet_" + O) + "_") + toBase58String(m.caller.bytes)) + "_") + take(toBase58String(m.transactionId), 15)) + "_") | |
107 | + | let T = ((("seq_" + O) + "_") + P) | |
108 | + | let U = { | |
109 | + | let q = getInteger(this, T) | |
110 | + | if ($isInstanceOf(q, "Int")) | |
109 | 111 | then { | |
110 | - | let | |
111 | - | ( | |
112 | + | let V = q | |
113 | + | (V + 1) | |
112 | 114 | } | |
113 | 115 | else 1 | |
114 | 116 | } | |
115 | - | | |
117 | + | t(m, WriteSet([DataEntry((y + "owner"), K), DataEntry((y + "event"), O), DataEntry((y + "subevent"), P), DataEntry((y + "side"), Q), DataEntry((y + "odds"), R), DataEntry((y + "amount"), S.amount), DataEntry((y + "spent"), 0), DataEntry((y + "timestamp"), lastBlock.timestamp), DataEntry((y + "sequence"), U), DataEntry(T, U)]), 0, unit) | |
116 | 118 | } | |
117 | 119 | } | |
118 | 120 | ||
119 | 121 | ||
120 | 122 | ||
121 | - | @Callable( | |
122 | - | func cancel ( | |
123 | + | @Callable(m) | |
124 | + | func cancel (y) = if ((getString(this, (y + "_owner")) != l(m, "autocancel"))) | |
123 | 125 | then throw("must be owner or its delegate to cancel") | |
124 | 126 | else { | |
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | | |
127 | + | let v = extract(getInteger(this, (y + "_amount"))) | |
128 | + | let W = extract(getInteger(this, (y + "_spent"))) | |
129 | + | let X = (v - W) | |
130 | + | t(m, WriteSet([DataEntry((y + "_spent"), v), DataEntry((y + "_cancel_amount"), X), DataEntry((y + "_cancel_tx"), toBase58String(m.transactionId))]), X, m.caller) | |
129 | 131 | } | |
130 | 132 | ||
131 | 133 | ||
132 | 134 | ||
133 | - | @Callable( | |
134 | - | func betMatch ( | |
135 | + | @Callable(m) | |
136 | + | func betMatch (Y,Z) = if ((getString(this, (Y + "_event")) != getString(this, (Z + "_event")))) | |
135 | 137 | then throw("event id must match") | |
136 | - | else if ((getString(this, ( | |
138 | + | else if ((getString(this, (Y + "_subevent")) != getString(this, (Z + "_subevent")))) | |
137 | 139 | then throw("subevent id must match") | |
138 | - | else if ((getString(this, ( | |
140 | + | else if ((getString(this, (Y + "_side")) != "for")) | |
139 | 141 | then throw("invalid *for* bet") | |
140 | - | else if ((getString(this, ( | |
142 | + | else if ((getString(this, (Z + "_side")) != "against")) | |
141 | 143 | then throw("invalid *against* bet") | |
142 | 144 | else { | |
143 | - | let Z = getStringValue(this, (X + "_owner")) | |
144 | 145 | let aa = getStringValue(this, (Y + "_owner")) | |
145 | - | let ab = extract(getString(this, (X + "_event"))) | |
146 | - | let ac = (((((((("match_" + ab) + "_") + takeRight(Z, 10)) + "_") + takeRight(aa, 10)) + "_") + toBase58String(l.transactionId)) + "_") | |
147 | - | let Q = extract(getInteger(this, (X + "_odds"))) | |
148 | - | let ad = y(X) | |
149 | - | let ae = y(Y) | |
150 | - | let af = ad | |
151 | - | let ag = ((ae * 100) / (Q - 100)) | |
152 | - | let ah = if ((af > ag)) | |
153 | - | then ag | |
154 | - | else af | |
155 | - | if ((d > ah)) | |
146 | + | let ab = getStringValue(this, (Z + "_owner")) | |
147 | + | let ac = extract(getString(this, (Y + "_event"))) | |
148 | + | let ad = (((((((("match_" + ac) + "_") + takeRight(aa, 10)) + "_") + takeRight(ab, 10)) + "_") + toBase58String(m.transactionId)) + "_") | |
149 | + | let R = extract(getInteger(this, (Y + "_odds"))) | |
150 | + | let ae = z(Y) | |
151 | + | let af = z(Z) | |
152 | + | let ag = ae | |
153 | + | let ah = ((af * 100) / (R - 100)) | |
154 | + | let ai = if ((ag > ah)) | |
155 | + | then ah | |
156 | + | else ag | |
157 | + | if ((d > ai)) | |
156 | 158 | then throw("match nominal too low") | |
157 | 159 | else { | |
158 | - | let ai = ah | |
159 | - | let aj = ((ah * (Q - 100)) / 100) | |
160 | - | let ak = (ai + extract(getInteger(this, (X + "_spent")))) | |
160 | + | let aj = ai | |
161 | + | let ak = ((ai * (R - 100)) / 100) | |
161 | 162 | let al = (aj + extract(getInteger(this, (Y + "_spent")))) | |
162 | - | if ((ak > extract(getInteger(this, (X + "_amount"))))) | |
163 | + | let am = (ak + extract(getInteger(this, (Z + "_spent")))) | |
164 | + | if ((al > extract(getInteger(this, (Y + "_amount"))))) | |
163 | 165 | then throw("invalid match") | |
164 | - | else if (( | |
166 | + | else if ((am > extract(getInteger(this, (Z + "_amount"))))) | |
165 | 167 | then throw("invalid match") | |
166 | - | else | |
168 | + | else t(m, WriteSet([DataEntry((ad + "amount"), (aj + ak)), DataEntry((ad + "for"), Y), DataEntry((ad + "against"), Z), DataEntry((Y + "_spent"), al), DataEntry((Z + "_spent"), am)]), 0, unit) | |
167 | 169 | } | |
168 | 170 | } | |
169 | 171 | ||
170 | 172 | ||
171 | 173 | ||
172 | - | @Callable( | |
173 | - | func approveDefeat ( | |
174 | - | then ( | |
174 | + | @Callable(m) | |
175 | + | func approveDefeat (an,ao) = if (if (isDefined(getInteger(this, (an + "_defeat")))) | |
176 | + | then (ao == 2) | |
175 | 177 | else false) | |
176 | 178 | then throw("can't dispute after approve") | |
177 | - | else if ((getString(this, ( | |
179 | + | else if ((getString(this, (an + "_owner")) != l(m, "autoapprove"))) | |
178 | 180 | then throw("must be owner or its delegate to approve") | |
179 | - | else | |
181 | + | else t(m, WriteSet([DataEntry((an + "_defeat"), ao)]), 0, unit) | |
180 | 182 | ||
181 | 183 | ||
182 | 184 | ||
183 | - | @Callable( | |
184 | - | func payWinner ( | |
185 | + | @Callable(m) | |
186 | + | func payWinner (ap) = if (!(s(m))) | |
185 | 187 | then throw("error") | |
186 | - | else if (isDefined(getInteger(this, ( | |
188 | + | else if (isDefined(getInteger(this, (ap + "_paid")))) | |
187 | 189 | then throw("already paid") | |
188 | 190 | else { | |
189 | - | let | |
190 | - | let | |
191 | - | let | |
192 | - | let | |
193 | - | if (if (!( | |
194 | - | then !( | |
191 | + | let aq = extract(getString(this, (ap + "_for"))) | |
192 | + | let ar = extract(getString(this, (ap + "_against"))) | |
193 | + | let as = A(aq) | |
194 | + | let at = A(ar) | |
195 | + | if (if (!(as)) | |
196 | + | then !(at) | |
195 | 197 | else false) | |
196 | 198 | then throw("no side approved defeat") | |
197 | 199 | else { | |
198 | - | let at = if (ar) | |
199 | - | then aq | |
200 | - | else ap | |
201 | - | let au = getStringValue(this, (at + "_owner")) | |
202 | - | let u = extract(getInteger(this, (ao + "_amount"))) | |
203 | - | let av = toBase58String(l.transactionId) | |
204 | - | let M = toString(lastBlock.timestamp) | |
200 | + | let au = if (as) | |
201 | + | then ar | |
202 | + | else aq | |
203 | + | let av = getStringValue(this, (au + "_owner")) | |
204 | + | let v = extract(getInteger(this, (ap + "_amount"))) | |
205 | + | let aw = toBase58String(m.transactionId) | |
206 | + | let N = toString(lastBlock.timestamp) | |
207 | + | let ax = ((v * i) / 1000) | |
205 | 208 | ScriptResult(WriteSet({ | |
206 | - | let | |
207 | - | if ($isInstanceOf( | |
209 | + | let q = C(av) | |
210 | + | if ($isInstanceOf(q, "String")) | |
208 | 211 | then { | |
209 | - | let | |
210 | - | let | |
211 | - | let | |
212 | - | [DataEntry(( | |
213 | - | let | |
214 | - | if ($isInstanceOf( | |
212 | + | let ay = q | |
213 | + | let az = ((ax * e) / 1000) | |
214 | + | let aA = ((ax * h) / 1000) | |
215 | + | [DataEntry((ap + "_paid"), toBase58String(m.transactionId)), E(av, aA), J(av, av, aA, "cashback", aw, N), E(ay, az), J(ay, av, az, "l1", aw, N), { | |
216 | + | let aB = C(ay) | |
217 | + | if ($isInstanceOf(aB, "String")) | |
215 | 218 | then { | |
216 | - | let | |
217 | - | let | |
218 | - | [ | |
219 | - | let | |
220 | - | if ($isInstanceOf( | |
219 | + | let aC = aB | |
220 | + | let aD = ((ax * f) / 1000) | |
221 | + | [E(aC, aD), J(aC, av, aD, "l2", aw, N), { | |
222 | + | let aE = C(aC) | |
223 | + | if ($isInstanceOf(aE, "String")) | |
221 | 224 | then { | |
222 | - | let | |
223 | - | let | |
224 | - | [ | |
225 | + | let aF = aE | |
226 | + | let aG = ((ax * g) / 1000) | |
227 | + | [E(aF, aG), J(aF, av, aG, "l3", aw, N), E(j, (((ax - az) - aD) - aG)), J(j, av, (((ax - az) - aD) - aG), "change", aw, N)] | |
225 | 228 | } | |
226 | - | else [ | |
229 | + | else [E(j, ((ax - az) - aD)), J(j, av, ((ax - az) - aD), "change", aw, N)] | |
227 | 230 | }] | |
228 | 231 | } | |
229 | - | else [ | |
232 | + | else [E(j, (ax - az)), J(j, av, (ax - az), "change", aw, N)] | |
230 | 233 | }] | |
231 | 234 | } | |
232 | - | else [ | |
233 | - | }), TransferSet([ScriptTransfer( | |
235 | + | else [E(j, ax), J(j, av, ax, "change", aw, N)] | |
236 | + | }), TransferSet([ScriptTransfer(m.caller, m.fee, unit), ScriptTransfer(addressFromStringValue(av), (v - ax), a)])) | |
234 | 237 | } | |
235 | 238 | } | |
236 | 239 | ||
237 | 240 | ||
238 | 241 | ||
239 | - | @Callable( | |
240 | - | func delegate ( | |
242 | + | @Callable(m) | |
243 | + | func delegate (aH,aI,aJ) = t(m, WriteSet([DataEntry((("delegate_" + aH) + "_address"), toBase58String(m.caller.bytes)), DataEntry((("delegate_" + aH) + "_autoapprove"), aI), DataEntry((("delegate_" + aH) + "_autocancel"), aJ)]), 0, unit) | |
241 | 244 | ||
242 | 245 | ||
243 | 246 | ||
244 | - | @Callable( | |
245 | - | func withdraw () = if (!( | |
247 | + | @Callable(m) | |
248 | + | func withdraw () = if (!(s(m))) | |
246 | 249 | then throw("error") | |
247 | 250 | else { | |
248 | - | let | |
249 | - | let | |
250 | - | let | |
251 | - | let | |
252 | - | let | |
253 | - | if ($isInstanceOf( | |
251 | + | let K = toBase58String(m.caller.bytes) | |
252 | + | let aw = toBase58String(m.transactionId) | |
253 | + | let H = (K + "_balance") | |
254 | + | let v = { | |
255 | + | let q = getInteger(this, H) | |
256 | + | if ($isInstanceOf(q, "Int")) | |
254 | 257 | then { | |
255 | - | let | |
256 | - | | |
258 | + | let I = q | |
259 | + | I | |
257 | 260 | } | |
258 | 261 | else 0 | |
259 | 262 | } | |
260 | - | if (( | |
261 | - | then throw(("Min withdraw amount is" + toString( | |
262 | - | else ScriptResult(WriteSet([DataEntry( | |
263 | + | if ((k > v)) | |
264 | + | then throw(("Min withdraw amount is" + toString(k))) | |
265 | + | else ScriptResult(WriteSet([DataEntry(H, 0), DataEntry(((("withdraw_" + K) + "_") + aw), ((toString(v) + ":") + toString(lastBlock.timestamp)))]), TransferSet([ScriptTransfer(m.caller, (v + m.fee), unit)])) | |
263 | 266 | } | |
264 | 267 | ||
265 | 268 | ||
266 | 269 | ||
267 | - | @Callable( | |
268 | - | func register ( | |
270 | + | @Callable(m) | |
271 | + | func register (aK,aL) = if (!(s(m))) | |
269 | 272 | then throw("error") | |
270 | - | else if ((take(toBase58String( | |
273 | + | else if ((take(toBase58String(m.transactionId), 3) != "123")) | |
271 | 274 | then throw("proof of work failed") | |
272 | 275 | else { | |
273 | - | let | |
274 | - | if (isDefined( | |
276 | + | let K = toBase58String(m.caller.bytes) | |
277 | + | if (isDefined(C(K))) | |
275 | 278 | then throw("Already registered") | |
276 | - | else ScriptResult(WriteSet([DataEntry(( | |
279 | + | else ScriptResult(WriteSet([DataEntry((K + "_referer"), aK), DataEntry(((aK + "_referral_") + K), K)]), TransferSet([ScriptTransfer(m.caller, m.fee, unit)])) | |
277 | 280 | } | |
278 | 281 | ||
279 | 282 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'33kV5hRVtgEGpYqhp9wQn2g9hP1fNWSYGCzzYk1T9Hyg' | |
5 | 5 | ||
6 | 6 | let b = 5000000 | |
7 | 7 | ||
8 | 8 | let c = 5000000 | |
9 | 9 | ||
10 | 10 | let d = 5000000 | |
11 | 11 | ||
12 | - | let e = | |
12 | + | let e = 250 | |
13 | 13 | ||
14 | - | let f = | |
14 | + | let f = 150 | |
15 | 15 | ||
16 | - | let g = | |
16 | + | let g = 100 | |
17 | 17 | ||
18 | - | let h = | |
18 | + | let h = 500 | |
19 | 19 | ||
20 | - | let i = | |
20 | + | let i = 10 | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = "3NAxsbHxS63azdAicVvLGsxjAQ9DsK6L4NL" | |
23 | 23 | ||
24 | - | func k (l,m) = { | |
25 | - | let n = toBase58String(l.caller.bytes) | |
26 | - | let o = ("delegate_" + n) | |
27 | - | if ((getBoolean(this, ((o + "_") + m)) == true)) | |
24 | + | let k = 1000000 | |
25 | + | ||
26 | + | func l (m,n) = { | |
27 | + | let o = toBase58String(m.caller.bytes) | |
28 | + | let p = ("delegate_" + o) | |
29 | + | if ((getBoolean(this, ((p + "_") + n)) == true)) | |
28 | 30 | then { | |
29 | - | let | |
30 | - | if ($isInstanceOf( | |
31 | + | let q = getString(this, (p + "_address")) | |
32 | + | if ($isInstanceOf(q, "String")) | |
31 | 33 | then { | |
32 | - | let | |
33 | - | | |
34 | + | let r = q | |
35 | + | r | |
34 | 36 | } | |
35 | - | else | |
37 | + | else o | |
36 | 38 | } | |
37 | - | else | |
39 | + | else o | |
38 | 40 | } | |
39 | 41 | ||
40 | 42 | ||
41 | - | func | |
43 | + | func s (m) = if ((m.fee > b)) | |
42 | 44 | then throw("unreasonable large fee") | |
43 | - | else if (( | |
45 | + | else if ((m.feeAssetId != unit)) | |
44 | 46 | then throw("fee must be in WAVES") | |
45 | 47 | else true | |
46 | 48 | ||
47 | 49 | ||
48 | - | func | |
49 | - | then if (if (( | |
50 | - | then isDefined( | |
50 | + | func t (m,u,v,w) = if (s(m)) | |
51 | + | then if (if ((v > 0)) | |
52 | + | then isDefined(w) | |
51 | 53 | else false) | |
52 | - | then ScriptResult( | |
53 | - | else ScriptResult( | |
54 | + | then ScriptResult(u, TransferSet([ScriptTransfer(m.caller, m.fee, unit), ScriptTransfer(extract(w), v, a)])) | |
55 | + | else ScriptResult(u, TransferSet([ScriptTransfer(m.caller, m.fee, unit)])) | |
54 | 56 | else throw("error") | |
55 | 57 | ||
56 | 58 | ||
57 | - | func | |
59 | + | func x (m,y) = (getString(this, (y + "_owner")) == toBase58String(m.caller.bytes)) | |
58 | 60 | ||
59 | 61 | ||
60 | - | func | |
62 | + | func z (y) = (extract(getInteger(this, (y + "_amount"))) - extract(getInteger(this, (y + "_spent")))) | |
61 | 63 | ||
62 | 64 | ||
63 | - | func | |
64 | - | let | |
65 | - | if (( | |
65 | + | func A (y) = { | |
66 | + | let B = getInteger(this, (y + "_defeat")) | |
67 | + | if ((B == 1)) | |
66 | 68 | then true | |
67 | - | else ( | |
69 | + | else (B == 3) | |
68 | 70 | } | |
69 | 71 | ||
70 | 72 | ||
71 | - | func | |
73 | + | func C (D) = getString(this, (D + "_referer")) | |
72 | 74 | ||
73 | 75 | ||
74 | - | func | |
75 | - | let | |
76 | - | DataEntry( | |
77 | - | let | |
78 | - | if ($isInstanceOf( | |
76 | + | func E (F,G) = { | |
77 | + | let H = (F + "_balance") | |
78 | + | DataEntry(H, (G + { | |
79 | + | let q = getInteger(this, H) | |
80 | + | if ($isInstanceOf(q, "Int")) | |
79 | 81 | then { | |
80 | - | let | |
81 | - | | |
82 | + | let I = q | |
83 | + | I | |
82 | 84 | } | |
83 | 85 | else 0 | |
84 | 86 | })) | |
85 | 87 | } | |
86 | 88 | ||
87 | 89 | ||
88 | - | func | |
90 | + | func J (F,K,G,L,M,N) = DataEntry(((("fund_" + F) + "_") + M), ((((((K + ":") + toString(G)) + ":") + L) + ":") + N)) | |
89 | 91 | ||
90 | 92 | ||
91 | - | @Callable( | |
92 | - | func bet ( | |
93 | - | let | |
94 | - | let | |
95 | - | if (( | |
93 | + | @Callable(m) | |
94 | + | func bet (O,P,Q,R) = { | |
95 | + | let K = toBase58String(m.caller.bytes) | |
96 | + | let S = extract(m.payment) | |
97 | + | if ((S.assetId != a)) | |
96 | 98 | then throw(("bet must be in asset " + toBase58String(a))) | |
97 | - | else if ((c > | |
99 | + | else if ((c > S.amount)) | |
98 | 100 | then throw(("minimum allowed bet is " + toString(c))) | |
99 | - | else if (if (( | |
100 | - | then ( | |
101 | + | else if (if ((Q != "for")) | |
102 | + | then (Q != "against") | |
101 | 103 | else false) | |
102 | 104 | then throw("unexpected side") | |
103 | 105 | else { | |
104 | - | let | |
105 | - | let | |
106 | - | let | |
107 | - | let | |
108 | - | if ($isInstanceOf( | |
106 | + | let y = (((((("bet_" + O) + "_") + toBase58String(m.caller.bytes)) + "_") + take(toBase58String(m.transactionId), 15)) + "_") | |
107 | + | let T = ((("seq_" + O) + "_") + P) | |
108 | + | let U = { | |
109 | + | let q = getInteger(this, T) | |
110 | + | if ($isInstanceOf(q, "Int")) | |
109 | 111 | then { | |
110 | - | let | |
111 | - | ( | |
112 | + | let V = q | |
113 | + | (V + 1) | |
112 | 114 | } | |
113 | 115 | else 1 | |
114 | 116 | } | |
115 | - | | |
117 | + | t(m, WriteSet([DataEntry((y + "owner"), K), DataEntry((y + "event"), O), DataEntry((y + "subevent"), P), DataEntry((y + "side"), Q), DataEntry((y + "odds"), R), DataEntry((y + "amount"), S.amount), DataEntry((y + "spent"), 0), DataEntry((y + "timestamp"), lastBlock.timestamp), DataEntry((y + "sequence"), U), DataEntry(T, U)]), 0, unit) | |
116 | 118 | } | |
117 | 119 | } | |
118 | 120 | ||
119 | 121 | ||
120 | 122 | ||
121 | - | @Callable( | |
122 | - | func cancel ( | |
123 | + | @Callable(m) | |
124 | + | func cancel (y) = if ((getString(this, (y + "_owner")) != l(m, "autocancel"))) | |
123 | 125 | then throw("must be owner or its delegate to cancel") | |
124 | 126 | else { | |
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | | |
127 | + | let v = extract(getInteger(this, (y + "_amount"))) | |
128 | + | let W = extract(getInteger(this, (y + "_spent"))) | |
129 | + | let X = (v - W) | |
130 | + | t(m, WriteSet([DataEntry((y + "_spent"), v), DataEntry((y + "_cancel_amount"), X), DataEntry((y + "_cancel_tx"), toBase58String(m.transactionId))]), X, m.caller) | |
129 | 131 | } | |
130 | 132 | ||
131 | 133 | ||
132 | 134 | ||
133 | - | @Callable( | |
134 | - | func betMatch ( | |
135 | + | @Callable(m) | |
136 | + | func betMatch (Y,Z) = if ((getString(this, (Y + "_event")) != getString(this, (Z + "_event")))) | |
135 | 137 | then throw("event id must match") | |
136 | - | else if ((getString(this, ( | |
138 | + | else if ((getString(this, (Y + "_subevent")) != getString(this, (Z + "_subevent")))) | |
137 | 139 | then throw("subevent id must match") | |
138 | - | else if ((getString(this, ( | |
140 | + | else if ((getString(this, (Y + "_side")) != "for")) | |
139 | 141 | then throw("invalid *for* bet") | |
140 | - | else if ((getString(this, ( | |
142 | + | else if ((getString(this, (Z + "_side")) != "against")) | |
141 | 143 | then throw("invalid *against* bet") | |
142 | 144 | else { | |
143 | - | let Z = getStringValue(this, (X + "_owner")) | |
144 | 145 | let aa = getStringValue(this, (Y + "_owner")) | |
145 | - | let ab = extract(getString(this, (X + "_event"))) | |
146 | - | let ac = (((((((("match_" + ab) + "_") + takeRight(Z, 10)) + "_") + takeRight(aa, 10)) + "_") + toBase58String(l.transactionId)) + "_") | |
147 | - | let Q = extract(getInteger(this, (X + "_odds"))) | |
148 | - | let ad = y(X) | |
149 | - | let ae = y(Y) | |
150 | - | let af = ad | |
151 | - | let ag = ((ae * 100) / (Q - 100)) | |
152 | - | let ah = if ((af > ag)) | |
153 | - | then ag | |
154 | - | else af | |
155 | - | if ((d > ah)) | |
146 | + | let ab = getStringValue(this, (Z + "_owner")) | |
147 | + | let ac = extract(getString(this, (Y + "_event"))) | |
148 | + | let ad = (((((((("match_" + ac) + "_") + takeRight(aa, 10)) + "_") + takeRight(ab, 10)) + "_") + toBase58String(m.transactionId)) + "_") | |
149 | + | let R = extract(getInteger(this, (Y + "_odds"))) | |
150 | + | let ae = z(Y) | |
151 | + | let af = z(Z) | |
152 | + | let ag = ae | |
153 | + | let ah = ((af * 100) / (R - 100)) | |
154 | + | let ai = if ((ag > ah)) | |
155 | + | then ah | |
156 | + | else ag | |
157 | + | if ((d > ai)) | |
156 | 158 | then throw("match nominal too low") | |
157 | 159 | else { | |
158 | - | let ai = ah | |
159 | - | let aj = ((ah * (Q - 100)) / 100) | |
160 | - | let ak = (ai + extract(getInteger(this, (X + "_spent")))) | |
160 | + | let aj = ai | |
161 | + | let ak = ((ai * (R - 100)) / 100) | |
161 | 162 | let al = (aj + extract(getInteger(this, (Y + "_spent")))) | |
162 | - | if ((ak > extract(getInteger(this, (X + "_amount"))))) | |
163 | + | let am = (ak + extract(getInteger(this, (Z + "_spent")))) | |
164 | + | if ((al > extract(getInteger(this, (Y + "_amount"))))) | |
163 | 165 | then throw("invalid match") | |
164 | - | else if (( | |
166 | + | else if ((am > extract(getInteger(this, (Z + "_amount"))))) | |
165 | 167 | then throw("invalid match") | |
166 | - | else | |
168 | + | else t(m, WriteSet([DataEntry((ad + "amount"), (aj + ak)), DataEntry((ad + "for"), Y), DataEntry((ad + "against"), Z), DataEntry((Y + "_spent"), al), DataEntry((Z + "_spent"), am)]), 0, unit) | |
167 | 169 | } | |
168 | 170 | } | |
169 | 171 | ||
170 | 172 | ||
171 | 173 | ||
172 | - | @Callable( | |
173 | - | func approveDefeat ( | |
174 | - | then ( | |
174 | + | @Callable(m) | |
175 | + | func approveDefeat (an,ao) = if (if (isDefined(getInteger(this, (an + "_defeat")))) | |
176 | + | then (ao == 2) | |
175 | 177 | else false) | |
176 | 178 | then throw("can't dispute after approve") | |
177 | - | else if ((getString(this, ( | |
179 | + | else if ((getString(this, (an + "_owner")) != l(m, "autoapprove"))) | |
178 | 180 | then throw("must be owner or its delegate to approve") | |
179 | - | else | |
181 | + | else t(m, WriteSet([DataEntry((an + "_defeat"), ao)]), 0, unit) | |
180 | 182 | ||
181 | 183 | ||
182 | 184 | ||
183 | - | @Callable( | |
184 | - | func payWinner ( | |
185 | + | @Callable(m) | |
186 | + | func payWinner (ap) = if (!(s(m))) | |
185 | 187 | then throw("error") | |
186 | - | else if (isDefined(getInteger(this, ( | |
188 | + | else if (isDefined(getInteger(this, (ap + "_paid")))) | |
187 | 189 | then throw("already paid") | |
188 | 190 | else { | |
189 | - | let | |
190 | - | let | |
191 | - | let | |
192 | - | let | |
193 | - | if (if (!( | |
194 | - | then !( | |
191 | + | let aq = extract(getString(this, (ap + "_for"))) | |
192 | + | let ar = extract(getString(this, (ap + "_against"))) | |
193 | + | let as = A(aq) | |
194 | + | let at = A(ar) | |
195 | + | if (if (!(as)) | |
196 | + | then !(at) | |
195 | 197 | else false) | |
196 | 198 | then throw("no side approved defeat") | |
197 | 199 | else { | |
198 | - | let at = if (ar) | |
199 | - | then aq | |
200 | - | else ap | |
201 | - | let au = getStringValue(this, (at + "_owner")) | |
202 | - | let u = extract(getInteger(this, (ao + "_amount"))) | |
203 | - | let av = toBase58String(l.transactionId) | |
204 | - | let M = toString(lastBlock.timestamp) | |
200 | + | let au = if (as) | |
201 | + | then ar | |
202 | + | else aq | |
203 | + | let av = getStringValue(this, (au + "_owner")) | |
204 | + | let v = extract(getInteger(this, (ap + "_amount"))) | |
205 | + | let aw = toBase58String(m.transactionId) | |
206 | + | let N = toString(lastBlock.timestamp) | |
207 | + | let ax = ((v * i) / 1000) | |
205 | 208 | ScriptResult(WriteSet({ | |
206 | - | let | |
207 | - | if ($isInstanceOf( | |
209 | + | let q = C(av) | |
210 | + | if ($isInstanceOf(q, "String")) | |
208 | 211 | then { | |
209 | - | let | |
210 | - | let | |
211 | - | let | |
212 | - | [DataEntry(( | |
213 | - | let | |
214 | - | if ($isInstanceOf( | |
212 | + | let ay = q | |
213 | + | let az = ((ax * e) / 1000) | |
214 | + | let aA = ((ax * h) / 1000) | |
215 | + | [DataEntry((ap + "_paid"), toBase58String(m.transactionId)), E(av, aA), J(av, av, aA, "cashback", aw, N), E(ay, az), J(ay, av, az, "l1", aw, N), { | |
216 | + | let aB = C(ay) | |
217 | + | if ($isInstanceOf(aB, "String")) | |
215 | 218 | then { | |
216 | - | let | |
217 | - | let | |
218 | - | [ | |
219 | - | let | |
220 | - | if ($isInstanceOf( | |
219 | + | let aC = aB | |
220 | + | let aD = ((ax * f) / 1000) | |
221 | + | [E(aC, aD), J(aC, av, aD, "l2", aw, N), { | |
222 | + | let aE = C(aC) | |
223 | + | if ($isInstanceOf(aE, "String")) | |
221 | 224 | then { | |
222 | - | let | |
223 | - | let | |
224 | - | [ | |
225 | + | let aF = aE | |
226 | + | let aG = ((ax * g) / 1000) | |
227 | + | [E(aF, aG), J(aF, av, aG, "l3", aw, N), E(j, (((ax - az) - aD) - aG)), J(j, av, (((ax - az) - aD) - aG), "change", aw, N)] | |
225 | 228 | } | |
226 | - | else [ | |
229 | + | else [E(j, ((ax - az) - aD)), J(j, av, ((ax - az) - aD), "change", aw, N)] | |
227 | 230 | }] | |
228 | 231 | } | |
229 | - | else [ | |
232 | + | else [E(j, (ax - az)), J(j, av, (ax - az), "change", aw, N)] | |
230 | 233 | }] | |
231 | 234 | } | |
232 | - | else [ | |
233 | - | }), TransferSet([ScriptTransfer( | |
235 | + | else [E(j, ax), J(j, av, ax, "change", aw, N)] | |
236 | + | }), TransferSet([ScriptTransfer(m.caller, m.fee, unit), ScriptTransfer(addressFromStringValue(av), (v - ax), a)])) | |
234 | 237 | } | |
235 | 238 | } | |
236 | 239 | ||
237 | 240 | ||
238 | 241 | ||
239 | - | @Callable( | |
240 | - | func delegate ( | |
242 | + | @Callable(m) | |
243 | + | func delegate (aH,aI,aJ) = t(m, WriteSet([DataEntry((("delegate_" + aH) + "_address"), toBase58String(m.caller.bytes)), DataEntry((("delegate_" + aH) + "_autoapprove"), aI), DataEntry((("delegate_" + aH) + "_autocancel"), aJ)]), 0, unit) | |
241 | 244 | ||
242 | 245 | ||
243 | 246 | ||
244 | - | @Callable( | |
245 | - | func withdraw () = if (!( | |
247 | + | @Callable(m) | |
248 | + | func withdraw () = if (!(s(m))) | |
246 | 249 | then throw("error") | |
247 | 250 | else { | |
248 | - | let | |
249 | - | let | |
250 | - | let | |
251 | - | let | |
252 | - | let | |
253 | - | if ($isInstanceOf( | |
251 | + | let K = toBase58String(m.caller.bytes) | |
252 | + | let aw = toBase58String(m.transactionId) | |
253 | + | let H = (K + "_balance") | |
254 | + | let v = { | |
255 | + | let q = getInteger(this, H) | |
256 | + | if ($isInstanceOf(q, "Int")) | |
254 | 257 | then { | |
255 | - | let | |
256 | - | | |
258 | + | let I = q | |
259 | + | I | |
257 | 260 | } | |
258 | 261 | else 0 | |
259 | 262 | } | |
260 | - | if (( | |
261 | - | then throw(("Min withdraw amount is" + toString( | |
262 | - | else ScriptResult(WriteSet([DataEntry( | |
263 | + | if ((k > v)) | |
264 | + | then throw(("Min withdraw amount is" + toString(k))) | |
265 | + | else ScriptResult(WriteSet([DataEntry(H, 0), DataEntry(((("withdraw_" + K) + "_") + aw), ((toString(v) + ":") + toString(lastBlock.timestamp)))]), TransferSet([ScriptTransfer(m.caller, (v + m.fee), unit)])) | |
263 | 266 | } | |
264 | 267 | ||
265 | 268 | ||
266 | 269 | ||
267 | - | @Callable( | |
268 | - | func register ( | |
270 | + | @Callable(m) | |
271 | + | func register (aK,aL) = if (!(s(m))) | |
269 | 272 | then throw("error") | |
270 | - | else if ((take(toBase58String( | |
273 | + | else if ((take(toBase58String(m.transactionId), 3) != "123")) | |
271 | 274 | then throw("proof of work failed") | |
272 | 275 | else { | |
273 | - | let | |
274 | - | if (isDefined( | |
276 | + | let K = toBase58String(m.caller.bytes) | |
277 | + | if (isDefined(C(K))) | |
275 | 278 | then throw("Already registered") | |
276 | - | else ScriptResult(WriteSet([DataEntry(( | |
279 | + | else ScriptResult(WriteSet([DataEntry((K + "_referer"), aK), DataEntry(((aK + "_referral_") + K), K)]), TransferSet([ScriptTransfer(m.caller, m.fee, unit)])) | |
277 | 280 | } | |
278 | 281 | ||
279 | 282 |
github/deemru/w8io/169f3d6 130.81 ms ◑