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:BgKMFggCEgQKAgIBEgYKBAEYEQESBAoCCAESABIAEgMKAQgSABIECgIYERIAEgMKAQgiA1NFUCIFU0NBTEUiBU1VTFQ4IgdNVUxUOEJJIgp6ZXJvQmlnSW50IhRwcm9jZXNzaW5nU3RhZ2VUb3RhbCIVcHJvY2Vzc2luZ1N0YWdlU2hhcmVzIgZNVUxUMTgiCE1VTFQxOEJJIgt3YXZlc1N0cmluZyIHd3JhcEVyciIDbXNnIgh0aHJvd0VyciIOZ2V0TnVtYmVyQnlLZXkiA2tleSIPZ2V0TnVtYmVyT3JGYWlsIg5nZXRTdHJpbmdCeUtleSIPZ2V0U3RyaW5nT3JGYWlsIgxwYXJzZUFzc2V0SWQiBWlucHV0IgNhYnMiA3ZhbCIJYWJzQmlnSW50IgtrZXlNYXhEZXB0aCIPbWF4RGVwdGhEZWZhdWx0IghtYXhEZXB0aCIRa2V5RmFjdG9yeUFkZHJlc3MiEWZhY3RvcnlBZGRyZXNzU3RyIg9mYWN0b3J5Q29udHJhY3QiEmtleUVtaXNzaW9uQWRkcmVzcyIZa2V5Vm90aW5nRW1p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gADCQABAgUCYVACCkJ5dGVWZWN0b3IEAmFWBQJhUAUCYVYDCQABAgUCYVACBFVuaXQIBQJjZg9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCY2YJYm9keUJ5dGVzCQCRAwIIBQJjZgZwcm9vZnMAAAUCY2iJw1hP", "height": 2714656, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: F1jk2vaguPNe2csU8QgwMub7ZcvwW6GhDN8ZRT4PLLgA Next: G6fZHDhXeatGFoj34kPv9VhdwkiimeX6CM7cG5843yyL Diff:
OldNewDifferences
77
88 let c = 100000000
99
10-let d = toBigInt(0)
10+let d = toBigInt(c)
1111
12-let e = 0
12+let e = toBigInt(0)
1313
14-let f = 1
14+let f = 0
1515
16-let g = "WAVES"
16+let g = 1
1717
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], " ")
1925
2026
21-func j (i) = valueOrErrorMessage(getInteger(this, i), (("mandatory this." + i) + " is not defined"))
27+func m (l) = throw(k(l))
2228
2329
24-func k (i) = valueOrElse(getString(this, i), "")
30+func n (o) = valueOrElse(getInteger(this, o), 0)
2531
2632
27-func l (i) = valueOrErrorMessage(getString(this, i), (("mandatory this." + i) + " is not defined"))
33+func p (o) = valueOrErrorMessage(getInteger(this, o), k((("mandatory this." + o) + " is not defined")))
2834
2935
30-func m (n) = if ((n == g))
31- then unit
32- else fromBase58String(n)
36+func q (o) = valueOrElse(getString(this, o), "")
3337
3438
35-func o (p) = makeString(["gwx_reward.ride:", p], " ")
39+func r (o) = valueOrErrorMessage(getString(this, o), k((("mandatory this." + o) + " is not defined")))
3640
3741
38-func q (p) = throw(o(p))
42+func s (t) = if ((t == j))
43+ then unit
44+ else fromBase58String(t)
3945
4046
41-func r (s) = if ((0 > s))
42- then -(s)
43- else s
47+func u (v) = if ((0 > v))
48+ then -(v)
49+ else v
4450
4551
46-func t (s) = if ((d > s))
47- then -(s)
48- else s
52+func w (v) = if ((e > v))
53+ then -(v)
54+ else v
4955
5056
51-let u = "%s__maxDepth"
57+let x = "%s__maxDepth"
5258
53-let v = 30
59+let y = 30
5460
55-let w = valueOrElse(getInteger(this, u), v)
61+let z = valueOrElse(getInteger(this, x), y)
5662
57-func x () = "%s%s__config__factoryAddress"
63+func A () = "%s%s__config__factoryAddress"
5864
5965
60-let y = l(x())
66+let B = r(A())
6167
62-let z = addressFromStringValue(y)
68+let C = addressFromStringValue(B)
6369
64-func A () = "%s%s__config__emissionAddress"
70+func D () = "%s%s__config__emissionAddress"
6571
6672
67-func B () = makeString(["%s", "votingEmissionContract"], a)
73+func E () = makeString(["%s", "votingEmissionContract"], a)
6874
6975
70-let C = addressFromStringValue(getStringValue(z, B()))
76+let F = addressFromStringValue(getStringValue(C, E()))
7177
72-func D (E) = makeString(["%s%s%s", "mapping", "num2user", toString(E)], a)
78+func G (H) = makeString(["%s%s%s", "mapping", "num2user", toString(H)], a)
7379
7480
75-let F = makeString(["%s%s", "referral", "programName"], a)
81+let I = makeString(["%s%s", "referral", "programName"], a)
7682
77-let G = "wxlock"
83+let J = "wxlock"
7884
79-let H = valueOrElse(getString(this, F), G)
85+let K = valueOrElse(getString(this, I), J)
8086
81-let I = makeString(["%s%s", "referral", "minGWxAmount"], a)
87+let L = makeString(["%s%s", "referral", "minGWxAmount"], a)
8288
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)
9090
9191 let N = valueOrElse(getInteger(this, L), M)
9292
93-let O = makeString(["%s%s", "referral", "referralRewardPermille"], a)
93+let O = makeString(["%s%s", "referral", "referrerRewardPermille"], a)
9494
9595 let P = 50
9696
9797 let Q = valueOrElse(getInteger(this, O), P)
9898
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)
100106
101107
102-func T (U,V) = makeString(["%s%s%s", "unclaimedReferral", U, V], a)
108+func W (X,Y) = makeString(["%s%s%s", "unclaimedReferral", X, Y], a)
103109
104110
105-let W = l(A())
111+let Z = r(D())
106112
107-let X = addressFromStringValue(W)
113+let aa = addressFromStringValue(Z)
108114
109-let Y = 1
115+let ab = 1
110116
111-let Z = 2
117+let ac = 2
112118
113-let aa = 3
119+let ad = 3
114120
115-let ab = 4
121+let ae = 4
116122
117-func ac () = "%s__config"
123+func af () = "%s__config"
118124
119125
120-func ad () = addressFromStringValue(valueOrErrorMessage(getString(this, A()), (("mandatory this." + A()) + " is not defined")))
126+func ag () = addressFromStringValue(valueOrErrorMessage(getString(this, D()), (("mandatory this." + D()) + " is not defined")))
121127
122128
123-let ae = ad()
129+let ah = ag()
124130
125-let af = split(value(getString(ae, ac())), a)[1]
131+let ai = split(value(getString(ah, af())), a)[1]
126132
127-let ag = fromBase58String(af)
133+let aj = fromBase58String(ai)
128134
129-func ah () = split(l(ac()), a)
135+func ak () = split(r(af()), a)
130136
131137
132-func ai (af,aj,ak,w) = makeString(["%s%s%s%d", af, aj, ak, toString(w)], a)
138+func al (ai,am,an,z) = makeString(["%s%s%s%d", ai, am, an, toString(z)], a)
133139
134140
135-func al () = {
136- let am = ah()
137- valueOrErrorMessage(addressFromString(am[aa]), "boosting contract address is not defined")
141+func ao () = {
142+ let ap = ak()
143+ valueOrErrorMessage(addressFromString(ap[ad]), "boosting contract address is not defined")
138144 }
139145
140146
141-func an () = "%s%s__gwxRewardEmissionPart__startHeight"
147+func aq () = "%s%s__gwxRewardEmissionPart__startHeight"
142148
143149
144-func ao () = "%s__nextUserNum"
150+func ar () = "%s__nextUserNum"
145151
146152
147-func ap () = "%s%s__ratePerBlock__current"
153+func as (at) = makeString(["%s%s%s__mapping__user2num", toString(at)], a)
148154
149155
150-func aq () = "%s%s__gwxHoldersReward__current"
156+func au () = "%s%s__ratePerBlock__current"
151157
152158
153-func ar () = "%s%s__gwxHoldersReward__next"
159+func av () = "%s%s__gwxHoldersReward__current"
154160
155161
156-func as () = "%s%s__poolWeight__GWXvirtualPOOL"
162+func aw () = "%s%s__gwxHoldersReward__next"
157163
158164
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"
172166
173167
174168 func ay (az) = makeString(["%s%d", "userUnclaimed", toString(az)], a)
175169
176170
177-func aA (az) = makeString(["%s%d__nextClaimedPeriod", toString(az)], a)
171+func aA () = makeString(["%s%s", "config", "referralsContractAddress"], a)
178172
179173
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)
181177
182178
183-func aC (aD) = makeString(["%s%d__startHeightForPeriod", toString(aD)], a)
179+func aF (at) = makeString(["%s%s", "tradingReward", at], a)
184180
185181
186-func aE (aD) = makeString(["%s%d__auxEmissionReward", toString(aD)], a)
182+func aG () = makeString(["%s", "maxRecipients"], a)
187183
188184
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)
231189 }
232190
233191
234-func bc () = "%s__managerPublicKey"
192+func aM () = "%s__managerPublicKey"
235193
236194
237-func bd () = "%s__managerVaultAddress"
195+func aN () = "%s__managerVaultAddress"
238196
239197
240-func be () = {
241- let bf = getString(bd())
242- if ($isInstanceOf(bf, "String"))
198+func aO () = {
199+ let aP = getString(aN())
200+ if ($isInstanceOf(aP, "String"))
243201 then {
244- let bg = bf
245- addressFromStringValue(bg)
202+ let aQ = aP
203+ addressFromStringValue(aQ)
246204 }
247205 else this
248206 }
249207
250208
251-func bh () = {
252- let bi = be()
253- let bf = getString(bi, bc())
254- if ($isInstanceOf(bf, "String"))
209+func aR () = {
210+ let aS = aO()
211+ let aP = getString(aS, aM())
212+ if ($isInstanceOf(aP, "String"))
255213 then {
256- let bg = bf
257- fromBase58String(bg)
214+ let aQ = aP
215+ fromBase58String(aQ)
258216 }
259- else if ($isInstanceOf(bf, "Unit"))
217+ else if ($isInstanceOf(aP, "Unit"))
260218 then unit
261219 else throw("Match error")
262220 }
263221
264222
265-func bj (aT) = {
266- let bk = throw("Permission denied")
267- let bf = bh()
268- if ($isInstanceOf(bf, "ByteVector"))
223+func aT (aE) = {
224+ let aU = throw("Permission denied")
225+ let aP = aR()
226+ if ($isInstanceOf(aP, "ByteVector"))
269227 then {
270- let bl = bf
271- if ((aT.callerPublicKey == bl))
228+ let aV = aP
229+ if ((aE.callerPublicKey == aV))
272230 then true
273- else bk
231+ else aU
274232 }
275- else if ($isInstanceOf(bf, "Unit"))
276- then if ((aT.caller == this))
233+ else if ($isInstanceOf(aP, "Unit"))
234+ then if ((aE.caller == this))
277235 then true
278- else bk
236+ else aU
279237 else throw("Match error")
280238 }
281239
282240
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)))
313244 }
314245
315246
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)
328256 }
329257
330258
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))
334263 }
335264
336265
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"))
348270 then {
349- let bF = bf
350- $Tuple2(bF, [IntegerEntry(ay(bD), 0)])
271+ let aQ = aP
272+ parseBigInt(aQ)
351273 }
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)
353288 }
354289
355290
356-func bG (aV) = valueOrElse(getInteger(this, aU(aV)), 0)
291+func bm (at) = makeString(["%s%s", "rewardPerGwxIntegralUserLast", toString(at)], a)
357292
358293
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)))
361347 then nil
362348 else {
363- let bL = [if ((aT.caller == this))
349+ let bI = [if ((aE.caller == this))
364350 then true
365- else q("Permission denied"), if ((bH >= bJ[bK]))
351+ else m("Permission denied"), if ((bE >= bG[bH]))
366352 then true
367- else q("insufficient payment assetId")]
368- if ((bL == bL))
353+ else m("insufficient payment assetId")]
354+ if ((bI == bI))
369355 then {
370- let bM = invoke(this, "tradeRewardInternal", [(bH - bJ[bK]), bI, bJ, (bK + 1)], nil)
371- if ((bM == bM))
356+ let bJ = invoke(this, "tradeRewardInternal", [(bE - bG[bH]), bF, bG, (bH + 1)], nil)
357+ if ((bJ == bJ))
372358 then {
373- let bN = aR(bI[bK], aT)
374- let aV = addressFromStringValue(bI[bK])
375- $Tuple2([IntegerEntry(bN, bJ[bK]), IntegerEntry(aU(bI[bK]), bJ[bK])], bM)
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)
376362 }
377363 else throw("Strict value is not equal to itself.")
378364 }
381367
382368
383369
384-@Callable(aT)
385-func updateReferralActivity (aV,bO) = {
386- let bP = getString(aQ, R(aV))
387- let bQ = if ((bP == unit))
370+@Callable(aE)
371+func updateReferralActivity (at,bL) = {
372+ let bM = getString(aB, U(at))
373+ let bN = if ((bM == unit))
388374 then unit
389- else invoke(aQ, "updateReferralActivity", [H, aV, (bO >= K)], nil)
390- if ((bQ == bQ))
375+ else invoke(aB, "updateReferralActivity", [K, at, (bL >= N)], nil)
376+ if ((bN == bN))
391377 then $Tuple2(nil, unit)
392378 else throw("Strict value is not equal to itself.")
393379 }
394380
395381
396382
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"))
457385
458386
459387
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))
489397 then true
490- else bj(aT)
491- if ((cn == cn))
398+ else throw("nothing to claim")
399+ if ((bP == bP))
492400 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))
498412 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))
504423 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"))
512429 }
513- if ((cv == cv))
430+ if ((bU == bU))
514431 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)
522434 }
523435 else throw("Strict value is not equal to itself.")
524436 }
531443
532444
533445
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)
557454 }
558455
559456
560457
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)]
570462
571463
572464
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)))
684473 then true
685- else q("Too many recipients"), if (dv)
474+ else m("Too many recipients"), if (bZ)
686475 then true
687- else q("Arguments size mismatch"), if ((dy == ag))
476+ else m("Arguments size mismatch"), if ((cc == aj))
688477 then true
689- else q("Wrong asset payment")]
690- if ((bL == bL))
478+ else m("Wrong asset payment")]
479+ if ((bI == bI))
691480 then {
692- let bM = invoke(this, "tradeRewardInternal", [dz, bI, bJ, 0], nil)
693- if ((bM == bM))
694- then $Tuple2(nil, bM)
481+ let bJ = invoke(this, "tradeRewardInternal", [cd, bF, bG, 0], nil)
482+ if ((bJ == bJ))
483+ then $Tuple2(nil, bJ)
695484 else throw("Strict value is not equal to itself.")
696485 }
697486 else throw("Strict value is not equal to itself.")
699488
700489
701490
702-@Callable(aT)
491+@Callable(aE)
703492 func claimTradingReward () = {
704- let aV = aT.caller
705- let dA = toString(aV)
706- let dB = bG(dA)
707- if ((dB > 0))
708- then $Tuple2([ScriptTransfer(aV, dB, ag), IntegerEntry(aU(dA), 0)], dB)
709- else q("nothing to claim")
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")
710499 }
711500
712501
713502
714-@Callable(aT)
715-func claimTradingRewardREADONLY (aV) = $Tuple2(nil, bG(aV))
503+@Callable(aE)
504+func claimTradingRewardREADONLY (at) = $Tuple2(nil, aX(at))
716505
717506
718-@Verifier(dC)
719-func dD () = {
720- let dE = {
721- let bf = bh()
722- if ($isInstanceOf(bf, "ByteVector"))
507+@Verifier(cf)
508+func cg () = {
509+ let ch = {
510+ let aP = aR()
511+ if ($isInstanceOf(aP, "ByteVector"))
723512 then {
724- let bl = bf
725- bl
513+ let aV = aP
514+ aV
726515 }
727- else if ($isInstanceOf(bf, "Unit"))
728- then dC.senderPublicKey
516+ else if ($isInstanceOf(aP, "Unit"))
517+ then cf.senderPublicKey
729518 else throw("Match error")
730519 }
731- sigVerify(dC.bodyBytes, dC.proofs[0], dE)
520+ sigVerify(cf.bodyBytes, cf.proofs[0], ch)
732521 }
733522
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "__"
55
66 let b = 1000
77
88 let c = 100000000
99
10-let d = toBigInt(0)
10+let d = toBigInt(c)
1111
12-let e = 0
12+let e = toBigInt(0)
1313
14-let f = 1
14+let f = 0
1515
16-let g = "WAVES"
16+let g = 1
1717
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], " ")
1925
2026
21-func j (i) = valueOrErrorMessage(getInteger(this, i), (("mandatory this." + i) + " is not defined"))
27+func m (l) = throw(k(l))
2228
2329
24-func k (i) = valueOrElse(getString(this, i), "")
30+func n (o) = valueOrElse(getInteger(this, o), 0)
2531
2632
27-func l (i) = valueOrErrorMessage(getString(this, i), (("mandatory this." + i) + " is not defined"))
33+func p (o) = valueOrErrorMessage(getInteger(this, o), k((("mandatory this." + o) + " is not defined")))
2834
2935
30-func m (n) = if ((n == g))
31- then unit
32- else fromBase58String(n)
36+func q (o) = valueOrElse(getString(this, o), "")
3337
3438
35-func o (p) = makeString(["gwx_reward.ride:", p], " ")
39+func r (o) = valueOrErrorMessage(getString(this, o), k((("mandatory this." + o) + " is not defined")))
3640
3741
38-func q (p) = throw(o(p))
42+func s (t) = if ((t == j))
43+ then unit
44+ else fromBase58String(t)
3945
4046
41-func r (s) = if ((0 > s))
42- then -(s)
43- else s
47+func u (v) = if ((0 > v))
48+ then -(v)
49+ else v
4450
4551
46-func t (s) = if ((d > s))
47- then -(s)
48- else s
52+func w (v) = if ((e > v))
53+ then -(v)
54+ else v
4955
5056
51-let u = "%s__maxDepth"
57+let x = "%s__maxDepth"
5258
53-let v = 30
59+let y = 30
5460
55-let w = valueOrElse(getInteger(this, u), v)
61+let z = valueOrElse(getInteger(this, x), y)
5662
57-func x () = "%s%s__config__factoryAddress"
63+func A () = "%s%s__config__factoryAddress"
5864
5965
60-let y = l(x())
66+let B = r(A())
6167
62-let z = addressFromStringValue(y)
68+let C = addressFromStringValue(B)
6369
64-func A () = "%s%s__config__emissionAddress"
70+func D () = "%s%s__config__emissionAddress"
6571
6672
67-func B () = makeString(["%s", "votingEmissionContract"], a)
73+func E () = makeString(["%s", "votingEmissionContract"], a)
6874
6975
70-let C = addressFromStringValue(getStringValue(z, B()))
76+let F = addressFromStringValue(getStringValue(C, E()))
7177
72-func D (E) = makeString(["%s%s%s", "mapping", "num2user", toString(E)], a)
78+func G (H) = makeString(["%s%s%s", "mapping", "num2user", toString(H)], a)
7379
7480
75-let F = makeString(["%s%s", "referral", "programName"], a)
81+let I = makeString(["%s%s", "referral", "programName"], a)
7682
77-let G = "wxlock"
83+let J = "wxlock"
7884
79-let H = valueOrElse(getString(this, F), G)
85+let K = valueOrElse(getString(this, I), J)
8086
81-let I = makeString(["%s%s", "referral", "minGWxAmount"], a)
87+let L = makeString(["%s%s", "referral", "minGWxAmount"], a)
8288
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)
9090
9191 let N = valueOrElse(getInteger(this, L), M)
9292
93-let O = makeString(["%s%s", "referral", "referralRewardPermille"], a)
93+let O = makeString(["%s%s", "referral", "referrerRewardPermille"], a)
9494
9595 let P = 50
9696
9797 let Q = valueOrElse(getInteger(this, O), P)
9898
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)
100106
101107
102-func T (U,V) = makeString(["%s%s%s", "unclaimedReferral", U, V], a)
108+func W (X,Y) = makeString(["%s%s%s", "unclaimedReferral", X, Y], a)
103109
104110
105-let W = l(A())
111+let Z = r(D())
106112
107-let X = addressFromStringValue(W)
113+let aa = addressFromStringValue(Z)
108114
109-let Y = 1
115+let ab = 1
110116
111-let Z = 2
117+let ac = 2
112118
113-let aa = 3
119+let ad = 3
114120
115-let ab = 4
121+let ae = 4
116122
117-func ac () = "%s__config"
123+func af () = "%s__config"
118124
119125
120-func ad () = addressFromStringValue(valueOrErrorMessage(getString(this, A()), (("mandatory this." + A()) + " is not defined")))
126+func ag () = addressFromStringValue(valueOrErrorMessage(getString(this, D()), (("mandatory this." + D()) + " is not defined")))
121127
122128
123-let ae = ad()
129+let ah = ag()
124130
125-let af = split(value(getString(ae, ac())), a)[1]
131+let ai = split(value(getString(ah, af())), a)[1]
126132
127-let ag = fromBase58String(af)
133+let aj = fromBase58String(ai)
128134
129-func ah () = split(l(ac()), a)
135+func ak () = split(r(af()), a)
130136
131137
132-func ai (af,aj,ak,w) = makeString(["%s%s%s%d", af, aj, ak, toString(w)], a)
138+func al (ai,am,an,z) = makeString(["%s%s%s%d", ai, am, an, toString(z)], a)
133139
134140
135-func al () = {
136- let am = ah()
137- valueOrErrorMessage(addressFromString(am[aa]), "boosting contract address is not defined")
141+func ao () = {
142+ let ap = ak()
143+ valueOrErrorMessage(addressFromString(ap[ad]), "boosting contract address is not defined")
138144 }
139145
140146
141-func an () = "%s%s__gwxRewardEmissionPart__startHeight"
147+func aq () = "%s%s__gwxRewardEmissionPart__startHeight"
142148
143149
144-func ao () = "%s__nextUserNum"
150+func ar () = "%s__nextUserNum"
145151
146152
147-func ap () = "%s%s__ratePerBlock__current"
153+func as (at) = makeString(["%s%s%s__mapping__user2num", toString(at)], a)
148154
149155
150-func aq () = "%s%s__gwxHoldersReward__current"
156+func au () = "%s%s__ratePerBlock__current"
151157
152158
153-func ar () = "%s%s__gwxHoldersReward__next"
159+func av () = "%s%s__gwxHoldersReward__current"
154160
155161
156-func as () = "%s%s__poolWeight__GWXvirtualPOOL"
162+func aw () = "%s%s__gwxHoldersReward__next"
157163
158164
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"
172166
173167
174168 func ay (az) = makeString(["%s%d", "userUnclaimed", toString(az)], a)
175169
176170
177-func aA (az) = makeString(["%s%d__nextClaimedPeriod", toString(az)], a)
171+func aA () = makeString(["%s%s", "config", "referralsContractAddress"], a)
178172
179173
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)
181177
182178
183-func aC (aD) = makeString(["%s%d__startHeightForPeriod", toString(aD)], a)
179+func aF (at) = makeString(["%s%s", "tradingReward", at], a)
184180
185181
186-func aE (aD) = makeString(["%s%d__auxEmissionReward", toString(aD)], a)
182+func aG () = makeString(["%s", "maxRecipients"], a)
187183
188184
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)
231189 }
232190
233191
234-func bc () = "%s__managerPublicKey"
192+func aM () = "%s__managerPublicKey"
235193
236194
237-func bd () = "%s__managerVaultAddress"
195+func aN () = "%s__managerVaultAddress"
238196
239197
240-func be () = {
241- let bf = getString(bd())
242- if ($isInstanceOf(bf, "String"))
198+func aO () = {
199+ let aP = getString(aN())
200+ if ($isInstanceOf(aP, "String"))
243201 then {
244- let bg = bf
245- addressFromStringValue(bg)
202+ let aQ = aP
203+ addressFromStringValue(aQ)
246204 }
247205 else this
248206 }
249207
250208
251-func bh () = {
252- let bi = be()
253- let bf = getString(bi, bc())
254- if ($isInstanceOf(bf, "String"))
209+func aR () = {
210+ let aS = aO()
211+ let aP = getString(aS, aM())
212+ if ($isInstanceOf(aP, "String"))
255213 then {
256- let bg = bf
257- fromBase58String(bg)
214+ let aQ = aP
215+ fromBase58String(aQ)
258216 }
259- else if ($isInstanceOf(bf, "Unit"))
217+ else if ($isInstanceOf(aP, "Unit"))
260218 then unit
261219 else throw("Match error")
262220 }
263221
264222
265-func bj (aT) = {
266- let bk = throw("Permission denied")
267- let bf = bh()
268- if ($isInstanceOf(bf, "ByteVector"))
223+func aT (aE) = {
224+ let aU = throw("Permission denied")
225+ let aP = aR()
226+ if ($isInstanceOf(aP, "ByteVector"))
269227 then {
270- let bl = bf
271- if ((aT.callerPublicKey == bl))
228+ let aV = aP
229+ if ((aE.callerPublicKey == aV))
272230 then true
273- else bk
231+ else aU
274232 }
275- else if ($isInstanceOf(bf, "Unit"))
276- then if ((aT.caller == this))
233+ else if ($isInstanceOf(aP, "Unit"))
234+ then if ((aE.caller == this))
277235 then true
278- else bk
236+ else aU
279237 else throw("Match error")
280238 }
281239
282240
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)))
313244 }
314245
315246
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)
328256 }
329257
330258
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))
334263 }
335264
336265
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"))
348270 then {
349- let bF = bf
350- $Tuple2(bF, [IntegerEntry(ay(bD), 0)])
271+ let aQ = aP
272+ parseBigInt(aQ)
351273 }
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)
353288 }
354289
355290
356-func bG (aV) = valueOrElse(getInteger(this, aU(aV)), 0)
291+func bm (at) = makeString(["%s%s", "rewardPerGwxIntegralUserLast", toString(at)], a)
357292
358293
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)))
361347 then nil
362348 else {
363- let bL = [if ((aT.caller == this))
349+ let bI = [if ((aE.caller == this))
364350 then true
365- else q("Permission denied"), if ((bH >= bJ[bK]))
351+ else m("Permission denied"), if ((bE >= bG[bH]))
366352 then true
367- else q("insufficient payment assetId")]
368- if ((bL == bL))
353+ else m("insufficient payment assetId")]
354+ if ((bI == bI))
369355 then {
370- let bM = invoke(this, "tradeRewardInternal", [(bH - bJ[bK]), bI, bJ, (bK + 1)], nil)
371- if ((bM == bM))
356+ let bJ = invoke(this, "tradeRewardInternal", [(bE - bG[bH]), bF, bG, (bH + 1)], nil)
357+ if ((bJ == bJ))
372358 then {
373- let bN = aR(bI[bK], aT)
374- let aV = addressFromStringValue(bI[bK])
375- $Tuple2([IntegerEntry(bN, bJ[bK]), IntegerEntry(aU(bI[bK]), bJ[bK])], bM)
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)
376362 }
377363 else throw("Strict value is not equal to itself.")
378364 }
379365 else throw("Strict value is not equal to itself.")
380366 }
381367
382368
383369
384-@Callable(aT)
385-func updateReferralActivity (aV,bO) = {
386- let bP = getString(aQ, R(aV))
387- let bQ = if ((bP == unit))
370+@Callable(aE)
371+func updateReferralActivity (at,bL) = {
372+ let bM = getString(aB, U(at))
373+ let bN = if ((bM == unit))
388374 then unit
389- else invoke(aQ, "updateReferralActivity", [H, aV, (bO >= K)], nil)
390- if ((bQ == bQ))
375+ else invoke(aB, "updateReferralActivity", [K, at, (bL >= N)], nil)
376+ if ((bN == bN))
391377 then $Tuple2(nil, unit)
392378 else throw("Strict value is not equal to itself.")
393379 }
394380
395381
396382
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"))
457385
458386
459387
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))
489397 then true
490- else bj(aT)
491- if ((cn == cn))
398+ else throw("nothing to claim")
399+ if ((bP == bP))
492400 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))
498412 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))
504423 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"))
512429 }
513- if ((cv == cv))
430+ if ((bU == bU))
514431 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)
522434 }
523435 else throw("Strict value is not equal to itself.")
524436 }
525437 else throw("Strict value is not equal to itself.")
526438 }
527439 else throw("Strict value is not equal to itself.")
528440 }
529441 else throw("Strict value is not equal to itself.")
530442 }
531443
532444
533445
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)
557454 }
558455
559456
560457
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)]
570462
571463
572464
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)))
684473 then true
685- else q("Too many recipients"), if (dv)
474+ else m("Too many recipients"), if (bZ)
686475 then true
687- else q("Arguments size mismatch"), if ((dy == ag))
476+ else m("Arguments size mismatch"), if ((cc == aj))
688477 then true
689- else q("Wrong asset payment")]
690- if ((bL == bL))
478+ else m("Wrong asset payment")]
479+ if ((bI == bI))
691480 then {
692- let bM = invoke(this, "tradeRewardInternal", [dz, bI, bJ, 0], nil)
693- if ((bM == bM))
694- then $Tuple2(nil, bM)
481+ let bJ = invoke(this, "tradeRewardInternal", [cd, bF, bG, 0], nil)
482+ if ((bJ == bJ))
483+ then $Tuple2(nil, bJ)
695484 else throw("Strict value is not equal to itself.")
696485 }
697486 else throw("Strict value is not equal to itself.")
698487 }
699488
700489
701490
702-@Callable(aT)
491+@Callable(aE)
703492 func claimTradingReward () = {
704- let aV = aT.caller
705- let dA = toString(aV)
706- let dB = bG(dA)
707- if ((dB > 0))
708- then $Tuple2([ScriptTransfer(aV, dB, ag), IntegerEntry(aU(dA), 0)], dB)
709- else q("nothing to claim")
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")
710499 }
711500
712501
713502
714-@Callable(aT)
715-func claimTradingRewardREADONLY (aV) = $Tuple2(nil, bG(aV))
503+@Callable(aE)
504+func claimTradingRewardREADONLY (at) = $Tuple2(nil, aX(at))
716505
717506
718-@Verifier(dC)
719-func dD () = {
720- let dE = {
721- let bf = bh()
722- if ($isInstanceOf(bf, "ByteVector"))
507+@Verifier(cf)
508+func cg () = {
509+ let ch = {
510+ let aP = aR()
511+ if ($isInstanceOf(aP, "ByteVector"))
723512 then {
724- let bl = bf
725- bl
513+ let aV = aP
514+ aV
726515 }
727- else if ($isInstanceOf(bf, "Unit"))
728- then dC.senderPublicKey
516+ else if ($isInstanceOf(aP, "Unit"))
517+ then cf.senderPublicKey
729518 else throw("Match error")
730519 }
731- sigVerify(dC.bodyBytes, dC.proofs[0], dE)
520+ sigVerify(cf.bodyBytes, cf.proofs[0], ch)
732521 }
733522

github/deemru/w8io/169f3d6 
137.77 ms