tx · 5o7vXidGgi97QwQbkfZawR5e6khL6yhWLbMXwJaj5NfA

3MtFf3CUhD56xuEpnR9kRhZupdNHeXgKXSp:  -0.00500000 Waves

2023.03.16 14:53 [2492544] smart account 3MtFf3CUhD56xuEpnR9kRhZupdNHeXgKXSp > SELF 0.00000000 Waves

{ "type": 13, "id": "5o7vXidGgi97QwQbkfZawR5e6khL6yhWLbMXwJaj5NfA", "fee": 500000, "feeAssetId": null, "timestamp": 1678967635381, "version": 2, "chainId": 84, "sender": "3MtFf3CUhD56xuEpnR9kRhZupdNHeXgKXSp", "senderPublicKey": "9vVJu7zPDVRZAxpz8vVXXNJyidkhtkLTTjXEwQbBtkVP", "proofs": [ "47n2hyhcderkYLiZMheG4paf3AHrLim2M1wvytKhGLBi6pcyLokAswtcWgQYXdPNHbWxeezx7tukqv87mTq7u4hD" ], "script": null, "height": 2492544, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FRzSb3vSWGBas2Tzqv1ZdHk1WrtsPmw3WLXfTKTEVDPR Next: Eh5ezK46cKYD1cygRTSNXtAM17bsm6Qcvb43LMNSvTgz Full:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
2-{-# SCRIPT_TYPE ACCOUNT #-}
3-{-# CONTENT_TYPE DAPP #-}
4-let a = "__"
5-
6-let b = ""
7-
8-func c (d) = valueOrErrorMessage(getString(this, d), ("No data for this.key=" + d))
9-
10-
11-func e (d) = valueOrErrorMessage(getBoolean(this, d), ("No data for this.key=" + d))
12-
13-
14-func f () = makeString(["%s", "managerPublicKey"], a)
15-
16-
17-func g () = makeString(["%s", "pendingManagerPublicKey"], a)
18-
19-
20-func h (i,j,k,l) = throw(((((((i + ": baseAssetStr=") + j) + " userAddressStr=") + k) + " getTxIdStr=") + l))
21-
22-
23-func m () = makeString(["%s", "assetsStoreContract"], a)
24-
25-
26-func n (j) = ("%s%s%s__config__asset__" + j)
27-
28-
29-func o (p) = makeString(["%s%s", "proxyAddress", p], a)
30-
31-
32-func q (p) = makeString(["%s%s", "balance", p], a)
33-
34-
35-func r () = "%s__nextInternalAssetId"
36-
37-
38-func s (t) = ("%s%s%d__price__last__" + t)
39-
40-
41-func u (t,v) = makeString(["%s%s%s%d%s__topup__last__height", t, v], a)
42-
43-
44-func w (t,x,y) = makeString(["%s%s%d%d%d__price__history", t, toString(x), toString(y)], a)
45-
46-
47-func z (t) = ("%s%s%d__total__locked__" + t)
48-
49-
50-func A (B,k) = makeString(["%s%s%d%s__total__locked", B, k], a)
51-
52-
53-func C (D) = ("%s%s%d__mappings__internal2baseAssetId__" + toString(D))
54-
55-
56-func E (j) = ("%s%s%s__mappings__baseAsset2internalId__" + j)
57-
58-
59-func F (G) = ("%s%s%s__mappings__share2baseAssetId__" + G)
60-
61-
62-func H (j) = ("%s%s%s__mappings__baseAsset2shareId__" + j)
63-
64-
65-func I (B) = ("%s%s%d__shutdown__put__" + B)
66-
67-
68-func J (B) = ("%s%s%d__shutdown__manager__" + B)
69-
70-
71-func K () = addressFromStringValue(value(getString(m())))
72-
73-
74-let L = 1
75-
76-let M = 2
77-
78-let N = 3
79-
80-let O = 4
81-
82-let P = 5
83-
84-func Q (G,B,R,S,T) = makeString(["%s%d%d%d%d", G, B, toString(R), toString(S), toString(T)], a)
85-
86-
87-let U = 1
88-
89-let V = 2
90-
91-func W (X,Y) = makeString(["%d%d", toString(X), toString(Y)], a)
92-
93-
94-func Z (d) = {
95- let aa = split(valueOrElse(getString(this, d), W(0, 0)), a)
96-[-1, parseIntValue(aa[U]), parseIntValue(aa[V])]
97- }
98-
99-
100-func ab (ac,B,ad,ae) = makeString(["%s%d%s%s", ac, B, ad, ae], a)
101-
102-
103-let af = 1
104-
105-let ag = 2
106-
107-let ah = 3
108-
109-let ai = 4
110-
111-let aj = 5
112-
113-let ak = 6
114-
115-let al = 7
116-
117-let am = 8
118-
119-func an (ao,ap,aq,ar,as,at,au,av) = makeString(["%s%d%d%d%d%d%d%d", ao, ap, aq, ar, as, at, au, av], a)
120-
121-
122-func aw (ao,ap,aq,ar,as,at,au,av) = an(ao, toString(ap), toString(aq), toString(ar), toString(as), toString(at), toString(au), toString(av))
123-
124-
125-func ax (ay,az,aA) = an(az, ay[ag], ay[ah], ay[ai], ay[aj], ay[ak], ay[al], toString(aA))
126-
127-
128-func aB (j) = {
129- let d = n(j)
130- split(c(d), a)
131- }
132-
133-
134-func aC (d,X,Y) = {
135- let aD = Z(d)
136- StringEntry(d, W((aD[U] + X), (aD[V] + Y)))
137- }
138-
139-
140-func aE (d,X,Y) = {
141- let aD = Z(d)
142- StringEntry(d, W((aD[U] - X), (aD[V] - Y)))
143- }
144-
145-
146-func aF () = {
147- let aG = getString(f())
148- if ($isInstanceOf(aG, "String"))
149- then {
150- let aH = aG
151- fromBase58String(aH)
152- }
153- else if ($isInstanceOf(aG, "Unit"))
154- then unit
155- else throw("Match error")
156- }
157-
158-
159-func aI () = {
160- let aG = getString(g())
161- if ($isInstanceOf(aG, "String"))
162- then {
163- let aH = aG
164- fromBase58String(aH)
165- }
166- else if ($isInstanceOf(aG, "Unit"))
167- then unit
168- else throw("Match error")
169- }
170-
171-
172-func aJ (p) = valueOrElse(getInteger(q(p)), 0)
173-
174-
175-func aK (B,aL,aM,aN,R,S) = {
176- let aa = Z(z(B))
177- let aO = aa[V]
178- let aP = aJ(toBase58String(aL))
179- let aQ = (aP + aM)
180- if ((0 > aQ))
181- then throw(((("baseAssetBalanceConsideringLock < 0: baseAssetBalance=" + toString(aP)) + " baseAssetBalanceConsideringLock=") + toString(aQ)))
182- else {
183- let aR = value(assetInfo(aN)).quantity
184- let aq = if ((aR == 0))
185- then (1 * S)
186- else fraction(aQ, S, aR)
187- $Tuple5(aq, aP, aO, aQ, aR)
188- }
189- }
190-
191-
192-func aS (B,aL,aN,R,S) = {
193- let aa = Z(z(B))
194- let aO = aa[V]
195- let aP = aJ(toBase58String(aL))
196- let aQ = aP
197- let aR = value(assetInfo(aN)).quantity
198- let aq = value(getInteger(s(B)))
199- $Tuple5(aq, aP, aO, aQ, aR)
200- }
201-
202-
203-func aT (j) = {
204- let aL = fromBase58String(j)
205- let aU = aB(j)
206- let G = aU[L]
207- let aN = fromBase58String(G)
208- let R = parseIntValue(aU[N])
209- let S = parseIntValue(aU[O])
210- let B = aU[M]
211- let aV = aS(B, aL, aN, R, S)
212- let aW = {
213- let aG = getInteger(u(B, getStringValue(o(j))))
214- if ($isInstanceOf(aG, "Int"))
215- then {
216- let x = aG
217- value(x)
218- }
219- else if ($isInstanceOf(aG, "Unit"))
220- then getIntegerValue(u(B, toString(addressFromPublicKey(fromBase58String(getStringValue(f()))))))
221- else throw("undefined behaviour in privateCurrentSysParamsREST match")
222- }
223- $Tuple8(IntegerEntry("price", aV._1), IntegerEntry("decimalsMultPrice", S), IntegerEntry("baseAssetBalance", aV._2), IntegerEntry("totalLockedBaseAmount", aV._3), IntegerEntry("baseAssetBalanceConsideringLock", aV._4), IntegerEntry("shareEmission", aV._5), IntegerEntry("baseAssetDecimals", value(assetInfo(aL)).decimals), IntegerEntry("lastTopUpTimestamp", value(blockInfoByHeight(aW)).timestamp))
224- }
225-
226-
227-func aX (aY) = {
228- let aZ = throw("permission denied")
229- let aG = aF()
230- if ($isInstanceOf(aG, "ByteVector"))
231- then {
232- let ba = aG
233- if ((aY.callerPublicKey == ba))
234- then true
235- else aZ
236- }
237- else if ($isInstanceOf(aG, "Unit"))
238- then if ((aY.caller == this))
239- then true
240- else aZ
241- else throw("Match error")
242- }
243-
244-
245-func bb (aY,p) = {
246- let bc = (toString(aY.caller) == valueOrElse(getString(o(p)), b))
247- if (bc)
248- then true
249- else {
250- let bd = aX(aY)
251- if ((bd == bd))
252- then true
253- else throw("Strict value is not equal to itself.")
254- }
255- }
256-
257-
258-@Callable(aY)
259-func constructor (K) = {
260- let bd = aX(aY)
261- if ((bd == bd))
262- then [StringEntry(m(), K)]
263- else throw("Strict value is not equal to itself.")
264- }
265-
266-
267-
268-@Callable(aY)
269-func adminRegisterAsset (j,be,bf,bg,bh,bi,bj) = {
270- let aL = fromBase58String(j)
271- let bk = value(assetInfo(aL)).decimals
272- let bl = aX(aY)
273- if ((bl == bl))
274- then if ((toString(addressFromStringValue(bi)) != bi))
275- then throw("invalid shutdownManagerAddress")
276- else if ((0 > bh))
277- then throw(("invalid getDelayinBlocks=" + toString(bh)))
278- else {
279- let bm = Issue(be, bf, 1, bk, true)
280- let aN = calculateAssetId(bm)
281- let G = toBase58String(aN)
282- let S = ((100 * 1000) * 1000)
283- let R = pow(10, 0, bk, 0, 0, DOWN)
284- let bn = (1 * S)
285- let bo = valueOrElse(getInteger(this, r()), 0)
286- let B = toString(bo)
287- let bp = invoke(K(), "createOrUpdate", [G, bg, false], nil)
288- if ((bp == bp))
289- then {
290- let bq = invoke(K(), "addLabel", [G, "STAKING_LP"], nil)
291- if ((bq == bq))
292- then [StringEntry(n(j), Q(G, B, R, S, bh)), StringEntry(C(bo), j), StringEntry(E(j), B), StringEntry(F(G), j), StringEntry(H(j), G), BooleanEntry(I(B), false), StringEntry(J(B), bi), IntegerEntry(r(), (bo + 1)), IntegerEntry(s(B), bn), IntegerEntry(w(B, height, lastBlock.timestamp), bn), bm, Burn(aN, 1), StringEntry(o(j), bj)]
293- else throw("Strict value is not equal to itself.")
294- }
295- else throw("Strict value is not equal to itself.")
296- }
297- else throw("Strict value is not equal to itself.")
298- }
299-
300-
301-
302-@Callable(aY)
303-func shutdownPut (br) = {
304- let bs = toString(br)
305- let bt = c(C(br))
306- let bi = c(J(bs))
307- if ((1 > size(bt)))
308- then throw("invalid internalBaseAssetId")
309- else if ((toString(aY.caller) != bi))
310- then throw("access denied")
311- else [BooleanEntry(I(toString(br)), true)]
312- }
313-
314-
315-
316-@Callable(aY)
317-func put () = {
318- let bu = value(aY.payments[0])
319- let aL = value(bu.assetId)
320- let j = toBase58String(aL)
321- let k = toString(aY.caller)
322- let aU = aB(j)
323- let G = aU[L]
324- let aN = fromBase58String(G)
325- let R = parseIntValue(aU[N])
326- let S = parseIntValue(aU[O])
327- let B = aU[M]
328- let bv = e(I(B))
329- if (bv)
330- then throw("put operation is blocked")
331- else {
332- let bw = (aJ(j) + bu.amount)
333- let aq = aS(B, aL, aN, R, S)._1
334- let X = fraction(bu.amount, S, aq, CEILING)
335-[Reissue(aN, X, true), ScriptTransfer(aY.caller, X, aN), StringEntry(ab("P", B, k, toBase58String(aY.transactionId)), aw("FINISHED", bu.amount, aq, X, height, lastBlock.timestamp, height, lastBlock.timestamp)), ScriptTransfer(addressFromStringValue(value(getString(o(j)))), bu.amount, aL), IntegerEntry(q(j), bw)]
336- }
337- }
338-
339-
340-
341-@Callable(aY)
342-func submitGetRequest () = {
343- let bu = value(aY.payments[0])
344- let aN = value(bu.assetId)
345- let G = toBase58String(aN)
346- let bx = toBase58String(aY.callerPublicKey)
347- let ad = aY.caller
348- let k = toString(ad)
349- let X = bu.amount
350- let j = c(F(G))
351- let aL = fromBase58String(j)
352- let aU = aB(j)
353- let R = parseIntValue(aU[N])
354- let S = parseIntValue(aU[O])
355- let by = parseIntValue(aU[P])
356- let B = aU[M]
357- let aq = aS(B, aL, aN, R, S)._1
358- let Y = fraction(X, aq, S)
359- let bz = ab("G", B, k, toBase58String(aY.transactionId))
360- let bA = aw("PENDING", X, aq, Y, height, lastBlock.timestamp, (height + by), 0)
361-[Burn(aN, X), StringEntry(bz, bA), aC(z(B), X, Y), aC(A(B, k), X, Y), IntegerEntry(q(j), (aJ(j) - Y))]
362- }
363-
364-
365-
366-@Callable(aY)
367-func executeGetRequest (j,k,l) = {
368- let ad = addressFromStringValue(k)
369- let bB = aB(j)
370- let aN = fromBase58String(bB[L])
371- let aL = fromBase58String(j)
372- let B = bB[M]
373- let bz = ab("G", B, k, l)
374- let bC = split(c(bz), a)
375- let ao = bC[af]
376- let au = parseIntValue(bC[al])
377- let bD = parseIntValue(bC[ag])
378- let bE = parseIntValue(bC[ai])
379- if ((ao != "PENDING"))
380- then h("Status is not PENDING", j, k, l)
381- else if ((au > height))
382- then h(((("EndHeight[" + toString(au)) + "] > ") + toString(height)), j, k, l)
383- else [ScriptTransfer(ad, bE, aL), StringEntry(bz, ax(bC, "FINISHED", lastBlock.timestamp)), aE(z(B), bD, bE), aE(A(B, k), bD, bE)]
384- }
385-
386-
387-
388-@Callable(aY)
389-func topUpBalance (j,bF) = {
390- let bB = aB(j)
391- let bu = value(aY.payments[0])
392- let bG = value(bu.assetId)
393- let bH = toBase58String(bG)
394- let aN = fromBase58String(bB[L])
395- let R = parseIntValue(bB[N])
396- let S = parseIntValue(bB[O])
397- let B = bB[M]
398- let bI = u(B, toString(aY.caller))
399- let aW = valueOrElse(getInteger(this, bI), 0)
400- let bJ = [bb(aY, j), if ((aW != height))
401- then true
402- else throw("only one topUp per block is allowed"), if ((bF > 0))
403- then true
404- else throw("only positive delta is allowed")]
405- if ((bJ == bJ))
406- then if ((j != bH))
407- then throw("attached payment's asset id is NOT matched passed baseAssetStr")
408- else if ((size(aY.payments) > 1))
409- then throw("only one payment can be attached")
410- else {
411- let aq = aK(B, bG, bF, aN, R, S)._1
412-[IntegerEntry(s(B), aq), IntegerEntry(w(B, height, lastBlock.timestamp), aq), IntegerEntry(bI, height), IntegerEntry(q(bH), (aJ(bH) + bF))]
413- }
414- else throw("Strict value is not equal to itself.")
415- }
416-
417-
418-
419-@Callable(aY)
420-func currentSysParamsREST (j) = {
421- let bK = aT(j)
422- let aq = bK._1.value
423- let S = bK._2.value
424- let aP = bK._3.value
425- let aO = bK._4.value
426- let aQ = bK._5.value
427- let aR = bK._6.value
428- let bL = makeString(["startCurrentSysParamsREST", toString(aq), toString(S), toString(aP), toString(aO), toString(aQ), toString(aR), "endCurrentSysParamsREST"], a)
429- throw(bL)
430- }
431-
432-
433-
434-@Callable(aY)
435-func setManager (bM) = {
436- let bd = aX(aY)
437- if ((bd == bd))
438- then {
439- let bN = fromBase58String(bM)
440- if ((bN == bN))
441- then [StringEntry(g(), bM)]
442- else throw("Strict value is not equal to itself.")
443- }
444- else throw("Strict value is not equal to itself.")
445- }
446-
447-
448-
449-@Callable(aY)
450-func confirmManager () = {
451- let bO = aI()
452- let bP = if (isDefined(bO))
453- then true
454- else throw("no pending manager")
455- if ((bP == bP))
456- then {
457- let bQ = if ((aY.callerPublicKey == value(bO)))
458- then true
459- else throw("you are not pending manager")
460- if ((bQ == bQ))
461- then [StringEntry(f(), toBase58String(value(bO))), DeleteEntry(g())]
462- else throw("Strict value is not equal to itself.")
463- }
464- else throw("Strict value is not equal to itself.")
465- }
466-
467-
468-@Verifier(bR)
469-func bS () = {
470- let bT = {
471- let aG = aF()
472- if ($isInstanceOf(aG, "ByteVector"))
473- then {
474- let ba = aG
475- ba
476- }
477- else if ($isInstanceOf(aG, "Unit"))
478- then bR.senderPublicKey
479- else throw("Match error")
480- }
481- sigVerify(bR.bodyBytes, bR.proofs[0], bT)
482- }
483-
1+# no script

github/deemru/w8io/873ac7e 
59.19 ms