tx · Dw5HPqqhBvepzspaCV3PuvhK4BHpbVxt84H7oiRYqVi8

3N3PoX8z2Mvu5YbaqZmtyF3dRFjqvhRkB3M:  -0.01400000 Waves

2022.03.10 17:50 [1957993] smart account 3N3PoX8z2Mvu5YbaqZmtyF3dRFjqvhRkB3M > SELF 0.00000000 Waves

{ "type": 13, "id": "Dw5HPqqhBvepzspaCV3PuvhK4BHpbVxt84H7oiRYqVi8", "fee": 1400000, "feeAssetId": null, "timestamp": 1646923828876, "version": 2, "chainId": 84, "sender": "3N3PoX8z2Mvu5YbaqZmtyF3dRFjqvhRkB3M", "senderPublicKey": "FWZMxrtn6KRrWMPXmQPqDg5eRzwB2YvHhMjMJpwnLmBi", "proofs": [ "2iSL6zsw2HtdmcpW2gx4UErtsfSh3b5uqw42adJt1Dnh7GVDLX9hYLoQAQvmYkDKicb4whnTLUCGdHYdFeBoaa95" ], "script": "base64:AAIFAAAAAAAAB4oIAhIDCgEIEgASAwoBCBIDCgEIEgAaFgoBQRIRaW50ZXJuYWxCYXNlQXNzZXQaEgoBQhINa2V5UG9vbENvbmZpZxoOCgFDEglpQW10QXNzZXQaEAoBRBILaVByaWNlQXNzZXQaGAoBRRITa2V5QWxsUG9vbHNTaHV0ZG93bhoSCgFGEg1rZXlQb29sV2VpZ2h0GhQKAUcSD2NvbnRyYWN0QWRkcmVzcxoYCgFIEhNrZXlNYW5hZ2VyUHVibGljS2V5Gh8KAUkSGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5GhQKAUoSD2ZhY3RvcnlDb250cmFjdBoTCgFLEg5jb252ZXJ0QXNzZXRJZBoWCgFMEhFkYXRhUHV0QWN0aW9uSW5mbxoOCgFNEglpbkFzc2V0SWQaDwoBThIKaW5Bc3NldEFtdBoNCgFPEgh0eEhlaWdodBoQCgFQEgt0eFRpbWVzdGFtcBoZCgFREhRkYXRhSW52ZXN0QWN0aW9uSW5mbxoWCgFSEhFvdXRBbW91bnRBc3NldEFtdBoVCgFTEhBvdXRQ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G8gaXRzZWxmLgAAAAJhZgEAAAAOY29uZmlybU1hbmFnZXIAAAAABAAAAAJhTgkBAAAAAmFkAAAAAAQAAAACYU8DCQEAAAAJaXNEZWZpbmVkAAAAAQUAAAACYU4GCQAAAgAAAAECAAAAEk5vIHBlbmRpbmcgbWFuYWdlcgMJAAAAAAAAAgUAAAACYU8FAAAAAmFPBAAAAAJhUAMJAAAAAAAAAggFAAAAAmFmAAAAD2NhbGxlclB1YmxpY0tleQkBAAAABXZhbHVlAAAAAQUAAAACYU4GCQAAAgAAAAECAAAAG1lvdSBhcmUgbm90IHBlbmRpbmcgbWFuYWdlcgMJAAAAAAAAAgUAAAACYVAFAAAAAmFQCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAQAAAAFIAAAAAAkAAlgAAAABCQEAAAAFdmFsdWUAAAABBQAAAAJhTgkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAABSQAAAAAFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAQAAAAJhUQEAAAACYVIAAAAABAAAAAJhUwQAAAABVgkBAAAAAmFiAAAAAAMJAAABAAAAAgUAAAABVgIAAAAKQnl0ZVZlY3RvcgQAAAACYWgFAAAAAVYFAAAAAmFoAwkAAAEAAAACBQAAAAFWAgAAAARVbml0CAUAAAACYVEAAAAPc2VuZGVyUHVibGljS2V5CQAAAgAAAAECAAAAC01hdGNoIGVycm9yCQAB9AAAAAMIBQAAAAJhUQAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAmFRAAAABnByb29mcwAAAAAAAAAAAAUAAAACYVP9P6oS", "height": 1957993, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6yAo28f4tA5JpJof7PCMZ2ipYSe24GhZLhVwkZnvPN9k Next: 12fwpVRbQWHR5SK2n69N2w7uASeGUsMqxMHAUhRGWKZA Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = 8
4+let a = "__"
55
66 let b = 100000000
77
8-let c = 18
8+let c = 4
99
10-let d = toBigInt(1000000000000000000)
10+let d = 1
1111
12-let e = "__"
12+let e = 2
1313
14-let f = b
14+let f = 3
1515
16-let g = toBigInt(0)
16+let g = 4
1717
18-let h = 1
18+let h = 5
1919
20-let i = 2
20+let i = 6
2121
22-let j = 3
22+let j = 7
2323
24-let k = 4
24+let k = 8
2525
26-let l = 5
26+let l = 9
2727
28-let m = 6
28+let m = 10
2929
30-let n = 7
30+let n = 11
3131
32-let o = 8
33-
34-let p = 9
35-
36-let q = 10
37-
38-func r (s) = valueOrErrorMessage(getString(s), (("mandatory this." + s) + " is not defined"))
32+func o (p,q) = ((("%s%s%s__P__" + p) + "__") + q)
3933
4034
41-func t (u,s) = valueOrErrorMessage(getString(u, s), (((("mandatory " + toString(u)) + ".") + s) + " is not defined"))
35+func r (p,q) = ((("%s%s%s__invest__" + p) + "__") + q)
4236
4337
44-func v (u,s) = valueOrElse(getInteger(u, s), 0)
38+func s (p,t) = ((("%s%s%s__total__" + p) + "__") + t)
4539
4640
47-func w (u,s) = valueOrErrorMessage(getInteger(u, s), (("mandatory this." + s) + " is not defined"))
41+func u () = "%s__factoryContract"
4842
4943
50-func x (y) = {
51- let z = y
52- if ($isInstanceOf(z, "List[Any]"))
53- then {
54- let A = z
55- A
56- }
57- else throw("fail to cast into List[Any]")
58- }
44+func v (p,t) = (((("%s%s%s__" + p) + "__") + t) + "__slippageCumulative")
5945
6046
61-func B (y) = {
62- let z = y
63- if ($isInstanceOf(z, "Int"))
64- then {
65- let C = z
66- C
67- }
68- else throw("fail to cast into Int")
69- }
47+func w () = "%s__factoryConfig"
7048
7149
72-func D (y) = {
73- let z = y
74- if ($isInstanceOf(z, "String"))
50+func x (y) = (("%s%s%s__" + y) + "__mappings__poolContract2PoolAssets")
51+
52+
53+func z (A) = ("%s%s%d__mappings__internal2baseAssetId__" + toString(A))
54+
55+
56+func B (C,D) = (((("%d%d%s__" + C) + "__") + D) + "__config")
57+
58+
59+func E () = "%s__shutdown"
60+
61+
62+func F (G) = ("%s%s__poolWeight__" + G)
63+
64+
65+func H () = "%s__managerPublicKey"
66+
67+
68+func I () = "%s__pendingManagerPublicKey"
69+
70+
71+let J = addressFromStringValue(valueOrErrorMessage(getString(this, u()), "No Factory Acc found."))
72+
73+func K (t) = if (!(isDefined(t)))
74+ then "WAVES"
75+ else t
76+
77+
78+func L (M,N,O,P) = makeString(["%s%d%d%d", M, toString(N), toString(O), toString(P)], a)
79+
80+
81+func Q (R,S,O,P) = makeString(["%d%d%d%d", toString(R), toString(S), toString(O), toString(P)], a)
82+
83+
84+func T (U) = {
85+ let V = U
86+ if ($isInstanceOf(V, "String"))
7587 then {
76- let E = z
77- E
88+ let W = V
89+ W
7890 }
7991 else throw("fail to cast into String")
8092 }
8193
8294
83-func F () = "%s%s__config__factoryAddress"
95+func X (Y,Z,aa) = fraction(Y, Z, aa)
8496
8597
86-func G () = "%s__managerPublicKey"
87-
88-
89-func H () = "%s__pendingManagerPublicKey"
90-
91-
92-let I = 1
93-
94-let J = 2
95-
96-let K = 3
97-
98-let L = 4
99-
100-let M = 5
101-
102-let N = 6
103-
104-let O = 7
105-
106-let P = 8
107-
108-func Q () = "%s__factoryConfig"
109-
110-
111-func R (S) = makeString(["%s%s%s", S, "mappings__lpAsset2PoolContract"], e)
112-
113-
114-func T () = "%s__lpTokensList"
115-
116-
117-func U (S) = makeString(["%s%s%s", S, "mappings__lpAsset2PoolContract"], e)
118-
119-
120-func V (W) = makeString(["%s%s", "poolWeight", W], e)
121-
122-
123-func X () = addressFromStringValue(r(F()))
124-
125-
126-func Y () = split(valueOrElse(getString(X(), T()), ""), e)
127-
128-
129-func Z (aa) = split(t(aa, Q()), e)
130-
131-
132-func ab (ac) = addressFromStringValue(ac[J])
133-
134-
135-func ad (ac) = addressFromStringValue(ac[M])
136-
137-
138-func ae (ac) = addressFromStringValue(ac[I])
139-
140-
141-func af (ac) = addressFromStringValue(ac[P])
142-
143-
144-func ag () = "%s__config"
145-
146-
147-func ah () = "%s%s__stats__activeTotalLocked"
148-
149-
150-func ai () = "%s%s__stats__locksDurationSumInBlocks"
151-
152-
153-func aj () = "%s%s__stats__locksCount"
154-
155-
156-func ak () = "%s%s__stats__activeUsersCount"
157-
158-
159-func al (am) = makeString(["%s%s%s__mapping__user2num", am], e)
160-
161-
162-func an (ao) = makeString(["%s%s%s__mapping__num2user", ao], e)
163-
164-
165-func ap (aq) = makeString(["%s%d%s__paramByUserNum", aq, "amount"], e)
166-
167-
168-func ar (aq) = makeString(["%s%d%s__paramByUserNum", aq, "start"], e)
169-
170-
171-func as (aq) = makeString(["%s%d%s__paramByUserNum", aq, "duration"], e)
172-
173-
174-func at (aq) = makeString(["%s%d%s__paramByUserNum", aq, "k"], e)
175-
176-
177-func au (aq) = makeString(["%s%d%s__paramByUserNum", aq, "b"], e)
178-
179-
180-func av (aq,aw) = makeString(["%s%d%s%d__paramByPeriod", aq, "k", aw], e)
181-
182-
183-func ax (aq,aw) = makeString(["%s%d%s%d__paramByPeriod", aq, "b", aw], e)
184-
185-
186-func ay (aq) = makeString(["%s%d__userBoostEmissionLastInt", aq], e)
187-
188-
189-func az (aq) = makeString(["%s%d__maxBoostInt", aq], e)
190-
191-
192-func aA () = "%s%s__maxBoostInt__total"
193-
194-
195-func aB (aq) = makeString(["%s%d__userBoostAvaliableToClaimTotal", aq], e)
196-
197-
198-func aC (aq) = makeString(["%s%d__userBoostClaimed", aq], e)
199-
200-
201-func aD () = "%s%s__gwxCached__total"
202-
203-
204-func aE (aF,aG) = makeString(["%s%s%s__staked", aF, aG], e)
205-
206-
207-func aH (aG) = ("%s%s%s__staked__total__" + aG)
208-
209-
210-func aI (aG,aF) = makeString(["%s%s%s__claimed", aF, aG], e)
211-
212-
213-func aJ (aG,aF) = makeString(["%s%s%s__claimedMinReward", aF, aG], e)
214-
215-
216-func aK (aG,aF) = makeString(["%s%s%s__claimedBoostReward", aF, aG], e)
217-
218-
219-func aL (aM,s) = valueOrElse(getInteger(aM, s), 0)
220-
221-
222-func aN () = "%s%s__ratePerBlock__current"
223-
224-
225-func aO () = "%s%s__ratePerBlockMax__current"
226-
227-
228-func aP () = "%s%s__emission__startBlock"
229-
230-
231-func aQ () = "%s%s__emission__duration"
232-
233-
234-func aR () = "%s%s__emission__endBlock"
235-
236-
237-let aS = X()
238-
239-let aT = Z(aS)
240-
241-let aU = ad(aT)
242-
243-let aM = ae(aT)
244-
245-let aV = af(aT)
246-
247-let aW = ab(aT)
248-
249-func aX (aY) = {
250- let aZ = t(aS, U(aY))
251- let ba = b
252- let bb = getIntegerValue(aS, V(aZ))
253- let bc = w(aU, aN())
254- let bd = w(aU, aO())
255- let be = 3
256- let bf = (fraction(bc, bb, ba) / be)
257- let bg = fraction(bd, bb, ba)
258- let bh = (be * b)
259- let bi = v(aM, aH(aY))
260-[bf, bh, bi]
261- }
262-
263-
264-func bj (bk,bl,bm) = {
265- let bn = fraction(bl, b, bm)
266- let bo = fraction(bk, bn, b)
267-[bo]
268- }
269-
270-
271-func bp () = {
272- let z = getString(G())
273- if ($isInstanceOf(z, "String"))
98+func ab () = {
99+ let V = getString(H())
100+ if ($isInstanceOf(V, "String"))
274101 then {
275- let bq = z
276- fromBase58String(bq)
102+ let ac = V
103+ fromBase58String(ac)
277104 }
278- else if ($isInstanceOf(z, "Unit"))
105+ else if ($isInstanceOf(V, "Unit"))
279106 then unit
280107 else throw("Match error")
281108 }
282109
283110
284-func br () = {
285- let z = getString(H())
286- if ($isInstanceOf(z, "String"))
111+func ad () = {
112+ let V = getString(I())
113+ if ($isInstanceOf(V, "String"))
287114 then {
288- let bq = z
289- fromBase58String(bq)
115+ let ac = V
116+ fromBase58String(ac)
290117 }
291- else if ($isInstanceOf(z, "Unit"))
118+ else if ($isInstanceOf(V, "Unit"))
292119 then unit
293120 else throw("Match error")
294121 }
295122
296123
297-func bs (bt) = {
298- let bu = throw("Permission denied")
299- let z = bp()
300- if ($isInstanceOf(z, "ByteVector"))
124+func ae (af) = {
125+ let ag = throw("Permission denied")
126+ let V = ab()
127+ if ($isInstanceOf(V, "ByteVector"))
301128 then {
302- let bv = z
303- if ((bt.callerPublicKey == bv))
129+ let ah = V
130+ if ((af.callerPublicKey == ah))
304131 then true
305- else bu
132+ else ag
306133 }
307- else if ($isInstanceOf(z, "Unit"))
308- then if ((bt.caller == this))
134+ else if ($isInstanceOf(V, "Unit"))
135+ then if ((af.caller == this))
309136 then true
310- else bu
137+ else ag
311138 else throw("Match error")
312139 }
313140
314141
315-@Callable(bt)
316-func constructor (bw) = if ((bt.caller != this))
317- then throw("not authorized")
318- else [StringEntry(F(), bw)]
319-
320-
321-
322-@Callable(bt)
323-func currentRewardRateREADONLY (aY) = {
324- let bx = aX(aY)
325- let bc = bx[0]
326- let bh = bx[1]
327- let bi = bx[2]
328- $Tuple2(nil, makeString(["%d%d%d", toString(bc), toString(bh), toString(bi)], e))
142+@Callable(af)
143+func constructor (J) = {
144+ let ai = ae(af)
145+ if ((ai == ai))
146+ then [StringEntry(u(), J)]
147+ else throw("Strict value is not equal to itself.")
329148 }
330149
331150
332151
333-@Callable(bt)
334-func currentUserRewardRateREADONLY (aY,am) = {
335- let bx = aX(aY)
336- let bc = bx[0]
337- let bh = bx[1]
338- let bi = bx[2]
339- let by = v(aM, aE(am, aY))
340- let bz = split(D(invoke(aM, "claimWxREADONLY", [aY, am], nil)), e)
341- let bA = valueOrErrorMessage(parseInt(bz[5]), "couldn't parse minRewardPart")
342- let bB = valueOrErrorMessage(parseInt(bz[6]), "couldn't parse boostRewardPart")
343- let bC = bz[7]
344- let bD = if ((bB == 0))
345- then (1 * b)
346- else fraction((bA + bB), b, bA)
347- $Tuple2(nil, makeString(["%d%d%d%d%d%s", toString(bc), toString(bh), toString(bi), toString(by), toString(bD), bC], e))
152+@Callable(af)
153+func put () = {
154+ let aj = toString(af.caller)
155+ let ak = value(af.payments[0])
156+ let al = if (!(isDefined(ak.assetId)))
157+ then "WAVES"
158+ else toBase58String(value(ak.assetId))
159+ let am = ak.amount
160+ let an = split(valueOrErrorMessage(getString(J, x(aj)), "Invalid caller"), a)
161+ let ao = parseIntValue(an[1])
162+ let ap = parseIntValue(an[2])
163+ let aq = valueOrErrorMessage(getString(J, z(ao)), "Cannot find asset")
164+ let ar = valueOrErrorMessage(getString(J, z(ap)), "Cannot find asset")
165+ let as = valueOrElse(getInteger(this, s(aj, al)), 0)
166+ let at = valueOrElse(getInteger(this, v(aj, al)), 0)
167+[StringEntry(o(aj, toBase58String(af.transactionId)), L(al, am, height, lastBlock.timestamp)), IntegerEntry(s(aj, al), (as + am)), IntegerEntry(v(aj, al), (at + am))]
348168 }
349169
350170
351171
352-@Callable(bt)
353-func claimedRewardREADONLY (am) = {
354- let bE = Y()
355- let bF = "%s%d%d%d%s"
356- func bG (bH,bI) = {
357- let bJ = aJ(bI, am)
358- let bK = aK(bI, am)
359- let bL = valueOrElse(getInteger(aM, bJ), 0)
360- let bM = valueOrElse(getInteger(aM, bK), 0)
361- let bN = 0
362- makeString([(bF + bH), bI, toString(bL), toString(bM), toString(bN), "end"], e)
363- }
364-
365- let bO = {
366- let bP = bE
367- let bQ = size(bP)
368- let bR = "%s"
369- func bS (bT,bU) = if ((bU >= bQ))
370- then bT
371- else bG(bT, bP[bU])
372-
373- func bV (bT,bU) = if ((bU >= bQ))
374- then bT
375- else throw("List size exceeds 10")
376-
377- bV(bS(bS(bS(bS(bS(bS(bS(bS(bS(bS(bR, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
378- }
379- $Tuple2(nil, ((bO + e) + am))
172+@Callable(af)
173+func invest (au) = {
174+ let p = valueOrErrorMessage(addressFromString(au), "invalid pool address")
175+ let an = split(valueOrErrorMessage(getString(J, x(au)), "Invalid pool passed."), a)
176+ let av = valueOrErrorMessage(getString(J, z(parseIntValue(an[1]))), "No asset mapping found")
177+ let aw = valueOrErrorMessage(getString(J, z(parseIntValue(an[2]))), "No asset mapping found")
178+ let ax = valueOrElse(getInteger(this, s(au, av)), 0)
179+ let ay = valueOrElse(getInteger(this, s(au, aw)), 0)
180+ let az = invoke(p, "evaluatePutByPriceAssetREADONLY", [ay], nil)
181+ let aA = invoke(p, "evaluatePutByAmountAssetREADONLY", [ax], nil)
182+ let aB = 7
183+ let aC = 8
184+ let aD = valueOrErrorMessage(parseIntValue(split(T(az), a)[aB]), "fail to parse estimated amAsset amount")
185+ let aE = valueOrErrorMessage(parseIntValue(split(T(aA), a)[aC]), "fail to parse estimated prAsset amount")
186+ let aF = if ((ax >= aD))
187+ then $Tuple2(aD, ay)
188+ else $Tuple2(ax, aE)
189+ let aG = aF._1
190+ let aH = aF._2
191+ let aI = if ((av == "WAVES"))
192+ then unit
193+ else fromBase58String(av)
194+ let aJ = if ((aw == "WAVES"))
195+ then unit
196+ else fromBase58String(aw)
197+ let aK = invoke(p, "putForFree", [1000], [AttachedPayment(aI, aG), AttachedPayment(aJ, aH)])
198+ if ((aK == aK))
199+ then [StringEntry(r(au, toBase58String(af.transactionId)), Q(aG, aH, height, lastBlock.timestamp)), IntegerEntry(s(au, av), (ax - aG)), IntegerEntry(s(au, aw), (ay - aH))]
200+ else throw("Strict value is not equal to itself.")
380201 }
381202
382203
383204
384-@Callable(bt)
385-func calcBoostREADONLY (bW,bX,bY,bZ,ca) = {
386- let cb = aV
387- let cc = "empty"
388- let cd = parseIntValue(split(t(aW, ag()), e)[4])
389- let aG = if ((bZ == ""))
390- then cc
391- else bZ
392- let aF = if ((ca == ""))
393- then cc
394- else ca
395- let ce = valueOrElse(getString(aW, al(ca)), cc)
396- let cf = valueOrElse(getInteger(aW, ap(ce)), 0)
397- let cg = valueOrElse(getInteger(aW, ar(ce)), height)
398- let bl = valueOrElse(getInteger(aW, as(ce)), 0)
399- let ch = (cg + bl)
400- let ci = max([(ch - height), 0])
401- let cj = (cf + bW)
402- let ck = min([(ci + bX), cd])
403- let cl = B(x(invoke(aW, "gwxUserInfoREADONLY", [aF], nil))[0])
404- let cm = bj(cj, ck, cd)[0]
405- let cn = x(invoke(cb, "calcGwxParamsREADONLY", [cm, height, ck], nil))
406- let co = (cm - cl)
407- let cp = B(cn[0])
408- let cq = B(cn[1])
409- let aw = toString(B(cn[2]))
410- let cr = aA()
411- let cs = aD()
412- let ct = ((cm * ck) / 2)
413- let cu = v(aW, cr)
414- let cv = valueOrElse(getInteger(aW, cs), 0)
415- let cw = 1000
416- let cx = (w(aU, aN()) * cw)
417- let cy = aE(aF, aG)
418- let cz = aH(aG)
419- let cA = aL(aM, cy)
420- let cB = aL(aM, cz)
421- let cC = (cA + bY)
422- let cD = (cB + bY)
423- let bb = if ((aG != cc))
205+@Callable(af)
206+func setManager (aL) = {
207+ let ai = ae(af)
208+ if ((ai == ai))
424209 then {
425- let aZ = valueOrErrorMessage(getString(aS, R(aG)), ("unsupported lp asset " + aG))
426- getIntegerValue(aS, V(aZ))
427- }
428- else 0
429- let cE = fraction(cx, bb, (f * 3))
430- let cF = if ((cD != 0))
431- then fraction(cE, b, cD)
432- else 0
433- let cG = fraction(cF, cC, b)
434- let cH = (cE * 2)
435- let cI = fraction(cm, cH, (cv + co))
436- let cJ = min([cI, (cG * 2)])
437- let cK = if ((cG == 0))
438- then (1 * b)
439- else fraction((cJ + cG), b, cG)
440- let bC = makeString([("lpAssetIdStr=" + aG), ("userAddressStr=" + aF), ("userNumStr=" + ce), ("userAmount=" + toString(cf)), ("userAmountNew=" + toString(cj)), ("lockDurationNew=" + toString(ck)), ("gWxAmountStart=" + toString(cm)), ("tmpUserBoostPerBlockX3=" + toString(cI)), ("stakedByUserNew=" + toString(cC)), ("stakedTotalNew=" + toString(cD)), ("poolWeight=" + toString(bb)), ("wxPerLpX3=" + toString(cF)), ("poolWxEmissionPerBlockX3=" + toString(cE)), ("userWxPerBlockX3=" + toString(cG)), ("gWxAmountDiff=" + toString(co)), ("totalCachedGwx=" + toString(cv)), ("userCurrgWxAmount=" + toString(cl))], "::")
441- $Tuple2(nil, makeString(["%d%d%s", toString(cm), toString(cK), bC], e))
442- }
443-
444-
445-
446-@Callable(bt)
447-func wxEmissionStatsREADONLY () = {
448- let cL = toString(b)
449- let cM = "1"
450- let bc = w(aU, aN())
451- let cN = w(aU, aP())
452- let cO = if ((cN > height))
453- then 0
454- else (height - cN)
455- let cP = (1440 * 365)
456- let cQ = (201000000 * b)
457- let cR = if ((cO > cP))
458- then cQ
459- else fraction(cQ, cO, cP)
460- let cS = ((bc * cO) + cR)
461- let cT = v(aW, ah())
462- let cU = v(aW, ai())
463- let cV = v(aW, aj())
464- $Tuple2(nil, makeString(["%d%d%d%d", toString(cS), toString(cT), toString(cU), toString(cV)], e))
465- }
466-
467-
468-
469-@Callable(bt)
470-func poolStatsREADONLY (cW) = {
471- let cX = addressFromStringValue(t(aS, U(cW)))
472- let cY = x(invoke(cX, "getPoolConfigWrapperREADONLY", nil, nil))
473- let aY = fromBase58String(D(cY[j]))
474- let cZ = D(cY[k])
475- let da = D(cY[l])
476- let db = D(cY[o])
477- let dc = D(cY[p])
478- let dd = parseIntValue(D(cY[m]))
479- let de = parseIntValue(D(cY[n]))
480- let df = valueOrErrorMessage(assetInfo(aY), (("Asset " + toBase58String(aY)) + " doesn't exist")).quantity
481- let dg = B(invoke(cX, "getAccBalanceWrapperREADONLY", [cZ], nil))
482- let dh = B(invoke(cX, "getAccBalanceWrapperREADONLY", [da], nil))
483- let di = if ((df == 0))
484- then [toString(g), toString(g), toString(g)]
485- else x(invoke(cX, "calcPricesWrapperREADONLY", [dg, dh, df], nil))
486- let dj = 0
487- let dk = B(invoke(cX, "fromX18WrapperREADONLY", [di[1], b], nil))
488- let dl = B(invoke(cX, "fromX18WrapperREADONLY", [di[2], b], nil))
489- let bb = getIntegerValue(aS, V(toString(cX)))
490- $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(dg), toString(dh), toString(df), toString(dj), toString(dk), toString(dl), toString(bb)], e))
491- }
492-
493-
494-
495-@Callable(bt)
496-func poolEvaluatePutByAmountAssetREADONLY (cW,dm) = {
497- let cX = addressFromStringValue(t(aS, U(cW)))
498- let cY = x(invoke(cX, "getPoolConfigWrapperREADONLY", nil, nil))
499- let aY = fromBase58String(D(cY[j]))
500- let dn = D(cY[k])
501- let do = fromBase58String(dn)
502- let dp = D(cY[l])
503- let dq = fromBase58String(dp)
504- let dd = parseIntValue(D(cY[m]))
505- let de = parseIntValue(D(cY[n]))
506- let dr = D(cY[i])
507- let df = valueOrErrorMessage(assetInfo(aY), (("Asset " + toBase58String(aY)) + " doesn't exist")).quantity
508- let dg = B(invoke(cX, "getAccBalanceWrapperREADONLY", [dn], nil))
509- let dh = B(invoke(cX, "getAccBalanceWrapperREADONLY", [dp], nil))
510- let ds = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dg, dd], nil)))
511- let dt = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dh, de], nil)))
512- let du = if ((df == 0))
513- then g
514- else parseBigIntValue(D(invoke(cX, "calcPriceBigIntWrapperREADONLY", [toString(dt), toString(ds)], nil)))
515- let dj = B(invoke(cX, "fromX18WrapperREADONLY", [toString(du), b], nil))
516- let dv = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dm, dd], nil)))
517- let dw = fraction(dv, du, d)
518- let dx = B(invoke(cX, "fromX18WrapperREADONLY", [toString(dw), de], nil))
519- let dy = invoke(cX, "estimatePutOperationWrapperREADONLY", ["", 500000, dm, do, dx, dq, "", true, false], nil)
520- let dz = {
521- let z = dy
522- if (if ($isInstanceOf(z._1, "Int"))
523- then if ($isInstanceOf(z._3, "Int"))
524- then if ($isInstanceOf(z._4, "Int"))
525- then if ($isInstanceOf(z._5, "Int"))
526- then $isInstanceOf(z._6, "Int")
527- else false
528- else false
529- else false
530- else false)
531- then {
532- let dA = z._1
533- let dB = z._3
534- let dC = z._4
535- let dD = z._5
536- let dE = z._6
537- $Tuple5(dA, dB, dC, dD, dE)
538- }
539- else throw("Couldn't cast types")
540- }
541- let dA = dz._1
542- let dB = dz._2
543- let dC = dz._3
544- let dD = dz._4
545- let dE = dz._5
546- $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(dA), toString(dj), toString(dC), toString(dD), toString(dE), dr, toString(dm), toString(dx)], e))
547- }
548-
549-
550-
551-@Callable(bt)
552-func poolEvaluatePutByPriceAssetREADONLY (cW,dx) = {
553- let cX = addressFromStringValue(t(aS, U(cW)))
554- let cY = x(invoke(cX, "getPoolConfigWrapperREADONLY", nil, nil))
555- let aY = fromBase58String(D(cY[j]))
556- let dn = D(cY[k])
557- let do = fromBase58String(dn)
558- let dp = D(cY[l])
559- let dq = fromBase58String(dp)
560- let dd = parseIntValue(D(cY[m]))
561- let de = parseIntValue(D(cY[n]))
562- let dr = D(cY[i])
563- let df = valueOrErrorMessage(assetInfo(aY), (("Asset " + toBase58String(aY)) + " doesn't exist")).quantity
564- let dF = B(invoke(cX, "getAccBalanceWrapperREADONLY", [dn], nil))
565- let dG = B(invoke(cX, "getAccBalanceWrapperREADONLY", [dp], nil))
566- let dH = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dF, dd], nil)))
567- let dI = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dG, de], nil)))
568- let du = if ((df == 0))
569- then g
570- else parseBigIntValue(D(invoke(cX, "calcPriceBigIntWrapperREADONLY", [toString(dI), toString(dH)], nil)))
571- let dj = B(invoke(cX, "fromX18WrapperREADONLY", [toString(du), b], nil))
572- let dw = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dx, de], nil)))
573- let dv = fraction(dw, d, du)
574- let dm = B(invoke(cX, "fromX18WrapperREADONLY", [toString(dv), dd], nil))
575- let dy = invoke(cX, "estimatePutOperationWrapperREADONLY", ["", 500000, dm, do, dx, dq, "", true, false], nil)
576- let dJ = {
577- let z = dy
578- if (if ($isInstanceOf(z._1, "Int"))
579- then if ($isInstanceOf(z._3, "Int"))
580- then if ($isInstanceOf(z._4, "Int"))
581- then if ($isInstanceOf(z._5, "Int"))
582- then $isInstanceOf(z._6, "Int")
583- else false
584- else false
585- else false
586- else false)
587- then {
588- let dA = z._1
589- let dB = z._3
590- let dC = z._4
591- let dD = z._5
592- let dE = z._6
593- $Tuple5(dA, dB, dC, dD, dE)
594- }
595- else throw("Couldn't cast types")
596- }
597- let dA = dJ._1
598- let dB = dJ._2
599- let dC = dJ._3
600- let dD = dJ._4
601- let dE = dJ._5
602- $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(dA), toString(dj), toString(dC), toString(dD), toString(dE), dr, toString(dm), toString(dx)], e))
603- }
604-
605-
606-
607-@Callable(bt)
608-func poolEvaluateGetREADONLY (dK,dL) = {
609- let cX = addressFromStringValue(t(aS, U(dK)))
610- let dy = invoke(cX, "estimateGetOperationWrapperREADONLY", ["", dK, dL, toString(cX)], nil)
611- let dM = {
612- let z = dy
613- if (if ($isInstanceOf(z._1, "Int"))
614- then if ($isInstanceOf(z._2, "Int"))
615- then if ($isInstanceOf(z._5, "Int"))
616- then if ($isInstanceOf(z._6, "Int"))
617- then if ($isInstanceOf(z._7, "Int"))
618- then if ($isInstanceOf(z._8, "String"))
619- then $isInstanceOf(z._9, "String")
620- else false
621- else false
622- else false
623- else false
624- else false
625- else false)
626- then {
627- let dN = z._1
628- let dO = z._2
629- let dC = z._5
630- let dD = z._6
631- let dE = z._7
632- let dj = z._8
633- let dr = z._9
634- $Tuple7(dN, dO, dC, dD, dE, dj, dr)
635- }
636- else throw("Couldn't cast types")
637- }
638- let dN = dM._1
639- let dO = dM._2
640- let dC = dM._3
641- let dD = dM._4
642- let dE = dM._5
643- let dj = dM._6
644- let dr = dM._7
645- $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(dN), toString(dO), toString(dC), toString(dD), toString(dE), dj, dr], e))
646- }
647-
648-
649-
650-@Callable(bt)
651-func gwxUserInfoREADONLY (am) = {
652- let dP = x(invoke(aW, "gwxUserInfoREADONLY", [am], nil))
653- let dQ = B(dP[0])
654- $Tuple2(nil, makeString(["%d", toString(dQ)], e))
655- }
656-
657-
658-
659-@Callable(bt)
660-func setManager (dR) = {
661- let dS = bs(bt)
662- if ((dS == dS))
663- then {
664- let dT = fromBase58String(dR)
665- if ((dT == dT))
666- then [StringEntry(H(), dR)]
210+ let aM = fromBase58String(aL)
211+ if ((aM == aM))
212+ then [StringEntry(I(), aL)]
667213 else throw("Strict value is not equal to itself.")
668214 }
669215 else throw("Strict value is not equal to itself.")
671217
672218
673219
674-@Callable(bt)
220+@Callable(af)
675221 func confirmManager () = {
676- let dU = br()
677- let dV = if (isDefined(dU))
222+ let aN = ad()
223+ let aO = if (isDefined(aN))
678224 then true
679225 else throw("No pending manager")
680- if ((dV == dV))
226+ if ((aO == aO))
681227 then {
682- let dW = if ((bt.callerPublicKey == value(dU)))
228+ let aP = if ((af.callerPublicKey == value(aN)))
683229 then true
684230 else throw("You are not pending manager")
685- if ((dW == dW))
686- then [StringEntry(G(), toBase58String(value(dU))), DeleteEntry(H())]
231+ if ((aP == aP))
232+ then [StringEntry(H(), toBase58String(value(aN))), DeleteEntry(I())]
687233 else throw("Strict value is not equal to itself.")
688234 }
689235 else throw("Strict value is not equal to itself.")
690236 }
691237
692238
693-@Verifier(dX)
694-func dY () = {
695- let dZ = {
696- let z = bp()
697- if ($isInstanceOf(z, "ByteVector"))
239+@Verifier(aQ)
240+func aR () = {
241+ let aS = {
242+ let V = ab()
243+ if ($isInstanceOf(V, "ByteVector"))
698244 then {
699- let bv = z
700- bv
245+ let ah = V
246+ ah
701247 }
702- else if ($isInstanceOf(z, "Unit"))
703- then dX.senderPublicKey
248+ else if ($isInstanceOf(V, "Unit"))
249+ then aQ.senderPublicKey
704250 else throw("Match error")
705251 }
706- sigVerify(dX.bodyBytes, dX.proofs[0], dZ)
252+ sigVerify(aQ.bodyBytes, aQ.proofs[0], aS)
707253 }
708254
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = 8
4+let a = "__"
55
66 let b = 100000000
77
8-let c = 18
8+let c = 4
99
10-let d = toBigInt(1000000000000000000)
10+let d = 1
1111
12-let e = "__"
12+let e = 2
1313
14-let f = b
14+let f = 3
1515
16-let g = toBigInt(0)
16+let g = 4
1717
18-let h = 1
18+let h = 5
1919
20-let i = 2
20+let i = 6
2121
22-let j = 3
22+let j = 7
2323
24-let k = 4
24+let k = 8
2525
26-let l = 5
26+let l = 9
2727
28-let m = 6
28+let m = 10
2929
30-let n = 7
30+let n = 11
3131
32-let o = 8
33-
34-let p = 9
35-
36-let q = 10
37-
38-func r (s) = valueOrErrorMessage(getString(s), (("mandatory this." + s) + " is not defined"))
32+func o (p,q) = ((("%s%s%s__P__" + p) + "__") + q)
3933
4034
41-func t (u,s) = valueOrErrorMessage(getString(u, s), (((("mandatory " + toString(u)) + ".") + s) + " is not defined"))
35+func r (p,q) = ((("%s%s%s__invest__" + p) + "__") + q)
4236
4337
44-func v (u,s) = valueOrElse(getInteger(u, s), 0)
38+func s (p,t) = ((("%s%s%s__total__" + p) + "__") + t)
4539
4640
47-func w (u,s) = valueOrErrorMessage(getInteger(u, s), (("mandatory this." + s) + " is not defined"))
41+func u () = "%s__factoryContract"
4842
4943
50-func x (y) = {
51- let z = y
52- if ($isInstanceOf(z, "List[Any]"))
53- then {
54- let A = z
55- A
56- }
57- else throw("fail to cast into List[Any]")
58- }
44+func v (p,t) = (((("%s%s%s__" + p) + "__") + t) + "__slippageCumulative")
5945
6046
61-func B (y) = {
62- let z = y
63- if ($isInstanceOf(z, "Int"))
64- then {
65- let C = z
66- C
67- }
68- else throw("fail to cast into Int")
69- }
47+func w () = "%s__factoryConfig"
7048
7149
72-func D (y) = {
73- let z = y
74- if ($isInstanceOf(z, "String"))
50+func x (y) = (("%s%s%s__" + y) + "__mappings__poolContract2PoolAssets")
51+
52+
53+func z (A) = ("%s%s%d__mappings__internal2baseAssetId__" + toString(A))
54+
55+
56+func B (C,D) = (((("%d%d%s__" + C) + "__") + D) + "__config")
57+
58+
59+func E () = "%s__shutdown"
60+
61+
62+func F (G) = ("%s%s__poolWeight__" + G)
63+
64+
65+func H () = "%s__managerPublicKey"
66+
67+
68+func I () = "%s__pendingManagerPublicKey"
69+
70+
71+let J = addressFromStringValue(valueOrErrorMessage(getString(this, u()), "No Factory Acc found."))
72+
73+func K (t) = if (!(isDefined(t)))
74+ then "WAVES"
75+ else t
76+
77+
78+func L (M,N,O,P) = makeString(["%s%d%d%d", M, toString(N), toString(O), toString(P)], a)
79+
80+
81+func Q (R,S,O,P) = makeString(["%d%d%d%d", toString(R), toString(S), toString(O), toString(P)], a)
82+
83+
84+func T (U) = {
85+ let V = U
86+ if ($isInstanceOf(V, "String"))
7587 then {
76- let E = z
77- E
88+ let W = V
89+ W
7890 }
7991 else throw("fail to cast into String")
8092 }
8193
8294
83-func F () = "%s%s__config__factoryAddress"
95+func X (Y,Z,aa) = fraction(Y, Z, aa)
8496
8597
86-func G () = "%s__managerPublicKey"
87-
88-
89-func H () = "%s__pendingManagerPublicKey"
90-
91-
92-let I = 1
93-
94-let J = 2
95-
96-let K = 3
97-
98-let L = 4
99-
100-let M = 5
101-
102-let N = 6
103-
104-let O = 7
105-
106-let P = 8
107-
108-func Q () = "%s__factoryConfig"
109-
110-
111-func R (S) = makeString(["%s%s%s", S, "mappings__lpAsset2PoolContract"], e)
112-
113-
114-func T () = "%s__lpTokensList"
115-
116-
117-func U (S) = makeString(["%s%s%s", S, "mappings__lpAsset2PoolContract"], e)
118-
119-
120-func V (W) = makeString(["%s%s", "poolWeight", W], e)
121-
122-
123-func X () = addressFromStringValue(r(F()))
124-
125-
126-func Y () = split(valueOrElse(getString(X(), T()), ""), e)
127-
128-
129-func Z (aa) = split(t(aa, Q()), e)
130-
131-
132-func ab (ac) = addressFromStringValue(ac[J])
133-
134-
135-func ad (ac) = addressFromStringValue(ac[M])
136-
137-
138-func ae (ac) = addressFromStringValue(ac[I])
139-
140-
141-func af (ac) = addressFromStringValue(ac[P])
142-
143-
144-func ag () = "%s__config"
145-
146-
147-func ah () = "%s%s__stats__activeTotalLocked"
148-
149-
150-func ai () = "%s%s__stats__locksDurationSumInBlocks"
151-
152-
153-func aj () = "%s%s__stats__locksCount"
154-
155-
156-func ak () = "%s%s__stats__activeUsersCount"
157-
158-
159-func al (am) = makeString(["%s%s%s__mapping__user2num", am], e)
160-
161-
162-func an (ao) = makeString(["%s%s%s__mapping__num2user", ao], e)
163-
164-
165-func ap (aq) = makeString(["%s%d%s__paramByUserNum", aq, "amount"], e)
166-
167-
168-func ar (aq) = makeString(["%s%d%s__paramByUserNum", aq, "start"], e)
169-
170-
171-func as (aq) = makeString(["%s%d%s__paramByUserNum", aq, "duration"], e)
172-
173-
174-func at (aq) = makeString(["%s%d%s__paramByUserNum", aq, "k"], e)
175-
176-
177-func au (aq) = makeString(["%s%d%s__paramByUserNum", aq, "b"], e)
178-
179-
180-func av (aq,aw) = makeString(["%s%d%s%d__paramByPeriod", aq, "k", aw], e)
181-
182-
183-func ax (aq,aw) = makeString(["%s%d%s%d__paramByPeriod", aq, "b", aw], e)
184-
185-
186-func ay (aq) = makeString(["%s%d__userBoostEmissionLastInt", aq], e)
187-
188-
189-func az (aq) = makeString(["%s%d__maxBoostInt", aq], e)
190-
191-
192-func aA () = "%s%s__maxBoostInt__total"
193-
194-
195-func aB (aq) = makeString(["%s%d__userBoostAvaliableToClaimTotal", aq], e)
196-
197-
198-func aC (aq) = makeString(["%s%d__userBoostClaimed", aq], e)
199-
200-
201-func aD () = "%s%s__gwxCached__total"
202-
203-
204-func aE (aF,aG) = makeString(["%s%s%s__staked", aF, aG], e)
205-
206-
207-func aH (aG) = ("%s%s%s__staked__total__" + aG)
208-
209-
210-func aI (aG,aF) = makeString(["%s%s%s__claimed", aF, aG], e)
211-
212-
213-func aJ (aG,aF) = makeString(["%s%s%s__claimedMinReward", aF, aG], e)
214-
215-
216-func aK (aG,aF) = makeString(["%s%s%s__claimedBoostReward", aF, aG], e)
217-
218-
219-func aL (aM,s) = valueOrElse(getInteger(aM, s), 0)
220-
221-
222-func aN () = "%s%s__ratePerBlock__current"
223-
224-
225-func aO () = "%s%s__ratePerBlockMax__current"
226-
227-
228-func aP () = "%s%s__emission__startBlock"
229-
230-
231-func aQ () = "%s%s__emission__duration"
232-
233-
234-func aR () = "%s%s__emission__endBlock"
235-
236-
237-let aS = X()
238-
239-let aT = Z(aS)
240-
241-let aU = ad(aT)
242-
243-let aM = ae(aT)
244-
245-let aV = af(aT)
246-
247-let aW = ab(aT)
248-
249-func aX (aY) = {
250- let aZ = t(aS, U(aY))
251- let ba = b
252- let bb = getIntegerValue(aS, V(aZ))
253- let bc = w(aU, aN())
254- let bd = w(aU, aO())
255- let be = 3
256- let bf = (fraction(bc, bb, ba) / be)
257- let bg = fraction(bd, bb, ba)
258- let bh = (be * b)
259- let bi = v(aM, aH(aY))
260-[bf, bh, bi]
261- }
262-
263-
264-func bj (bk,bl,bm) = {
265- let bn = fraction(bl, b, bm)
266- let bo = fraction(bk, bn, b)
267-[bo]
268- }
269-
270-
271-func bp () = {
272- let z = getString(G())
273- if ($isInstanceOf(z, "String"))
98+func ab () = {
99+ let V = getString(H())
100+ if ($isInstanceOf(V, "String"))
274101 then {
275- let bq = z
276- fromBase58String(bq)
102+ let ac = V
103+ fromBase58String(ac)
277104 }
278- else if ($isInstanceOf(z, "Unit"))
105+ else if ($isInstanceOf(V, "Unit"))
279106 then unit
280107 else throw("Match error")
281108 }
282109
283110
284-func br () = {
285- let z = getString(H())
286- if ($isInstanceOf(z, "String"))
111+func ad () = {
112+ let V = getString(I())
113+ if ($isInstanceOf(V, "String"))
287114 then {
288- let bq = z
289- fromBase58String(bq)
115+ let ac = V
116+ fromBase58String(ac)
290117 }
291- else if ($isInstanceOf(z, "Unit"))
118+ else if ($isInstanceOf(V, "Unit"))
292119 then unit
293120 else throw("Match error")
294121 }
295122
296123
297-func bs (bt) = {
298- let bu = throw("Permission denied")
299- let z = bp()
300- if ($isInstanceOf(z, "ByteVector"))
124+func ae (af) = {
125+ let ag = throw("Permission denied")
126+ let V = ab()
127+ if ($isInstanceOf(V, "ByteVector"))
301128 then {
302- let bv = z
303- if ((bt.callerPublicKey == bv))
129+ let ah = V
130+ if ((af.callerPublicKey == ah))
304131 then true
305- else bu
132+ else ag
306133 }
307- else if ($isInstanceOf(z, "Unit"))
308- then if ((bt.caller == this))
134+ else if ($isInstanceOf(V, "Unit"))
135+ then if ((af.caller == this))
309136 then true
310- else bu
137+ else ag
311138 else throw("Match error")
312139 }
313140
314141
315-@Callable(bt)
316-func constructor (bw) = if ((bt.caller != this))
317- then throw("not authorized")
318- else [StringEntry(F(), bw)]
319-
320-
321-
322-@Callable(bt)
323-func currentRewardRateREADONLY (aY) = {
324- let bx = aX(aY)
325- let bc = bx[0]
326- let bh = bx[1]
327- let bi = bx[2]
328- $Tuple2(nil, makeString(["%d%d%d", toString(bc), toString(bh), toString(bi)], e))
142+@Callable(af)
143+func constructor (J) = {
144+ let ai = ae(af)
145+ if ((ai == ai))
146+ then [StringEntry(u(), J)]
147+ else throw("Strict value is not equal to itself.")
329148 }
330149
331150
332151
333-@Callable(bt)
334-func currentUserRewardRateREADONLY (aY,am) = {
335- let bx = aX(aY)
336- let bc = bx[0]
337- let bh = bx[1]
338- let bi = bx[2]
339- let by = v(aM, aE(am, aY))
340- let bz = split(D(invoke(aM, "claimWxREADONLY", [aY, am], nil)), e)
341- let bA = valueOrErrorMessage(parseInt(bz[5]), "couldn't parse minRewardPart")
342- let bB = valueOrErrorMessage(parseInt(bz[6]), "couldn't parse boostRewardPart")
343- let bC = bz[7]
344- let bD = if ((bB == 0))
345- then (1 * b)
346- else fraction((bA + bB), b, bA)
347- $Tuple2(nil, makeString(["%d%d%d%d%d%s", toString(bc), toString(bh), toString(bi), toString(by), toString(bD), bC], e))
152+@Callable(af)
153+func put () = {
154+ let aj = toString(af.caller)
155+ let ak = value(af.payments[0])
156+ let al = if (!(isDefined(ak.assetId)))
157+ then "WAVES"
158+ else toBase58String(value(ak.assetId))
159+ let am = ak.amount
160+ let an = split(valueOrErrorMessage(getString(J, x(aj)), "Invalid caller"), a)
161+ let ao = parseIntValue(an[1])
162+ let ap = parseIntValue(an[2])
163+ let aq = valueOrErrorMessage(getString(J, z(ao)), "Cannot find asset")
164+ let ar = valueOrErrorMessage(getString(J, z(ap)), "Cannot find asset")
165+ let as = valueOrElse(getInteger(this, s(aj, al)), 0)
166+ let at = valueOrElse(getInteger(this, v(aj, al)), 0)
167+[StringEntry(o(aj, toBase58String(af.transactionId)), L(al, am, height, lastBlock.timestamp)), IntegerEntry(s(aj, al), (as + am)), IntegerEntry(v(aj, al), (at + am))]
348168 }
349169
350170
351171
352-@Callable(bt)
353-func claimedRewardREADONLY (am) = {
354- let bE = Y()
355- let bF = "%s%d%d%d%s"
356- func bG (bH,bI) = {
357- let bJ = aJ(bI, am)
358- let bK = aK(bI, am)
359- let bL = valueOrElse(getInteger(aM, bJ), 0)
360- let bM = valueOrElse(getInteger(aM, bK), 0)
361- let bN = 0
362- makeString([(bF + bH), bI, toString(bL), toString(bM), toString(bN), "end"], e)
363- }
364-
365- let bO = {
366- let bP = bE
367- let bQ = size(bP)
368- let bR = "%s"
369- func bS (bT,bU) = if ((bU >= bQ))
370- then bT
371- else bG(bT, bP[bU])
372-
373- func bV (bT,bU) = if ((bU >= bQ))
374- then bT
375- else throw("List size exceeds 10")
376-
377- bV(bS(bS(bS(bS(bS(bS(bS(bS(bS(bS(bR, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
378- }
379- $Tuple2(nil, ((bO + e) + am))
172+@Callable(af)
173+func invest (au) = {
174+ let p = valueOrErrorMessage(addressFromString(au), "invalid pool address")
175+ let an = split(valueOrErrorMessage(getString(J, x(au)), "Invalid pool passed."), a)
176+ let av = valueOrErrorMessage(getString(J, z(parseIntValue(an[1]))), "No asset mapping found")
177+ let aw = valueOrErrorMessage(getString(J, z(parseIntValue(an[2]))), "No asset mapping found")
178+ let ax = valueOrElse(getInteger(this, s(au, av)), 0)
179+ let ay = valueOrElse(getInteger(this, s(au, aw)), 0)
180+ let az = invoke(p, "evaluatePutByPriceAssetREADONLY", [ay], nil)
181+ let aA = invoke(p, "evaluatePutByAmountAssetREADONLY", [ax], nil)
182+ let aB = 7
183+ let aC = 8
184+ let aD = valueOrErrorMessage(parseIntValue(split(T(az), a)[aB]), "fail to parse estimated amAsset amount")
185+ let aE = valueOrErrorMessage(parseIntValue(split(T(aA), a)[aC]), "fail to parse estimated prAsset amount")
186+ let aF = if ((ax >= aD))
187+ then $Tuple2(aD, ay)
188+ else $Tuple2(ax, aE)
189+ let aG = aF._1
190+ let aH = aF._2
191+ let aI = if ((av == "WAVES"))
192+ then unit
193+ else fromBase58String(av)
194+ let aJ = if ((aw == "WAVES"))
195+ then unit
196+ else fromBase58String(aw)
197+ let aK = invoke(p, "putForFree", [1000], [AttachedPayment(aI, aG), AttachedPayment(aJ, aH)])
198+ if ((aK == aK))
199+ then [StringEntry(r(au, toBase58String(af.transactionId)), Q(aG, aH, height, lastBlock.timestamp)), IntegerEntry(s(au, av), (ax - aG)), IntegerEntry(s(au, aw), (ay - aH))]
200+ else throw("Strict value is not equal to itself.")
380201 }
381202
382203
383204
384-@Callable(bt)
385-func calcBoostREADONLY (bW,bX,bY,bZ,ca) = {
386- let cb = aV
387- let cc = "empty"
388- let cd = parseIntValue(split(t(aW, ag()), e)[4])
389- let aG = if ((bZ == ""))
390- then cc
391- else bZ
392- let aF = if ((ca == ""))
393- then cc
394- else ca
395- let ce = valueOrElse(getString(aW, al(ca)), cc)
396- let cf = valueOrElse(getInteger(aW, ap(ce)), 0)
397- let cg = valueOrElse(getInteger(aW, ar(ce)), height)
398- let bl = valueOrElse(getInteger(aW, as(ce)), 0)
399- let ch = (cg + bl)
400- let ci = max([(ch - height), 0])
401- let cj = (cf + bW)
402- let ck = min([(ci + bX), cd])
403- let cl = B(x(invoke(aW, "gwxUserInfoREADONLY", [aF], nil))[0])
404- let cm = bj(cj, ck, cd)[0]
405- let cn = x(invoke(cb, "calcGwxParamsREADONLY", [cm, height, ck], nil))
406- let co = (cm - cl)
407- let cp = B(cn[0])
408- let cq = B(cn[1])
409- let aw = toString(B(cn[2]))
410- let cr = aA()
411- let cs = aD()
412- let ct = ((cm * ck) / 2)
413- let cu = v(aW, cr)
414- let cv = valueOrElse(getInteger(aW, cs), 0)
415- let cw = 1000
416- let cx = (w(aU, aN()) * cw)
417- let cy = aE(aF, aG)
418- let cz = aH(aG)
419- let cA = aL(aM, cy)
420- let cB = aL(aM, cz)
421- let cC = (cA + bY)
422- let cD = (cB + bY)
423- let bb = if ((aG != cc))
205+@Callable(af)
206+func setManager (aL) = {
207+ let ai = ae(af)
208+ if ((ai == ai))
424209 then {
425- let aZ = valueOrErrorMessage(getString(aS, R(aG)), ("unsupported lp asset " + aG))
426- getIntegerValue(aS, V(aZ))
427- }
428- else 0
429- let cE = fraction(cx, bb, (f * 3))
430- let cF = if ((cD != 0))
431- then fraction(cE, b, cD)
432- else 0
433- let cG = fraction(cF, cC, b)
434- let cH = (cE * 2)
435- let cI = fraction(cm, cH, (cv + co))
436- let cJ = min([cI, (cG * 2)])
437- let cK = if ((cG == 0))
438- then (1 * b)
439- else fraction((cJ + cG), b, cG)
440- let bC = makeString([("lpAssetIdStr=" + aG), ("userAddressStr=" + aF), ("userNumStr=" + ce), ("userAmount=" + toString(cf)), ("userAmountNew=" + toString(cj)), ("lockDurationNew=" + toString(ck)), ("gWxAmountStart=" + toString(cm)), ("tmpUserBoostPerBlockX3=" + toString(cI)), ("stakedByUserNew=" + toString(cC)), ("stakedTotalNew=" + toString(cD)), ("poolWeight=" + toString(bb)), ("wxPerLpX3=" + toString(cF)), ("poolWxEmissionPerBlockX3=" + toString(cE)), ("userWxPerBlockX3=" + toString(cG)), ("gWxAmountDiff=" + toString(co)), ("totalCachedGwx=" + toString(cv)), ("userCurrgWxAmount=" + toString(cl))], "::")
441- $Tuple2(nil, makeString(["%d%d%s", toString(cm), toString(cK), bC], e))
442- }
443-
444-
445-
446-@Callable(bt)
447-func wxEmissionStatsREADONLY () = {
448- let cL = toString(b)
449- let cM = "1"
450- let bc = w(aU, aN())
451- let cN = w(aU, aP())
452- let cO = if ((cN > height))
453- then 0
454- else (height - cN)
455- let cP = (1440 * 365)
456- let cQ = (201000000 * b)
457- let cR = if ((cO > cP))
458- then cQ
459- else fraction(cQ, cO, cP)
460- let cS = ((bc * cO) + cR)
461- let cT = v(aW, ah())
462- let cU = v(aW, ai())
463- let cV = v(aW, aj())
464- $Tuple2(nil, makeString(["%d%d%d%d", toString(cS), toString(cT), toString(cU), toString(cV)], e))
465- }
466-
467-
468-
469-@Callable(bt)
470-func poolStatsREADONLY (cW) = {
471- let cX = addressFromStringValue(t(aS, U(cW)))
472- let cY = x(invoke(cX, "getPoolConfigWrapperREADONLY", nil, nil))
473- let aY = fromBase58String(D(cY[j]))
474- let cZ = D(cY[k])
475- let da = D(cY[l])
476- let db = D(cY[o])
477- let dc = D(cY[p])
478- let dd = parseIntValue(D(cY[m]))
479- let de = parseIntValue(D(cY[n]))
480- let df = valueOrErrorMessage(assetInfo(aY), (("Asset " + toBase58String(aY)) + " doesn't exist")).quantity
481- let dg = B(invoke(cX, "getAccBalanceWrapperREADONLY", [cZ], nil))
482- let dh = B(invoke(cX, "getAccBalanceWrapperREADONLY", [da], nil))
483- let di = if ((df == 0))
484- then [toString(g), toString(g), toString(g)]
485- else x(invoke(cX, "calcPricesWrapperREADONLY", [dg, dh, df], nil))
486- let dj = 0
487- let dk = B(invoke(cX, "fromX18WrapperREADONLY", [di[1], b], nil))
488- let dl = B(invoke(cX, "fromX18WrapperREADONLY", [di[2], b], nil))
489- let bb = getIntegerValue(aS, V(toString(cX)))
490- $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(dg), toString(dh), toString(df), toString(dj), toString(dk), toString(dl), toString(bb)], e))
491- }
492-
493-
494-
495-@Callable(bt)
496-func poolEvaluatePutByAmountAssetREADONLY (cW,dm) = {
497- let cX = addressFromStringValue(t(aS, U(cW)))
498- let cY = x(invoke(cX, "getPoolConfigWrapperREADONLY", nil, nil))
499- let aY = fromBase58String(D(cY[j]))
500- let dn = D(cY[k])
501- let do = fromBase58String(dn)
502- let dp = D(cY[l])
503- let dq = fromBase58String(dp)
504- let dd = parseIntValue(D(cY[m]))
505- let de = parseIntValue(D(cY[n]))
506- let dr = D(cY[i])
507- let df = valueOrErrorMessage(assetInfo(aY), (("Asset " + toBase58String(aY)) + " doesn't exist")).quantity
508- let dg = B(invoke(cX, "getAccBalanceWrapperREADONLY", [dn], nil))
509- let dh = B(invoke(cX, "getAccBalanceWrapperREADONLY", [dp], nil))
510- let ds = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dg, dd], nil)))
511- let dt = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dh, de], nil)))
512- let du = if ((df == 0))
513- then g
514- else parseBigIntValue(D(invoke(cX, "calcPriceBigIntWrapperREADONLY", [toString(dt), toString(ds)], nil)))
515- let dj = B(invoke(cX, "fromX18WrapperREADONLY", [toString(du), b], nil))
516- let dv = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dm, dd], nil)))
517- let dw = fraction(dv, du, d)
518- let dx = B(invoke(cX, "fromX18WrapperREADONLY", [toString(dw), de], nil))
519- let dy = invoke(cX, "estimatePutOperationWrapperREADONLY", ["", 500000, dm, do, dx, dq, "", true, false], nil)
520- let dz = {
521- let z = dy
522- if (if ($isInstanceOf(z._1, "Int"))
523- then if ($isInstanceOf(z._3, "Int"))
524- then if ($isInstanceOf(z._4, "Int"))
525- then if ($isInstanceOf(z._5, "Int"))
526- then $isInstanceOf(z._6, "Int")
527- else false
528- else false
529- else false
530- else false)
531- then {
532- let dA = z._1
533- let dB = z._3
534- let dC = z._4
535- let dD = z._5
536- let dE = z._6
537- $Tuple5(dA, dB, dC, dD, dE)
538- }
539- else throw("Couldn't cast types")
540- }
541- let dA = dz._1
542- let dB = dz._2
543- let dC = dz._3
544- let dD = dz._4
545- let dE = dz._5
546- $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(dA), toString(dj), toString(dC), toString(dD), toString(dE), dr, toString(dm), toString(dx)], e))
547- }
548-
549-
550-
551-@Callable(bt)
552-func poolEvaluatePutByPriceAssetREADONLY (cW,dx) = {
553- let cX = addressFromStringValue(t(aS, U(cW)))
554- let cY = x(invoke(cX, "getPoolConfigWrapperREADONLY", nil, nil))
555- let aY = fromBase58String(D(cY[j]))
556- let dn = D(cY[k])
557- let do = fromBase58String(dn)
558- let dp = D(cY[l])
559- let dq = fromBase58String(dp)
560- let dd = parseIntValue(D(cY[m]))
561- let de = parseIntValue(D(cY[n]))
562- let dr = D(cY[i])
563- let df = valueOrErrorMessage(assetInfo(aY), (("Asset " + toBase58String(aY)) + " doesn't exist")).quantity
564- let dF = B(invoke(cX, "getAccBalanceWrapperREADONLY", [dn], nil))
565- let dG = B(invoke(cX, "getAccBalanceWrapperREADONLY", [dp], nil))
566- let dH = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dF, dd], nil)))
567- let dI = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dG, de], nil)))
568- let du = if ((df == 0))
569- then g
570- else parseBigIntValue(D(invoke(cX, "calcPriceBigIntWrapperREADONLY", [toString(dI), toString(dH)], nil)))
571- let dj = B(invoke(cX, "fromX18WrapperREADONLY", [toString(du), b], nil))
572- let dw = parseBigIntValue(D(invoke(cX, "toX18WrapperREADONLY", [dx, de], nil)))
573- let dv = fraction(dw, d, du)
574- let dm = B(invoke(cX, "fromX18WrapperREADONLY", [toString(dv), dd], nil))
575- let dy = invoke(cX, "estimatePutOperationWrapperREADONLY", ["", 500000, dm, do, dx, dq, "", true, false], nil)
576- let dJ = {
577- let z = dy
578- if (if ($isInstanceOf(z._1, "Int"))
579- then if ($isInstanceOf(z._3, "Int"))
580- then if ($isInstanceOf(z._4, "Int"))
581- then if ($isInstanceOf(z._5, "Int"))
582- then $isInstanceOf(z._6, "Int")
583- else false
584- else false
585- else false
586- else false)
587- then {
588- let dA = z._1
589- let dB = z._3
590- let dC = z._4
591- let dD = z._5
592- let dE = z._6
593- $Tuple5(dA, dB, dC, dD, dE)
594- }
595- else throw("Couldn't cast types")
596- }
597- let dA = dJ._1
598- let dB = dJ._2
599- let dC = dJ._3
600- let dD = dJ._4
601- let dE = dJ._5
602- $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(dA), toString(dj), toString(dC), toString(dD), toString(dE), dr, toString(dm), toString(dx)], e))
603- }
604-
605-
606-
607-@Callable(bt)
608-func poolEvaluateGetREADONLY (dK,dL) = {
609- let cX = addressFromStringValue(t(aS, U(dK)))
610- let dy = invoke(cX, "estimateGetOperationWrapperREADONLY", ["", dK, dL, toString(cX)], nil)
611- let dM = {
612- let z = dy
613- if (if ($isInstanceOf(z._1, "Int"))
614- then if ($isInstanceOf(z._2, "Int"))
615- then if ($isInstanceOf(z._5, "Int"))
616- then if ($isInstanceOf(z._6, "Int"))
617- then if ($isInstanceOf(z._7, "Int"))
618- then if ($isInstanceOf(z._8, "String"))
619- then $isInstanceOf(z._9, "String")
620- else false
621- else false
622- else false
623- else false
624- else false
625- else false)
626- then {
627- let dN = z._1
628- let dO = z._2
629- let dC = z._5
630- let dD = z._6
631- let dE = z._7
632- let dj = z._8
633- let dr = z._9
634- $Tuple7(dN, dO, dC, dD, dE, dj, dr)
635- }
636- else throw("Couldn't cast types")
637- }
638- let dN = dM._1
639- let dO = dM._2
640- let dC = dM._3
641- let dD = dM._4
642- let dE = dM._5
643- let dj = dM._6
644- let dr = dM._7
645- $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(dN), toString(dO), toString(dC), toString(dD), toString(dE), dj, dr], e))
646- }
647-
648-
649-
650-@Callable(bt)
651-func gwxUserInfoREADONLY (am) = {
652- let dP = x(invoke(aW, "gwxUserInfoREADONLY", [am], nil))
653- let dQ = B(dP[0])
654- $Tuple2(nil, makeString(["%d", toString(dQ)], e))
655- }
656-
657-
658-
659-@Callable(bt)
660-func setManager (dR) = {
661- let dS = bs(bt)
662- if ((dS == dS))
663- then {
664- let dT = fromBase58String(dR)
665- if ((dT == dT))
666- then [StringEntry(H(), dR)]
210+ let aM = fromBase58String(aL)
211+ if ((aM == aM))
212+ then [StringEntry(I(), aL)]
667213 else throw("Strict value is not equal to itself.")
668214 }
669215 else throw("Strict value is not equal to itself.")
670216 }
671217
672218
673219
674-@Callable(bt)
220+@Callable(af)
675221 func confirmManager () = {
676- let dU = br()
677- let dV = if (isDefined(dU))
222+ let aN = ad()
223+ let aO = if (isDefined(aN))
678224 then true
679225 else throw("No pending manager")
680- if ((dV == dV))
226+ if ((aO == aO))
681227 then {
682- let dW = if ((bt.callerPublicKey == value(dU)))
228+ let aP = if ((af.callerPublicKey == value(aN)))
683229 then true
684230 else throw("You are not pending manager")
685- if ((dW == dW))
686- then [StringEntry(G(), toBase58String(value(dU))), DeleteEntry(H())]
231+ if ((aP == aP))
232+ then [StringEntry(H(), toBase58String(value(aN))), DeleteEntry(I())]
687233 else throw("Strict value is not equal to itself.")
688234 }
689235 else throw("Strict value is not equal to itself.")
690236 }
691237
692238
693-@Verifier(dX)
694-func dY () = {
695- let dZ = {
696- let z = bp()
697- if ($isInstanceOf(z, "ByteVector"))
239+@Verifier(aQ)
240+func aR () = {
241+ let aS = {
242+ let V = ab()
243+ if ($isInstanceOf(V, "ByteVector"))
698244 then {
699- let bv = z
700- bv
245+ let ah = V
246+ ah
701247 }
702- else if ($isInstanceOf(z, "Unit"))
703- then dX.senderPublicKey
248+ else if ($isInstanceOf(V, "Unit"))
249+ then aQ.senderPublicKey
704250 else throw("Match error")
705251 }
706- sigVerify(dX.bodyBytes, dX.proofs[0], dZ)
252+ sigVerify(aQ.bodyBytes, aQ.proofs[0], aS)
707253 }
708254

github/deemru/w8io/026f985 
132.72 ms