tx · ETis8qzSbrc5uGDyrR8tpZqqhXz2RHYzUx5wKpUYTDGR

3MpMsKowU1BqibQgMGvj6wBFUHv3N1vmQUR:  -0.01000000 Waves

2023.09.21 10:49 [2764865] smart account 3MpMsKowU1BqibQgMGvj6wBFUHv3N1vmQUR > SELF 0.00000000 Waves

{ "type": 13, "id": "ETis8qzSbrc5uGDyrR8tpZqqhXz2RHYzUx5wKpUYTDGR", "fee": 1000000, "feeAssetId": null, "timestamp": 1695282562367, "version": 2, "chainId": 84, "sender": "3MpMsKowU1BqibQgMGvj6wBFUHv3N1vmQUR", "senderPublicKey": "J4qLv7kHj72gGHRT348ncmmJpznDqXMdtWYTpEyky9KN", "proofs": [ "5aBKZhSAmrniSyi6eDQtURVWpj1aDrr3aXbDLQ3f5noPTDrgGfzTEy4V3wPqkY9AyozeuqK3ErMv7w9SGvuoV7Mf" ], "script": "base64:BgIKCAISABIAEgASAA4ACXd4QXNzZXRJZAEgM1Kp0g5+advMxKQnvIKrDTRAE/WbFcGgKo+DMmTBTQkABk1VTFQxMACAyK+gJQADU0VQAgJfXwAGcG9vbElkAAEAEnBvb2xMUFRva2VuQWRkcmVzcwEgM1Kp0g5+advMxKQnvIKrDTRAE/WbFcGgKo+DMmTBTQkAF3N0YWtlYm9vc3RlclJvb3RBZGRyZXNzARoBVIjFcN5G9OJsOhwdJuqY/GjHC7IJwkxSPQAMYWRtaW5BZGRyZXNzARoBVIxhil+sdwu2jS1p0aM0qMpq9rr6QP5z7QAUdG90YWxQb29sTFBTdGFrZWRLZXkCFHRvdGFsX3Bvb2xfbHBfc3Rha2VkABJ0b3RhbFBvb2xFYXJuZWRLZXkCEXRvdGFsX3Bvb2xfZWFybmVkABVwb29sQ3VycmVudENsYWltSWRLZXkCFXBvb2xfY3VycmVudF9jbGFpbV9pZAEJYXNQYXltZW50AQF2BAckbWF0Y2gwBQF2AwkAAQIFByRtYXRjaDACD0F0dGFjaGVkUGF5bWVudAQBcAUHJG1hdGNoMAUBcAkAAgEC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AZAIFD3RvdGFsUG9vbEVhcm5lZAUWY3VycmVudENsYWltSWRFYXJuaW5ncwUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleRvL7yA=", "height": 2764865, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 3Gj1FUriVof63Du6icHoRgGcga8zmFoST67JmjwP4Jku Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 6 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let a = base58'4TLuEDo8QjPsxUGjfRPyqqvAk4JtnYMXK1ypGo8uKrb2'
5+
6+let b = 10000000000
7+
8+let c = "__"
9+
10+let d = 1
11+
12+let e = base58'4TLuEDo8QjPsxUGjfRPyqqvAk4JtnYMXK1ypGo8uKrb2'
13+
14+let f = base58'3N2PGCSexF2nUN9SmgsaLedFix3M67A9reg'
15+
16+let g = base58'3N2iME1bcpy9zdFi2S1rmQDjPvvN5X8t3qW'
17+
18+let h = "total_pool_lp_staked"
19+
20+let i = "total_pool_earned"
21+
22+let j = "pool_current_claim_id"
23+
24+func k (l) = {
25+ let m = l
26+ if ($isInstanceOf(m, "AttachedPayment"))
27+ then {
28+ let n = m
29+ n
30+ }
31+ else throw("fail to cast into AttachedPayment")
32+ }
33+
34+
35+func o (p) = {
36+ let m = p
37+ if ($isInstanceOf(m, "Int"))
38+ then {
39+ let q = m
40+ q
41+ }
42+ else throw("fail to cast into Int")
43+ }
44+
45+
46+func r (p) = {
47+ let m = p
48+ if ($isInstanceOf(m, "String"))
49+ then {
50+ let s = m
51+ s
52+ }
53+ else throw("fail to cast into String")
54+ }
55+
56+
57+func t (u) = if (!(isDefined(getString(u))))
58+ then false
59+ else {
60+ let v = getIntegerValue(j)
61+ let w = split(getStringValue(u), c)
62+ let x = o(parseInt(w[2]))
63+ (v > x)
64+ }
65+
66+
67+@Callable(y)
68+func stakeLP () = if ((size(y.payments) != 1))
69+ then throw("One Payment expected")
70+ else {
71+ let z = toBase58String(y.caller.bytes)
72+ let A = k(y.payments[0])
73+ if (t(z))
74+ then throw("You have unclaimed rewards on contract, claim them first")
75+ else {
76+ let B = valueOrElse(getInteger(j), 0)
77+ let C = valueOrElse(getInteger(h), 0)
78+ let D = valueOrElse(getInteger(i), 0)
79+ let E = invoke(Address(f), "stakePoolLps", [d], [A])
80+ if ((E == E))
81+ then {
82+ let F = getString(z)
83+ let w = if (isDefined(F))
84+ then {
85+ let w = split(r(F), c)
86+ let G = o(parseInt(w[0]))
87+ let H = [toString((G + A.amount)), removeByIndex(w, 0)]
88+ makeString(H, c)
89+ }
90+ else makeString([toString(A.amount), "0", toString(B), toString(D)], c)
91+[StringEntry(z, w), IntegerEntry(j, B), IntegerEntry(i, D), IntegerEntry(h, (C + A.amount))]
92+ }
93+ else throw("Strict value is not equal to itself.")
94+ }
95+ }
96+
97+
98+
99+@Callable(y)
100+func withdrawLP () = {
101+ let z = toBase58String(y.caller.bytes)
102+ if (t(z))
103+ then throw("You have unclaimed rewards on contract, claim them first")
104+ else nil
105+ }
106+
107+
108+
109+@Callable(y)
110+func claimRewards () = {
111+ let z = toBase58String(y.caller.bytes)
112+ if (!(t(z)))
113+ then throw("Nothing to claim, wait for a while, pool will collect the rewards from WX soon")
114+ else {
115+ let I = getIntegerValue(j)
116+ let J = getIntegerValue(i)
117+ let w = split(getStringValue(z), c)
118+ let K = o(parseInt(w[0]))
119+ let L = o(parseInt(w[1]))
120+ let M = o(parseInt(w[2]))
121+ let N = o(parseInt(w[3]))
122+ let O = (J - N)
123+ let P = (O - (L * b))
124+ let Q = fraction(P, K, b)
125+ let H = makeString([w[0], toString((L + Q)), toString(I), w[3]], c)
126+[StringEntry(z, H), ScriptTransfer(y.caller, Q, a)]
127+ }
128+ }
129+
130+
131+
132+@Callable(y)
133+func claimPoolRewards () = if ((y.caller.bytes != g))
134+ then throw("Admin only")
135+ else {
136+ let R = getIntegerValue(h)
137+ let J = getIntegerValue(i)
138+ let I = getIntegerValue(j)
139+ let S = assetBalance(this, a)
140+ if ((S == S))
141+ then {
142+ let E = invoke(Address(f), "claimPoolRewards", [d], nil)
143+ if ((E == E))
144+ then {
145+ let T = assetBalance(this, a)
146+ let U = (T - S)
147+ let V = fraction(U, b, R)
148+[IntegerEntry("CURRENT_WX_ON_CONTRACT", S), IntegerEntry("NEW_WX_ON_CONTRACT", T), IntegerEntry(j, (I + 1)), IntegerEntry(i, (J + V))]
149+ }
150+ else throw("Strict value is not equal to itself.")
151+ }
152+ else throw("Strict value is not equal to itself.")
153+ }
154+
155+
156+@Verifier(W)
157+func X () = sigVerify(W.bodyBytes, W.proofs[0], W.senderPublicKey)
158+

github/deemru/w8io/169f3d6 
28.70 ms