tx · ECZ5ks2Fr6gQpWBaUuJRgsVuctmivBG5Fo9GK2Uc75kg 3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE: -0.01500000 Waves 2023.08.17 16:29 [2714656] smart account 3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE > SELF 0.00000000 Waves
{ "type": 13, "id": "ECZ5ks2Fr6gQpWBaUuJRgsVuctmivBG5Fo9GK2Uc75kg", "fee": 1500000, "feeAssetId": null, "timestamp": 1692279033196, "version": 2, "chainId": 84, "sender": "3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE", "senderPublicKey": "G349Uq3FTox7dRNLeAfAQeoACvwZ9iEnVSaHcEYn6j8J", "proofs": [ "4qhYeHm8QWkdWzGeBEqFxBxqhjchupmdpK6JaxKvbALN3ELCgCxaTiU6ZDEgF8phhq5ZbcL3sj5VG5E6Gz6eZLmm" ], "script": "base64:BgKMFggCEgQKAgIBEgYKBAEYEQESBAoCCAESABIAEgMKAQgSABIECgIYERIAEgMKAQgiA1NFUCIFU0NBTEUiBU1VTFQ4IgdNVUxUOEJJIgp6ZXJvQmlnSW50IhRwcm9jZXNzaW5nU3RhZ2VUb3RhbCIVcHJvY2Vzc2luZ1N0YWdlU2hhcmVzIgZNVUxUMTgiCE1VTFQxOEJJIgt3YXZlc1N0cmluZyIHd3JhcEVyciIDbXNnIgh0aHJvd0VyciIOZ2V0TnVtYmVyQnlLZXkiA2tleSIPZ2V0TnVtYmVyT3JGYWlsIg5nZXRTdHJpbmdCeUtleSIPZ2V0U3RyaW5nT3JGYWlsIgxwYXJzZUFzc2V0SWQiBWlucHV0IgNhYnMiA3ZhbCIJYWJzQmlnSW50IgtrZXlNYXhEZXB0aCIPbWF4RGVwdGhEZWZhdWx0IghtYXhEZXB0aCIRa2V5RmFjdG9yeUFkZHJlc3MiEWZhY3RvcnlBZGRyZXNzU3RyIg9mYWN0b3J5Q29udHJhY3QiEmtleUVtaXNzaW9uQWRkcmVzcyIZa2V5Vm90aW5nRW1pc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ADCQABAgUCYVACCkJ5dGVWZWN0b3IEAmFWBQJhUAUCYVYDCQABAgUCYVACBFVuaXQIBQJjZg9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCY2YJYm9keUJ5dGVzCQCRAwIIBQJjZgZwcm9vZnMAAAUCY2iJw1hP", "height": 2714656, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: F1jk2vaguPNe2csU8QgwMub7ZcvwW6GhDN8ZRT4PLLgA Next: G6fZHDhXeatGFoj34kPv9VhdwkiimeX6CM7cG5843yyL Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | ||
8 | 8 | let c = 100000000 | |
9 | 9 | ||
10 | - | let d = toBigInt( | |
10 | + | let d = toBigInt(c) | |
11 | 11 | ||
12 | - | let e = 0 | |
12 | + | let e = toBigInt(0) | |
13 | 13 | ||
14 | - | let f = | |
14 | + | let f = 0 | |
15 | 15 | ||
16 | - | let g = | |
16 | + | let g = 1 | |
17 | 17 | ||
18 | - | func h (i) = valueOrElse(getInteger(this, i), 0) | |
18 | + | let h = 1000000000000000000 | |
19 | + | ||
20 | + | let i = toBigInt(h) | |
21 | + | ||
22 | + | let j = "WAVES" | |
23 | + | ||
24 | + | func k (l) = makeString(["gwx_reward.ride:", l], " ") | |
19 | 25 | ||
20 | 26 | ||
21 | - | func | |
27 | + | func m (l) = throw(k(l)) | |
22 | 28 | ||
23 | 29 | ||
24 | - | func | |
30 | + | func n (o) = valueOrElse(getInteger(this, o), 0) | |
25 | 31 | ||
26 | 32 | ||
27 | - | func | |
33 | + | func p (o) = valueOrErrorMessage(getInteger(this, o), k((("mandatory this." + o) + " is not defined"))) | |
28 | 34 | ||
29 | 35 | ||
30 | - | func m (n) = if ((n == g)) | |
31 | - | then unit | |
32 | - | else fromBase58String(n) | |
36 | + | func q (o) = valueOrElse(getString(this, o), "") | |
33 | 37 | ||
34 | 38 | ||
35 | - | func | |
39 | + | func r (o) = valueOrErrorMessage(getString(this, o), k((("mandatory this." + o) + " is not defined"))) | |
36 | 40 | ||
37 | 41 | ||
38 | - | func q (p) = throw(o(p)) | |
42 | + | func s (t) = if ((t == j)) | |
43 | + | then unit | |
44 | + | else fromBase58String(t) | |
39 | 45 | ||
40 | 46 | ||
41 | - | func | |
42 | - | then -( | |
43 | - | else | |
47 | + | func u (v) = if ((0 > v)) | |
48 | + | then -(v) | |
49 | + | else v | |
44 | 50 | ||
45 | 51 | ||
46 | - | func | |
47 | - | then -( | |
48 | - | else | |
52 | + | func w (v) = if ((e > v)) | |
53 | + | then -(v) | |
54 | + | else v | |
49 | 55 | ||
50 | 56 | ||
51 | - | let | |
57 | + | let x = "%s__maxDepth" | |
52 | 58 | ||
53 | - | let | |
59 | + | let y = 30 | |
54 | 60 | ||
55 | - | let | |
61 | + | let z = valueOrElse(getInteger(this, x), y) | |
56 | 62 | ||
57 | - | func | |
63 | + | func A () = "%s%s__config__factoryAddress" | |
58 | 64 | ||
59 | 65 | ||
60 | - | let | |
66 | + | let B = r(A()) | |
61 | 67 | ||
62 | - | let | |
68 | + | let C = addressFromStringValue(B) | |
63 | 69 | ||
64 | - | func | |
70 | + | func D () = "%s%s__config__emissionAddress" | |
65 | 71 | ||
66 | 72 | ||
67 | - | func | |
73 | + | func E () = makeString(["%s", "votingEmissionContract"], a) | |
68 | 74 | ||
69 | 75 | ||
70 | - | let | |
76 | + | let F = addressFromStringValue(getStringValue(C, E())) | |
71 | 77 | ||
72 | - | func | |
78 | + | func G (H) = makeString(["%s%s%s", "mapping", "num2user", toString(H)], a) | |
73 | 79 | ||
74 | 80 | ||
75 | - | let | |
81 | + | let I = makeString(["%s%s", "referral", "programName"], a) | |
76 | 82 | ||
77 | - | let | |
83 | + | let J = "wxlock" | |
78 | 84 | ||
79 | - | let | |
85 | + | let K = valueOrElse(getString(this, I), J) | |
80 | 86 | ||
81 | - | let | |
87 | + | let L = makeString(["%s%s", "referral", "minGWxAmount"], a) | |
82 | 88 | ||
83 | - | let J = (500 * c) | |
84 | - | ||
85 | - | let K = valueOrElse(getInteger(this, I), J) | |
86 | - | ||
87 | - | let L = makeString(["%s%s", "referral", "referrerRewardPermille"], a) | |
88 | - | ||
89 | - | let M = 50 | |
89 | + | let M = (500 * c) | |
90 | 90 | ||
91 | 91 | let N = valueOrElse(getInteger(this, L), M) | |
92 | 92 | ||
93 | - | let O = makeString(["%s%s", "referral", " | |
93 | + | let O = makeString(["%s%s", "referral", "referrerRewardPermille"], a) | |
94 | 94 | ||
95 | 95 | let P = 50 | |
96 | 96 | ||
97 | 97 | let Q = valueOrElse(getInteger(this, O), P) | |
98 | 98 | ||
99 | - | func R (S) = makeString(["%s%s%s", "referrer", H, S], a) | |
99 | + | let R = makeString(["%s%s", "referral", "referralRewardPermille"], a) | |
100 | + | ||
101 | + | let S = 50 | |
102 | + | ||
103 | + | let T = valueOrElse(getInteger(this, R), S) | |
104 | + | ||
105 | + | func U (V) = makeString(["%s%s%s", "referrer", K, V], a) | |
100 | 106 | ||
101 | 107 | ||
102 | - | func | |
108 | + | func W (X,Y) = makeString(["%s%s%s", "unclaimedReferral", X, Y], a) | |
103 | 109 | ||
104 | 110 | ||
105 | - | let | |
111 | + | let Z = r(D()) | |
106 | 112 | ||
107 | - | let | |
113 | + | let aa = addressFromStringValue(Z) | |
108 | 114 | ||
109 | - | let | |
115 | + | let ab = 1 | |
110 | 116 | ||
111 | - | let | |
117 | + | let ac = 2 | |
112 | 118 | ||
113 | - | let | |
119 | + | let ad = 3 | |
114 | 120 | ||
115 | - | let | |
121 | + | let ae = 4 | |
116 | 122 | ||
117 | - | func | |
123 | + | func af () = "%s__config" | |
118 | 124 | ||
119 | 125 | ||
120 | - | func | |
126 | + | func ag () = addressFromStringValue(valueOrErrorMessage(getString(this, D()), (("mandatory this." + D()) + " is not defined"))) | |
121 | 127 | ||
122 | 128 | ||
123 | - | let | |
129 | + | let ah = ag() | |
124 | 130 | ||
125 | - | let | |
131 | + | let ai = split(value(getString(ah, af())), a)[1] | |
126 | 132 | ||
127 | - | let | |
133 | + | let aj = fromBase58String(ai) | |
128 | 134 | ||
129 | - | func | |
135 | + | func ak () = split(r(af()), a) | |
130 | 136 | ||
131 | 137 | ||
132 | - | func | |
138 | + | func al (ai,am,an,z) = makeString(["%s%s%s%d", ai, am, an, toString(z)], a) | |
133 | 139 | ||
134 | 140 | ||
135 | - | func | |
136 | - | let | |
137 | - | valueOrErrorMessage(addressFromString( | |
141 | + | func ao () = { | |
142 | + | let ap = ak() | |
143 | + | valueOrErrorMessage(addressFromString(ap[ad]), "boosting contract address is not defined") | |
138 | 144 | } | |
139 | 145 | ||
140 | 146 | ||
141 | - | func | |
147 | + | func aq () = "%s%s__gwxRewardEmissionPart__startHeight" | |
142 | 148 | ||
143 | 149 | ||
144 | - | func | |
150 | + | func ar () = "%s__nextUserNum" | |
145 | 151 | ||
146 | 152 | ||
147 | - | func | |
153 | + | func as (at) = makeString(["%s%s%s__mapping__user2num", toString(at)], a) | |
148 | 154 | ||
149 | 155 | ||
150 | - | func | |
156 | + | func au () = "%s%s__ratePerBlock__current" | |
151 | 157 | ||
152 | 158 | ||
153 | - | func | |
159 | + | func av () = "%s%s__gwxHoldersReward__current" | |
154 | 160 | ||
155 | 161 | ||
156 | - | func | |
162 | + | func aw () = "%s%s__gwxHoldersReward__next" | |
157 | 163 | ||
158 | 164 | ||
159 | - | func at () = "%s__nextProcessedUser" | |
160 | - | ||
161 | - | ||
162 | - | func au () = "%s__latestPeriod" | |
163 | - | ||
164 | - | ||
165 | - | func av () = "%s__nextPeriod" | |
166 | - | ||
167 | - | ||
168 | - | func aw () = "%s__processingStage" | |
169 | - | ||
170 | - | ||
171 | - | func ax () = "%s__nextProcessedPeriod" | |
165 | + | func ax () = "%s%s__poolWeight__GWXvirtualPOOL" | |
172 | 166 | ||
173 | 167 | ||
174 | 168 | func ay (az) = makeString(["%s%d", "userUnclaimed", toString(az)], a) | |
175 | 169 | ||
176 | 170 | ||
177 | - | func aA ( | |
171 | + | func aA () = makeString(["%s%s", "config", "referralsContractAddress"], a) | |
178 | 172 | ||
179 | 173 | ||
180 | - | func aB (az) = makeString(["%s%d__lastProcessedPeriod", toString(az)], a) | |
174 | + | let aB = addressFromStringValue(r(aA())) | |
175 | + | ||
176 | + | func aC (aD,aE) = makeString(["%s%s%s%s", "tradingReward", "history", aD, toBase58String(aE.transactionId)], a) | |
181 | 177 | ||
182 | 178 | ||
183 | - | func | |
179 | + | func aF (at) = makeString(["%s%s", "tradingReward", at], a) | |
184 | 180 | ||
185 | 181 | ||
186 | - | func | |
182 | + | func aG () = makeString(["%s", "maxRecipients"], a) | |
187 | 183 | ||
188 | 184 | ||
189 | - | func aF (aD) = makeString(["%s%d__totalAmountForPeriod", toString(aD)], a) | |
190 | - | ||
191 | - | ||
192 | - | func aG () = "%s__lastPayoutInfo" | |
193 | - | ||
194 | - | ||
195 | - | func aH (aD,aI,aJ) = makeString(["%d%d%d", toString(aD), toString(aI), toString(aJ)], a) | |
196 | - | ||
197 | - | ||
198 | - | func aK (aD) = makeString(["%s%s%d__payouts__history", toString(aD)], a) | |
199 | - | ||
200 | - | ||
201 | - | func aL (aD) = makeString(["%s%d__totalWeightForPeriod", toString(aD)], a) | |
202 | - | ||
203 | - | ||
204 | - | func aM (aD,az) = makeString(["%s%d%s%d__paramByPeriod", toString(az), "k", toString(aD)], a) | |
205 | - | ||
206 | - | ||
207 | - | func aN (aD,az) = makeString(["%s%d%s%d__paramByPeriod", toString(az), "b", toString(aD)], a) | |
208 | - | ||
209 | - | ||
210 | - | func aO (aD,az) = makeString(["%s%d%s%d__paramByPeriod", toString(az), "weight", toString(aD)], a) | |
211 | - | ||
212 | - | ||
213 | - | func aP () = makeString(["%s%s", "config", "referralsContractAddress"], a) | |
214 | - | ||
215 | - | ||
216 | - | let aQ = addressFromStringValue(l(aP())) | |
217 | - | ||
218 | - | func aR (aS,aT) = makeString(["%s%s%s%s", "tradingReward", "history", aS, toBase58String(aT.transactionId)], a) | |
219 | - | ||
220 | - | ||
221 | - | func aU (aV) = makeString(["%s%s", "tradingReward", aV], a) | |
222 | - | ||
223 | - | ||
224 | - | func aW () = makeString(["%s", "maxRecipients"], a) | |
225 | - | ||
226 | - | ||
227 | - | func aX (aY,aS,aZ,aT) = { | |
228 | - | let ba = makeString(["%s%s%s%s__history", aY, aS, toBase58String(aT.transactionId)], a) | |
229 | - | let bb = makeString(["%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(aZ)], a) | |
230 | - | StringEntry(ba, bb) | |
185 | + | func aH (aI,aD,aJ,aE) = { | |
186 | + | let aK = makeString(["%s%s%s%s__history", aI, aD, toBase58String(aE.transactionId)], a) | |
187 | + | let aL = makeString(["%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(aJ)], a) | |
188 | + | StringEntry(aK, aL) | |
231 | 189 | } | |
232 | 190 | ||
233 | 191 | ||
234 | - | func | |
192 | + | func aM () = "%s__managerPublicKey" | |
235 | 193 | ||
236 | 194 | ||
237 | - | func | |
195 | + | func aN () = "%s__managerVaultAddress" | |
238 | 196 | ||
239 | 197 | ||
240 | - | func | |
241 | - | let | |
242 | - | if ($isInstanceOf( | |
198 | + | func aO () = { | |
199 | + | let aP = getString(aN()) | |
200 | + | if ($isInstanceOf(aP, "String")) | |
243 | 201 | then { | |
244 | - | let | |
245 | - | addressFromStringValue( | |
202 | + | let aQ = aP | |
203 | + | addressFromStringValue(aQ) | |
246 | 204 | } | |
247 | 205 | else this | |
248 | 206 | } | |
249 | 207 | ||
250 | 208 | ||
251 | - | func | |
252 | - | let | |
253 | - | let | |
254 | - | if ($isInstanceOf( | |
209 | + | func aR () = { | |
210 | + | let aS = aO() | |
211 | + | let aP = getString(aS, aM()) | |
212 | + | if ($isInstanceOf(aP, "String")) | |
255 | 213 | then { | |
256 | - | let | |
257 | - | fromBase58String( | |
214 | + | let aQ = aP | |
215 | + | fromBase58String(aQ) | |
258 | 216 | } | |
259 | - | else if ($isInstanceOf( | |
217 | + | else if ($isInstanceOf(aP, "Unit")) | |
260 | 218 | then unit | |
261 | 219 | else throw("Match error") | |
262 | 220 | } | |
263 | 221 | ||
264 | 222 | ||
265 | - | func | |
266 | - | let | |
267 | - | let | |
268 | - | if ($isInstanceOf( | |
223 | + | func aT (aE) = { | |
224 | + | let aU = throw("Permission denied") | |
225 | + | let aP = aR() | |
226 | + | if ($isInstanceOf(aP, "ByteVector")) | |
269 | 227 | then { | |
270 | - | let | |
271 | - | if (( | |
228 | + | let aV = aP | |
229 | + | if ((aE.callerPublicKey == aV)) | |
272 | 230 | then true | |
273 | - | else | |
231 | + | else aU | |
274 | 232 | } | |
275 | - | else if ($isInstanceOf( | |
276 | - | then if (( | |
233 | + | else if ($isInstanceOf(aP, "Unit")) | |
234 | + | then if ((aE.caller == this)) | |
277 | 235 | then true | |
278 | - | else | |
236 | + | else aU | |
279 | 237 | else throw("Match error") | |
280 | 238 | } | |
281 | 239 | ||
282 | 240 | ||
283 | - | func bm (bn,bo,aD,az) = { | |
284 | - | let bp = aB(az) | |
285 | - | let bq = aM(aD, az) | |
286 | - | let br = getInteger(bn, bq) | |
287 | - | let bs = aO(aD, az) | |
288 | - | if (isDefined(br)) | |
289 | - | then { | |
290 | - | let bt = value(br) | |
291 | - | let bu = value(getInteger(bn, aN(aD, az))) | |
292 | - | let bv = ((bt * bo) + bu) | |
293 | - | if ((bv > 0)) | |
294 | - | then $Tuple2((bv / b), [IntegerEntry(bp, aD), IntegerEntry(bs, bv)]) | |
295 | - | else $Tuple2(0, nil) | |
296 | - | } | |
297 | - | else { | |
298 | - | let bw = getInteger(this, bp) | |
299 | - | if (if (isDefined(bw)) | |
300 | - | then (aD >= value(bw)) | |
301 | - | else false) | |
302 | - | then { | |
303 | - | let bx = value(bw) | |
304 | - | let bt = value(getInteger(bn, aM(bx, az))) | |
305 | - | let bu = value(getInteger(bn, aN(bx, az))) | |
306 | - | let bv = ((bt * bo) + bu) | |
307 | - | if ((bv > 0)) | |
308 | - | then $Tuple2((bv / b), [IntegerEntry(bs, bv)]) | |
309 | - | else $Tuple2(0, nil) | |
310 | - | } | |
311 | - | else $Tuple2(0, nil) | |
312 | - | } | |
241 | + | func aW (an,at) = { | |
242 | + | let o = makeString(["%s%s%s", "mapping", "user2num", at], a) | |
243 | + | parseIntValue(valueOrErrorMessage(getString(Address(fromBase58String(an)), o), ((("User address " + at) + " is not found in boosting contract data, key=") + o))) | |
313 | 244 | } | |
314 | 245 | ||
315 | 246 | ||
316 | - | func by (bn,bo,aD,az) = { | |
317 | - | let bs = aO(aD, az) | |
318 | - | let bz = getInteger(bs) | |
319 | - | let bf = bz | |
320 | - | if ($isInstanceOf(bf, "Unit")) | |
321 | - | then 0 | |
322 | - | else if ($isInstanceOf(bf, "Int")) | |
323 | - | then { | |
324 | - | let bv = bf | |
325 | - | (bv / b) | |
326 | - | } | |
327 | - | else throw("Match error") | |
247 | + | func aX (at) = valueOrElse(getInteger(this, aF(at)), 0) | |
248 | + | ||
249 | + | ||
250 | + | func aY () = makeString(["%s", "rewardPerGwxIntegral"], a) | |
251 | + | ||
252 | + | ||
253 | + | func aZ () = { | |
254 | + | let ba = "%s%s__gwx__total" | |
255 | + | getInteger(ao(), ba) | |
328 | 256 | } | |
329 | 257 | ||
330 | 258 | ||
331 | - | func bA (ak,aV) = { | |
332 | - | let i = makeString(["%s%s%s", "mapping", "user2num", aV], a) | |
333 | - | parseIntValue(valueOrErrorMessage(getString(Address(fromBase58String(ak)), i), ((("User address " + aV) + " is not found in boosting contract data, key=") + i))) | |
259 | + | func bb (at) = { | |
260 | + | func bc (at) = makeString(["%s%s__gwxAmountTotal", toString(at)], a) | |
261 | + | ||
262 | + | getInteger(ao(), bc(at)) | |
334 | 263 | } | |
335 | 264 | ||
336 | 265 | ||
337 | - | func bB () = h(av()) | |
338 | - | ||
339 | - | ||
340 | - | func bC (aV) = { | |
341 | - | let am = ah() | |
342 | - | let bD = bA(am[aa], aV) | |
343 | - | let bE = getInteger(ay(bD)) | |
344 | - | let bf = bE | |
345 | - | if ($isInstanceOf(bf, "Unit")) | |
346 | - | then $Tuple2(0, nil) | |
347 | - | else if ($isInstanceOf(bf, "Int")) | |
266 | + | func bd () = { | |
267 | + | let be = valueOrElse({ | |
268 | + | let aP = getString(this, aY()) | |
269 | + | if ($isInstanceOf(aP, "String")) | |
348 | 270 | then { | |
349 | - | let | |
350 | - | | |
271 | + | let aQ = aP | |
272 | + | parseBigInt(aQ) | |
351 | 273 | } | |
352 | - | else throw("Match error") | |
274 | + | else if ($isInstanceOf(aP, "Unit")) | |
275 | + | then unit | |
276 | + | else throw("Match error") | |
277 | + | }, e) | |
278 | + | let bf = valueOrErrorMessage(getInteger(this, aq()), k(("invalid " + aq()))) | |
279 | + | let bg = valueOrErrorMessage(getInteger(aa, au()), k(("invalid " + au()))) | |
280 | + | let bh = valueOrElse(getInteger(aa, av()), 0) | |
281 | + | let bi = valueOrElse(aZ(), 0) | |
282 | + | let bj = toBigInt((height - bf)) | |
283 | + | let bk = toBigInt(bi) | |
284 | + | let bl = (be + (if ((bk == e)) | |
285 | + | then e | |
286 | + | else fraction(bj, ((toBigInt(bg) * toBigInt(bh)) * i), (bk * d)))) | |
287 | + | $Tuple2([IntegerEntry(aq(), height), StringEntry(aY(), toString(bl))], bl) | |
353 | 288 | } | |
354 | 289 | ||
355 | 290 | ||
356 | - | func | |
291 | + | func bm (at) = makeString(["%s%s", "rewardPerGwxIntegralUserLast", toString(at)], a) | |
357 | 292 | ||
358 | 293 | ||
359 | - | @Callable(aT) | |
360 | - | func tradeRewardInternal (bH,bI,bJ,bK) = if ((bK == size(bI))) | |
294 | + | func bn (at,bo) = { | |
295 | + | let bp = bd() | |
296 | + | let bq = bp._1 | |
297 | + | let bl = bp._2 | |
298 | + | let br = { | |
299 | + | let aP = getString(this, bm(at)) | |
300 | + | if ($isInstanceOf(aP, "String")) | |
301 | + | then { | |
302 | + | let aQ = aP | |
303 | + | valueOrErrorMessage(parseBigInt(aQ), k("invalid user last integral")) | |
304 | + | } | |
305 | + | else if ($isInstanceOf(aP, "Unit")) | |
306 | + | then bl | |
307 | + | else throw("Match error") | |
308 | + | } | |
309 | + | let bs = getString(ao(), as(at)) | |
310 | + | let bt = valueOrElse(getInteger(ay(bo)), 0) | |
311 | + | let bu = valueOrElse(bb(at), 0) | |
312 | + | let bv = (toInt(fraction(toBigInt(bu), (bl - br), i)) + bt) | |
313 | + | $Tuple2(([StringEntry(bm(at), toString(bl))] ++ bq), bv) | |
314 | + | } | |
315 | + | ||
316 | + | ||
317 | + | func bw (bx) = { | |
318 | + | let at = valueOrErrorMessage(addressFromString(bx), k("invalid user address")) | |
319 | + | let ap = ak() | |
320 | + | let bo = aW(ap[ad], bx) | |
321 | + | let by = bn(at, bo) | |
322 | + | let bz = by._1 | |
323 | + | let bA = by._2 | |
324 | + | $Tuple2(bA, ([IntegerEntry(ay(bo), 0)] ++ bz)) | |
325 | + | } | |
326 | + | ||
327 | + | ||
328 | + | @Callable(aE) | |
329 | + | func refreshUserReward (bB,bo) = { | |
330 | + | let bC = if ((aE.caller == ao())) | |
331 | + | then true | |
332 | + | else m("permission denied") | |
333 | + | if ((bC == bC)) | |
334 | + | then { | |
335 | + | let bD = bn(Address(bB), bo) | |
336 | + | let bz = bD._1 | |
337 | + | let bA = bD._2 | |
338 | + | $Tuple2(([IntegerEntry(ay(bo), bA)] ++ bz), bA) | |
339 | + | } | |
340 | + | else throw("Strict value is not equal to itself.") | |
341 | + | } | |
342 | + | ||
343 | + | ||
344 | + | ||
345 | + | @Callable(aE) | |
346 | + | func tradeRewardInternal (bE,bF,bG,bH) = if ((bH == size(bF))) | |
361 | 347 | then nil | |
362 | 348 | else { | |
363 | - | let | |
349 | + | let bI = [if ((aE.caller == this)) | |
364 | 350 | then true | |
365 | - | else | |
351 | + | else m("Permission denied"), if ((bE >= bG[bH])) | |
366 | 352 | then true | |
367 | - | else | |
368 | - | if (( | |
353 | + | else m("insufficient payment assetId")] | |
354 | + | if ((bI == bI)) | |
369 | 355 | then { | |
370 | - | let | |
371 | - | if (( | |
356 | + | let bJ = invoke(this, "tradeRewardInternal", [(bE - bG[bH]), bF, bG, (bH + 1)], nil) | |
357 | + | if ((bJ == bJ)) | |
372 | 358 | then { | |
373 | - | let | |
374 | - | let | |
375 | - | $Tuple2([IntegerEntry( | |
359 | + | let bK = aC(bF[bH], aE) | |
360 | + | let at = addressFromStringValue(bF[bH]) | |
361 | + | $Tuple2([IntegerEntry(bK, bG[bH]), IntegerEntry(aF(bF[bH]), bG[bH])], bJ) | |
376 | 362 | } | |
377 | 363 | else throw("Strict value is not equal to itself.") | |
378 | 364 | } | |
381 | 367 | ||
382 | 368 | ||
383 | 369 | ||
384 | - | @Callable( | |
385 | - | func updateReferralActivity ( | |
386 | - | let | |
387 | - | let | |
370 | + | @Callable(aE) | |
371 | + | func updateReferralActivity (at,bL) = { | |
372 | + | let bM = getString(aB, U(at)) | |
373 | + | let bN = if ((bM == unit)) | |
388 | 374 | then unit | |
389 | - | else invoke( | |
390 | - | if (( | |
375 | + | else invoke(aB, "updateReferralActivity", [K, at, (bL >= N)], nil) | |
376 | + | if ((bN == bN)) | |
391 | 377 | then $Tuple2(nil, unit) | |
392 | 378 | else throw("Strict value is not equal to itself.") | |
393 | 379 | } | |
394 | 380 | ||
395 | 381 | ||
396 | 382 | ||
397 | - | @Callable(aT) | |
398 | - | func finalizeHelper () = { | |
399 | - | let bR = valueOrElse(getInteger(aw()), e) | |
400 | - | let bS = h(ax()) | |
401 | - | let bT = h(at()) | |
402 | - | let bU = h(au()) | |
403 | - | let bV = valueOrElse(getInteger(al(), ao()), 0) | |
404 | - | let bW = aL(bS) | |
405 | - | let bX = h(aL(bS)) | |
406 | - | let bo = h(aC(bS)) | |
407 | - | if ((bS > bU)) | |
408 | - | then $Tuple2(nil, false) | |
409 | - | else if ((bR == e)) | |
410 | - | then { | |
411 | - | let bY = bm(al(), bo, bS, bT) | |
412 | - | let bZ = bY._1 | |
413 | - | let ca = bY._2 | |
414 | - | let cb = (bX + bZ) | |
415 | - | let cc = if (((bV - 1) > bT)) | |
416 | - | then [IntegerEntry(at(), (bT + 1))] | |
417 | - | else [IntegerEntry(aw(), f), IntegerEntry(at(), 0)] | |
418 | - | $Tuple2((([IntegerEntry(bW, cb)] ++ cc) ++ ca), true) | |
419 | - | } | |
420 | - | else if ((bR == f)) | |
421 | - | then { | |
422 | - | let bZ = by(al(), bo, bS, bT) | |
423 | - | let cd = fraction(h(aF(bS)), bZ, bX) | |
424 | - | let ce = fraction(h(aE(bS)), bZ, bX) | |
425 | - | let cf = (ce + cd) | |
426 | - | let bE = getInteger(ay(bT)) | |
427 | - | let aV = getStringValue(al(), D(bT)) | |
428 | - | let bP = getString(aQ, R(aV)) | |
429 | - | let bQ = if ((bP == unit)) | |
430 | - | then unit | |
431 | - | else invoke(aQ, "updateReferralActivity", [H, aV, (bZ >= K)], nil) | |
432 | - | if ((bQ == bQ)) | |
433 | - | then { | |
434 | - | let cg = if (if ((bP == unit)) | |
435 | - | then true | |
436 | - | else (K > bZ)) | |
437 | - | then unit | |
438 | - | else { | |
439 | - | let ch = fraction(cf, N, b) | |
440 | - | let ci = fraction(cf, Q, b) | |
441 | - | invoke(aQ, "incUnclaimed", [H, aV, ch, ci], nil) | |
442 | - | } | |
443 | - | if ((cg == cg)) | |
444 | - | then { | |
445 | - | let cj = [IntegerEntry(ay(bT), (valueOrElse(bE, 0) + cf))] | |
446 | - | let cc = if (((bV - 1) > bT)) | |
447 | - | then [IntegerEntry(at(), (bT + 1))] | |
448 | - | else [IntegerEntry(ax(), (bS + 1)), IntegerEntry(at(), 0), DeleteEntry(aw())] | |
449 | - | $Tuple2((cj ++ cc), true) | |
450 | - | } | |
451 | - | else throw("Strict value is not equal to itself.") | |
452 | - | } | |
453 | - | else throw("Strict value is not equal to itself.") | |
454 | - | } | |
455 | - | else throw("invalid processing stage") | |
456 | - | } | |
383 | + | @Callable(aE) | |
384 | + | func processPendingPeriodsAndUsers () = $Tuple2(nil, m("deprecated")) | |
457 | 385 | ||
458 | 386 | ||
459 | 387 | ||
460 | - | @Callable(aT) | |
461 | - | func finalizeWrapper (ck) = { | |
462 | - | let cl = { | |
463 | - | let cm = invoke(this, "finalizeHelper", nil, nil) | |
464 | - | if ($isInstanceOf(cm, "Boolean")) | |
465 | - | then cm | |
466 | - | else throw(($getType(cm) + " couldn't be cast to Boolean")) | |
467 | - | } | |
468 | - | if ((cl == cl)) | |
469 | - | then if (!(cl)) | |
470 | - | then if ((ck == w)) | |
471 | - | then throw("Nothing to process") | |
472 | - | else $Tuple2(nil, unit) | |
473 | - | else if ((ck > 0)) | |
474 | - | then $Tuple2(nil, invoke(this, "finalizeWrapper", [(ck - 1)], nil)) | |
475 | - | else $Tuple2(nil, unit) | |
476 | - | else throw("Strict value is not equal to itself.") | |
477 | - | } | |
478 | - | ||
479 | - | ||
480 | - | ||
481 | - | @Callable(aT) | |
482 | - | func processPendingPeriodsAndUsers () = $Tuple2(nil, invoke(this, "finalizeWrapper", [w], nil)) | |
483 | - | ||
484 | - | ||
485 | - | ||
486 | - | @Callable(aT) | |
487 | - | func deposit () = { | |
488 | - | let cn = if ((aT.caller == C)) | |
388 | + | @Callable(aE) | |
389 | + | func claimReward () = { | |
390 | + | let ap = ak() | |
391 | + | let at = aE.caller | |
392 | + | let bx = toString(at) | |
393 | + | let bO = bw(bx) | |
394 | + | let aJ = bO._1 | |
395 | + | let bz = bO._2 | |
396 | + | let bP = if ((aJ > 0)) | |
489 | 397 | then true | |
490 | - | else | |
491 | - | if (( | |
398 | + | else throw("nothing to claim") | |
399 | + | if ((bP == bP)) | |
492 | 400 | then { | |
493 | - | let aD = bB() | |
494 | - | let co = (height - j(an())) | |
495 | - | let cp = valueOrErrorMessage(getInteger(X, ap()), (("mandatory emission_contract." + ap()) + " is not defined")) | |
496 | - | let cq = valueOrElse(getInteger(X, aq()), 0) | |
497 | - | if ((cq == cq)) | |
401 | + | let bu = { | |
402 | + | let bQ = invoke(ao(), "getUserGwxAmount", [bx], nil) | |
403 | + | if ($isInstanceOf(bQ, "Int")) | |
404 | + | then bQ | |
405 | + | else throw(($getType(bQ) + " couldn't be cast to Int")) | |
406 | + | } | |
407 | + | let bM = getString(aB, U(bx)) | |
408 | + | let bN = if ((bM == unit)) | |
409 | + | then unit | |
410 | + | else invoke(aB, "updateReferralActivity", [K, at, (bu >= N)], nil) | |
411 | + | if ((bN == bN)) | |
498 | 412 | then { | |
499 | - | let cr = fraction((co * cq), cp, c) | |
500 | - | let cs = if ((cr > 0)) | |
501 | - | then invoke(X, "emit", [cr], nil) | |
502 | - | else unit | |
503 | - | if ((cs == cs)) | |
413 | + | let bR = if (if ((bM == unit)) | |
414 | + | then true | |
415 | + | else (N > bu)) | |
416 | + | then unit | |
417 | + | else { | |
418 | + | let bS = fraction(aJ, Q, b) | |
419 | + | let bT = fraction(aJ, T, b) | |
420 | + | invoke(aB, "incUnclaimed", [K, at, bS, bT], nil) | |
421 | + | } | |
422 | + | if ((bR == bR)) | |
504 | 423 | then { | |
505 | - | let ct = 0 | |
506 | - | let cu = aH(aD, ct, cr) | |
507 | - | let cv = { | |
508 | - | let cm = invoke(X, "gwxHoldersRewardUpdate", nil, nil) | |
509 | - | if ($isInstanceOf(cm, "Boolean")) | |
510 | - | then cm | |
511 | - | else throw(($getType(cm) + " couldn't be cast to Boolean")) | |
424 | + | let bU = { | |
425 | + | let bQ = invoke(aB, "claim", [K], nil) | |
426 | + | if ($isInstanceOf(bQ, "Int")) | |
427 | + | then bQ | |
428 | + | else throw(($getType(bQ) + " couldn't be cast to Int")) | |
512 | 429 | } | |
513 | - | if (( | |
430 | + | if ((bU == bU)) | |
514 | 431 | then { | |
515 | - | let cw = (ct + cr) | |
516 | - | let cx = if (if ((cw == 0)) | |
517 | - | then !(cv) | |
518 | - | else false) | |
519 | - | then nil | |
520 | - | else [IntegerEntry(au(), aD), IntegerEntry(aC(aD), height), IntegerEntry(aE(aD), cr), IntegerEntry(an(), height), IntegerEntry(aF(aD), ct), IntegerEntry(av(), (aD + 1)), StringEntry(aG(), cu), StringEntry(aK(aD), cu)] | |
521 | - | $Tuple2(cx, unit) | |
432 | + | let bV = (aJ + bU) | |
433 | + | $Tuple2(([ScriptTransfer(aE.caller, aJ, fromBase58String(ap[ab])), aH("claim", bx, bV, aE)] ++ bz), bV) | |
522 | 434 | } | |
523 | 435 | else throw("Strict value is not equal to itself.") | |
524 | 436 | } | |
531 | 443 | ||
532 | 444 | ||
533 | 445 | ||
534 | - | @Callable(aT) | |
535 | - | func claimReward () = { | |
536 | - | let am = ah() | |
537 | - | let cy = toString(aT.caller) | |
538 | - | let cz = bC(cy) | |
539 | - | let aZ = cz._1 | |
540 | - | let cx = cz._2 | |
541 | - | let cA = if ((aZ > 0)) | |
542 | - | then true | |
543 | - | else throw("Nothing to claim") | |
544 | - | if ((cA == cA)) | |
545 | - | then { | |
546 | - | let cB = 0 | |
547 | - | let cC = { | |
548 | - | let cm = invoke(aQ, "claim", [H], nil) | |
549 | - | if ($isInstanceOf(cm, "Int")) | |
550 | - | then cm | |
551 | - | else throw(($getType(cm) + " couldn't be cast to Int")) | |
552 | - | } | |
553 | - | let cD = (aZ + cC) | |
554 | - | $Tuple2(([ScriptTransfer(aT.caller, cD, fromBase58String(am[Y])), aX("claim", cy, aZ, aT)] ++ cx), [cD, cB]) | |
555 | - | } | |
556 | - | else throw("Strict value is not equal to itself.") | |
446 | + | @Callable(aE) | |
447 | + | func claimRewardREADONLY (bW) = { | |
448 | + | let bX = bw(bW) | |
449 | + | let aJ = bX._1 | |
450 | + | let bz = bX._2 | |
451 | + | let bY = valueOrElse(getInteger(aB, W(K, bW)), 0) | |
452 | + | let bV = (aJ + bY) | |
453 | + | $Tuple2(nil, bV) | |
557 | 454 | } | |
558 | 455 | ||
559 | 456 | ||
560 | 457 | ||
561 | - | @Callable(aT) | |
562 | - | func claimRewardREADONLY (cy) = { | |
563 | - | let cE = bC(cy) | |
564 | - | let aZ = cE._1 | |
565 | - | let cx = cE._2 | |
566 | - | let cF = valueOrElse(getInteger(aQ, T(H, cy)), 0) | |
567 | - | let cD = (aZ + cF) | |
568 | - | $Tuple2(nil, cD) | |
569 | - | } | |
458 | + | @Callable(aE) | |
459 | + | func onEmissionForGwxStart () = if ((aE.caller != C)) | |
460 | + | then throw("permissions denied") | |
461 | + | else [IntegerEntry(aq(), height)] | |
570 | 462 | ||
571 | 463 | ||
572 | 464 | ||
573 | - | @Callable(aT) | |
574 | - | func latestFinalizedPeriodREADONLY (cy) = $Tuple2(nil, valueOrElse(getInteger(this, au()), -1)) | |
575 | - | ||
576 | - | ||
577 | - | ||
578 | - | @Callable(aT) | |
579 | - | func latestFinalizedPeriodInfoREADONLY (cy) = $Tuple2(nil, k(aG())) | |
580 | - | ||
581 | - | ||
582 | - | ||
583 | - | @Callable(aT) | |
584 | - | func calcGwxParamsREADONLY (cG,cH,cI) = { | |
585 | - | let cJ = (cH + cI) | |
586 | - | let cK = -(fraction(cG, b, cI)) | |
587 | - | let cL = (fraction(cG, b, cI) * cJ) | |
588 | - | $Tuple2(nil, [cK, cL, bB()]) | |
589 | - | } | |
590 | - | ||
591 | - | ||
592 | - | ||
593 | - | @Callable(aT) | |
594 | - | func calcGwxAmountStartREADONLY (cM,cN,cO) = { | |
595 | - | let cP = fraction(cN, c, cO) | |
596 | - | let bO = fraction(cM, cP, c) | |
597 | - | $Tuple2(nil, [bO]) | |
598 | - | } | |
599 | - | ||
600 | - | ||
601 | - | ||
602 | - | @Callable(aT) | |
603 | - | func onEmissionForGwxStart () = if ((aT.caller != z)) | |
604 | - | then throw("permissions denied") | |
605 | - | else [IntegerEntry(an(), height)] | |
606 | - | ||
607 | - | ||
608 | - | ||
609 | - | @Callable(aT) | |
610 | - | func latestPeriodEmissionRewardsREADONLY (cy) = { | |
611 | - | let aD = bB() | |
612 | - | $Tuple2(nil, [h(aE(aD))]) | |
613 | - | } | |
614 | - | ||
615 | - | ||
616 | - | ||
617 | - | @Callable(aT) | |
618 | - | func calcD (cQ,cR,cS,cT,cU) = { | |
619 | - | let cV = toBigInt(2) | |
620 | - | let cW = parseBigIntValue(cT) | |
621 | - | let cX = parseBigIntValue(cU) | |
622 | - | let cY = parseBigIntValue(cQ) | |
623 | - | let cZ = parseBigIntValue(cR) | |
624 | - | let da = (parseBigIntValue(cS) * cW) | |
625 | - | let bg = (cY + cZ) | |
626 | - | if ((bg == d)) | |
627 | - | then $Tuple2(nil, toString(d)) | |
628 | - | else { | |
629 | - | let db = (da * cV) | |
630 | - | let dc = [0, 1, 2, 3, 4, 5, 6] | |
631 | - | func dd (de,df) = { | |
632 | - | let dg = de | |
633 | - | let dh = dg._1 | |
634 | - | let di = dg._2 | |
635 | - | let dj = dg._3 | |
636 | - | if ((dj != unit)) | |
637 | - | then de | |
638 | - | else { | |
639 | - | let dk = (((dh * dh) * dh) / (((cY * cZ) * cV) * cV)) | |
640 | - | let dl = (((((db * bg) / cW) + (dk * cV)) * dh) / ((((db - cW) * dh) / cW) + ((cV + toBigInt(1)) * dk))) | |
641 | - | let dm = t((dl - value(dh))) | |
642 | - | if ((cX >= dm)) | |
643 | - | then $Tuple3(dl, dh, df) | |
644 | - | else $Tuple3(dl, dh, unit) | |
645 | - | } | |
646 | - | } | |
647 | - | ||
648 | - | let dn = { | |
649 | - | let do = dc | |
650 | - | let dp = size(do) | |
651 | - | let dq = $Tuple3(bg, unit, unit) | |
652 | - | func dr (ds,dt) = if ((dt >= dp)) | |
653 | - | then ds | |
654 | - | else dd(ds, do[dt]) | |
655 | - | ||
656 | - | func du (ds,dt) = if ((dt >= dp)) | |
657 | - | then ds | |
658 | - | else throw("List size exceeds 7") | |
659 | - | ||
660 | - | du(dr(dr(dr(dr(dr(dr(dr(dq, 0), 1), 2), 3), 4), 5), 6), 7) | |
661 | - | } | |
662 | - | let dl = dn._1 | |
663 | - | let di = dn._2 | |
664 | - | let dj = dn._3 | |
665 | - | if ((dj != unit)) | |
666 | - | then $Tuple2(nil, toString(dl)) | |
667 | - | else { | |
668 | - | let dm = t((dl - value(di))) | |
669 | - | throw(("D calculation error, dDiff = " + toString(dm))) | |
670 | - | } | |
671 | - | } | |
672 | - | } | |
673 | - | ||
674 | - | ||
675 | - | ||
676 | - | @Callable(aT) | |
677 | - | func tradeReward (bI,bJ) = { | |
678 | - | let dv = (size(bI) == size(bJ)) | |
679 | - | let dw = valueOrElse(getInteger(aW()), 0) | |
680 | - | let dx = aT.payments[0] | |
681 | - | let dy = dx.assetId | |
682 | - | let dz = dx.amount | |
683 | - | let bL = [if ((dw >= size(bI))) | |
465 | + | @Callable(aE) | |
466 | + | func tradeReward (bF,bG) = { | |
467 | + | let bZ = (size(bF) == size(bG)) | |
468 | + | let ca = valueOrElse(getInteger(aG()), 0) | |
469 | + | let cb = aE.payments[0] | |
470 | + | let cc = cb.assetId | |
471 | + | let cd = cb.amount | |
472 | + | let bI = [if ((ca >= size(bF))) | |
684 | 473 | then true | |
685 | - | else | |
474 | + | else m("Too many recipients"), if (bZ) | |
686 | 475 | then true | |
687 | - | else | |
476 | + | else m("Arguments size mismatch"), if ((cc == aj)) | |
688 | 477 | then true | |
689 | - | else | |
690 | - | if (( | |
478 | + | else m("Wrong asset payment")] | |
479 | + | if ((bI == bI)) | |
691 | 480 | then { | |
692 | - | let | |
693 | - | if (( | |
694 | - | then $Tuple2(nil, | |
481 | + | let bJ = invoke(this, "tradeRewardInternal", [cd, bF, bG, 0], nil) | |
482 | + | if ((bJ == bJ)) | |
483 | + | then $Tuple2(nil, bJ) | |
695 | 484 | else throw("Strict value is not equal to itself.") | |
696 | 485 | } | |
697 | 486 | else throw("Strict value is not equal to itself.") | |
699 | 488 | ||
700 | 489 | ||
701 | 490 | ||
702 | - | @Callable( | |
491 | + | @Callable(aE) | |
703 | 492 | func claimTradingReward () = { | |
704 | - | let | |
705 | - | let | |
706 | - | let | |
707 | - | if (( | |
708 | - | then $Tuple2([ScriptTransfer( | |
709 | - | else | |
493 | + | let at = aE.caller | |
494 | + | let ce = toString(at) | |
495 | + | let bA = aX(ce) | |
496 | + | if ((bA > 0)) | |
497 | + | then $Tuple2([ScriptTransfer(at, bA, aj), IntegerEntry(aF(ce), 0)], bA) | |
498 | + | else m("nothing to claim") | |
710 | 499 | } | |
711 | 500 | ||
712 | 501 | ||
713 | 502 | ||
714 | - | @Callable( | |
715 | - | func claimTradingRewardREADONLY ( | |
503 | + | @Callable(aE) | |
504 | + | func claimTradingRewardREADONLY (at) = $Tuple2(nil, aX(at)) | |
716 | 505 | ||
717 | 506 | ||
718 | - | @Verifier( | |
719 | - | func | |
720 | - | let | |
721 | - | let | |
722 | - | if ($isInstanceOf( | |
507 | + | @Verifier(cf) | |
508 | + | func cg () = { | |
509 | + | let ch = { | |
510 | + | let aP = aR() | |
511 | + | if ($isInstanceOf(aP, "ByteVector")) | |
723 | 512 | then { | |
724 | - | let | |
725 | - | | |
513 | + | let aV = aP | |
514 | + | aV | |
726 | 515 | } | |
727 | - | else if ($isInstanceOf( | |
728 | - | then | |
516 | + | else if ($isInstanceOf(aP, "Unit")) | |
517 | + | then cf.senderPublicKey | |
729 | 518 | else throw("Match error") | |
730 | 519 | } | |
731 | - | sigVerify( | |
520 | + | sigVerify(cf.bodyBytes, cf.proofs[0], ch) | |
732 | 521 | } | |
733 | 522 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | 6 | let b = 1000 | |
7 | 7 | ||
8 | 8 | let c = 100000000 | |
9 | 9 | ||
10 | - | let d = toBigInt( | |
10 | + | let d = toBigInt(c) | |
11 | 11 | ||
12 | - | let e = 0 | |
12 | + | let e = toBigInt(0) | |
13 | 13 | ||
14 | - | let f = | |
14 | + | let f = 0 | |
15 | 15 | ||
16 | - | let g = | |
16 | + | let g = 1 | |
17 | 17 | ||
18 | - | func h (i) = valueOrElse(getInteger(this, i), 0) | |
18 | + | let h = 1000000000000000000 | |
19 | + | ||
20 | + | let i = toBigInt(h) | |
21 | + | ||
22 | + | let j = "WAVES" | |
23 | + | ||
24 | + | func k (l) = makeString(["gwx_reward.ride:", l], " ") | |
19 | 25 | ||
20 | 26 | ||
21 | - | func | |
27 | + | func m (l) = throw(k(l)) | |
22 | 28 | ||
23 | 29 | ||
24 | - | func | |
30 | + | func n (o) = valueOrElse(getInteger(this, o), 0) | |
25 | 31 | ||
26 | 32 | ||
27 | - | func | |
33 | + | func p (o) = valueOrErrorMessage(getInteger(this, o), k((("mandatory this." + o) + " is not defined"))) | |
28 | 34 | ||
29 | 35 | ||
30 | - | func m (n) = if ((n == g)) | |
31 | - | then unit | |
32 | - | else fromBase58String(n) | |
36 | + | func q (o) = valueOrElse(getString(this, o), "") | |
33 | 37 | ||
34 | 38 | ||
35 | - | func | |
39 | + | func r (o) = valueOrErrorMessage(getString(this, o), k((("mandatory this." + o) + " is not defined"))) | |
36 | 40 | ||
37 | 41 | ||
38 | - | func q (p) = throw(o(p)) | |
42 | + | func s (t) = if ((t == j)) | |
43 | + | then unit | |
44 | + | else fromBase58String(t) | |
39 | 45 | ||
40 | 46 | ||
41 | - | func | |
42 | - | then -( | |
43 | - | else | |
47 | + | func u (v) = if ((0 > v)) | |
48 | + | then -(v) | |
49 | + | else v | |
44 | 50 | ||
45 | 51 | ||
46 | - | func | |
47 | - | then -( | |
48 | - | else | |
52 | + | func w (v) = if ((e > v)) | |
53 | + | then -(v) | |
54 | + | else v | |
49 | 55 | ||
50 | 56 | ||
51 | - | let | |
57 | + | let x = "%s__maxDepth" | |
52 | 58 | ||
53 | - | let | |
59 | + | let y = 30 | |
54 | 60 | ||
55 | - | let | |
61 | + | let z = valueOrElse(getInteger(this, x), y) | |
56 | 62 | ||
57 | - | func | |
63 | + | func A () = "%s%s__config__factoryAddress" | |
58 | 64 | ||
59 | 65 | ||
60 | - | let | |
66 | + | let B = r(A()) | |
61 | 67 | ||
62 | - | let | |
68 | + | let C = addressFromStringValue(B) | |
63 | 69 | ||
64 | - | func | |
70 | + | func D () = "%s%s__config__emissionAddress" | |
65 | 71 | ||
66 | 72 | ||
67 | - | func | |
73 | + | func E () = makeString(["%s", "votingEmissionContract"], a) | |
68 | 74 | ||
69 | 75 | ||
70 | - | let | |
76 | + | let F = addressFromStringValue(getStringValue(C, E())) | |
71 | 77 | ||
72 | - | func | |
78 | + | func G (H) = makeString(["%s%s%s", "mapping", "num2user", toString(H)], a) | |
73 | 79 | ||
74 | 80 | ||
75 | - | let | |
81 | + | let I = makeString(["%s%s", "referral", "programName"], a) | |
76 | 82 | ||
77 | - | let | |
83 | + | let J = "wxlock" | |
78 | 84 | ||
79 | - | let | |
85 | + | let K = valueOrElse(getString(this, I), J) | |
80 | 86 | ||
81 | - | let | |
87 | + | let L = makeString(["%s%s", "referral", "minGWxAmount"], a) | |
82 | 88 | ||
83 | - | let J = (500 * c) | |
84 | - | ||
85 | - | let K = valueOrElse(getInteger(this, I), J) | |
86 | - | ||
87 | - | let L = makeString(["%s%s", "referral", "referrerRewardPermille"], a) | |
88 | - | ||
89 | - | let M = 50 | |
89 | + | let M = (500 * c) | |
90 | 90 | ||
91 | 91 | let N = valueOrElse(getInteger(this, L), M) | |
92 | 92 | ||
93 | - | let O = makeString(["%s%s", "referral", " | |
93 | + | let O = makeString(["%s%s", "referral", "referrerRewardPermille"], a) | |
94 | 94 | ||
95 | 95 | let P = 50 | |
96 | 96 | ||
97 | 97 | let Q = valueOrElse(getInteger(this, O), P) | |
98 | 98 | ||
99 | - | func R (S) = makeString(["%s%s%s", "referrer", H, S], a) | |
99 | + | let R = makeString(["%s%s", "referral", "referralRewardPermille"], a) | |
100 | + | ||
101 | + | let S = 50 | |
102 | + | ||
103 | + | let T = valueOrElse(getInteger(this, R), S) | |
104 | + | ||
105 | + | func U (V) = makeString(["%s%s%s", "referrer", K, V], a) | |
100 | 106 | ||
101 | 107 | ||
102 | - | func | |
108 | + | func W (X,Y) = makeString(["%s%s%s", "unclaimedReferral", X, Y], a) | |
103 | 109 | ||
104 | 110 | ||
105 | - | let | |
111 | + | let Z = r(D()) | |
106 | 112 | ||
107 | - | let | |
113 | + | let aa = addressFromStringValue(Z) | |
108 | 114 | ||
109 | - | let | |
115 | + | let ab = 1 | |
110 | 116 | ||
111 | - | let | |
117 | + | let ac = 2 | |
112 | 118 | ||
113 | - | let | |
119 | + | let ad = 3 | |
114 | 120 | ||
115 | - | let | |
121 | + | let ae = 4 | |
116 | 122 | ||
117 | - | func | |
123 | + | func af () = "%s__config" | |
118 | 124 | ||
119 | 125 | ||
120 | - | func | |
126 | + | func ag () = addressFromStringValue(valueOrErrorMessage(getString(this, D()), (("mandatory this." + D()) + " is not defined"))) | |
121 | 127 | ||
122 | 128 | ||
123 | - | let | |
129 | + | let ah = ag() | |
124 | 130 | ||
125 | - | let | |
131 | + | let ai = split(value(getString(ah, af())), a)[1] | |
126 | 132 | ||
127 | - | let | |
133 | + | let aj = fromBase58String(ai) | |
128 | 134 | ||
129 | - | func | |
135 | + | func ak () = split(r(af()), a) | |
130 | 136 | ||
131 | 137 | ||
132 | - | func | |
138 | + | func al (ai,am,an,z) = makeString(["%s%s%s%d", ai, am, an, toString(z)], a) | |
133 | 139 | ||
134 | 140 | ||
135 | - | func | |
136 | - | let | |
137 | - | valueOrErrorMessage(addressFromString( | |
141 | + | func ao () = { | |
142 | + | let ap = ak() | |
143 | + | valueOrErrorMessage(addressFromString(ap[ad]), "boosting contract address is not defined") | |
138 | 144 | } | |
139 | 145 | ||
140 | 146 | ||
141 | - | func | |
147 | + | func aq () = "%s%s__gwxRewardEmissionPart__startHeight" | |
142 | 148 | ||
143 | 149 | ||
144 | - | func | |
150 | + | func ar () = "%s__nextUserNum" | |
145 | 151 | ||
146 | 152 | ||
147 | - | func | |
153 | + | func as (at) = makeString(["%s%s%s__mapping__user2num", toString(at)], a) | |
148 | 154 | ||
149 | 155 | ||
150 | - | func | |
156 | + | func au () = "%s%s__ratePerBlock__current" | |
151 | 157 | ||
152 | 158 | ||
153 | - | func | |
159 | + | func av () = "%s%s__gwxHoldersReward__current" | |
154 | 160 | ||
155 | 161 | ||
156 | - | func | |
162 | + | func aw () = "%s%s__gwxHoldersReward__next" | |
157 | 163 | ||
158 | 164 | ||
159 | - | func at () = "%s__nextProcessedUser" | |
160 | - | ||
161 | - | ||
162 | - | func au () = "%s__latestPeriod" | |
163 | - | ||
164 | - | ||
165 | - | func av () = "%s__nextPeriod" | |
166 | - | ||
167 | - | ||
168 | - | func aw () = "%s__processingStage" | |
169 | - | ||
170 | - | ||
171 | - | func ax () = "%s__nextProcessedPeriod" | |
165 | + | func ax () = "%s%s__poolWeight__GWXvirtualPOOL" | |
172 | 166 | ||
173 | 167 | ||
174 | 168 | func ay (az) = makeString(["%s%d", "userUnclaimed", toString(az)], a) | |
175 | 169 | ||
176 | 170 | ||
177 | - | func aA ( | |
171 | + | func aA () = makeString(["%s%s", "config", "referralsContractAddress"], a) | |
178 | 172 | ||
179 | 173 | ||
180 | - | func aB (az) = makeString(["%s%d__lastProcessedPeriod", toString(az)], a) | |
174 | + | let aB = addressFromStringValue(r(aA())) | |
175 | + | ||
176 | + | func aC (aD,aE) = makeString(["%s%s%s%s", "tradingReward", "history", aD, toBase58String(aE.transactionId)], a) | |
181 | 177 | ||
182 | 178 | ||
183 | - | func | |
179 | + | func aF (at) = makeString(["%s%s", "tradingReward", at], a) | |
184 | 180 | ||
185 | 181 | ||
186 | - | func | |
182 | + | func aG () = makeString(["%s", "maxRecipients"], a) | |
187 | 183 | ||
188 | 184 | ||
189 | - | func aF (aD) = makeString(["%s%d__totalAmountForPeriod", toString(aD)], a) | |
190 | - | ||
191 | - | ||
192 | - | func aG () = "%s__lastPayoutInfo" | |
193 | - | ||
194 | - | ||
195 | - | func aH (aD,aI,aJ) = makeString(["%d%d%d", toString(aD), toString(aI), toString(aJ)], a) | |
196 | - | ||
197 | - | ||
198 | - | func aK (aD) = makeString(["%s%s%d__payouts__history", toString(aD)], a) | |
199 | - | ||
200 | - | ||
201 | - | func aL (aD) = makeString(["%s%d__totalWeightForPeriod", toString(aD)], a) | |
202 | - | ||
203 | - | ||
204 | - | func aM (aD,az) = makeString(["%s%d%s%d__paramByPeriod", toString(az), "k", toString(aD)], a) | |
205 | - | ||
206 | - | ||
207 | - | func aN (aD,az) = makeString(["%s%d%s%d__paramByPeriod", toString(az), "b", toString(aD)], a) | |
208 | - | ||
209 | - | ||
210 | - | func aO (aD,az) = makeString(["%s%d%s%d__paramByPeriod", toString(az), "weight", toString(aD)], a) | |
211 | - | ||
212 | - | ||
213 | - | func aP () = makeString(["%s%s", "config", "referralsContractAddress"], a) | |
214 | - | ||
215 | - | ||
216 | - | let aQ = addressFromStringValue(l(aP())) | |
217 | - | ||
218 | - | func aR (aS,aT) = makeString(["%s%s%s%s", "tradingReward", "history", aS, toBase58String(aT.transactionId)], a) | |
219 | - | ||
220 | - | ||
221 | - | func aU (aV) = makeString(["%s%s", "tradingReward", aV], a) | |
222 | - | ||
223 | - | ||
224 | - | func aW () = makeString(["%s", "maxRecipients"], a) | |
225 | - | ||
226 | - | ||
227 | - | func aX (aY,aS,aZ,aT) = { | |
228 | - | let ba = makeString(["%s%s%s%s__history", aY, aS, toBase58String(aT.transactionId)], a) | |
229 | - | let bb = makeString(["%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(aZ)], a) | |
230 | - | StringEntry(ba, bb) | |
185 | + | func aH (aI,aD,aJ,aE) = { | |
186 | + | let aK = makeString(["%s%s%s%s__history", aI, aD, toBase58String(aE.transactionId)], a) | |
187 | + | let aL = makeString(["%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(aJ)], a) | |
188 | + | StringEntry(aK, aL) | |
231 | 189 | } | |
232 | 190 | ||
233 | 191 | ||
234 | - | func | |
192 | + | func aM () = "%s__managerPublicKey" | |
235 | 193 | ||
236 | 194 | ||
237 | - | func | |
195 | + | func aN () = "%s__managerVaultAddress" | |
238 | 196 | ||
239 | 197 | ||
240 | - | func | |
241 | - | let | |
242 | - | if ($isInstanceOf( | |
198 | + | func aO () = { | |
199 | + | let aP = getString(aN()) | |
200 | + | if ($isInstanceOf(aP, "String")) | |
243 | 201 | then { | |
244 | - | let | |
245 | - | addressFromStringValue( | |
202 | + | let aQ = aP | |
203 | + | addressFromStringValue(aQ) | |
246 | 204 | } | |
247 | 205 | else this | |
248 | 206 | } | |
249 | 207 | ||
250 | 208 | ||
251 | - | func | |
252 | - | let | |
253 | - | let | |
254 | - | if ($isInstanceOf( | |
209 | + | func aR () = { | |
210 | + | let aS = aO() | |
211 | + | let aP = getString(aS, aM()) | |
212 | + | if ($isInstanceOf(aP, "String")) | |
255 | 213 | then { | |
256 | - | let | |
257 | - | fromBase58String( | |
214 | + | let aQ = aP | |
215 | + | fromBase58String(aQ) | |
258 | 216 | } | |
259 | - | else if ($isInstanceOf( | |
217 | + | else if ($isInstanceOf(aP, "Unit")) | |
260 | 218 | then unit | |
261 | 219 | else throw("Match error") | |
262 | 220 | } | |
263 | 221 | ||
264 | 222 | ||
265 | - | func | |
266 | - | let | |
267 | - | let | |
268 | - | if ($isInstanceOf( | |
223 | + | func aT (aE) = { | |
224 | + | let aU = throw("Permission denied") | |
225 | + | let aP = aR() | |
226 | + | if ($isInstanceOf(aP, "ByteVector")) | |
269 | 227 | then { | |
270 | - | let | |
271 | - | if (( | |
228 | + | let aV = aP | |
229 | + | if ((aE.callerPublicKey == aV)) | |
272 | 230 | then true | |
273 | - | else | |
231 | + | else aU | |
274 | 232 | } | |
275 | - | else if ($isInstanceOf( | |
276 | - | then if (( | |
233 | + | else if ($isInstanceOf(aP, "Unit")) | |
234 | + | then if ((aE.caller == this)) | |
277 | 235 | then true | |
278 | - | else | |
236 | + | else aU | |
279 | 237 | else throw("Match error") | |
280 | 238 | } | |
281 | 239 | ||
282 | 240 | ||
283 | - | func bm (bn,bo,aD,az) = { | |
284 | - | let bp = aB(az) | |
285 | - | let bq = aM(aD, az) | |
286 | - | let br = getInteger(bn, bq) | |
287 | - | let bs = aO(aD, az) | |
288 | - | if (isDefined(br)) | |
289 | - | then { | |
290 | - | let bt = value(br) | |
291 | - | let bu = value(getInteger(bn, aN(aD, az))) | |
292 | - | let bv = ((bt * bo) + bu) | |
293 | - | if ((bv > 0)) | |
294 | - | then $Tuple2((bv / b), [IntegerEntry(bp, aD), IntegerEntry(bs, bv)]) | |
295 | - | else $Tuple2(0, nil) | |
296 | - | } | |
297 | - | else { | |
298 | - | let bw = getInteger(this, bp) | |
299 | - | if (if (isDefined(bw)) | |
300 | - | then (aD >= value(bw)) | |
301 | - | else false) | |
302 | - | then { | |
303 | - | let bx = value(bw) | |
304 | - | let bt = value(getInteger(bn, aM(bx, az))) | |
305 | - | let bu = value(getInteger(bn, aN(bx, az))) | |
306 | - | let bv = ((bt * bo) + bu) | |
307 | - | if ((bv > 0)) | |
308 | - | then $Tuple2((bv / b), [IntegerEntry(bs, bv)]) | |
309 | - | else $Tuple2(0, nil) | |
310 | - | } | |
311 | - | else $Tuple2(0, nil) | |
312 | - | } | |
241 | + | func aW (an,at) = { | |
242 | + | let o = makeString(["%s%s%s", "mapping", "user2num", at], a) | |
243 | + | parseIntValue(valueOrErrorMessage(getString(Address(fromBase58String(an)), o), ((("User address " + at) + " is not found in boosting contract data, key=") + o))) | |
313 | 244 | } | |
314 | 245 | ||
315 | 246 | ||
316 | - | func by (bn,bo,aD,az) = { | |
317 | - | let bs = aO(aD, az) | |
318 | - | let bz = getInteger(bs) | |
319 | - | let bf = bz | |
320 | - | if ($isInstanceOf(bf, "Unit")) | |
321 | - | then 0 | |
322 | - | else if ($isInstanceOf(bf, "Int")) | |
323 | - | then { | |
324 | - | let bv = bf | |
325 | - | (bv / b) | |
326 | - | } | |
327 | - | else throw("Match error") | |
247 | + | func aX (at) = valueOrElse(getInteger(this, aF(at)), 0) | |
248 | + | ||
249 | + | ||
250 | + | func aY () = makeString(["%s", "rewardPerGwxIntegral"], a) | |
251 | + | ||
252 | + | ||
253 | + | func aZ () = { | |
254 | + | let ba = "%s%s__gwx__total" | |
255 | + | getInteger(ao(), ba) | |
328 | 256 | } | |
329 | 257 | ||
330 | 258 | ||
331 | - | func bA (ak,aV) = { | |
332 | - | let i = makeString(["%s%s%s", "mapping", "user2num", aV], a) | |
333 | - | parseIntValue(valueOrErrorMessage(getString(Address(fromBase58String(ak)), i), ((("User address " + aV) + " is not found in boosting contract data, key=") + i))) | |
259 | + | func bb (at) = { | |
260 | + | func bc (at) = makeString(["%s%s__gwxAmountTotal", toString(at)], a) | |
261 | + | ||
262 | + | getInteger(ao(), bc(at)) | |
334 | 263 | } | |
335 | 264 | ||
336 | 265 | ||
337 | - | func bB () = h(av()) | |
338 | - | ||
339 | - | ||
340 | - | func bC (aV) = { | |
341 | - | let am = ah() | |
342 | - | let bD = bA(am[aa], aV) | |
343 | - | let bE = getInteger(ay(bD)) | |
344 | - | let bf = bE | |
345 | - | if ($isInstanceOf(bf, "Unit")) | |
346 | - | then $Tuple2(0, nil) | |
347 | - | else if ($isInstanceOf(bf, "Int")) | |
266 | + | func bd () = { | |
267 | + | let be = valueOrElse({ | |
268 | + | let aP = getString(this, aY()) | |
269 | + | if ($isInstanceOf(aP, "String")) | |
348 | 270 | then { | |
349 | - | let | |
350 | - | | |
271 | + | let aQ = aP | |
272 | + | parseBigInt(aQ) | |
351 | 273 | } | |
352 | - | else throw("Match error") | |
274 | + | else if ($isInstanceOf(aP, "Unit")) | |
275 | + | then unit | |
276 | + | else throw("Match error") | |
277 | + | }, e) | |
278 | + | let bf = valueOrErrorMessage(getInteger(this, aq()), k(("invalid " + aq()))) | |
279 | + | let bg = valueOrErrorMessage(getInteger(aa, au()), k(("invalid " + au()))) | |
280 | + | let bh = valueOrElse(getInteger(aa, av()), 0) | |
281 | + | let bi = valueOrElse(aZ(), 0) | |
282 | + | let bj = toBigInt((height - bf)) | |
283 | + | let bk = toBigInt(bi) | |
284 | + | let bl = (be + (if ((bk == e)) | |
285 | + | then e | |
286 | + | else fraction(bj, ((toBigInt(bg) * toBigInt(bh)) * i), (bk * d)))) | |
287 | + | $Tuple2([IntegerEntry(aq(), height), StringEntry(aY(), toString(bl))], bl) | |
353 | 288 | } | |
354 | 289 | ||
355 | 290 | ||
356 | - | func | |
291 | + | func bm (at) = makeString(["%s%s", "rewardPerGwxIntegralUserLast", toString(at)], a) | |
357 | 292 | ||
358 | 293 | ||
359 | - | @Callable(aT) | |
360 | - | func tradeRewardInternal (bH,bI,bJ,bK) = if ((bK == size(bI))) | |
294 | + | func bn (at,bo) = { | |
295 | + | let bp = bd() | |
296 | + | let bq = bp._1 | |
297 | + | let bl = bp._2 | |
298 | + | let br = { | |
299 | + | let aP = getString(this, bm(at)) | |
300 | + | if ($isInstanceOf(aP, "String")) | |
301 | + | then { | |
302 | + | let aQ = aP | |
303 | + | valueOrErrorMessage(parseBigInt(aQ), k("invalid user last integral")) | |
304 | + | } | |
305 | + | else if ($isInstanceOf(aP, "Unit")) | |
306 | + | then bl | |
307 | + | else throw("Match error") | |
308 | + | } | |
309 | + | let bs = getString(ao(), as(at)) | |
310 | + | let bt = valueOrElse(getInteger(ay(bo)), 0) | |
311 | + | let bu = valueOrElse(bb(at), 0) | |
312 | + | let bv = (toInt(fraction(toBigInt(bu), (bl - br), i)) + bt) | |
313 | + | $Tuple2(([StringEntry(bm(at), toString(bl))] ++ bq), bv) | |
314 | + | } | |
315 | + | ||
316 | + | ||
317 | + | func bw (bx) = { | |
318 | + | let at = valueOrErrorMessage(addressFromString(bx), k("invalid user address")) | |
319 | + | let ap = ak() | |
320 | + | let bo = aW(ap[ad], bx) | |
321 | + | let by = bn(at, bo) | |
322 | + | let bz = by._1 | |
323 | + | let bA = by._2 | |
324 | + | $Tuple2(bA, ([IntegerEntry(ay(bo), 0)] ++ bz)) | |
325 | + | } | |
326 | + | ||
327 | + | ||
328 | + | @Callable(aE) | |
329 | + | func refreshUserReward (bB,bo) = { | |
330 | + | let bC = if ((aE.caller == ao())) | |
331 | + | then true | |
332 | + | else m("permission denied") | |
333 | + | if ((bC == bC)) | |
334 | + | then { | |
335 | + | let bD = bn(Address(bB), bo) | |
336 | + | let bz = bD._1 | |
337 | + | let bA = bD._2 | |
338 | + | $Tuple2(([IntegerEntry(ay(bo), bA)] ++ bz), bA) | |
339 | + | } | |
340 | + | else throw("Strict value is not equal to itself.") | |
341 | + | } | |
342 | + | ||
343 | + | ||
344 | + | ||
345 | + | @Callable(aE) | |
346 | + | func tradeRewardInternal (bE,bF,bG,bH) = if ((bH == size(bF))) | |
361 | 347 | then nil | |
362 | 348 | else { | |
363 | - | let | |
349 | + | let bI = [if ((aE.caller == this)) | |
364 | 350 | then true | |
365 | - | else | |
351 | + | else m("Permission denied"), if ((bE >= bG[bH])) | |
366 | 352 | then true | |
367 | - | else | |
368 | - | if (( | |
353 | + | else m("insufficient payment assetId")] | |
354 | + | if ((bI == bI)) | |
369 | 355 | then { | |
370 | - | let | |
371 | - | if (( | |
356 | + | let bJ = invoke(this, "tradeRewardInternal", [(bE - bG[bH]), bF, bG, (bH + 1)], nil) | |
357 | + | if ((bJ == bJ)) | |
372 | 358 | then { | |
373 | - | let | |
374 | - | let | |
375 | - | $Tuple2([IntegerEntry( | |
359 | + | let bK = aC(bF[bH], aE) | |
360 | + | let at = addressFromStringValue(bF[bH]) | |
361 | + | $Tuple2([IntegerEntry(bK, bG[bH]), IntegerEntry(aF(bF[bH]), bG[bH])], bJ) | |
376 | 362 | } | |
377 | 363 | else throw("Strict value is not equal to itself.") | |
378 | 364 | } | |
379 | 365 | else throw("Strict value is not equal to itself.") | |
380 | 366 | } | |
381 | 367 | ||
382 | 368 | ||
383 | 369 | ||
384 | - | @Callable( | |
385 | - | func updateReferralActivity ( | |
386 | - | let | |
387 | - | let | |
370 | + | @Callable(aE) | |
371 | + | func updateReferralActivity (at,bL) = { | |
372 | + | let bM = getString(aB, U(at)) | |
373 | + | let bN = if ((bM == unit)) | |
388 | 374 | then unit | |
389 | - | else invoke( | |
390 | - | if (( | |
375 | + | else invoke(aB, "updateReferralActivity", [K, at, (bL >= N)], nil) | |
376 | + | if ((bN == bN)) | |
391 | 377 | then $Tuple2(nil, unit) | |
392 | 378 | else throw("Strict value is not equal to itself.") | |
393 | 379 | } | |
394 | 380 | ||
395 | 381 | ||
396 | 382 | ||
397 | - | @Callable(aT) | |
398 | - | func finalizeHelper () = { | |
399 | - | let bR = valueOrElse(getInteger(aw()), e) | |
400 | - | let bS = h(ax()) | |
401 | - | let bT = h(at()) | |
402 | - | let bU = h(au()) | |
403 | - | let bV = valueOrElse(getInteger(al(), ao()), 0) | |
404 | - | let bW = aL(bS) | |
405 | - | let bX = h(aL(bS)) | |
406 | - | let bo = h(aC(bS)) | |
407 | - | if ((bS > bU)) | |
408 | - | then $Tuple2(nil, false) | |
409 | - | else if ((bR == e)) | |
410 | - | then { | |
411 | - | let bY = bm(al(), bo, bS, bT) | |
412 | - | let bZ = bY._1 | |
413 | - | let ca = bY._2 | |
414 | - | let cb = (bX + bZ) | |
415 | - | let cc = if (((bV - 1) > bT)) | |
416 | - | then [IntegerEntry(at(), (bT + 1))] | |
417 | - | else [IntegerEntry(aw(), f), IntegerEntry(at(), 0)] | |
418 | - | $Tuple2((([IntegerEntry(bW, cb)] ++ cc) ++ ca), true) | |
419 | - | } | |
420 | - | else if ((bR == f)) | |
421 | - | then { | |
422 | - | let bZ = by(al(), bo, bS, bT) | |
423 | - | let cd = fraction(h(aF(bS)), bZ, bX) | |
424 | - | let ce = fraction(h(aE(bS)), bZ, bX) | |
425 | - | let cf = (ce + cd) | |
426 | - | let bE = getInteger(ay(bT)) | |
427 | - | let aV = getStringValue(al(), D(bT)) | |
428 | - | let bP = getString(aQ, R(aV)) | |
429 | - | let bQ = if ((bP == unit)) | |
430 | - | then unit | |
431 | - | else invoke(aQ, "updateReferralActivity", [H, aV, (bZ >= K)], nil) | |
432 | - | if ((bQ == bQ)) | |
433 | - | then { | |
434 | - | let cg = if (if ((bP == unit)) | |
435 | - | then true | |
436 | - | else (K > bZ)) | |
437 | - | then unit | |
438 | - | else { | |
439 | - | let ch = fraction(cf, N, b) | |
440 | - | let ci = fraction(cf, Q, b) | |
441 | - | invoke(aQ, "incUnclaimed", [H, aV, ch, ci], nil) | |
442 | - | } | |
443 | - | if ((cg == cg)) | |
444 | - | then { | |
445 | - | let cj = [IntegerEntry(ay(bT), (valueOrElse(bE, 0) + cf))] | |
446 | - | let cc = if (((bV - 1) > bT)) | |
447 | - | then [IntegerEntry(at(), (bT + 1))] | |
448 | - | else [IntegerEntry(ax(), (bS + 1)), IntegerEntry(at(), 0), DeleteEntry(aw())] | |
449 | - | $Tuple2((cj ++ cc), true) | |
450 | - | } | |
451 | - | else throw("Strict value is not equal to itself.") | |
452 | - | } | |
453 | - | else throw("Strict value is not equal to itself.") | |
454 | - | } | |
455 | - | else throw("invalid processing stage") | |
456 | - | } | |
383 | + | @Callable(aE) | |
384 | + | func processPendingPeriodsAndUsers () = $Tuple2(nil, m("deprecated")) | |
457 | 385 | ||
458 | 386 | ||
459 | 387 | ||
460 | - | @Callable(aT) | |
461 | - | func finalizeWrapper (ck) = { | |
462 | - | let cl = { | |
463 | - | let cm = invoke(this, "finalizeHelper", nil, nil) | |
464 | - | if ($isInstanceOf(cm, "Boolean")) | |
465 | - | then cm | |
466 | - | else throw(($getType(cm) + " couldn't be cast to Boolean")) | |
467 | - | } | |
468 | - | if ((cl == cl)) | |
469 | - | then if (!(cl)) | |
470 | - | then if ((ck == w)) | |
471 | - | then throw("Nothing to process") | |
472 | - | else $Tuple2(nil, unit) | |
473 | - | else if ((ck > 0)) | |
474 | - | then $Tuple2(nil, invoke(this, "finalizeWrapper", [(ck - 1)], nil)) | |
475 | - | else $Tuple2(nil, unit) | |
476 | - | else throw("Strict value is not equal to itself.") | |
477 | - | } | |
478 | - | ||
479 | - | ||
480 | - | ||
481 | - | @Callable(aT) | |
482 | - | func processPendingPeriodsAndUsers () = $Tuple2(nil, invoke(this, "finalizeWrapper", [w], nil)) | |
483 | - | ||
484 | - | ||
485 | - | ||
486 | - | @Callable(aT) | |
487 | - | func deposit () = { | |
488 | - | let cn = if ((aT.caller == C)) | |
388 | + | @Callable(aE) | |
389 | + | func claimReward () = { | |
390 | + | let ap = ak() | |
391 | + | let at = aE.caller | |
392 | + | let bx = toString(at) | |
393 | + | let bO = bw(bx) | |
394 | + | let aJ = bO._1 | |
395 | + | let bz = bO._2 | |
396 | + | let bP = if ((aJ > 0)) | |
489 | 397 | then true | |
490 | - | else | |
491 | - | if (( | |
398 | + | else throw("nothing to claim") | |
399 | + | if ((bP == bP)) | |
492 | 400 | then { | |
493 | - | let aD = bB() | |
494 | - | let co = (height - j(an())) | |
495 | - | let cp = valueOrErrorMessage(getInteger(X, ap()), (("mandatory emission_contract." + ap()) + " is not defined")) | |
496 | - | let cq = valueOrElse(getInteger(X, aq()), 0) | |
497 | - | if ((cq == cq)) | |
401 | + | let bu = { | |
402 | + | let bQ = invoke(ao(), "getUserGwxAmount", [bx], nil) | |
403 | + | if ($isInstanceOf(bQ, "Int")) | |
404 | + | then bQ | |
405 | + | else throw(($getType(bQ) + " couldn't be cast to Int")) | |
406 | + | } | |
407 | + | let bM = getString(aB, U(bx)) | |
408 | + | let bN = if ((bM == unit)) | |
409 | + | then unit | |
410 | + | else invoke(aB, "updateReferralActivity", [K, at, (bu >= N)], nil) | |
411 | + | if ((bN == bN)) | |
498 | 412 | then { | |
499 | - | let cr = fraction((co * cq), cp, c) | |
500 | - | let cs = if ((cr > 0)) | |
501 | - | then invoke(X, "emit", [cr], nil) | |
502 | - | else unit | |
503 | - | if ((cs == cs)) | |
413 | + | let bR = if (if ((bM == unit)) | |
414 | + | then true | |
415 | + | else (N > bu)) | |
416 | + | then unit | |
417 | + | else { | |
418 | + | let bS = fraction(aJ, Q, b) | |
419 | + | let bT = fraction(aJ, T, b) | |
420 | + | invoke(aB, "incUnclaimed", [K, at, bS, bT], nil) | |
421 | + | } | |
422 | + | if ((bR == bR)) | |
504 | 423 | then { | |
505 | - | let ct = 0 | |
506 | - | let cu = aH(aD, ct, cr) | |
507 | - | let cv = { | |
508 | - | let cm = invoke(X, "gwxHoldersRewardUpdate", nil, nil) | |
509 | - | if ($isInstanceOf(cm, "Boolean")) | |
510 | - | then cm | |
511 | - | else throw(($getType(cm) + " couldn't be cast to Boolean")) | |
424 | + | let bU = { | |
425 | + | let bQ = invoke(aB, "claim", [K], nil) | |
426 | + | if ($isInstanceOf(bQ, "Int")) | |
427 | + | then bQ | |
428 | + | else throw(($getType(bQ) + " couldn't be cast to Int")) | |
512 | 429 | } | |
513 | - | if (( | |
430 | + | if ((bU == bU)) | |
514 | 431 | then { | |
515 | - | let cw = (ct + cr) | |
516 | - | let cx = if (if ((cw == 0)) | |
517 | - | then !(cv) | |
518 | - | else false) | |
519 | - | then nil | |
520 | - | else [IntegerEntry(au(), aD), IntegerEntry(aC(aD), height), IntegerEntry(aE(aD), cr), IntegerEntry(an(), height), IntegerEntry(aF(aD), ct), IntegerEntry(av(), (aD + 1)), StringEntry(aG(), cu), StringEntry(aK(aD), cu)] | |
521 | - | $Tuple2(cx, unit) | |
432 | + | let bV = (aJ + bU) | |
433 | + | $Tuple2(([ScriptTransfer(aE.caller, aJ, fromBase58String(ap[ab])), aH("claim", bx, bV, aE)] ++ bz), bV) | |
522 | 434 | } | |
523 | 435 | else throw("Strict value is not equal to itself.") | |
524 | 436 | } | |
525 | 437 | else throw("Strict value is not equal to itself.") | |
526 | 438 | } | |
527 | 439 | else throw("Strict value is not equal to itself.") | |
528 | 440 | } | |
529 | 441 | else throw("Strict value is not equal to itself.") | |
530 | 442 | } | |
531 | 443 | ||
532 | 444 | ||
533 | 445 | ||
534 | - | @Callable(aT) | |
535 | - | func claimReward () = { | |
536 | - | let am = ah() | |
537 | - | let cy = toString(aT.caller) | |
538 | - | let cz = bC(cy) | |
539 | - | let aZ = cz._1 | |
540 | - | let cx = cz._2 | |
541 | - | let cA = if ((aZ > 0)) | |
542 | - | then true | |
543 | - | else throw("Nothing to claim") | |
544 | - | if ((cA == cA)) | |
545 | - | then { | |
546 | - | let cB = 0 | |
547 | - | let cC = { | |
548 | - | let cm = invoke(aQ, "claim", [H], nil) | |
549 | - | if ($isInstanceOf(cm, "Int")) | |
550 | - | then cm | |
551 | - | else throw(($getType(cm) + " couldn't be cast to Int")) | |
552 | - | } | |
553 | - | let cD = (aZ + cC) | |
554 | - | $Tuple2(([ScriptTransfer(aT.caller, cD, fromBase58String(am[Y])), aX("claim", cy, aZ, aT)] ++ cx), [cD, cB]) | |
555 | - | } | |
556 | - | else throw("Strict value is not equal to itself.") | |
446 | + | @Callable(aE) | |
447 | + | func claimRewardREADONLY (bW) = { | |
448 | + | let bX = bw(bW) | |
449 | + | let aJ = bX._1 | |
450 | + | let bz = bX._2 | |
451 | + | let bY = valueOrElse(getInteger(aB, W(K, bW)), 0) | |
452 | + | let bV = (aJ + bY) | |
453 | + | $Tuple2(nil, bV) | |
557 | 454 | } | |
558 | 455 | ||
559 | 456 | ||
560 | 457 | ||
561 | - | @Callable(aT) | |
562 | - | func claimRewardREADONLY (cy) = { | |
563 | - | let cE = bC(cy) | |
564 | - | let aZ = cE._1 | |
565 | - | let cx = cE._2 | |
566 | - | let cF = valueOrElse(getInteger(aQ, T(H, cy)), 0) | |
567 | - | let cD = (aZ + cF) | |
568 | - | $Tuple2(nil, cD) | |
569 | - | } | |
458 | + | @Callable(aE) | |
459 | + | func onEmissionForGwxStart () = if ((aE.caller != C)) | |
460 | + | then throw("permissions denied") | |
461 | + | else [IntegerEntry(aq(), height)] | |
570 | 462 | ||
571 | 463 | ||
572 | 464 | ||
573 | - | @Callable(aT) | |
574 | - | func latestFinalizedPeriodREADONLY (cy) = $Tuple2(nil, valueOrElse(getInteger(this, au()), -1)) | |
575 | - | ||
576 | - | ||
577 | - | ||
578 | - | @Callable(aT) | |
579 | - | func latestFinalizedPeriodInfoREADONLY (cy) = $Tuple2(nil, k(aG())) | |
580 | - | ||
581 | - | ||
582 | - | ||
583 | - | @Callable(aT) | |
584 | - | func calcGwxParamsREADONLY (cG,cH,cI) = { | |
585 | - | let cJ = (cH + cI) | |
586 | - | let cK = -(fraction(cG, b, cI)) | |
587 | - | let cL = (fraction(cG, b, cI) * cJ) | |
588 | - | $Tuple2(nil, [cK, cL, bB()]) | |
589 | - | } | |
590 | - | ||
591 | - | ||
592 | - | ||
593 | - | @Callable(aT) | |
594 | - | func calcGwxAmountStartREADONLY (cM,cN,cO) = { | |
595 | - | let cP = fraction(cN, c, cO) | |
596 | - | let bO = fraction(cM, cP, c) | |
597 | - | $Tuple2(nil, [bO]) | |
598 | - | } | |
599 | - | ||
600 | - | ||
601 | - | ||
602 | - | @Callable(aT) | |
603 | - | func onEmissionForGwxStart () = if ((aT.caller != z)) | |
604 | - | then throw("permissions denied") | |
605 | - | else [IntegerEntry(an(), height)] | |
606 | - | ||
607 | - | ||
608 | - | ||
609 | - | @Callable(aT) | |
610 | - | func latestPeriodEmissionRewardsREADONLY (cy) = { | |
611 | - | let aD = bB() | |
612 | - | $Tuple2(nil, [h(aE(aD))]) | |
613 | - | } | |
614 | - | ||
615 | - | ||
616 | - | ||
617 | - | @Callable(aT) | |
618 | - | func calcD (cQ,cR,cS,cT,cU) = { | |
619 | - | let cV = toBigInt(2) | |
620 | - | let cW = parseBigIntValue(cT) | |
621 | - | let cX = parseBigIntValue(cU) | |
622 | - | let cY = parseBigIntValue(cQ) | |
623 | - | let cZ = parseBigIntValue(cR) | |
624 | - | let da = (parseBigIntValue(cS) * cW) | |
625 | - | let bg = (cY + cZ) | |
626 | - | if ((bg == d)) | |
627 | - | then $Tuple2(nil, toString(d)) | |
628 | - | else { | |
629 | - | let db = (da * cV) | |
630 | - | let dc = [0, 1, 2, 3, 4, 5, 6] | |
631 | - | func dd (de,df) = { | |
632 | - | let dg = de | |
633 | - | let dh = dg._1 | |
634 | - | let di = dg._2 | |
635 | - | let dj = dg._3 | |
636 | - | if ((dj != unit)) | |
637 | - | then de | |
638 | - | else { | |
639 | - | let dk = (((dh * dh) * dh) / (((cY * cZ) * cV) * cV)) | |
640 | - | let dl = (((((db * bg) / cW) + (dk * cV)) * dh) / ((((db - cW) * dh) / cW) + ((cV + toBigInt(1)) * dk))) | |
641 | - | let dm = t((dl - value(dh))) | |
642 | - | if ((cX >= dm)) | |
643 | - | then $Tuple3(dl, dh, df) | |
644 | - | else $Tuple3(dl, dh, unit) | |
645 | - | } | |
646 | - | } | |
647 | - | ||
648 | - | let dn = { | |
649 | - | let do = dc | |
650 | - | let dp = size(do) | |
651 | - | let dq = $Tuple3(bg, unit, unit) | |
652 | - | func dr (ds,dt) = if ((dt >= dp)) | |
653 | - | then ds | |
654 | - | else dd(ds, do[dt]) | |
655 | - | ||
656 | - | func du (ds,dt) = if ((dt >= dp)) | |
657 | - | then ds | |
658 | - | else throw("List size exceeds 7") | |
659 | - | ||
660 | - | du(dr(dr(dr(dr(dr(dr(dr(dq, 0), 1), 2), 3), 4), 5), 6), 7) | |
661 | - | } | |
662 | - | let dl = dn._1 | |
663 | - | let di = dn._2 | |
664 | - | let dj = dn._3 | |
665 | - | if ((dj != unit)) | |
666 | - | then $Tuple2(nil, toString(dl)) | |
667 | - | else { | |
668 | - | let dm = t((dl - value(di))) | |
669 | - | throw(("D calculation error, dDiff = " + toString(dm))) | |
670 | - | } | |
671 | - | } | |
672 | - | } | |
673 | - | ||
674 | - | ||
675 | - | ||
676 | - | @Callable(aT) | |
677 | - | func tradeReward (bI,bJ) = { | |
678 | - | let dv = (size(bI) == size(bJ)) | |
679 | - | let dw = valueOrElse(getInteger(aW()), 0) | |
680 | - | let dx = aT.payments[0] | |
681 | - | let dy = dx.assetId | |
682 | - | let dz = dx.amount | |
683 | - | let bL = [if ((dw >= size(bI))) | |
465 | + | @Callable(aE) | |
466 | + | func tradeReward (bF,bG) = { | |
467 | + | let bZ = (size(bF) == size(bG)) | |
468 | + | let ca = valueOrElse(getInteger(aG()), 0) | |
469 | + | let cb = aE.payments[0] | |
470 | + | let cc = cb.assetId | |
471 | + | let cd = cb.amount | |
472 | + | let bI = [if ((ca >= size(bF))) | |
684 | 473 | then true | |
685 | - | else | |
474 | + | else m("Too many recipients"), if (bZ) | |
686 | 475 | then true | |
687 | - | else | |
476 | + | else m("Arguments size mismatch"), if ((cc == aj)) | |
688 | 477 | then true | |
689 | - | else | |
690 | - | if (( | |
478 | + | else m("Wrong asset payment")] | |
479 | + | if ((bI == bI)) | |
691 | 480 | then { | |
692 | - | let | |
693 | - | if (( | |
694 | - | then $Tuple2(nil, | |
481 | + | let bJ = invoke(this, "tradeRewardInternal", [cd, bF, bG, 0], nil) | |
482 | + | if ((bJ == bJ)) | |
483 | + | then $Tuple2(nil, bJ) | |
695 | 484 | else throw("Strict value is not equal to itself.") | |
696 | 485 | } | |
697 | 486 | else throw("Strict value is not equal to itself.") | |
698 | 487 | } | |
699 | 488 | ||
700 | 489 | ||
701 | 490 | ||
702 | - | @Callable( | |
491 | + | @Callable(aE) | |
703 | 492 | func claimTradingReward () = { | |
704 | - | let | |
705 | - | let | |
706 | - | let | |
707 | - | if (( | |
708 | - | then $Tuple2([ScriptTransfer( | |
709 | - | else | |
493 | + | let at = aE.caller | |
494 | + | let ce = toString(at) | |
495 | + | let bA = aX(ce) | |
496 | + | if ((bA > 0)) | |
497 | + | then $Tuple2([ScriptTransfer(at, bA, aj), IntegerEntry(aF(ce), 0)], bA) | |
498 | + | else m("nothing to claim") | |
710 | 499 | } | |
711 | 500 | ||
712 | 501 | ||
713 | 502 | ||
714 | - | @Callable( | |
715 | - | func claimTradingRewardREADONLY ( | |
503 | + | @Callable(aE) | |
504 | + | func claimTradingRewardREADONLY (at) = $Tuple2(nil, aX(at)) | |
716 | 505 | ||
717 | 506 | ||
718 | - | @Verifier( | |
719 | - | func | |
720 | - | let | |
721 | - | let | |
722 | - | if ($isInstanceOf( | |
507 | + | @Verifier(cf) | |
508 | + | func cg () = { | |
509 | + | let ch = { | |
510 | + | let aP = aR() | |
511 | + | if ($isInstanceOf(aP, "ByteVector")) | |
723 | 512 | then { | |
724 | - | let | |
725 | - | | |
513 | + | let aV = aP | |
514 | + | aV | |
726 | 515 | } | |
727 | - | else if ($isInstanceOf( | |
728 | - | then | |
516 | + | else if ($isInstanceOf(aP, "Unit")) | |
517 | + | then cf.senderPublicKey | |
729 | 518 | else throw("Match error") | |
730 | 519 | } | |
731 | - | sigVerify( | |
520 | + | sigVerify(cf.bodyBytes, cf.proofs[0], ch) | |
732 | 521 | } | |
733 | 522 |
github/deemru/w8io/169f3d6 137.77 ms ◑