tx · 4uLNb1SfWccQz67HSQBB2f9wPrzKp1c1aS4zggNTe7fa 3MzDR7sZ4ZUzM7JHx2RmeDcx7JCkVGfe6Tw: -0.01000000 Waves 2023.09.22 15:46 [2766605] smart account 3MzDR7sZ4ZUzM7JHx2RmeDcx7JCkVGfe6Tw > SELF 0.00000000 Waves
{ "type": 13, "id": "4uLNb1SfWccQz67HSQBB2f9wPrzKp1c1aS4zggNTe7fa", "fee": 1000000, "feeAssetId": null, "timestamp": 1695386811418, "version": 2, "chainId": 84, "sender": "3MzDR7sZ4ZUzM7JHx2RmeDcx7JCkVGfe6Tw", "senderPublicKey": "Cvpeuf75BRR44Hz7As27yX9gRcxgcLbEic6KVHx3d5Fx", "proofs": [ "5GtZ2G4kUzSQ6Go74cNbP8gS9UBgwn5hR5HrszSdVo3Pv62jU8gChftmxauUUmhCEtFuzfPgqZCq89arq69v3D2y" ], "script": "base64:BgITCAISBwoFAQgICAgSABIAEgASAA8ABk1VTFQxMACAyK+gJQADU0VQAgJfXwAJcG9vbElkS2V5Agdwb29sX2lkABBpc0NvbnN0cnVjdGVkS2V5Ag5pc19jb25zdHJ1Y3RlZAAMd3hBc3NldElkS2V5Agt3eF9hc3NldF9pZAAVcG9vbExQVG9rZW5BZGRyZXNzS2V5AhVwb29sX3BsX3Rva2VuX2FkZHJlc3MAGnN0YWtlYm9vc3RlclJvb3RBZGRyZXNzS2V5AhlzdGFrZWJvb3N0ZXJfcm9vdF9hZGRyZXNzAA9hZG1pbkFkZHJlc3NLZXkCEWFkbWluX2FkZHJlc3Nfa2V5ABR0b3RhbFBvb2xMUFN0YWtlZEtleQIUdG90YWxfcG9vbF9scF9zdGFrZWQAEnRvdGFsUG9vbEVhcm5lZEtleQIRdG90YWxfcG9vbF9lYXJuZWQAFXBvb2xDdXJyZW50Q2xhaW1JZEtleQIVcG9vbF9jdXJyZW50X2NsYWltX2lkAQlhc1BheW1lbnQBAXYEByRtYXRjaDAFAXYDCQABAgUHJG1hdGNoMAIPQXR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W1JZEtleQkAZAIFEnBvb2xDdXJyZW50Q2xhaW1JZAABCQDMCAIJAQxJbnRlZ2VyRW50cnkCBRJ0b3RhbFBvb2xFYXJuZWRLZXkJAGQCBQ90b3RhbFBvb2xFYXJuZWQFFmN1cnJlbnRDbGFpbUlkRWFybmluZ3MFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkmy9M1", "height": 2766605, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = 10000000000 | |
5 | + | ||
6 | + | let b = "__" | |
7 | + | ||
8 | + | let c = "pool_id" | |
9 | + | ||
10 | + | let d = "is_constructed" | |
11 | + | ||
12 | + | let e = "wx_asset_id" | |
13 | + | ||
14 | + | let f = "pool_pl_token_address" | |
15 | + | ||
16 | + | let g = "stakebooster_root_address" | |
17 | + | ||
18 | + | let h = "admin_address_key" | |
19 | + | ||
20 | + | let i = "total_pool_lp_staked" | |
21 | + | ||
22 | + | let j = "total_pool_earned" | |
23 | + | ||
24 | + | let k = "pool_current_claim_id" | |
25 | + | ||
26 | + | func l (m) = { | |
27 | + | let n = m | |
28 | + | if ($isInstanceOf(n, "AttachedPayment")) | |
29 | + | then { | |
30 | + | let o = n | |
31 | + | o | |
32 | + | } | |
33 | + | else throw("fail to cast into AttachedPayment") | |
34 | + | } | |
35 | + | ||
36 | + | ||
37 | + | func p (q) = { | |
38 | + | let n = q | |
39 | + | if ($isInstanceOf(n, "Int")) | |
40 | + | then { | |
41 | + | let r = n | |
42 | + | r | |
43 | + | } | |
44 | + | else throw("fail to cast into Int") | |
45 | + | } | |
46 | + | ||
47 | + | ||
48 | + | func s (q) = { | |
49 | + | let n = q | |
50 | + | if ($isInstanceOf(n, "String")) | |
51 | + | then { | |
52 | + | let t = n | |
53 | + | t | |
54 | + | } | |
55 | + | else throw("fail to cast into String") | |
56 | + | } | |
57 | + | ||
58 | + | ||
59 | + | func u (v) = if (!(isDefined(getString(v)))) | |
60 | + | then false | |
61 | + | else { | |
62 | + | let w = getIntegerValue(k) | |
63 | + | let x = split(getStringValue(v), b) | |
64 | + | let y = p(parseInt(x[2])) | |
65 | + | (w > y) | |
66 | + | } | |
67 | + | ||
68 | + | ||
69 | + | @Callable(z) | |
70 | + | func constructor (A,B,C,D,E) = if (isDefined(getBoolean(d))) | |
71 | + | then throw("Constructor can be called one time") | |
72 | + | else [BooleanEntry(d, true), IntegerEntry(c, A), StringEntry(e, B), StringEntry(f, C), StringEntry(g, D), StringEntry(h, E)] | |
73 | + | ||
74 | + | ||
75 | + | ||
76 | + | @Callable(z) | |
77 | + | func stakeLP () = if ((size(z.payments) != 1)) | |
78 | + | then throw("One Payment expected") | |
79 | + | else { | |
80 | + | let F = toBase58String(z.caller.bytes) | |
81 | + | let G = l(z.payments[0]) | |
82 | + | let H = fromBase58String(getStringValue(f)) | |
83 | + | if (if ((G.assetId != H)) | |
84 | + | then true | |
85 | + | else (0 >= G.amount)) | |
86 | + | then throw("Wrong asset id or negative amount") | |
87 | + | else if (u(F)) | |
88 | + | then throw("You have unclaimed rewards on contract, claim them first") | |
89 | + | else { | |
90 | + | let I = valueOrElse(getInteger(k), 0) | |
91 | + | let J = valueOrElse(getInteger(i), 0) | |
92 | + | let K = valueOrElse(getInteger(j), 0) | |
93 | + | let L = fromBase58String(getStringValue(g)) | |
94 | + | let M = invoke(Address(L), "stakePoolLps", [getIntegerValue(c)], [G]) | |
95 | + | if ((M == M)) | |
96 | + | then { | |
97 | + | let N = getString(F) | |
98 | + | let x = if (isDefined(N)) | |
99 | + | then { | |
100 | + | let x = split(s(N), b) | |
101 | + | let O = p(parseInt(x[0])) | |
102 | + | let P = [toString((O + G.amount)), removeByIndex(x, 0)] | |
103 | + | makeString(P, b) | |
104 | + | } | |
105 | + | else makeString([toString(G.amount), "0", toString(I), toString(K)], b) | |
106 | + | [StringEntry(F, x), IntegerEntry(k, I), IntegerEntry(j, K), IntegerEntry(i, (J + G.amount))] | |
107 | + | } | |
108 | + | else throw("Strict value is not equal to itself.") | |
109 | + | } | |
110 | + | } | |
111 | + | ||
112 | + | ||
113 | + | ||
114 | + | @Callable(z) | |
115 | + | func withdrawLP () = { | |
116 | + | let F = toBase58String(z.caller.bytes) | |
117 | + | if (u(F)) | |
118 | + | then throw("You have unclaimed rewards on contract, claim them first") | |
119 | + | else nil | |
120 | + | } | |
121 | + | ||
122 | + | ||
123 | + | ||
124 | + | @Callable(z) | |
125 | + | func claimRewards () = { | |
126 | + | let F = toBase58String(z.caller.bytes) | |
127 | + | if (!(u(F))) | |
128 | + | then throw("Nothing to claim, wait for a while, pool will collect the rewards from WX soon") | |
129 | + | else { | |
130 | + | let Q = getIntegerValue(k) | |
131 | + | let R = getIntegerValue(j) | |
132 | + | let x = split(getStringValue(F), b) | |
133 | + | let S = p(parseInt(x[0])) | |
134 | + | let T = p(parseInt(x[1])) | |
135 | + | let U = p(parseInt(x[2])) | |
136 | + | let V = p(parseInt(x[3])) | |
137 | + | let W = (R - V) | |
138 | + | let X = fraction(W, S, a, HALFUP) | |
139 | + | let Y = fraction(X, a, S, HALFUP) | |
140 | + | let P = makeString([x[0], toString((T + X)), toString(Q), toString((V + Y))], b) | |
141 | + | let B = fromBase58String(getStringValue(e)) | |
142 | + | [StringEntry(F, P), ScriptTransfer(z.caller, X, B)] | |
143 | + | } | |
144 | + | } | |
145 | + | ||
146 | + | ||
147 | + | ||
148 | + | @Callable(z) | |
149 | + | func claimPoolRewards () = if ((z.caller.bytes != fromBase58String(getStringValue(h)))) | |
150 | + | then throw("Admin only") | |
151 | + | else { | |
152 | + | let Z = getIntegerValue(i) | |
153 | + | let R = getIntegerValue(j) | |
154 | + | let Q = getIntegerValue(k) | |
155 | + | let B = fromBase58String(getStringValue(e)) | |
156 | + | let L = fromBase58String(getStringValue(g)) | |
157 | + | let aa = assetBalance(this, B) | |
158 | + | if ((aa == aa)) | |
159 | + | then { | |
160 | + | let M = invoke(Address(L), "claimPoolRewards", [getIntegerValue(c)], nil) | |
161 | + | if ((M == M)) | |
162 | + | then { | |
163 | + | let ab = assetBalance(this, B) | |
164 | + | let ac = (ab - aa) | |
165 | + | let ad = fraction(ac, a, Z, HALFUP) | |
166 | + | [IntegerEntry(k, (Q + 1)), IntegerEntry(j, (R + ad))] | |
167 | + | } | |
168 | + | else throw("Strict value is not equal to itself.") | |
169 | + | } | |
170 | + | else throw("Strict value is not equal to itself.") | |
171 | + | } | |
172 | + | ||
173 | + | ||
174 | + | @Verifier(ae) | |
175 | + | func af () = sigVerify(ae.bodyBytes, ae.proofs[0], ae.senderPublicKey) | |
176 | + |
github/deemru/w8io/169f3d6 22.65 ms ◑