tx · 3pM9yWfQSoVcL38oQQGCapDDp6wacBGsBYLQsb3D9Bju

3NChGL86Z1gFcd6bgPxJyHSSEdPYdPkxmNv:  -0.00500000 Waves

2023.03.16 14:55 [2492547] smart account 3NChGL86Z1gFcd6bgPxJyHSSEdPYdPkxmNv > SELF 0.00000000 Waves

{ "type": 13, "id": "3pM9yWfQSoVcL38oQQGCapDDp6wacBGsBYLQsb3D9Bju", "fee": 500000, "feeAssetId": null, "timestamp": 1678967784517, "version": 2, "chainId": 84, "sender": "3NChGL86Z1gFcd6bgPxJyHSSEdPYdPkxmNv", "senderPublicKey": "7WFp9MhGkKapUD5G1vwgWmy65Akv3eBnMThTsBDTcGgV", "proofs": [ "n1aLyPYt5F3J34KMjt5X81FXe81AYmLnSbRh6KpHbzU3tf1vvRJEJuar8tNnUQVW6uLpmDZ5aZKfUKEtsiMWxBR" ], "script": null, "height": 2492547, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: C7qaVmBLDrzdTUaZHNw1TzCucpGReU2Jgc8gW857RK72 Next: HoRuvXhcx2ePBi2y9bVafkV4XyfatRY1QbVvbLPh3GWv Full:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
2-{-# SCRIPT_TYPE ACCOUNT #-}
3-{-# CONTENT_TYPE DAPP #-}
4-let a = "__"
5-
6-let b = makeString(["%s", "fee"], a)
7-
8-let c = makeString(["%s", "usdnAssetId"], a)
9-
10-let d = makeString(["%s", "epochLength"], a)
11-
12-let e = makeString(["%s", "finalizeReward"], a)
13-
14-let f = makeString(["%s", "wxAssetId"], a)
15-
16-let g = makeString(["%s", "assetsStoreContract"], a)
17-
18-let h = makeString(["%s", "userPoolContract"], a)
19-
20-let i = makeString(["%s", "emissionContract"], a)
21-
22-let j = makeString(["%s", "boostingContract"], a)
23-
24-let k = makeString(["%s", "factoryContract"], a)
25-
26-let l = makeString(["%s", "votingEmissionContract"], a)
27-
28-let m = makeString(["%s", "votingThreshold"], a)
29-
30-func n (o) = valueOrErrorMessage(getString(this, o), (o + " is not defined"))
31-
32-
33-func p (o) = valueOrErrorMessage(getInteger(this, o), (o + " is not defined"))
34-
35-
36-func q (r,s) = makeString(["%s%s%s", "inList", r, s], a)
37-
38-
39-func t (r,s) = makeString(["%s%s%s", "suggestIndex", r, s], a)
40-
41-
42-func u (r,s,v) = makeString(["%s%s%s%d", "startHeight", r, s, toString(v)], a)
43-
44-
45-func w (r,s,v) = makeString(["%s%s%s%d", "votingResult", r, s, toString(v)], a)
46-
47-
48-func x (y,z) = makeString(["%d%d", y, z], a)
49-
50-
51-func A (r,s,v,B) = makeString(["%s%s%s%d%s", "vote", r, s, toString(v), B], a)
52-
53-
54-func C (D,E) = {
55- let o = if (E)
56- then makeString(["%d%s", D, "yes"], a)
57- else makeString(["%d%s", D, "no"], a)
58- o
59- }
60-
61-
62-func F (G) = {
63- let H = G
64- let r = H._1
65- let s = H._2
66- makeString(["%s%s%s", "inList", r, s], a)
67- }
68-
69-
70-func I () = "%s__managerPublicKey"
71-
72-
73-func J () = "%s__pendingManagerPublicKey"
74-
75-
76-let K = addressFromStringValue(n(g))
77-
78-let L = addressFromStringValue(n(j))
79-
80-let M = addressFromStringValue(n(i))
81-
82-let N = addressFromStringValue(n(k))
83-
84-let O = addressFromStringValue(n(h))
85-
86-let P = addressFromStringValue(n(l))
87-
88-func Q () = {
89- let R = getString(I())
90- if ($isInstanceOf(R, "String"))
91- then {
92- let S = R
93- fromBase58String(S)
94- }
95- else if ($isInstanceOf(R, "Unit"))
96- then unit
97- else throw("Match error")
98- }
99-
100-
101-func T () = {
102- let R = getString(J())
103- if ($isInstanceOf(R, "String"))
104- then {
105- let S = R
106- fromBase58String(S)
107- }
108- else if ($isInstanceOf(R, "Unit"))
109- then unit
110- else throw("Match error")
111- }
112-
113-
114-func U (V) = {
115- let R = Q()
116- if ($isInstanceOf(R, "ByteVector"))
117- then {
118- let W = R
119- (V.callerPublicKey == W)
120- }
121- else if ($isInstanceOf(R, "Unit"))
122- then (V.caller == this)
123- else throw("Match error")
124- }
125-
126-
127-func X (V) = if (U(V))
128- then true
129- else throw("permission denied")
130-
131-
132-func Y (Z) = {
133- let R = Z
134- if ($isInstanceOf(R, "Int"))
135- then {
136- let aa = R
137- aa
138- }
139- else throw("failed to cast into Integer")
140- }
141-
142-
143-@Callable(V)
144-func constructor (ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al) = {
145- let am = [X(V), if (isDefined(addressFromString(ab)))
146- then true
147- else throw("Invalid asset_store contract address"), if (isDefined(addressFromString(ac)))
148- then true
149- else throw("Invalid boosting contract address"), if (isDefined(addressFromString(af)))
150- then true
151- else throw("Invalid user_pools contract address"), if (isDefined(addressFromString(ad)))
152- then true
153- else throw("Invalid emission contract address"), if (isDefined(addressFromString(ae)))
154- then true
155- else throw("Invalid factory contract address"), if ((ah >= 0))
156- then true
157- else throw("Invalid fee amount"), if ((aj > 0))
158- then true
159- else throw("Invalid voting duration"), if ((al >= 0))
160- then true
161- else throw("Invalid finalize reward"), if (isDefined(assetInfo(fromBase58String(ai))))
162- then true
163- else throw("Invalid WX asset ID"), if (isDefined(assetInfo(fromBase58String(ak))))
164- then true
165- else throw("Invalid USDN asset ID")]
166- if ((am == am))
167- then $Tuple2([StringEntry(g, ab), StringEntry(j, ac), StringEntry(i, ad), StringEntry(k, ae), StringEntry(h, af), StringEntry(l, ag), IntegerEntry(b, ah), IntegerEntry(d, aj), IntegerEntry(e, al), StringEntry(f, ai), StringEntry(c, ak)], unit)
168- else throw("Strict value is not equal to itself.")
169- }
170-
171-
172-
173-@Callable(V)
174-func constructorV2 (an) = {
175- let am = [X(V), if ((an > 0))
176- then true
177- else throw("invalid threshold")]
178- if ((am == am))
179- then $Tuple2([IntegerEntry(m, an)], unit)
180- else throw("Strict value is not equal to itself.")
181- }
182-
183-
184-
185-@Callable(V)
186-func suggest (r,s) = {
187- let G = $Tuple2(r, s)
188- let ao = value(V.payments[0])
189- let ap = if ((r == "WAVES"))
190- then unit
191- else {
192- let aq = valueOrErrorMessage(assetInfo(fromBase58String(r)), "invalid amountAssetId ID")
193- if ((aq.scripted == false))
194- then true
195- else throw("asset is smart")
196- }
197- if ((ap == ap))
198- then {
199- let am = [if ((toBase58String(value(ao.assetId)) == value(getString(f))))
200- then true
201- else throw("invalid fee asset"), if ((ao.amount == value(getInteger(b))))
202- then true
203- else throw("invalid fee amount"), if ((getInteger(q(r, s)) == unit))
204- then true
205- else throw("already in voting list"), if (!(valueOrElse(getBoolean(P, F(G)), false)))
206- then true
207- else throw("pool is in emission voting list")]
208- if ((am == am))
209- then {
210- let ar = {
211- let R = invoke(O, "statusREADONLY", [r, s], nil)
212- if ($isInstanceOf(R, "String"))
213- then {
214- let S = R
215- if ((S == "active"))
216- then true
217- else throw("user pool is not active")
218- }
219- else throw("user pool is not active")
220- }
221- if ((ar == ar))
222- then {
223- let as = if (U(V))
224- then unit
225- else {
226- let at = {
227- let R = invoke(K, "isVerifiedREADONLY", [r], nil)
228- if ($isInstanceOf(R, "Boolean"))
229- then {
230- let au = R
231- if (au)
232- then true
233- else throw("asset is not verified")
234- }
235- else throw("asset is not verified")
236- }
237- if ((at == at))
238- then unit
239- else throw("Strict value is not equal to itself.")
240- }
241- if ((as == as))
242- then {
243- let av = invoke(M, "burn", nil, [AttachedPayment(ao.assetId, ao.amount)])
244- if ((av == av))
245- then {
246- let aw = {
247- let R = getInteger(t(r, s))
248- if ($isInstanceOf(R, "Int"))
249- then {
250- let ax = R
251- (ax + 1)
252- }
253- else 0
254- }
255- $Tuple2([IntegerEntry(q(r, s), aw), IntegerEntry(u(r, s, aw), height), StringEntry(w(r, s, aw), x("0", "0")), IntegerEntry(t(r, s), aw)], unit)
256- }
257- else throw("Strict value is not equal to itself.")
258- }
259- else throw("Strict value is not equal to itself.")
260- }
261- else throw("Strict value is not equal to itself.")
262- }
263- else throw("Strict value is not equal to itself.")
264- }
265- else throw("Strict value is not equal to itself.")
266- }
267-
268-
269-
270-@Callable(V)
271-func vote (r,s,ay) = {
272- let v = value(getInteger(q(r, s)))
273- let az = (value(getInteger(u(r, s, v))) + value(getInteger(d)))
274- let am = [if (isDefined(getInteger(q(r, s))))
275- then true
276- else throw("the token isn't on the voting list"), if ((az > height))
277- then true
278- else throw("too late to vote")]
279- if ((am == am))
280- then {
281- let D = invoke(L, "getUserGwxAmountAtHeightREADONLY", [toString(V.caller), az], nil)
282- let aA = if ((Y(D) > 0))
283- then true
284- else throw("you don't have gwx")
285- if ((aA == aA))
286- then {
287- let E = {
288- let R = getString(A(r, s, v, toString(V.caller)))
289- if ($isInstanceOf(R, "String"))
290- then {
291- let S = R
292- let E = split(S, a)
293- let aB = E[1]
294- let aC = E[2]
295- let aD = if (if ((aC == "yes"))
296- then (ay == true)
297- else false)
298- then true
299- else if ((aC == "no"))
300- then (ay == false)
301- else false
302- let aE = if (aD)
303- then (Y(D) == parseIntValue(aB))
304- else false
305- let aF = if (if (aD)
306- then aE
307- else false)
308- then throw("you already voted")
309- else invoke(this, "cancelVote", [r, s], nil)
310- aF
311- }
312- else if ($isInstanceOf(R, "Unit"))
313- then {
314- let aG = R
315- aG
316- }
317- else throw("Match error")
318- }
319- if ((E == E))
320- then {
321- let aH = split(value(getString(w(r, s, v))), a)
322- let aI = aH[1]
323- let aJ = aH[2]
324- let aK = if (ay)
325- then {
326- let aL = (parseIntValue(aI) + Y(D))
327-[toString(aL), aJ]
328- }
329- else {
330- let aM = (parseIntValue(aJ) + Y(D))
331-[aI, toString(aM)]
332- }
333- let aN = A(r, s, v, toString(V.caller))
334- let aB = C(toString(Y(D)), ay)
335- $Tuple2([StringEntry(w(r, s, v), x(aK[0], aK[1])), StringEntry(aN, aB)], unit)
336- }
337- else throw("Strict value is not equal to itself.")
338- }
339- else throw("Strict value is not equal to itself.")
340- }
341- else throw("Strict value is not equal to itself.")
342- }
343-
344-
345-
346-@Callable(V)
347-func cancelVote (r,s) = {
348- let aO = if ((V.caller == this))
349- then toString(V.originCaller)
350- else toString(V.caller)
351- let v = value(getInteger(q(r, s)))
352- let am = [if (isDefined(getString(w(r, s, v))))
353- then true
354- else throw("no vote for assets pair")]
355- if ((am == am))
356- then {
357- let E = split(value(getString(A(r, s, v, aO))), a)
358- let aB = E[1]
359- let aC = E[2]
360- let aH = split(value(getString(w(r, s, v))), a)
361- let aI = aH[1]
362- let aJ = aH[2]
363- let aP = if ((aC == "yes"))
364- then {
365- let aL = (parseIntValue(aI) - parseIntValue(aB))
366- $Tuple2([StringEntry(w(r, s, v), x(toString(aL), aJ)), DeleteEntry(A(r, s, v, aO))], unit)
367- }
368- else {
369- let aM = (parseIntValue(aJ) - parseIntValue(aB))
370- $Tuple2([StringEntry(w(r, s, v), x(aI, toString(aM))), DeleteEntry(A(r, s, v, aO))], unit)
371- }
372- aP
373- }
374- else throw("Strict value is not equal to itself.")
375- }
376-
377-
378-
379-@Callable(V)
380-func setFee (aQ) = {
381- let am = [X(V)]
382- if ((am == am))
383- then [IntegerEntry(b, aQ)]
384- else throw("Strict value is not equal to itself.")
385- }
386-
387-
388-
389-@Callable(V)
390-func setThreshold (aR) = {
391- let am = [X(V), if ((aR > 0))
392- then true
393- else throw("invalid threshold")]
394- if ((am == am))
395- then $Tuple2([IntegerEntry(m, aR)], unit)
396- else throw("Strict value is not equal to itself.")
397- }
398-
399-
400-
401-@Callable(V)
402-func finalize (r,s) = {
403- let v = value(getInteger(q(r, s)))
404- let az = (value(getInteger(u(r, s, v))) + value(getInteger(d)))
405- let am = [if (isDefined(getInteger(q(r, s))))
406- then true
407- else throw("no assets pair"), if ((height >= az))
408- then true
409- else throw("insufficient height for completion")]
410- if ((am == am))
411- then {
412- let aH = split(value(getString(w(r, s, v))), a)
413- let aI = parseIntValue(aH[1])
414- let aJ = parseIntValue(aH[2])
415- let aS = (aI + aJ)
416- let an = p(m)
417- let aP = if (if ((aS >= an))
418- then (aI > aJ)
419- else false)
420- then {
421- let aT = invoke(N, "setWxEmissionPoolLabel", [r, s], nil)
422- if ((aT == aT))
423- then {
424- let aU = invoke(P, "create", [r, s], nil)
425- if ((aU == aU))
426- then $Tuple2([DeleteEntry(q(r, s))], unit)
427- else throw("Strict value is not equal to itself.")
428- }
429- else throw("Strict value is not equal to itself.")
430- }
431- else $Tuple2([DeleteEntry(q(r, s))], unit)
432- aP
433- }
434- else throw("Strict value is not equal to itself.")
435- }
436-
437-
438-
439-@Callable(V)
440-func setManager (aV) = {
441- let aW = X(V)
442- if ((aW == aW))
443- then {
444- let aX = fromBase58String(aV)
445- if ((aX == aX))
446- then [StringEntry(J(), aV)]
447- else throw("Strict value is not equal to itself.")
448- }
449- else throw("Strict value is not equal to itself.")
450- }
451-
452-
453-
454-@Callable(V)
455-func confirmManager () = {
456- let aY = T()
457- let aZ = if (isDefined(aY))
458- then true
459- else throw("no pending manager")
460- if ((aZ == aZ))
461- then {
462- let ba = if ((V.callerPublicKey == value(aY)))
463- then true
464- else throw("you are not pending manager")
465- if ((ba == ba))
466- then [StringEntry(I(), toBase58String(value(aY))), DeleteEntry(J())]
467- else throw("Strict value is not equal to itself.")
468- }
469- else throw("Strict value is not equal to itself.")
470- }
471-
472-
473-@Verifier(bb)
474-func bc () = {
475- let bd = {
476- let R = Q()
477- if ($isInstanceOf(R, "ByteVector"))
478- then {
479- let W = R
480- W
481- }
482- else if ($isInstanceOf(R, "Unit"))
483- then bb.senderPublicKey
484- else throw("Match error")
485- }
486- sigVerify(bb.bodyBytes, bb.proofs[0], bd)
487- }
488-
1+# no script

github/deemru/w8io/026f985 
34.19 ms