tx · C2AVK4JaqwYa5J7AQcJEqiSF6j1r6CQK6Rha1JZpu33v 3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq: -0.01300000 Waves 2023.02.15 13:43 [2450617] smart account 3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq > SELF 0.00000000 Waves
{ "type": 13, "id": "C2AVK4JaqwYa5J7AQcJEqiSF6j1r6CQK6Rha1JZpu33v", "fee": 1300000, "feeAssetId": null, "timestamp": 1676457818535, "version": 2, "chainId": 84, "sender": "3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq", "senderPublicKey": "2u2wYYcVBQv43Cc71zkhHPPitkqgg6dqTZ3nUMvYJ1uq", "proofs": [ "4FUrN6HMWH2tFJXjc1V4LdX65Qcdh5reoUR1tHZMkNfgBNLindKCtAX8ktVEzRyJf2kv76m3wpsL1FqmCLsEaPR5" ], "script": "base64:BgIXCAISBQoDAQgIEgUKAwEICBIDCgEIEgAXAANTRVACAl9fAAhmZWVTY2FsZQkAtgIBAIDC1y8BD2dldFN0cmluZ09yRmFpbAEDa2V5CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJ0IAgUEdGhpcwUDa2V5CQCsAgICFU5vIGRhdGEgZm9yIHRoaXMua2V5PQUDa2V5AAxwb29sRGlzYWJsZWQJAAIBAg1Qb29sIGRpc2FibGVkAAxwb29sTm90RXhpc3QJAAIBAhFQb29sIGlzIG5vdCBleGlzdAAOc2xpcHBhZ2VUb29CaWcJAAIBAhNTbGlwcGFnZSBpcyB0b28gYmlnARNrZXlNYW5hZ2VyUHVibGljS2V5AAIUJXNfX21hbmFnZXJQdWJsaWNLZXkBGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAIbJXNfX3BlbmRpbmdNYW5hZ2VyUHVibGljS2V5AQJmYwACEyVzX19mYWN0b3J5Q29udHJhY3QAD2ZhY3RvcnlDb250cmFjdAkBEUBleHRyTmF0aXZlKDEwNjIpAQkBD2dldFN0cmluZ09yRmFpb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RjaCBlcnJvcgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUPdGFyZ2V0UHVibGljS2V58OGPyA==", "height": 2450617, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ALnuBBV9sSqPtwwqrSwPmNEpknEHcjw3jb5QgSmSnuE8 Next: xYqMb1fJX98Bdwa3XKpguLt7hTGQc7bAq1Fe9tkBmQ9 Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | 6 | let b = toBigInt(100000000) | |
7 | 7 | ||
8 | 8 | func c (d) = valueOrErrorMessage(getString(this, d), ("No data for this.key=" + d)) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | let e = throw("Pool disabled") | |
12 | 12 | ||
13 | 13 | let f = throw("Pool is not exist") | |
14 | 14 | ||
15 | 15 | let g = throw("Slippage is too big") | |
16 | 16 | ||
17 | 17 | func h () = "%s__managerPublicKey" | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func i () = "%s__pendingManagerPublicKey" | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func j () = "%s__factoryContract" | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | let k = addressFromStringValue(c(j())) | |
27 | 27 | ||
28 | 28 | func l () = makeString(["%s", "protocolFee"], a) | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func m () = makeString(["%s", "poolFee"], a) | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func n (o,d) = valueOrErrorMessage(getString(o, d), makeString(["mandatory ", toString(o), ".", d, " is not defined"], "")) | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | let p = "%s__feeCollectorAddress" | |
38 | 38 | ||
39 | 39 | let q = addressFromStringValue(n(k, p)) | |
40 | 40 | ||
41 | 41 | func r (s) = { | |
42 | 42 | let t = s | |
43 | 43 | if ($isInstanceOf(t, "Int")) | |
44 | 44 | then { | |
45 | 45 | let u = t | |
46 | 46 | u | |
47 | 47 | } | |
48 | 48 | else throw("fail to cast into Int") | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func v (w,x) = makeString(["%d%d", toString(w), toString(x)], a) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func y () = { | |
56 | 56 | let t = getString(h()) | |
57 | 57 | if ($isInstanceOf(t, "String")) | |
58 | 58 | then { | |
59 | 59 | let z = t | |
60 | 60 | fromBase58String(z) | |
61 | 61 | } | |
62 | 62 | else if ($isInstanceOf(t, "Unit")) | |
63 | 63 | then unit | |
64 | 64 | else throw("Match error") | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func A () = { | |
69 | 69 | let t = getString(i()) | |
70 | 70 | if ($isInstanceOf(t, "String")) | |
71 | 71 | then { | |
72 | 72 | let z = t | |
73 | 73 | fromBase58String(z) | |
74 | 74 | } | |
75 | 75 | else if ($isInstanceOf(t, "Unit")) | |
76 | 76 | then unit | |
77 | 77 | else throw("Match error") | |
78 | 78 | } | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func B (C) = { | |
82 | 82 | let t = y() | |
83 | 83 | if ($isInstanceOf(t, "ByteVector")) | |
84 | 84 | then { | |
85 | 85 | let D = t | |
86 | 86 | (C.callerPublicKey == D) | |
87 | 87 | } | |
88 | 88 | else if ($isInstanceOf(t, "Unit")) | |
89 | 89 | then (C.caller == this) | |
90 | 90 | else throw("Match error") | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func E (C) = if (B(C)) | |
95 | 95 | then true | |
96 | 96 | else throw("permission denied") | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func F (G) = if ((G == "WAVES")) | |
100 | 100 | then wavesBalance(this).available | |
101 | 101 | else assetBalance(this, fromBase58String(G)) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func H (I,J) = { | |
105 | 105 | let K = { | |
106 | 106 | let L = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [I, J], nil) | |
107 | 107 | if ($isInstanceOf(L, "String")) | |
108 | 108 | then L | |
109 | 109 | else unit | |
110 | 110 | } | |
111 | 111 | let M = { | |
112 | 112 | let L = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [J, I], nil) | |
113 | 113 | if ($isInstanceOf(L, "String")) | |
114 | 114 | then L | |
115 | 115 | else unit | |
116 | 116 | } | |
117 | 117 | let N = if ((K != unit)) | |
118 | 118 | then { | |
119 | 119 | let O = { | |
120 | 120 | let L = invoke(k, "getPoolAddressFromLpAssetREADONLY", [value(K)], nil) | |
121 | 121 | if ($isInstanceOf(L, "String")) | |
122 | 122 | then L | |
123 | 123 | else throw(($getType(L) + " couldn't be cast to String")) | |
124 | 124 | } | |
125 | 125 | $Tuple2(false, O) | |
126 | 126 | } | |
127 | 127 | else if ((M != unit)) | |
128 | 128 | then { | |
129 | 129 | let O = { | |
130 | 130 | let L = invoke(k, "getPoolAddressFromLpAssetREADONLY", [value(M)], nil) | |
131 | 131 | if ($isInstanceOf(L, "String")) | |
132 | 132 | then L | |
133 | 133 | else throw(($getType(L) + " couldn't be cast to String")) | |
134 | 134 | } | |
135 | 135 | $Tuple2(true, O) | |
136 | 136 | } | |
137 | 137 | else f | |
138 | 138 | let P = N._1 | |
139 | 139 | let O = N._2 | |
140 | 140 | let Q = { | |
141 | 141 | let L = invoke(k, "getPoolStatusREADONLY", [O], nil) | |
142 | 142 | if ($isInstanceOf(L, "Int")) | |
143 | 143 | then L | |
144 | 144 | else throw(($getType(L) + " couldn't be cast to Int")) | |
145 | 145 | } | |
146 | 146 | let R = if ((Q == 1)) | |
147 | 147 | then true | |
148 | 148 | else e | |
149 | 149 | if ((R == R)) | |
150 | 150 | then { | |
151 | 151 | let S = addressFromStringValue(valueOrElse(O, "")) | |
152 | 152 | $Tuple2(S, P) | |
153 | 153 | } | |
154 | 154 | else throw("Strict value is not equal to itself.") | |
155 | 155 | } | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | @Callable(C) | |
159 | 159 | func swapCalculateREADONLY (T,I,J) = { | |
160 | 160 | let U = value(getInteger(l())) | |
161 | 161 | let V = fraction(toBigInt(T), toBigInt(U), b) | |
162 | 162 | let W = value(getInteger(m())) | |
163 | 163 | let X = fraction(toBigInt(T), toBigInt(W), b) | |
164 | 164 | let Y = if ((toInt(V) == 0)) | |
165 | 165 | then toBigInt(1) | |
166 | 166 | else V | |
167 | 167 | let Z = if ((toInt(X) == 0)) | |
168 | 168 | then toBigInt(1) | |
169 | 169 | else X | |
170 | 170 | let aa = ((toBigInt(T) - Y) - Z) | |
171 | 171 | let ab = H(I, J) | |
172 | 172 | let S = ab._1 | |
173 | 173 | let P = ab._2 | |
174 | 174 | let ac = { | |
175 | 175 | let L = invoke(S, "calculateAmountOutForSwapREADONLY", [toInt(aa), P], nil) | |
176 | 176 | if ($isInstanceOf(L, "Int")) | |
177 | 177 | then L | |
178 | 178 | else throw(($getType(L) + " couldn't be cast to Int")) | |
179 | 179 | } | |
180 | 180 | $Tuple2(nil, ac) | |
181 | 181 | } | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | ||
185 | 185 | @Callable(C) | |
186 | 186 | func swap (ad,J,ae) = { | |
187 | 187 | let af = value(C.payments[0]) | |
188 | 188 | let I = if ((af.assetId == unit)) | |
189 | 189 | then "WAVES" | |
190 | 190 | else toBase58String(value(af.assetId)) | |
191 | 191 | let T = value(af.amount) | |
192 | 192 | let U = value(getInteger(l())) | |
193 | 193 | let V = fraction(toBigInt(T), toBigInt(U), b) | |
194 | 194 | let W = value(getInteger(m())) | |
195 | 195 | let X = fraction(toBigInt(T), toBigInt(W), b) | |
196 | 196 | let Y = if ((toInt(V) == 0)) | |
197 | 197 | then toBigInt(1) | |
198 | 198 | else V | |
199 | 199 | let Z = if ((toInt(X) == 0)) | |
200 | 200 | then toBigInt(1) | |
201 | 201 | else X | |
202 | 202 | let aa = ((toBigInt(T) - Y) - Z) | |
203 | 203 | let ag = [if ((size(C.payments) == 1)) | |
204 | 204 | then true | |
205 | 205 | else throw("exactly 1 payment are expected")] | |
206 | 206 | if ((ag == ag)) | |
207 | 207 | then { | |
208 | 208 | let ah = H(I, J) | |
209 | 209 | let S = ah._1 | |
210 | 210 | let P = ah._2 | |
211 | 211 | let ai = if ((I == "WAVES")) | |
212 | 212 | then unit | |
213 | 213 | else fromBase58String(I) | |
214 | 214 | let aj = { | |
215 | 215 | let L = invoke(S, "calculateAmountOutForSwapAndSendTokens", [toInt(aa), P, ad, ae], [AttachedPayment(ai, toInt(aa))]) | |
216 | 216 | if ($isInstanceOf(L, "Int")) | |
217 | 217 | then L | |
218 | 218 | else throw(($getType(L) + " couldn't be cast to Int")) | |
219 | 219 | } | |
220 | 220 | $Tuple2([ScriptTransfer(q, toInt(Y), ai), ScriptTransfer(S, toInt(Z), ai)], aj) | |
221 | 221 | } | |
222 | 222 | else throw("Strict value is not equal to itself.") | |
223 | 223 | } | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | ||
227 | 227 | @Callable(C) | |
228 | 228 | func setManager (ak) = { | |
229 | 229 | let al = E(C) | |
230 | 230 | if ((al == al)) | |
231 | 231 | then { | |
232 | 232 | let am = fromBase58String(ak) | |
233 | 233 | if ((am == am)) | |
234 | 234 | then [StringEntry(i(), ak)] | |
235 | 235 | else throw("Strict value is not equal to itself.") | |
236 | 236 | } | |
237 | 237 | else throw("Strict value is not equal to itself.") | |
238 | 238 | } | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | ||
242 | 242 | @Callable(C) | |
243 | 243 | func confirmManager () = { | |
244 | 244 | let an = A() | |
245 | 245 | let ao = if (isDefined(an)) | |
246 | 246 | then true | |
247 | 247 | else throw("no pending manager") | |
248 | 248 | if ((ao == ao)) | |
249 | 249 | then { | |
250 | 250 | let ap = if ((C.callerPublicKey == value(an))) | |
251 | 251 | then true | |
252 | 252 | else throw("you are not pending manager") | |
253 | 253 | if ((ap == ap)) | |
254 | 254 | then [StringEntry(h(), toBase58String(value(an))), DeleteEntry(i())] | |
255 | 255 | else throw("Strict value is not equal to itself.") | |
256 | 256 | } | |
257 | 257 | else throw("Strict value is not equal to itself.") | |
258 | 258 | } | |
259 | 259 | ||
260 | 260 | ||
261 | 261 | @Verifier(aq) | |
262 | 262 | func ar () = { | |
263 | 263 | let as = { | |
264 | 264 | let t = y() | |
265 | 265 | if ($isInstanceOf(t, "ByteVector")) | |
266 | 266 | then { | |
267 | 267 | let D = t | |
268 | 268 | D | |
269 | 269 | } | |
270 | 270 | else if ($isInstanceOf(t, "Unit")) | |
271 | 271 | then aq.senderPublicKey | |
272 | 272 | else throw("Match error") | |
273 | 273 | } | |
274 | 274 | sigVerify(aq.bodyBytes, aq.proofs[0], as) | |
275 | 275 | } | |
276 | 276 |
github/deemru/w8io/026f985 33.06 ms ◑