tx · 4LDgK1DQT1SAcPwQ1cis7UAysoZz2dFoN5vPHTU98Nek

3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq:  -0.01300000 Waves

2023.01.30 12:38 [2427529] smart account 3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq > SELF 0.00000000 Waves

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

github/deemru/w8io/169f3d6 
31.95 ms