tx · GjoAa61M4wMsoaaCAQmkJrPFH7jnphpWm2td6uGXJE83

3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq:  -0.01300000 Waves

2023.02.09 11:44 [2441872] smart account 3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq > SELF 0.00000000 Waves

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

github/deemru/w8io/169f3d6 
46.93 ms