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:BgIXCAISBQoDAQgIEgUKAwEICBIDCgEIEgAXAANTRVACAl9fAAhmZWVTY2FsZQkAtgIBAIDC1y8BD2dldFN0cmluZ09yRmFpbAEDa2V5CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJ0IAgUEdGhpcwUDa2V5CQCsAgICFU5vIGRhdGEgZm9yIHRoaXMua2V5PQUDa2V5AAxwb29sRGlzYWJsZWQJAAIBAg1Qb29sIGRpc2FibGVkAAxwb29sTm90RXhpc3QJAAIBAhFQb29sIGlzIG5vdCBleGlzdAAOc2xpcHBhZ2VUb29CaWcJAAIBAhNTbGlwcGFnZSBpcyB0b28gYmlnARNrZXlNYW5hZ2VyUHVibGljS2V5AAIUJXNfX21hbmFnZXJQdWJsaWNLZXkBGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAIbJXNfX3BlbmRpbmdNYW5hZ2VyUHVibGljS2V5AQJmYwACEyVzX19mYWN0b3J5Q29udHJhY3QAD2ZhY3RvcnlDb250cmFjdAkBEUBleHRyTmF0aXZlKDEwNjIpAQkBD2dldFN0cmluZ09yRmFp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XRjaCBlcnJvcgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUPdGFyZ2V0UHVibGljS2V58OGPyA==", "height": 2450617, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ALnuBBV9sSqPtwwqrSwPmNEpknEHcjw3jb5QgSmSnuE8 Next: xYqMb1fJX98Bdwa3XKpguLt7hTGQc7bAq1Fe9tkBmQ9 Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "__"
55
66 let b = toBigInt(100000000)
77
88 func c (d) = valueOrErrorMessage(getString(this, d), ("No data for this.key=" + d))
99
1010
1111 let e = throw("Pool disabled")
1212
1313 let f = throw("Pool is not exist")
1414
1515 let g = throw("Slippage is too big")
1616
1717 func h () = "%s__managerPublicKey"
1818
1919
2020 func i () = "%s__pendingManagerPublicKey"
2121
2222
2323 func j () = "%s__factoryContract"
2424
2525
2626 let k = addressFromStringValue(c(j()))
2727
2828 func l () = makeString(["%s", "protocolFee"], a)
2929
3030
3131 func m () = makeString(["%s", "poolFee"], a)
3232
3333
3434 func n (o,d) = valueOrErrorMessage(getString(o, d), makeString(["mandatory ", toString(o), ".", d, " is not defined"], ""))
3535
3636
3737 let p = "%s__feeCollectorAddress"
3838
3939 let q = addressFromStringValue(n(k, p))
4040
4141 func r (s) = {
4242 let t = s
4343 if ($isInstanceOf(t, "Int"))
4444 then {
4545 let u = t
4646 u
4747 }
4848 else throw("fail to cast into Int")
4949 }
5050
5151
5252 func v (w,x) = makeString(["%d%d", toString(w), toString(x)], a)
5353
5454
5555 func y () = {
5656 let t = getString(h())
5757 if ($isInstanceOf(t, "String"))
5858 then {
5959 let z = t
6060 fromBase58String(z)
6161 }
6262 else if ($isInstanceOf(t, "Unit"))
6363 then unit
6464 else throw("Match error")
6565 }
6666
6767
6868 func A () = {
6969 let t = getString(i())
7070 if ($isInstanceOf(t, "String"))
7171 then {
7272 let z = t
7373 fromBase58String(z)
7474 }
7575 else if ($isInstanceOf(t, "Unit"))
7676 then unit
7777 else throw("Match error")
7878 }
7979
8080
8181 func B (C) = {
8282 let t = y()
8383 if ($isInstanceOf(t, "ByteVector"))
8484 then {
8585 let D = t
8686 (C.callerPublicKey == D)
8787 }
8888 else if ($isInstanceOf(t, "Unit"))
8989 then (C.caller == this)
9090 else throw("Match error")
9191 }
9292
9393
9494 func E (C) = if (B(C))
9595 then true
9696 else throw("permission denied")
9797
9898
9999 func F (G) = if ((G == "WAVES"))
100100 then wavesBalance(this).available
101101 else assetBalance(this, fromBase58String(G))
102102
103103
104104 func H (I,J) = {
105105 let K = {
106106 let L = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [I, J], nil)
107107 if ($isInstanceOf(L, "String"))
108108 then L
109109 else unit
110110 }
111111 let M = {
112112 let L = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [J, I], nil)
113113 if ($isInstanceOf(L, "String"))
114114 then L
115115 else unit
116116 }
117117 let N = if ((K != unit))
118118 then {
119119 let O = {
120120 let L = invoke(k, "getPoolAddressFromLpAssetREADONLY", [value(K)], nil)
121121 if ($isInstanceOf(L, "String"))
122122 then L
123123 else throw(($getType(L) + " couldn't be cast to String"))
124124 }
125125 $Tuple2(false, O)
126126 }
127127 else if ((M != unit))
128128 then {
129129 let O = {
130130 let L = invoke(k, "getPoolAddressFromLpAssetREADONLY", [value(M)], nil)
131131 if ($isInstanceOf(L, "String"))
132132 then L
133133 else throw(($getType(L) + " couldn't be cast to String"))
134134 }
135135 $Tuple2(true, O)
136136 }
137137 else f
138138 let P = N._1
139139 let O = N._2
140140 let Q = {
141141 let L = invoke(k, "getPoolStatusREADONLY", [O], nil)
142142 if ($isInstanceOf(L, "Int"))
143143 then L
144144 else throw(($getType(L) + " couldn't be cast to Int"))
145145 }
146146 let R = if ((Q == 1))
147147 then true
148148 else e
149149 if ((R == R))
150150 then {
151151 let S = addressFromStringValue(valueOrElse(O, ""))
152152 $Tuple2(S, P)
153153 }
154154 else throw("Strict value is not equal to itself.")
155155 }
156156
157157
158158 @Callable(C)
159159 func swapCalculateREADONLY (T,I,J) = {
160160 let U = value(getInteger(l()))
161161 let V = fraction(toBigInt(T), toBigInt(U), b)
162162 let W = value(getInteger(m()))
163163 let X = fraction(toBigInt(T), toBigInt(W), b)
164164 let Y = if ((toInt(V) == 0))
165165 then toBigInt(1)
166166 else V
167167 let Z = if ((toInt(X) == 0))
168168 then toBigInt(1)
169169 else X
170170 let aa = ((toBigInt(T) - Y) - Z)
171171 let ab = H(I, J)
172172 let S = ab._1
173173 let P = ab._2
174174 let ac = {
175175 let L = invoke(S, "calculateAmountOutForSwapREADONLY", [toInt(aa), P], nil)
176176 if ($isInstanceOf(L, "Int"))
177177 then L
178178 else throw(($getType(L) + " couldn't be cast to Int"))
179179 }
180180 $Tuple2(nil, ac)
181181 }
182182
183183
184184
185185 @Callable(C)
186186 func swap (ad,J,ae) = {
187187 let af = value(C.payments[0])
188188 let I = if ((af.assetId == unit))
189189 then "WAVES"
190190 else toBase58String(value(af.assetId))
191191 let T = value(af.amount)
192192 let U = value(getInteger(l()))
193193 let V = fraction(toBigInt(T), toBigInt(U), b)
194194 let W = value(getInteger(m()))
195195 let X = fraction(toBigInt(T), toBigInt(W), b)
196196 let Y = if ((toInt(V) == 0))
197197 then toBigInt(1)
198198 else V
199199 let Z = if ((toInt(X) == 0))
200200 then toBigInt(1)
201201 else X
202202 let aa = ((toBigInt(T) - Y) - Z)
203203 let ag = [if ((size(C.payments) == 1))
204204 then true
205205 else throw("exactly 1 payment are expected")]
206206 if ((ag == ag))
207207 then {
208208 let ah = H(I, J)
209209 let S = ah._1
210210 let P = ah._2
211211 let ai = if ((I == "WAVES"))
212212 then unit
213213 else fromBase58String(I)
214214 let aj = {
215215 let L = invoke(S, "calculateAmountOutForSwapAndSendTokens", [toInt(aa), P, ad, ae], [AttachedPayment(ai, toInt(aa))])
216216 if ($isInstanceOf(L, "Int"))
217217 then L
218218 else throw(($getType(L) + " couldn't be cast to Int"))
219219 }
220220 $Tuple2([ScriptTransfer(q, toInt(Y), ai), ScriptTransfer(S, toInt(Z), ai)], aj)
221221 }
222222 else throw("Strict value is not equal to itself.")
223223 }
224224
225225
226226
227227 @Callable(C)
228228 func setManager (ak) = {
229229 let al = E(C)
230230 if ((al == al))
231231 then {
232232 let am = fromBase58String(ak)
233233 if ((am == am))
234234 then [StringEntry(i(), ak)]
235235 else throw("Strict value is not equal to itself.")
236236 }
237237 else throw("Strict value is not equal to itself.")
238238 }
239239
240240
241241
242242 @Callable(C)
243243 func confirmManager () = {
244244 let an = A()
245245 let ao = if (isDefined(an))
246246 then true
247247 else throw("no pending manager")
248248 if ((ao == ao))
249249 then {
250250 let ap = if ((C.callerPublicKey == value(an)))
251251 then true
252252 else throw("you are not pending manager")
253253 if ((ap == ap))
254254 then [StringEntry(h(), toBase58String(value(an))), DeleteEntry(i())]
255255 else throw("Strict value is not equal to itself.")
256256 }
257257 else throw("Strict value is not equal to itself.")
258258 }
259259
260260
261261 @Verifier(aq)
262262 func ar () = {
263263 let as = {
264264 let t = y()
265265 if ($isInstanceOf(t, "ByteVector"))
266266 then {
267267 let D = t
268268 D
269269 }
270270 else if ($isInstanceOf(t, "Unit"))
271271 then aq.senderPublicKey
272272 else throw("Match error")
273273 }
274274 sigVerify(aq.bodyBytes, aq.proofs[0], as)
275275 }
276276

github/deemru/w8io/026f985 
33.06 ms