tx · A3WTPGqr2CUHx3uqzosmiwZx1VLW4RQHwV83NQX5cg1w

3N3y7nQfqDc7rBUExjKQi5ZbspWRh9q8PYH:  -0.00500000 Waves

2023.12.01 15:34 [2867580] smart account 3N3y7nQfqDc7rBUExjKQi5ZbspWRh9q8PYH > SELF 0.00000000 Waves

{ "type": 13, "id": "A3WTPGqr2CUHx3uqzosmiwZx1VLW4RQHwV83NQX5cg1w", "fee": 500000, "feeAssetId": null, "timestamp": 1701434012992, "version": 2, "chainId": 84, "sender": "3N3y7nQfqDc7rBUExjKQi5ZbspWRh9q8PYH", "senderPublicKey": "9ggtmbyecVRfUY2zeZhNaoLBp2iymhnQhffXQhemTJaG", "proofs": [ "3XdnMES2yj87eVzCWSZ97axybvTfHNTgq9vayz9JZDttKadMD7asGoVZHS69zaZZacGCXTLKuSZddYDcW7UYfoL4" ], "script": null, "height": 2867580, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7KcqJWSgnkTciaw7yAkSNeKhp8Lp3Rm8CsfreSCT1bMh Next: 4Qk29EjaFknf76HfGfAs1QaER2Wkn7HMZmSNewb3LmWS Full:
OldNewDifferences
1-{-# STDLIB_VERSION 6 #-}
2-{-# SCRIPT_TYPE ACCOUNT #-}
3-{-# CONTENT_TYPE DAPP #-}
4-func a (b,c) = {
5- let d = getInteger(b, c)
6- if ($isInstanceOf(d, "Int"))
7- then {
8- let e = d
9- e
10- }
11- else 0
12- }
13-
14-
15-func f (b,c) = {
16- let d = getString(b, c)
17- if ($isInstanceOf(d, "String"))
18- then {
19- let e = d
20- e
21- }
22- else ""
23- }
24-
25-
26-let g = 100000000
27-
28-let h = (g * g)
29-
30-let i = (30 * 1440)
31-
32-let j = base58'2kpmuzw1ZbrtgAN3BrR7vbEW1XrJoJKCstL7mf7XNf2P'
33-
34-let k = (90 * 1440)
35-
36-let l = base58'4z8CKSYQBKkzx7PBb5uBP1YPa6YAHRNTApW1sQVHT5eU'
37-
38-let m = "Activated blockheight"
39-
40-let n = "surplus received in wavelets"
41-
42-let o = "total WAVES received in wavelets"
43-
44-let p = "total wavelets received for base treasury"
45-
46-let q = "total WAVES paid out in wavelets"
47-
48-let r = "ROI basis points"
49-
50-let s = "WHIRLPOOL issue price in wavelets"
51-
52-let t = base58'3PQHndCUVrv3wBuQjbvVP9SnGmfbfitGxfx'
53-
54-let u = base58'3PEtLVxDT8mxAh1SDAn8m7JTGNkdpkaFxBk'
55-
56-let v = base58'3P2myTbd5zpEHcYmNpdWTp5gXS5B8tL1RCY'
57-
58-let w = base58'fHJWWsh2hZAc4Atv8VRhKy3jNbHLeMwQMsLpdaBY51Y'
59-
60-let x = toBase58String(base58'73tY3E6Gd5AWYmsuq8m8Kek7KnJNAYyS3GoveTbc6jCi')
61-
62-let y = base58'WAVES'
63-
64-let z = base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi'
65-
66-let A = base58'HGgabTqUS8WtVFUJzfmrTDMgEccJuZLBPhFgQFxvnsoW'
67-
68-let B = base58'A81p1LTRyoq2rDR2TNxB2dWYxsiNwCSSi8sXef2SEkwb'
69-
70-let C = base58'4BKKSp6NoNcrFHyorZogDyctq1fq6w7114Ym1pw6HUtC'
71-
72-let D = base58'3SjxA2YLdfF9fTRbzLm9xFn27C6MW34W1YsdJ6Axefns'
73-
74-let E = base58'3VuV5WTmDz47Dmdn3QpcYjzbSdipjQE4JMdNe1xZpX13'
75-
76-let F = base58'66a1br3BrkoaJgP7yEar9hJcSTvJPoH6PYBLqscXcMGo'
77-
78-let G = base58'2Fge5HEBRD3XTeg7Xg3FW5yiB9HVJFQtMXiWMQo72Up6'
79-
80-let H = base58'EW1uGLVo21Wd9i2Rhq8o4VKDTCQTGCGXE8DqayHGrLg8'
81-
82-let I = base58'6phK22ztGBW127gUFmdMEHKB3CVd6ZhWox2WtwJkbqTq'
83-
84-let J = base58'GAB8JowY9UANZ4TQy2TzJyhxjPqXX3DUrb2cdMWrrJus'
85-
86-let K = base58'YiNbofFzC17jEHHCMwrRcpy9MrrjabMMLZxg8g5xmf7'
87-
88-let L = base58'At8D6NFFpheCbvKVnjVoeLL84Eo8NZn6ovManxfLaFWL'
89-
90-let M = base58'3P8eeDzUnoDNbQjW617pAe76cEUDQsP1m1V'
91-
92-let N = Address(base58'3P4uA5etnZi4AmBabKinq2bMiWU8KcnHZdH')
93-
94-let O = Address(base58'3P4DK5VzDwL3vfc5ahUEhtoe5ByZNyacJ3X')
95-
96-let P = Address(base58'3PHpuQUPVUoR3AYzFeJzeWJfYLsLTmWssVH')
97-
98-let Q = Address(base58'3P2hbtheN5apNppqqUK7L7qAwmRFXy91CNa')
99-
100-let R = Address(base58'3PJVwjfi2fF5Jv9AauayU6xLxrYBn8bpGH1')
101-
102-let S = Address(base58'3PDPzZVLhN1EuzGy4xAxjjTVkawKDLEaHiV')
103-
104-let T = Address(base58'3P2yiVnK48evTLr8MAZWavpE4WA4fw1weQg')
105-
106-let U = a(Address(t), (("global_" + toBase58String(y)) + "_balance"))
107-
108-let V = a(Address(t), (toString(this) + "_indexStaked"))
109-
110-let W = a(Address(t), "global_poolToken_amount")
111-
112-func X (Y,Z) = fraction(a(Y, ((toString(this) + "_supplied_") + toBase58String(Z))), a(Y, (toBase58String(Z) + "_sRate")), h)
113-
114-
115-func aa (ab,ac) = {
116- let d = getInteger(S, ab)
117- if ($isInstanceOf(d, "Int"))
118- then {
119- let ad = d
120- ad
121- }
122- else ac
123- }
124-
125-
126-func ae (ab,ac) = {
127- let d = getBinary(S, ab)
128- if ($isInstanceOf(d, "ByteVector"))
129- then {
130- let ad = d
131- toBigInt(ad)
132- }
133- else ac
134- }
135-
136-
137-let af = ae("LAST_RATE", toBigInt(1000000000000))
138-
139-let ag = ae("CURRENT_RATE", toBigInt(0))
140-
141-let ah = aa("LAST_HEIGHT", 0)
142-
143-let ai = min([aa("TARGET_HEIGHT", 0), height])
144-
145-let aj = (af + (ag * toBigInt((ai - ah))))
146-
147-let ak = toInt(fraction(toBigInt(assetBalance(R, K)), aj, toBigInt(1000000000000), FLOOR))
148-
149-let al = (wavesBalance(R).regular + ak)
150-
151-let am = assetBalance(R, I)
152-
153-let an = fraction((g * 100), am, al)
154-
155-let ao = (wavesBalance(T).regular + ak)
156-
157-let ap = assetBalance(T, E)
158-
159-let aq = fraction((g * 100), ao, ap)
160-
161-let ar = a(Address(v), (("global_" + toBase58String(y)) + "_balance"))
162-
163-let as = a(Address(v), (("global_" + x) + "_balance"))
164-
165-let at = a(Address(v), (toString(this) + "_indexStaked"))
166-
167-let au = a(Address(v), "global_poolToken_amount")
168-
169-let av = (fraction((fraction(assetBalance(this, J), a(Q, "%s__rate"), 1000000000000, HALFEVEN) / 100), g, an) * 100)
170-
171-let aw = (fraction(assetBalance(this, J), a(Q, "%s__rate"), 1000000000000, HALFEVEN) / 100)
172-
173-let ax = f(Address(base58'3PMtGnf3LXiEG6isDQLq1xMDKUqjQGqNHLb'), "%s%s%s__vault__3PAkmJniMgnnAej5pYf2jFYkCbZow5pt9tr__WAVES")
174-
175-let ay = parseIntValue(split(ax, "__")[2])
176-
177-let az = Address(base58'3PHxubMUtynEY2AeHq3K1kUizRPN9HUC2rt')
178-
179-let aA = a(az, "3PAkmJniMgnnAej5pYf2jFYkCbZow5pt9tr_aTokenBalance")
180-
181-let aB = a(az, "aTokenCirculation")
182-
183-let aC = f(az, "reserveGlobalData")
184-
185-let aD = split(aC, "|")[1]
186-
187-let aE = parseIntValue(aD)
188-
189-let aF = parseIntValue(split(f(az, "reserveGlobalData"), "|")[1])
190-
191-let aG = fraction(aA, aF, aB)
192-
193-let aH = fraction(aG, aq, g)
194-
195-let aI = ((fraction((U * 10), V, W) + fraction((ar * 10), at, au)) + aH)
196-
197-let aJ = ay
198-
199-let aK = (aJ + aI)
200-
201-let aL = {
202- let d = assetInfo(w)
203- if ($isInstanceOf(d, "Asset"))
204- then {
205- let Z = d
206- Z.quantity
207- }
208- else throw("Can't find asset")
209- }
210-
211-let aM = if (((fraction((aI + a(this, n)), g, aL) + g) >= a(this, s)))
212- then (fraction((aI + a(this, n)), g, aL) + g)
213- else a(this, s)
214-
215-@Callable(aN)
216-func buyWHIRLPOOLwithWAVES () = {
217- let aO = assetBalance(this, w)
218- if ((aO == aO))
219- then {
220- let aP = value(aN.payments[0])
221- let aQ = fraction((aM - g), aP.amount, g)
222- let aR = if ((aP.amount >= fraction(aP.amount, g, aM)))
223- then fraction(aP.amount, g, aM)
224- else throw("please contact project owner: issue amount error")
225- let aS = ((aP.amount - aQ) / 3)
226- let aT = (aP.amount - fraction(aP.amount, 200, 10000))
227- let aU = fraction(as, ((g * g) - toInt(pow(fraction(toBigInt(ar), toBigInt((g * g)), toBigInt((ar + aT)), HALFUP), 16, toBigInt(fraction(100000, 10000, 900000)), 4, 16, CEILING))), (g * g), DOWN)
228- if ((aP.assetId != unit))
229- then throw("attach WAVES token only")
230- else {
231- let aV = if ((aU > aR))
232- then invoke(Address(v), "swap", [x, (aR + 1)], [AttachedPayment(unit, aP.amount)])
233- else unit
234- if ((aV == aV))
235- then {
236- let aW = assetBalance(this, w)
237- let aX = (aW - aO)
238-[Reissue(w, if ((aR >= aU))
239- then aR
240- else 0, true), if ((aU > aR))
241- then ScriptTransfer(aN.caller, aX, w)
242- else ScriptTransfer(aN.caller, aR, w), IntegerEntry(s, aM), IntegerEntry(if ((aU > aR))
243- then "price WHIRLPOOL/WAVES"
244- else "WHIRLPOOL/WAVES mid market price", if ((aU > aR))
245- then fraction(g, aP.amount, aX)
246- else fraction(g, (ar * 9), as)), IntegerEntry(o, if ((aR >= aU))
247- then (aP.amount + a(this, o))
248- else a(this, o)), IntegerEntry(o, if ((aR >= aU))
249- then ((aP.amount - aQ) + a(this, o))
250- else a(this, o)), IntegerEntry(n, if ((aU > aR))
251- then getIntegerValue(this, n)
252- else (aQ + getIntegerValue(this, n)))]
253- }
254- else throw("Strict value is not equal to itself.")
255- }
256- }
257- else throw("Strict value is not equal to itself.")
258- }
259-
260-
261-
262-@Callable(aN)
263-func priceSurplusSupply () = [IntegerEntry("ETH/WAVES price", aq), IntegerEntry("BT WAVES in EAST vault", ay), IntegerEntry("ST BURN-XTN x PepeTeam in wavelets", fraction((U * 10), V, W)), IntegerEntry("ST WHIRLPOOL AMM in wavelets", fraction((ar * 10), at, au)), IntegerEntry("ST vETH", aG), IntegerEntry("ST vETH in wavelets", aH), IntegerEntry("Total ST in wavelets", aI), IntegerEntry(s, aM), IntegerEntry("WHIRLPOOL/WAVES mid market price", fraction(g, (ar * 9), as)), IntegerEntry("WHIRLPOOL total supply", aL), IntegerEntry("Total treasury", aK), IntegerEntry("NAV WHIRLPOOL", fraction(g, aK, aL)), IntegerEntry(o, a(this, o)), IntegerEntry(n, a(this, n)), IntegerEntry(o, a(this, o)), IntegerEntry(q, a(this, q)), IntegerEntry("total WAVES received", (a(this, o) / g)), IntegerEntry("Total treasury in WAVES", (aK / g)), IntegerEntry("surplus received in WAVES", (a(this, n) / g)), IntegerEntry("total WAVES received for base treasury", (a(this, o) / g)), IntegerEntry("total WAVES paid out in WAVES", (a(this, q) / g)), IntegerEntry(r, a(this, r))]
264-
265-
266-
267-@Callable(aN)
268-func boostPoolAPY () = if ((aN.caller != this))
269- then throw("access only by project owner")
270- else {
271- let aY = if ((g > wavesBalance(this).available))
272- then throw("not enough WAVES")
273- else (wavesBalance(this).available - g)
274- let aZ = fraction(aY, 80, 100)
275- if ((aZ == aZ))
276- then {
277- let ba = fraction(aZ, 80, 100)
278- if ((ba == ba))
279- then {
280- let bb = fraction(aZ, 20, 100)
281- if ((bb == bb))
282- then {
283- let bc = invoke(Address(M), "addBoosting", [toBase58String(v), 7], [AttachedPayment(unit, ba)])
284- if ((bc == bc))
285- then [ScriptTransfer(Address(u), bb, unit), IntegerEntry(q, (ba + a(this, q))), IntegerEntry(r, fraction(a(this, q), 10000, a(this, o))), IntegerEntry(m, height)]
286- else throw("Strict value is not equal to itself.")
287- }
288- else throw("Strict value is not equal to itself.")
289- }
290- else throw("Strict value is not equal to itself.")
291- }
292- else throw("Strict value is not equal to itself.")
293- }
294-
295-
296-
297-@Callable(aN)
298-func boostPoolAPY_all () = if ((aN.caller != this))
299- then throw("access only by project owner")
300- else {
301- let aY = if ((g > wavesBalance(this).available))
302- then throw("not enough WAVES")
303- else (wavesBalance(this).available - g)
304- let ba = fraction(aY, 80, 100)
305- if ((ba == ba))
306- then {
307- let bb = fraction(aY, 20, 100)
308- if ((bb == bb))
309- then {
310- let bc = invoke(Address(M), "addBoosting", [toBase58String(v), 7], [AttachedPayment(unit, ba)])
311- if ((bc == bc))
312- then [ScriptTransfer(Address(u), bb, unit), IntegerEntry(q, (ba + a(this, q))), IntegerEntry(r, fraction(a(this, q), 10000, a(this, o))), IntegerEntry(m, height)]
313- else throw("Strict value is not equal to itself.")
314- }
315- else throw("Strict value is not equal to itself.")
316- }
317- else throw("Strict value is not equal to itself.")
318- }
319-
320-
321-
322-@Callable(aN)
323-func transferPoolAPY () = if ((aN.caller != this))
324- then throw("access only by project owner")
325- else {
326- let aY = if ((g > wavesBalance(this).available))
327- then throw("not enough WAVES")
328- else (wavesBalance(this).available - g)
329- let aZ = fraction(aY, 80, 100)
330- if ((aZ == aZ))
331- then {
332- let ba = fraction(aZ, 80, 100)
333- if ((ba == ba))
334- then {
335- let bb = fraction(aZ, 20, 100)
336- if ((bb == bb))
337- then [ScriptTransfer(Address(v), ba, unit), ScriptTransfer(Address(u), bb, unit), IntegerEntry(q, (ba + a(this, q))), IntegerEntry(r, fraction(a(this, q), 10000, a(this, o))), IntegerEntry(m, height)]
338- else throw("Strict value is not equal to itself.")
339- }
340- else throw("Strict value is not equal to itself.")
341- }
342- else throw("Strict value is not equal to itself.")
343- }
344-
345-
346-
347-@Callable(aN)
348-func transferPoolAPY_all () = if ((aN.caller != this))
349- then throw("access only by project owner")
350- else {
351- let aY = if ((g > wavesBalance(this).available))
352- then throw("not enough WAVES")
353- else (wavesBalance(this).available - g)
354- let ba = fraction(aY, 80, 100)
355- if ((ba == ba))
356- then {
357- let bb = fraction(aY, 20, 100)
358- if ((bb == bb))
359- then [ScriptTransfer(Address(v), ba, unit), ScriptTransfer(Address(u), bb, unit), IntegerEntry(q, (ba + a(this, q))), IntegerEntry(r, fraction(a(this, q), 10000, a(this, o))), IntegerEntry(m, height)]
360- else throw("Strict value is not equal to itself.")
361- }
362- else throw("Strict value is not equal to itself.")
363- }
364-
365-
366-
367-@Callable(aN)
368-func poolOneTokenSurplus () = if ((aN.caller != this))
369- then throw("access only by project owner")
370- else {
371- let bd = a(this, n)
372- let be = invoke(Address(base58'3PR1Qvi9mHT35SwWEkLSqqE2L8thiPLdVWU'), "generateIndexWithOneTokenAndStake", [toBase58String(t)], [AttachedPayment(unit, bd)])
373- if ((be == be))
374- then [IntegerEntry(n, (a(this, n) - bd))]
375- else throw("Strict value is not equal to itself.")
376- }
377-
378-
379-
380-@Callable(aN)
381-func changeIntegerEntry (bf,bg) = if ((aN.caller != this))
382- then throw("access only by project owner")
383- else [IntegerEntry(bf, bg)]
384-
385-
386-
387-@Callable(aN)
388-func activated () = if ((aN.caller != this))
389- then throw("you are not allowed")
390- else [IntegerEntry(m, height)]
391-
392-
393-@Verifier(bh)
394-func bi () = if (sigVerify(bh.bodyBytes, bh.proofs[0], bh.senderPublicKey))
395- then true
396- else if (((a(this, m) + i) > height))
397- then false
398- else if (sigVerify(bh.bodyBytes, bh.proofs[0], j))
399- then true
400- else if (((a(this, m) + k) > height))
401- then false
402- else sigVerify(bh.bodyBytes, bh.proofs[0], l)
403-
1+# no script

github/deemru/w8io/169f3d6 
36.15 ms