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