1 | | - | {-# STDLIB_VERSION 6 #-} |
---|
2 | | - | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | | - | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let a = "__" |
---|
5 | | - | |
---|
6 | | - | let b = 8 |
---|
7 | | - | |
---|
8 | | - | let c = 100000000 |
---|
9 | | - | |
---|
10 | | - | let d = c |
---|
11 | | - | |
---|
12 | | - | func e (f) = makeString(["boosting.ride:", f], " ") |
---|
13 | | - | |
---|
14 | | - | |
---|
15 | | - | func g (f) = throw(e(f)) |
---|
16 | | - | |
---|
17 | | - | |
---|
18 | | - | func h (i,j) = valueOrErrorMessage(getString(i, j), (("mandatory this." + j) + " is not defined")) |
---|
19 | | - | |
---|
20 | | - | |
---|
21 | | - | func k (i,j) = valueOrElse(getInteger(i, j), 0) |
---|
22 | | - | |
---|
23 | | - | |
---|
24 | | - | func l (i,j,m) = valueOrElse(getInteger(i, j), m) |
---|
25 | | - | |
---|
26 | | - | |
---|
27 | | - | func n (i,j) = valueOrErrorMessage(getInteger(i, j), (("mandatory this." + j) + " is not defined")) |
---|
28 | | - | |
---|
29 | | - | |
---|
30 | | - | func o (p) = if ((0 > p)) |
---|
31 | | - | then -(p) |
---|
32 | | - | else p |
---|
33 | | - | |
---|
34 | | - | |
---|
35 | | - | func q (p) = { |
---|
36 | | - | let r = p |
---|
37 | | - | if ($isInstanceOf(r, "List[Any]")) |
---|
38 | | - | then { |
---|
39 | | - | let s = r |
---|
40 | | - | s |
---|
41 | | - | } |
---|
42 | | - | else throw("fail to cast into List[Any]") |
---|
43 | | - | } |
---|
44 | | - | |
---|
45 | | - | |
---|
46 | | - | func t (p) = { |
---|
47 | | - | let r = p |
---|
48 | | - | if ($isInstanceOf(r, "Int")) |
---|
49 | | - | then { |
---|
50 | | - | let u = r |
---|
51 | | - | u |
---|
52 | | - | } |
---|
53 | | - | else throw("fail to cast into Int") |
---|
54 | | - | } |
---|
55 | | - | |
---|
56 | | - | |
---|
57 | | - | func v () = makeString(["%s%s", "config", "referralsContractAddress"], a) |
---|
58 | | - | |
---|
59 | | - | |
---|
60 | | - | let w = addressFromStringValue(h(this, v())) |
---|
61 | | - | |
---|
62 | | - | let x = makeString(["%s%s", "referral", "programName"], a) |
---|
63 | | - | |
---|
64 | | - | let y = "wxlock" |
---|
65 | | - | |
---|
66 | | - | let z = valueOrElse(getString(this, x), y) |
---|
67 | | - | |
---|
68 | | - | func A () = "%s%s__config__factoryAddress" |
---|
69 | | - | |
---|
70 | | - | |
---|
71 | | - | let B = 1 |
---|
72 | | - | |
---|
73 | | - | let C = 2 |
---|
74 | | - | |
---|
75 | | - | let D = 3 |
---|
76 | | - | |
---|
77 | | - | let E = 4 |
---|
78 | | - | |
---|
79 | | - | let F = 5 |
---|
80 | | - | |
---|
81 | | - | let G = 6 |
---|
82 | | - | |
---|
83 | | - | let H = 7 |
---|
84 | | - | |
---|
85 | | - | let I = 8 |
---|
86 | | - | |
---|
87 | | - | let J = 9 |
---|
88 | | - | |
---|
89 | | - | let K = 10 |
---|
90 | | - | |
---|
91 | | - | let L = 11 |
---|
92 | | - | |
---|
93 | | - | func M () = "%s__factoryConfig" |
---|
94 | | - | |
---|
95 | | - | |
---|
96 | | - | func N (O) = makeString(["%s%s%s", O, "mappings__lpAsset2PoolContract"], a) |
---|
97 | | - | |
---|
98 | | - | |
---|
99 | | - | func P () = "%s__lpTokensList" |
---|
100 | | - | |
---|
101 | | - | |
---|
102 | | - | func Q (O) = makeString(["%s%s%s", O, "mappings__lpAsset2PoolContract"], a) |
---|
103 | | - | |
---|
104 | | - | |
---|
105 | | - | func R (S) = makeString(["%s%s", "poolWeight", S], a) |
---|
106 | | - | |
---|
107 | | - | |
---|
108 | | - | func T (U,V) = ((("%s%s__poolWeight__" + U) + "__") + toString(V)) |
---|
109 | | - | |
---|
110 | | - | |
---|
111 | | - | func W () = addressFromStringValue(h(this, A())) |
---|
112 | | - | |
---|
113 | | - | |
---|
114 | | - | func X () = split(valueOrElse(getString(W(), P()), ""), a) |
---|
115 | | - | |
---|
116 | | - | |
---|
117 | | - | func Y (Z) = split(h(Z, M()), a) |
---|
118 | | - | |
---|
119 | | - | |
---|
120 | | - | func aa (ab) = addressFromStringValue(ab[C]) |
---|
121 | | - | |
---|
122 | | - | |
---|
123 | | - | func ac (ab) = addressFromStringValue(ab[F]) |
---|
124 | | - | |
---|
125 | | - | |
---|
126 | | - | func ad (ab) = addressFromStringValue(ab[B]) |
---|
127 | | - | |
---|
128 | | - | |
---|
129 | | - | func ae (ab) = addressFromStringValue(ab[K]) |
---|
130 | | - | |
---|
131 | | - | |
---|
132 | | - | func af () = "%s__managerPublicKey" |
---|
133 | | - | |
---|
134 | | - | |
---|
135 | | - | func ag () = "%s__pendingManagerPublicKey" |
---|
136 | | - | |
---|
137 | | - | |
---|
138 | | - | func ah () = "%s%s__ratePerBlock__current" |
---|
139 | | - | |
---|
140 | | - | |
---|
141 | | - | func ai () = "%s%s__ratePerBlockMax__current" |
---|
142 | | - | |
---|
143 | | - | |
---|
144 | | - | func aj () = "%s%s__emission__startBlock" |
---|
145 | | - | |
---|
146 | | - | |
---|
147 | | - | func ak () = "%s%s__emission__duration" |
---|
148 | | - | |
---|
149 | | - | |
---|
150 | | - | func al () = "%s%s__emission__endBlock" |
---|
151 | | - | |
---|
152 | | - | |
---|
153 | | - | func am () = "%s__nextPeriod" |
---|
154 | | - | |
---|
155 | | - | |
---|
156 | | - | func an () = "%s%s__gwxRewardEmissionPart__startHeight" |
---|
157 | | - | |
---|
158 | | - | |
---|
159 | | - | let ao = 1 |
---|
160 | | - | |
---|
161 | | - | let ap = 2 |
---|
162 | | - | |
---|
163 | | - | let aq = 3 |
---|
164 | | - | |
---|
165 | | - | let ar = 4 |
---|
166 | | - | |
---|
167 | | - | let as = 5 |
---|
168 | | - | |
---|
169 | | - | func at () = "%s__config" |
---|
170 | | - | |
---|
171 | | - | |
---|
172 | | - | func au () = split(h(this, at()), a) |
---|
173 | | - | |
---|
174 | | - | |
---|
175 | | - | let av = addressFromStringValue(au()[as]) |
---|
176 | | - | |
---|
177 | | - | func aw (ax,ay,az,aA,av) = makeString(["%s%d%d%d", ax, ay, az, aA, av], a) |
---|
178 | | - | |
---|
179 | | - | |
---|
180 | | - | func aB (ax,ay,az,aA,av) = aw(ax, toString(ay), toString(az), toString(aA), av) |
---|
181 | | - | |
---|
182 | | - | |
---|
183 | | - | func aC () = { |
---|
184 | | - | let r = getString(af()) |
---|
185 | | - | if ($isInstanceOf(r, "String")) |
---|
186 | | - | then { |
---|
187 | | - | let aD = r |
---|
188 | | - | fromBase58String(aD) |
---|
189 | | - | } |
---|
190 | | - | else if ($isInstanceOf(r, "Unit")) |
---|
191 | | - | then unit |
---|
192 | | - | else throw("Match error") |
---|
193 | | - | } |
---|
194 | | - | |
---|
195 | | - | |
---|
196 | | - | func aE () = { |
---|
197 | | - | let r = getString(ag()) |
---|
198 | | - | if ($isInstanceOf(r, "String")) |
---|
199 | | - | then { |
---|
200 | | - | let aD = r |
---|
201 | | - | fromBase58String(aD) |
---|
202 | | - | } |
---|
203 | | - | else if ($isInstanceOf(r, "Unit")) |
---|
204 | | - | then unit |
---|
205 | | - | else throw("Match error") |
---|
206 | | - | } |
---|
207 | | - | |
---|
208 | | - | |
---|
209 | | - | func aF (aG) = { |
---|
210 | | - | let aH = throw("Permission denied") |
---|
211 | | - | let r = aC() |
---|
212 | | - | if ($isInstanceOf(r, "ByteVector")) |
---|
213 | | - | then { |
---|
214 | | - | let aI = r |
---|
215 | | - | if ((aG.callerPublicKey == aI)) |
---|
216 | | - | then true |
---|
217 | | - | else aH |
---|
218 | | - | } |
---|
219 | | - | else if ($isInstanceOf(r, "Unit")) |
---|
220 | | - | then if ((aG.caller == this)) |
---|
221 | | - | then true |
---|
222 | | - | else aH |
---|
223 | | - | else throw("Match error") |
---|
224 | | - | } |
---|
225 | | - | |
---|
226 | | - | |
---|
227 | | - | let aJ = 1 |
---|
228 | | - | |
---|
229 | | - | let aK = 2 |
---|
230 | | - | |
---|
231 | | - | let aL = 3 |
---|
232 | | - | |
---|
233 | | - | let aM = 4 |
---|
234 | | - | |
---|
235 | | - | let aN = 5 |
---|
236 | | - | |
---|
237 | | - | let aO = 6 |
---|
238 | | - | |
---|
239 | | - | func aP (aQ) = makeString(["%s%s__lock", aQ], a) |
---|
240 | | - | |
---|
241 | | - | |
---|
242 | | - | func aR (aQ) = split(h(this, aP(aQ)), a) |
---|
243 | | - | |
---|
244 | | - | |
---|
245 | | - | func aS (aT,aU,aV,aW,aX,aY,aZ,ba) = makeString(["%d%d%d%d%d%d%d%d", aT, aU, aV, aW, aX, aY, aZ, ba], a) |
---|
246 | | - | |
---|
247 | | - | |
---|
248 | | - | func bb (aT,aU,aV,aW,aX,aY,ba) = aS(aT, toString(aU), toString(aV), toString(aW), toString(aX), toString(aY), toString(lastBlock.timestamp), toString(ba)) |
---|
249 | | - | |
---|
250 | | - | |
---|
251 | | - | func bc () = "%s__nextUserNum" |
---|
252 | | - | |
---|
253 | | - | |
---|
254 | | - | func bd (aQ) = makeString(["%s%s%s__mapping__user2num", aQ], a) |
---|
255 | | - | |
---|
256 | | - | |
---|
257 | | - | func be (V) = makeString(["%s%s%s__mapping__num2user", V], a) |
---|
258 | | - | |
---|
259 | | - | |
---|
260 | | - | func bf (aT) = makeString(["%s%d%s__paramByUserNum", aT, "amount"], a) |
---|
261 | | - | |
---|
262 | | - | |
---|
263 | | - | func bg (aT) = makeString(["%s%d%s__paramByUserNum", aT, "start"], a) |
---|
264 | | - | |
---|
265 | | - | |
---|
266 | | - | func bh (aT) = makeString(["%s%d%s__paramByUserNum", aT, "duration"], a) |
---|
267 | | - | |
---|
268 | | - | |
---|
269 | | - | func bi (aT) = makeString(["%s%d%s__paramByUserNum", aT, "k"], a) |
---|
270 | | - | |
---|
271 | | - | |
---|
272 | | - | func bj (aT) = makeString(["%s%d%s__paramByUserNum", aT, "b"], a) |
---|
273 | | - | |
---|
274 | | - | |
---|
275 | | - | func bk (aT,bl) = makeString(["%s%d%s%d__paramByPeriod", aT, "k", bl], a) |
---|
276 | | - | |
---|
277 | | - | |
---|
278 | | - | func bm (aT,bl) = makeString(["%s%d%s%d__paramByPeriod", aT, "b", bl], a) |
---|
279 | | - | |
---|
280 | | - | |
---|
281 | | - | func bn () = "%s%s__stats__activeTotalLocked" |
---|
282 | | - | |
---|
283 | | - | |
---|
284 | | - | func bo () = "%s%s__stats__locksDurationSumInBlocks" |
---|
285 | | - | |
---|
286 | | - | |
---|
287 | | - | func bp () = "%s%s__stats__locksCount" |
---|
288 | | - | |
---|
289 | | - | |
---|
290 | | - | func bq () = "%s%s__stats__activeUsersCount" |
---|
291 | | - | |
---|
292 | | - | |
---|
293 | | - | func br (aT) = makeString(["%s%d__userBoostEmissionLastInt", aT], a) |
---|
294 | | - | |
---|
295 | | - | |
---|
296 | | - | func bs (aT,bt) = makeString(["%s%d__userBoostEmissionLastInt", aT, bt], a) |
---|
297 | | - | |
---|
298 | | - | |
---|
299 | | - | func bu (aT) = makeString(["%s%d__maxBoostInt", aT], a) |
---|
300 | | - | |
---|
301 | | - | |
---|
302 | | - | func bv () = "%s%s__maxBoostInt__total" |
---|
303 | | - | |
---|
304 | | - | |
---|
305 | | - | func bw (aT) = makeString(["%s%d__userBoostAvaliableToClaimTotal", aT], a) |
---|
306 | | - | |
---|
307 | | - | |
---|
308 | | - | func bx (aT) = makeString(["%s%d__userBoostClaimed", aT], a) |
---|
309 | | - | |
---|
310 | | - | |
---|
311 | | - | func by () = "%s%s__gwxCached__total" |
---|
312 | | - | |
---|
313 | | - | |
---|
314 | | - | func bz () = "%s__gwxCachedTotalCorrective" |
---|
315 | | - | |
---|
316 | | - | |
---|
317 | | - | let bA = W() |
---|
318 | | - | |
---|
319 | | - | let ab = Y(bA) |
---|
320 | | - | |
---|
321 | | - | let bB = ac(ab) |
---|
322 | | - | |
---|
323 | | - | let bC = ad(ab) |
---|
324 | | - | |
---|
325 | | - | let bD = ae(ab) |
---|
326 | | - | |
---|
327 | | - | let bE = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(makeString(["%s", "lpStakingPoolsContract"], a)), e("lp_staking_pools contract address is undefined"))), e("invalid lp_staking_pools contract address")) |
---|
328 | | - | |
---|
329 | | - | let bF = makeString(["%s", "votingEmissionContract"], a) |
---|
330 | | - | |
---|
331 | | - | let bG = addressFromStringValue(getStringValue(bA, bF)) |
---|
332 | | - | |
---|
333 | | - | func bH (bI) = { |
---|
334 | | - | let bJ = makeString(["%s", "currentEpochUi"], a) |
---|
335 | | - | let bK = getIntegerValue(bG, bJ) |
---|
336 | | - | let bL = makeString(["%s%s", "totalCachedGwxCorrection__activationEpoch"], a) |
---|
337 | | - | let bM = getInteger(this, bL) |
---|
338 | | - | let bN = valueOrElse(getInteger(this, by()), 0) |
---|
339 | | - | let bO = if (isDefined(bM)) |
---|
340 | | - | then (bK >= value(bM)) |
---|
341 | | - | else false |
---|
342 | | - | let bP = if (if (bO) |
---|
343 | | - | then bI |
---|
344 | | - | else false) |
---|
345 | | - | then valueOrElse(getInteger(this, bz()), 0) |
---|
346 | | - | else 0 |
---|
347 | | - | max([0, (bN + bP)]) |
---|
348 | | - | } |
---|
349 | | - | |
---|
350 | | - | |
---|
351 | | - | func bQ (bR,bS,aU,bT,aW,bU,bV,aG) = { |
---|
352 | | - | let bW = makeString(["%s%s%s%s__history", bR, bS, toBase58String(aG.transactionId)], a) |
---|
353 | | - | let bX = makeString(["%d%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(aU), toString(bT), toString(aW), toString(bU), toString(bV)], a) |
---|
354 | | - | StringEntry(bW, bX) |
---|
355 | | - | } |
---|
356 | | - | |
---|
357 | | - | |
---|
358 | | - | func bY (bZ,ca,cb,cc) = { |
---|
359 | | - | let cd = bo() |
---|
360 | | - | let ce = bp() |
---|
361 | | - | let cf = bq() |
---|
362 | | - | let cg = bn() |
---|
363 | | - | let ch = k(this, cd) |
---|
364 | | - | let ci = k(this, ce) |
---|
365 | | - | let cj = k(this, cf) |
---|
366 | | - | let ck = k(this, cg) |
---|
367 | | - | [IntegerEntry(cd, (ch + ca)), IntegerEntry(ce, (ci + cb)), IntegerEntry(cf, (cj + cc)), IntegerEntry(cg, (ck + bZ))] |
---|
368 | | - | } |
---|
369 | | - | |
---|
370 | | - | |
---|
371 | | - | func cl (cm,cn,co) = { |
---|
372 | | - | let cp = 1000 |
---|
373 | | - | (((cm * co) + cn) / cp) |
---|
374 | | - | } |
---|
375 | | - | |
---|
376 | | - | |
---|
377 | | - | func cq (aQ,aT,aU,aV,aW,bU,bV,bl) = { |
---|
378 | | - | let cr = bf(aT) |
---|
379 | | - | let cs = bg(aT) |
---|
380 | | - | let ct = bh(aT) |
---|
381 | | - | let cu = bi(aT) |
---|
382 | | - | let cv = bj(aT) |
---|
383 | | - | let cw = bk(aT, bl) |
---|
384 | | - | let cx = bm(aT, bl) |
---|
385 | | - | let ba = cl(bU, bV, height) |
---|
386 | | - | [IntegerEntry(cr, aU), IntegerEntry(cs, aV), IntegerEntry(ct, aW), IntegerEntry(cu, bU), IntegerEntry(cv, bV), IntegerEntry(cw, bU), IntegerEntry(cx, bV), StringEntry(aP(aQ), bb(aT, aU, aV, aW, bU, bV, ba))] |
---|
387 | | - | } |
---|
388 | | - | |
---|
389 | | - | |
---|
390 | | - | func cy (aG,cz) = if ((size(aG.payments) > 1)) |
---|
391 | | - | then throw("only one payment is allowed") |
---|
392 | | - | else if ((size(aG.payments) == 0)) |
---|
393 | | - | then 0 |
---|
394 | | - | else { |
---|
395 | | - | let cA = aG.payments[0] |
---|
396 | | - | if ((value(cA.assetId) != cz)) |
---|
397 | | - | then throw("invalid asset id in payment") |
---|
398 | | - | else cA.amount |
---|
399 | | - | } |
---|
400 | | - | |
---|
401 | | - | |
---|
402 | | - | func cB (aQ,cC) = { |
---|
403 | | - | let cD = "empty" |
---|
404 | | - | let cE = bd(aQ) |
---|
405 | | - | let aT = valueOrElse(getString(cE), cD) |
---|
406 | | - | let bU = valueOrElse(getInteger(bi(aT)), 0) |
---|
407 | | - | let bV = valueOrElse(getInteger(bj(aT)), 0) |
---|
408 | | - | let cF = cl(bU, bV, cC) |
---|
409 | | - | let ba = if ((0 > cF)) |
---|
410 | | - | then 0 |
---|
411 | | - | else cF |
---|
412 | | - | ba |
---|
413 | | - | } |
---|
414 | | - | |
---|
415 | | - | |
---|
416 | | - | func cG (aQ) = cB(aQ, height) |
---|
417 | | - | |
---|
418 | | - | |
---|
419 | | - | func cH () = { |
---|
420 | | - | let bJ = makeString(["%s", "currentEpochUi"], a) |
---|
421 | | - | let cI = { |
---|
422 | | - | let bK = value(getInteger(bG, bJ)) |
---|
423 | | - | let cJ = (bK - 1) |
---|
424 | | - | if ((0 > cJ)) |
---|
425 | | - | then g("invalid epoch") |
---|
426 | | - | else $Tuple2(bK, cJ) |
---|
427 | | - | } |
---|
428 | | - | let bK = cI._1 |
---|
429 | | - | let cJ = cI._2 |
---|
430 | | - | func cK (cL) = makeString(["%s%d", "startHeight", toString(cL)], a) |
---|
431 | | - | |
---|
432 | | - | let cM = value(getInteger(bG, cK(bK))) |
---|
433 | | - | $Tuple2(cJ, cM) |
---|
434 | | - | } |
---|
435 | | - | |
---|
436 | | - | |
---|
437 | | - | func cN (cO,cP,i,cL) = makeString(["%s%s%s%s%d", "vote", cO, cP, toString(i), toString(cL)], a) |
---|
438 | | - | |
---|
439 | | - | |
---|
440 | | - | func cQ (cR,cL) = makeString(["%s%s%d", "votingResultStaked", cR, toString(cL)], a) |
---|
441 | | - | |
---|
442 | | - | |
---|
443 | | - | func cS (cR,cL) = makeString(["%s%s%d", "votingResultStakedIntegral", cR, toString(cL)], a) |
---|
444 | | - | |
---|
445 | | - | |
---|
446 | | - | func cT (cR,cL) = makeString(["%s%s%d", "votingResultStakedIntegralLastUpdateHeight", cR, toString(cL)], a) |
---|
447 | | - | |
---|
448 | | - | |
---|
449 | | - | func cU (cR,i,cL) = makeString(["%s%s%s%d", "voteStakedIntegral", cR, toString(i), toString(cL)], a) |
---|
450 | | - | |
---|
451 | | - | |
---|
452 | | - | func cV (cR,i,cL) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", cR, toString(i), toString(cL)], a) |
---|
453 | | - | |
---|
454 | | - | |
---|
455 | | - | func cW (cR) = { |
---|
456 | | - | let cX = cH() |
---|
457 | | - | let cJ = cX._1 |
---|
458 | | - | let cM = cX._2 |
---|
459 | | - | let cY = valueOrElse(getInteger(bG, cQ(cR, cJ)), 0) |
---|
460 | | - | let cZ = valueOrElse(getInteger(this, cQ(cR, cJ)), cY) |
---|
461 | | - | cZ |
---|
462 | | - | } |
---|
463 | | - | |
---|
464 | | - | |
---|
465 | | - | func da (cR,db) = { |
---|
466 | | - | let dc = cH() |
---|
467 | | - | let cJ = dc._1 |
---|
468 | | - | let cM = dc._2 |
---|
469 | | - | let cZ = cW(cR) |
---|
470 | | - | let dd = (cZ + db) |
---|
471 | | - | let de = cS(cR, cJ) |
---|
472 | | - | let df = valueOrElse(getInteger(this, de), 0) |
---|
473 | | - | let dg = cT(cR, cJ) |
---|
474 | | - | let dh = valueOrElse(getInteger(this, dg), cM) |
---|
475 | | - | let di = (height - dh) |
---|
476 | | - | let dj = ((di * cZ) + df) |
---|
477 | | - | $Tuple2([IntegerEntry(cQ(cR, cJ), dd), IntegerEntry(dg, height), IntegerEntry(de, dj)], dj) |
---|
478 | | - | } |
---|
479 | | - | |
---|
480 | | - | |
---|
481 | | - | func dk (cR,dl,dm) = { |
---|
482 | | - | let dn = cH() |
---|
483 | | - | let cJ = dn._1 |
---|
484 | | - | let cM = dn._2 |
---|
485 | | - | let aQ = addressFromStringValue(dl) |
---|
486 | | - | let do = 4 |
---|
487 | | - | let dp = 5 |
---|
488 | | - | let dq = { |
---|
489 | | - | let dr = invoke(bA, "getPoolConfigByLpAssetId", [cR], nil) |
---|
490 | | - | if ($isInstanceOf(dr, "List[Any]")) |
---|
491 | | - | then dr |
---|
492 | | - | else throw(($getType(dr) + " couldn't be cast to List[Any]")) |
---|
493 | | - | } |
---|
494 | | - | let cO = { |
---|
495 | | - | let dr = dq[do] |
---|
496 | | - | if ($isInstanceOf(dr, "String")) |
---|
497 | | - | then dr |
---|
498 | | - | else throw(($getType(dr) + " couldn't be cast to String")) |
---|
499 | | - | } |
---|
500 | | - | let cP = { |
---|
501 | | - | let dr = dq[dp] |
---|
502 | | - | if ($isInstanceOf(dr, "String")) |
---|
503 | | - | then dr |
---|
504 | | - | else throw(($getType(dr) + " couldn't be cast to String")) |
---|
505 | | - | } |
---|
506 | | - | let ds = valueOrElse(getInteger(bG, cN(cO, cP, aQ, cJ)), 0) |
---|
507 | | - | let dt = if ((ds == 0)) |
---|
508 | | - | then nil |
---|
509 | | - | else { |
---|
510 | | - | let db = if (dm) |
---|
511 | | - | then ds |
---|
512 | | - | else -(ds) |
---|
513 | | - | let du = da(cR, db) |
---|
514 | | - | let dv = du._1 |
---|
515 | | - | let dj = du._2 |
---|
516 | | - | let dw = if (dm) |
---|
517 | | - | then 0 |
---|
518 | | - | else ds |
---|
519 | | - | let dx = cU(cR, aQ, cJ) |
---|
520 | | - | let dy = valueOrElse(getInteger(this, dx), 0) |
---|
521 | | - | let dz = cV(cR, aQ, cJ) |
---|
522 | | - | let dA = valueOrElse(getInteger(this, dz), cM) |
---|
523 | | - | let dB = (height - dA) |
---|
524 | | - | let dC = ((dB * dw) + dy) |
---|
525 | | - | let dD = [IntegerEntry(dz, height), IntegerEntry(dx, dC)] |
---|
526 | | - | (dv ++ dD) |
---|
527 | | - | } |
---|
528 | | - | dt |
---|
529 | | - | } |
---|
530 | | - | |
---|
531 | | - | |
---|
532 | | - | func dE (cR,dl,dF) = { |
---|
533 | | - | let cD = "EMPTY" |
---|
534 | | - | let dG = valueOrElse(getString(this, aP(dl)), cD) |
---|
535 | | - | if ((dG == cD)) |
---|
536 | | - | then $Tuple3(0, nil, "userRecord::is::empty") |
---|
537 | | - | else { |
---|
538 | | - | let dH = split(dG, a) |
---|
539 | | - | let dI = dH[aJ] |
---|
540 | | - | let dJ = valueOrElse(getInteger(bD, an()), 0) |
---|
541 | | - | let dK = "empty" |
---|
542 | | - | let dL = if ((cR != dK)) |
---|
543 | | - | then { |
---|
544 | | - | let dM = valueOrErrorMessage(getString(bA, N(cR)), ("unsupported lp asset " + cR)) |
---|
545 | | - | let dN = getIntegerValue(bA, R(dM)) |
---|
546 | | - | let dO = valueOrElse(getInteger(bA, T(dM, 0)), dN) |
---|
547 | | - | $Tuple2(dO, dN) |
---|
548 | | - | } |
---|
549 | | - | else if (dF) |
---|
550 | | - | then $Tuple2(0, 0) |
---|
551 | | - | else throw(("not readonly mode: unsupported lp asset " + cR)) |
---|
552 | | - | let dP = dL._1 |
---|
553 | | - | let dQ = dL._2 |
---|
554 | | - | let dR = n(bB, ah()) |
---|
555 | | - | let dS = n(bB, aj()) |
---|
556 | | - | let dT = n(bB, al()) |
---|
557 | | - | let co = if ((height > dT)) |
---|
558 | | - | then dT |
---|
559 | | - | else height |
---|
560 | | - | let dU = max([(co - dS), 0]) |
---|
561 | | - | let dV = bs(dI, cR) |
---|
562 | | - | let dW = br(dI) |
---|
563 | | - | let dX = valueOrElse(getInteger(this, dV), k(this, dW)) |
---|
564 | | - | let dY = (((dR * dU) * 2) / 3) |
---|
565 | | - | let dZ = (dY - dX) |
---|
566 | | - | let ea = fraction(dZ, 3, (2 * dR)) |
---|
567 | | - | let eb = (co - ea) |
---|
568 | | - | let ec = max([(dJ - eb), 0]) |
---|
569 | | - | let ed = ((co - eb) - ec) |
---|
570 | | - | if (if (if ((0 > eb)) |
---|
571 | | - | then true |
---|
572 | | - | else (0 > ed)) |
---|
573 | | - | then true |
---|
574 | | - | else (o(((ec + ed) - ea)) >= 1)) |
---|
575 | | - | then throw(((((((((((("invalid udh calc: udh=" + toString(ea)) + " uLastH=") + toString(eb)) + " udh0=") + toString(ec)) + " udh1=") + toString(ed)) + " lpAssetId=") + cR) + " userAddress=") + dl)) |
---|
576 | | - | else if ((0 > dZ)) |
---|
577 | | - | then throw("wrong calculations") |
---|
578 | | - | else { |
---|
579 | | - | let ee = bu(dI) |
---|
580 | | - | let ef = bv() |
---|
581 | | - | let eg = k(this, ee) |
---|
582 | | - | let eh = k(this, ef) |
---|
583 | | - | let ei = bH(true) |
---|
584 | | - | let ej = cG(dl) |
---|
585 | | - | let ek = bw(dI) |
---|
586 | | - | let el = k(this, ek) |
---|
587 | | - | let em = if ((ea == 0)) |
---|
588 | | - | then 0 |
---|
589 | | - | else fraction(dZ, ec, ea) |
---|
590 | | - | let en = if ((ea == 0)) |
---|
591 | | - | then 0 |
---|
592 | | - | else fraction(dZ, ed, ea) |
---|
593 | | - | let eo = fraction(em, dP, d) |
---|
594 | | - | let ep = fraction(en, dQ, d) |
---|
595 | | - | let eq = if ((ei == 0)) |
---|
596 | | - | then 0 |
---|
597 | | - | else fraction(eo, ej, ei) |
---|
598 | | - | let er = if ((ei == 0)) |
---|
599 | | - | then 0 |
---|
600 | | - | else fraction(ep, ej, ei) |
---|
601 | | - | let es = (eq + er) |
---|
602 | | - | let et = bx(dI) |
---|
603 | | - | let eu = k(this, et) |
---|
604 | | - | let ev = (es - eu) |
---|
605 | | - | let ew = [IntegerEntry(dV, dY)] |
---|
606 | | - | let ex = makeString([toString(dX), toString(dZ), toString(eu), toString(ev), toString(dP), toString(dQ), toString(co), toString(ea), toString(eb), toString(ec), toString(ed), toString(ej), toString(ei)], ":") |
---|
607 | | - | $Tuple3(es, ew, ex) |
---|
608 | | - | } |
---|
609 | | - | } |
---|
610 | | - | } |
---|
611 | | - | |
---|
612 | | - | |
---|
613 | | - | func ey (aG,aW) = { |
---|
614 | | - | let ez = au() |
---|
615 | | - | let eA = ez[ao] |
---|
616 | | - | let ax = fromBase58String(eA) |
---|
617 | | - | let ay = parseIntValue(ez[ap]) |
---|
618 | | - | let az = parseIntValue(ez[aq]) |
---|
619 | | - | let aA = parseIntValue(ez[ar]) |
---|
620 | | - | if ((size(aG.payments) != 1)) |
---|
621 | | - | then throw("invalid payment - exact one payment must be attached") |
---|
622 | | - | else { |
---|
623 | | - | let cA = aG.payments[0] |
---|
624 | | - | let eB = cA.amount |
---|
625 | | - | if ((ax != value(cA.assetId))) |
---|
626 | | - | then throw((("invalid asset is in payment - " + eA) + " is expected")) |
---|
627 | | - | else { |
---|
628 | | - | let eC = bc() |
---|
629 | | - | let dl = toString(aG.caller) |
---|
630 | | - | let eD = isDefined(getString(bd(dl))) |
---|
631 | | - | let dI = if (eD) |
---|
632 | | - | then value(getString(bd(dl))) |
---|
633 | | - | else toString(n(this, eC)) |
---|
634 | | - | let aT = parseIntValue(dI) |
---|
635 | | - | let bT = height |
---|
636 | | - | let cs = bg(dI) |
---|
637 | | - | let ct = bh(dI) |
---|
638 | | - | let cr = bf(dI) |
---|
639 | | - | if (if ((ay > eB)) |
---|
640 | | - | then (aG.caller != bE) |
---|
641 | | - | else false) |
---|
642 | | - | then throw(("amount is less then minLockAmount=" + toString(ay))) |
---|
643 | | - | else if ((az > aW)) |
---|
644 | | - | then throw(("passed duration is less then minLockDuration=" + toString(az))) |
---|
645 | | - | else if ((aW > aA)) |
---|
646 | | - | then throw(("passed duration is greater then maxLockDuration=" + toString(aA))) |
---|
647 | | - | else if (if (eD) |
---|
648 | | - | then ((n(this, cs) + n(this, ct)) >= bT) |
---|
649 | | - | else false) |
---|
650 | | - | then throw("there is an active lock - consider to use increaseLock") |
---|
651 | | - | else if ((k(this, cr) > 0)) |
---|
652 | | - | then throw(("there are locked WXs - consider to use increaseLock " + cr)) |
---|
653 | | - | else { |
---|
654 | | - | let eE = fraction(aW, c, aA) |
---|
655 | | - | let eF = fraction(eB, eE, c) |
---|
656 | | - | let eG = q(invoke(av, "calcGwxParamsREADONLY", [eF, bT, aW], nil)) |
---|
657 | | - | let bU = t(eG[0]) |
---|
658 | | - | let bV = t(eG[1]) |
---|
659 | | - | let bl = toString(t(eG[2])) |
---|
660 | | - | let dR = n(bB, ah()) |
---|
661 | | - | let dS = n(bB, aj()) |
---|
662 | | - | let dT = n(bB, al()) |
---|
663 | | - | let co = if ((height > dT)) |
---|
664 | | - | then dT |
---|
665 | | - | else height |
---|
666 | | - | let dU = max([(co - dS), 0]) |
---|
667 | | - | let dW = br(dI) |
---|
668 | | - | let dY = (((dR * dU) * 2) / 3) |
---|
669 | | - | let ee = bu(dI) |
---|
670 | | - | let ef = bv() |
---|
671 | | - | let eg = ((eF * aW) / 2) |
---|
672 | | - | let eh = k(this, ef) |
---|
673 | | - | let bN = bH(false) |
---|
674 | | - | let eH = if (eD) |
---|
675 | | - | then nil |
---|
676 | | - | else [IntegerEntry(eC, (aT + 1)), StringEntry(bd(dl), dI), StringEntry(be(dI), dl)] |
---|
677 | | - | $Tuple2(((((eH ++ cq(dl, dI, eB, bT, aW, bU, bV, bl)) ++ bY(eB, aW, 1, if (eD) |
---|
678 | | - | then 0 |
---|
679 | | - | else 1)) :+ bQ("lock", dl, eB, bT, aW, bU, bV, aG)) ++ [IntegerEntry(dW, dY), IntegerEntry(by(), (bN + eF))]), eF) |
---|
680 | | - | } |
---|
681 | | - | } |
---|
682 | | - | } |
---|
683 | | - | } |
---|
684 | | - | |
---|
685 | | - | |
---|
686 | | - | @Callable(aG) |
---|
687 | | - | func constructor (eI,eJ,ay,eK,eL,av) = { |
---|
688 | | - | let eM = aF(aG) |
---|
689 | | - | if ((eM == eM)) |
---|
690 | | - | then ([IntegerEntry(bc(), 0), StringEntry(at(), aB(eJ, ay, eK, eL, av)), StringEntry(A(), eI)] ++ bY(0, 0, 0, 0)) |
---|
691 | | - | else throw("Strict value is not equal to itself.") |
---|
692 | | - | } |
---|
693 | | - | |
---|
694 | | - | |
---|
695 | | - | |
---|
696 | | - | @Callable(aG) |
---|
697 | | - | func lockRef (aW,eN,eO) = { |
---|
698 | | - | let eP = ey(aG, aW) |
---|
699 | | - | let eQ = eP._1 |
---|
700 | | - | let eF = eP._2 |
---|
701 | | - | let eR = toString(aG.caller) |
---|
702 | | - | let eS = if (if ((eN == "")) |
---|
703 | | - | then true |
---|
704 | | - | else (eO == base58'')) |
---|
705 | | - | then unit |
---|
706 | | - | else invoke(w, "createPair", [z, eN, eR, eO], nil) |
---|
707 | | - | if ((eS == eS)) |
---|
708 | | - | then { |
---|
709 | | - | let eT = invoke(av, "updateReferralActivity", [toString(aG.caller), eF], nil) |
---|
710 | | - | if ((eT == eT)) |
---|
711 | | - | then $Tuple2(eQ, unit) |
---|
712 | | - | else throw("Strict value is not equal to itself.") |
---|
713 | | - | } |
---|
714 | | - | else throw("Strict value is not equal to itself.") |
---|
715 | | - | } |
---|
716 | | - | |
---|
717 | | - | |
---|
718 | | - | |
---|
719 | | - | @Callable(aG) |
---|
720 | | - | func lock (aW) = { |
---|
721 | | - | let eU = ey(aG, aW) |
---|
722 | | - | let eQ = eU._1 |
---|
723 | | - | let eF = eU._2 |
---|
724 | | - | let eT = invoke(av, "updateReferralActivity", [toString(aG.caller), eF], nil) |
---|
725 | | - | if ((eT == eT)) |
---|
726 | | - | then $Tuple2(eQ, unit) |
---|
727 | | - | else throw("Strict value is not equal to itself.") |
---|
728 | | - | } |
---|
729 | | - | |
---|
730 | | - | |
---|
731 | | - | |
---|
732 | | - | @Callable(aG) |
---|
733 | | - | func increaseLock (eV) = { |
---|
734 | | - | let ez = au() |
---|
735 | | - | let eA = ez[ao] |
---|
736 | | - | let ax = fromBase58String(eA) |
---|
737 | | - | let az = parseIntValue(ez[aq]) |
---|
738 | | - | let aA = parseIntValue(ez[ar]) |
---|
739 | | - | let eB = cy(aG, ax) |
---|
740 | | - | let dl = toString(aG.caller) |
---|
741 | | - | let dH = aR(dl) |
---|
742 | | - | let dI = dH[aJ] |
---|
743 | | - | let eW = parseIntValue(dH[aK]) |
---|
744 | | - | let bT = parseIntValue(dH[aL]) |
---|
745 | | - | let eX = parseIntValue(dH[aM]) |
---|
746 | | - | let eY = (bT + eX) |
---|
747 | | - | let eZ = max([(eY - height), 0]) |
---|
748 | | - | let fa = (eW + eB) |
---|
749 | | - | let fb = (eZ + eV) |
---|
750 | | - | if ((0 > eV)) |
---|
751 | | - | then throw("duration is less then zero") |
---|
752 | | - | else if ((az > fb)) |
---|
753 | | - | then throw(("lockDurationNew is less then minLockDuration=" + toString(az))) |
---|
754 | | - | else if ((fb > aA)) |
---|
755 | | - | then throw(("deltaDuration + existedLockDuration is greater then maxLockDuration=" + toString(aA))) |
---|
756 | | - | else { |
---|
757 | | - | let eE = fraction(fb, c, aA) |
---|
758 | | - | let eF = fraction(fa, eE, c) |
---|
759 | | - | let eT = invoke(av, "updateReferralActivity", [toString(aG.caller), eF], nil) |
---|
760 | | - | if ((eT == eT)) |
---|
761 | | - | then { |
---|
762 | | - | let fc = height |
---|
763 | | - | let eG = q(invoke(av, "calcGwxParamsREADONLY", [eF, fc, fb], nil)) |
---|
764 | | - | let bU = t(eG[0]) |
---|
765 | | - | let bV = t(eG[1]) |
---|
766 | | - | let bl = toString(t(eG[2])) |
---|
767 | | - | let dR = n(bB, ah()) |
---|
768 | | - | let dS = n(bB, aj()) |
---|
769 | | - | let dT = n(bB, al()) |
---|
770 | | - | let co = if ((height > dT)) |
---|
771 | | - | then dT |
---|
772 | | - | else height |
---|
773 | | - | let dU = max([(co - dS), 0]) |
---|
774 | | - | let dW = br(dI) |
---|
775 | | - | let dX = k(this, dW) |
---|
776 | | - | let dY = (((dR * dU) * 2) / 3) |
---|
777 | | - | let dZ = (dY - dX) |
---|
778 | | - | if ((0 > dZ)) |
---|
779 | | - | then throw("wrong calculations") |
---|
780 | | - | else { |
---|
781 | | - | let ee = bu(dI) |
---|
782 | | - | let ef = bv() |
---|
783 | | - | let eg = k(this, ee) |
---|
784 | | - | let eh = k(this, ef) |
---|
785 | | - | let fd = cG(dl) |
---|
786 | | - | let fe = (eF - fd) |
---|
787 | | - | if ((0 > fe)) |
---|
788 | | - | then throw(("gwxDiff is less then 0: " + toString(fe))) |
---|
789 | | - | else { |
---|
790 | | - | let bN = bH(false) |
---|
791 | | - | let ei = bH(true) |
---|
792 | | - | let ek = bw(dI) |
---|
793 | | - | let el = k(this, ek) |
---|
794 | | - | let es = fraction(dZ, fd, ei) |
---|
795 | | - | let ff = ((eF * fb) / 2) |
---|
796 | | - | let fg = ((fd * eZ) / 2) |
---|
797 | | - | let fh = (ff - fg) |
---|
798 | | - | (((cq(dl, dI, fa, fc, fb, bU, bV, bl) ++ bY(eB, eV, 0, 0)) :+ bQ("lock", dl, eB, bT, fb, bU, bV, aG)) ++ [IntegerEntry(by(), (bN + fe))]) |
---|
799 | | - | } |
---|
800 | | - | } |
---|
801 | | - | } |
---|
802 | | - | else throw("Strict value is not equal to itself.") |
---|
803 | | - | } |
---|
804 | | - | } |
---|
805 | | - | |
---|
806 | | - | |
---|
807 | | - | |
---|
808 | | - | @Callable(aG) |
---|
809 | | - | func claimWxBoost (cR,dl) = if ((bC != aG.caller)) |
---|
810 | | - | then throw("permissions denied") |
---|
811 | | - | else { |
---|
812 | | - | let fi = dE(cR, dl, false) |
---|
813 | | - | let ev = fi._1 |
---|
814 | | - | let ew = fi._2 |
---|
815 | | - | let ex = fi._3 |
---|
816 | | - | $Tuple2(ew, [ev]) |
---|
817 | | - | } |
---|
818 | | - | |
---|
819 | | - | |
---|
820 | | - | |
---|
821 | | - | @Callable(aG) |
---|
822 | | - | func claimWxBoostREADONLY (cR,dl) = { |
---|
823 | | - | let fj = dE(cR, dl, true) |
---|
824 | | - | let ev = fj._1 |
---|
825 | | - | let ew = fj._2 |
---|
826 | | - | let ex = fj._3 |
---|
827 | | - | $Tuple2(nil, [ev, ex]) |
---|
828 | | - | } |
---|
829 | | - | |
---|
830 | | - | |
---|
831 | | - | |
---|
832 | | - | @Callable(aG) |
---|
833 | | - | func unlock (aQ) = { |
---|
834 | | - | let dH = aR(aQ) |
---|
835 | | - | let dI = dH[aJ] |
---|
836 | | - | let eW = parseIntValue(dH[aK]) |
---|
837 | | - | let bT = parseIntValue(dH[aL]) |
---|
838 | | - | let eX = parseIntValue(dH[aM]) |
---|
839 | | - | let eY = (bT + eX) |
---|
840 | | - | let ez = au() |
---|
841 | | - | let ax = fromBase58String(ez[ao]) |
---|
842 | | - | if ((eY >= height)) |
---|
843 | | - | then throw((("wait " + toString(eY)) + " to unlock")) |
---|
844 | | - | else if ((0 >= eW)) |
---|
845 | | - | then throw("nothing to unlock") |
---|
846 | | - | else { |
---|
847 | | - | let bl = valueOrElse(getInteger(av, am()), 0) |
---|
848 | | - | (((cq(aQ, dI, 0, bT, eX, 0, 0, toString(bl)) ++ bY(-(eW), 0, 0, -1)) :+ bQ("unlock", aQ, eW, bT, eX, 0, 0, aG)) :+ ScriptTransfer(addressFromStringValue(aQ), eW, ax)) |
---|
849 | | - | } |
---|
850 | | - | } |
---|
851 | | - | |
---|
852 | | - | |
---|
853 | | - | |
---|
854 | | - | @Callable(aG) |
---|
855 | | - | func gwxUserInfoREADONLY (aQ) = { |
---|
856 | | - | let ba = cG(aQ) |
---|
857 | | - | $Tuple2(nil, [ba]) |
---|
858 | | - | } |
---|
859 | | - | |
---|
860 | | - | |
---|
861 | | - | |
---|
862 | | - | @Callable(aG) |
---|
863 | | - | func userMaxDurationREADONLY (dl) = { |
---|
864 | | - | let ez = au() |
---|
865 | | - | let aA = parseIntValue(ez[ar]) |
---|
866 | | - | let fk = getString(this, aP(dl)) |
---|
867 | | - | if ((fk == unit)) |
---|
868 | | - | then $Tuple2(nil, $Tuple2("lock", aA)) |
---|
869 | | - | else { |
---|
870 | | - | let dH = split(value(fk), a) |
---|
871 | | - | let bT = parseIntValue(dH[aL]) |
---|
872 | | - | let eX = parseIntValue(dH[aM]) |
---|
873 | | - | let eY = (bT + eX) |
---|
874 | | - | let eZ = max([(eY - height), 0]) |
---|
875 | | - | let fl = (aA - eZ) |
---|
876 | | - | $Tuple2(nil, $Tuple2("increaseLock", fl)) |
---|
877 | | - | } |
---|
878 | | - | } |
---|
879 | | - | |
---|
880 | | - | |
---|
881 | | - | |
---|
882 | | - | @Callable(aG) |
---|
883 | | - | func getUserGwxAmountAtHeightREADONLY (aQ,cC) = { |
---|
884 | | - | let ba = cB(aQ, cC) |
---|
885 | | - | $Tuple2(nil, ba) |
---|
886 | | - | } |
---|
887 | | - | |
---|
888 | | - | |
---|
889 | | - | |
---|
890 | | - | @Callable(aG) |
---|
891 | | - | func getTotalCachedGwxREADONLY () = $Tuple2(nil, bH(true)) |
---|
892 | | - | |
---|
893 | | - | |
---|
894 | | - | |
---|
895 | | - | @Callable(aG) |
---|
896 | | - | func onStakedVoteUpdate (cR,dl,dm) = { |
---|
897 | | - | let eM = if ((aG.caller == bC)) |
---|
898 | | - | then true |
---|
899 | | - | else aF(aG) |
---|
900 | | - | if ((eM == eM)) |
---|
901 | | - | then { |
---|
902 | | - | let dt = dk(cR, dl, dm) |
---|
903 | | - | $Tuple2(dt, unit) |
---|
904 | | - | } |
---|
905 | | - | else throw("Strict value is not equal to itself.") |
---|
906 | | - | } |
---|
907 | | - | |
---|
908 | | - | |
---|
909 | | - | |
---|
910 | | - | @Callable(aG) |
---|
911 | | - | func getVotingResultStakedREADONLY (cR) = $Tuple2(nil, cW(cR)) |
---|
912 | | - | |
---|
913 | | - | |
---|
914 | | - | |
---|
915 | | - | @Callable(aG) |
---|
916 | | - | func setManager (fm) = { |
---|
917 | | - | let eM = aF(aG) |
---|
918 | | - | if ((eM == eM)) |
---|
919 | | - | then { |
---|
920 | | - | let fn = fromBase58String(fm) |
---|
921 | | - | if ((fn == fn)) |
---|
922 | | - | then [StringEntry(ag(), fm)] |
---|
923 | | - | else throw("Strict value is not equal to itself.") |
---|
924 | | - | } |
---|
925 | | - | else throw("Strict value is not equal to itself.") |
---|
926 | | - | } |
---|
927 | | - | |
---|
928 | | - | |
---|
929 | | - | |
---|
930 | | - | @Callable(aG) |
---|
931 | | - | func confirmManager () = { |
---|
932 | | - | let fo = aE() |
---|
933 | | - | let fp = if (isDefined(fo)) |
---|
934 | | - | then true |
---|
935 | | - | else throw("No pending manager") |
---|
936 | | - | if ((fp == fp)) |
---|
937 | | - | then { |
---|
938 | | - | let fq = if ((aG.callerPublicKey == value(fo))) |
---|
939 | | - | then true |
---|
940 | | - | else throw("You are not pending manager") |
---|
941 | | - | if ((fq == fq)) |
---|
942 | | - | then [StringEntry(af(), toBase58String(value(fo))), DeleteEntry(ag())] |
---|
943 | | - | else throw("Strict value is not equal to itself.") |
---|
944 | | - | } |
---|
945 | | - | else throw("Strict value is not equal to itself.") |
---|
946 | | - | } |
---|
947 | | - | |
---|
948 | | - | |
---|
949 | | - | @Verifier(fr) |
---|
950 | | - | func fs () = { |
---|
951 | | - | let ft = { |
---|
952 | | - | let r = aC() |
---|
953 | | - | if ($isInstanceOf(r, "ByteVector")) |
---|
954 | | - | then { |
---|
955 | | - | let aI = r |
---|
956 | | - | aI |
---|
957 | | - | } |
---|
958 | | - | else if ($isInstanceOf(r, "Unit")) |
---|
959 | | - | then fr.senderPublicKey |
---|
960 | | - | else throw("Match error") |
---|
961 | | - | } |
---|
962 | | - | sigVerify(fr.bodyBytes, fr.proofs[0], ft) |
---|
963 | | - | } |
---|
964 | | - | |
---|
| 1 | + | # no script |
---|