tx · ZbukTgBHH3KsgfZPGV2kZBR3SKvD2zW5wgMHEbddpog

3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq:  -0.01300000 Waves

2023.01.17 13:50 [2408829] smart account 3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq > SELF 0.00000000 Waves

{ "type": 13, "id": "ZbukTgBHH3KsgfZPGV2kZBR3SKvD2zW5wgMHEbddpog", "fee": 1300000, "feeAssetId": null, "timestamp": 1673952641518, "version": 1, "sender": "3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq", "senderPublicKey": "2u2wYYcVBQv43Cc71zkhHPPitkqgg6dqTZ3nUMvYJ1uq", "proofs": [ "3wQfWXXsufVsu4K14dyvAdFvJkybrrd8x7kRunJitrLnozdRntiykF2ka7ZvoYN1Z42cDKamkVmiTjwbb15Z5zq9" ], "script": "base64:BgIYCAISBgoEAQEICBIFCgMBCAgSAwoBCBIAEwADU0VQAgJfXwAIZmVlU2NhbGUJALYCAQCgjQYBD2dldFN0cmluZ09yRmFpbAEDa2V5CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJ0IAgUEdGhpcwUDa2V5CQCsAgICFU5vIGRhdGEgZm9yIHRoaXMua2V5PQUDa2V5AAxwb29sRGlzYWJsZWQJAAIBAg1Qb29sIGRpc2FibGVkAAxwb29sTm90RXhpc3QJAAIBAhFQb29sIGlzIG5vdCBleGlzdAAOc2xpcHBhZ2VUb29CaWcJAAIBAhNTbGlwcGFnZSBpcyB0b28gYmlnARNrZXlNYW5hZ2VyUHVibGljS2V5AAIUJXNfX21hbmFnZXJQdWJsaWNLZXkBGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAIbJXNfX3BlbmRpbmdNYW5hZ2VyUHVibGljS2V5AQJmYwACEyVzX19mYWN0b3J5Q29udHJhY3QAD2ZhY3RvcnlDb250cmFjdAkBEUBleHRyTmF0aXZlKDEwNjIpAQkBD2dldFN0cmluZ09yRmFpbAEJAQJmYwABG2Zl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RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJ0eAEGdmVyaWZ5AAQPdGFyZ2V0UHVibGljS2V5BAckbWF0Y2gwCQEWbWFuYWdlclB1YmxpY0tleU9yVW5pdAADCQABAgUHJG1hdGNoMAIKQnl0ZVZlY3RvcgQCcGsFByRtYXRjaDAFAnBrAwkAAQIFByRtYXRjaDACBFVuaXQIBQJ0eA9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUPdGFyZ2V0UHVibGljS2V5qO9FCw==", "chainId": 84, "height": 2408829, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: B9fgfpEGSrfgGcHD1vzBkj6YqzZRxRvfzm1GY2VurVLa Next: 3XNuPqrLxCykM5YCU9L5mZmYiGrmPeEwC9g3UQwpDNG9 Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let a = "__"
5+
6+let b = toBigInt(100000)
7+
8+func c (d) = valueOrErrorMessage(getString(this, d), ("No data for this.key=" + d))
49
510
11+let e = throw("Pool disabled")
12+
13+let f = throw("Pool is not exist")
14+
15+let g = throw("Slippage is too big")
16+
17+func h () = "%s__managerPublicKey"
18+
19+
20+func i () = "%s__pendingManagerPublicKey"
21+
22+
23+func j () = "%s__factoryContract"
24+
25+
26+let k = addressFromStringValue(c(j()))
27+
28+func l () = makeString(["%s", "feeLiquidityContractAddress"], a)
29+
30+
31+func m () = makeString(["%d", "feeLiquidity"], a)
32+
33+
34+func n () = makeString(["%d", "protocolFee"], a)
35+
36+
37+func o (p) = {
38+ let q = p
39+ if ($isInstanceOf(q, "Int"))
40+ then {
41+ let r = q
42+ r
43+ }
44+ else throw("fail to cast into Int")
45+ }
46+
47+
48+func s (t,u) = makeString(["%d%d", toString(t), toString(u)], a)
49+
50+
51+func v () = {
52+ let q = getString(h())
53+ if ($isInstanceOf(q, "String"))
54+ then {
55+ let w = q
56+ fromBase58String(w)
57+ }
58+ else if ($isInstanceOf(q, "Unit"))
59+ then unit
60+ else throw("Match error")
61+ }
62+
63+
64+func x () = {
65+ let q = getString(i())
66+ if ($isInstanceOf(q, "String"))
67+ then {
68+ let w = q
69+ fromBase58String(w)
70+ }
71+ else if ($isInstanceOf(q, "Unit"))
72+ then unit
73+ else throw("Match error")
74+ }
75+
76+
77+func y (z) = {
78+ let q = v()
79+ if ($isInstanceOf(q, "ByteVector"))
80+ then {
81+ let A = q
82+ (z.callerPublicKey == A)
83+ }
84+ else if ($isInstanceOf(q, "Unit"))
85+ then (z.caller == this)
86+ else throw("Match error")
87+ }
88+
89+
90+func B (z) = if (y(z))
91+ then true
92+ else throw("permission denied")
93+
94+
95+@Callable(z)
96+func constructor (C,D,E,j) = {
97+ let F = B(z)
98+ if ((F == F))
99+ then [StringEntry(l(), E), IntegerEntry(m(), D), IntegerEntry(n(), C), StringEntry(j(), j)]
100+ else throw("Strict value is not equal to itself.")
101+ }
102+
103+
104+
105+@Callable(z)
106+func swap (G,H,I) = {
107+ let J = value(z.payments[0])
108+ let K = value(J.assetId)
109+ let L = value(J.amount)
110+ let M = value(getInteger(n()))
111+ let N = fraction(toBigInt(L), toBigInt(M), b)
112+ let D = fraction(toBigInt(L), toBigInt(M), b)
113+ let O = (toBigInt(L) - N)
114+ let P = (O - D)
115+ let Q = [if ((size(z.payments) == 1))
116+ then true
117+ else throw("exactly 1 payment are expected")]
118+ if ((Q == Q))
119+ then {
120+ let R = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [K, H], nil)
121+ let S = invoke(k, "getLpAssetFromPoolAssetsREADONLY", [H, K], nil)
122+ let T = if ((R != unit))
123+ then {
124+ let U = false
125+ let V = invoke(k, "getPoolAddressFromLpAssetREADONLY", [R], nil)
126+ $Tuple2(U, V)
127+ }
128+ else if ((S != unit))
129+ then {
130+ let U = true
131+ let V = invoke(k, "getPoolAddressFromLpAssetREADONLY", [S], nil)
132+ $Tuple2(U, V)
133+ }
134+ else {
135+ let U = true
136+ let V = ""
137+ $Tuple2(U, V)
138+ }
139+ let U = T._1
140+ let V = T._2
141+ let W = [if ((V != ""))
142+ then true
143+ else f]
144+ if ((W == W))
145+ then {
146+ let X = {
147+ let Y = invoke(k, "isPoolOneTokenOperationsDisabledREADONLY", [V], nil)
148+ if ($isInstanceOf(Y, "Boolean"))
149+ then Y
150+ else throw(($getType(Y) + " couldn't be cast to Boolean"))
151+ }
152+ let F = [if (X)
153+ then true
154+ else e]
155+ if ((F == F))
156+ then {
157+ let Z = addressFromStringValue(valueOrElse(V, ""))
158+ let aa = invoke(Z, "calculateAmountOutForSwapAndSendTokens", [P, U, G, I], [AttachedPayment(K, toInt(O))])
159+ $Tuple2(nil, true)
160+ }
161+ else throw("Strict value is not equal to itself.")
162+ }
163+ else throw("Strict value is not equal to itself.")
164+ }
165+ else throw("Strict value is not equal to itself.")
166+ }
167+
168+
169+
170+@Callable(z)
171+func setManager (ab) = {
172+ let ac = B(z)
173+ if ((ac == ac))
174+ then {
175+ let ad = fromBase58String(ab)
176+ if ((ad == ad))
177+ then [StringEntry(i(), ab)]
178+ else throw("Strict value is not equal to itself.")
179+ }
180+ else throw("Strict value is not equal to itself.")
181+ }
182+
183+
184+
185+@Callable(z)
186+func confirmManager () = {
187+ let ae = x()
188+ let af = if (isDefined(ae))
189+ then true
190+ else throw("no pending manager")
191+ if ((af == af))
192+ then {
193+ let ag = if ((z.callerPublicKey == value(ae)))
194+ then true
195+ else throw("you are not pending manager")
196+ if ((ag == ag))
197+ then [StringEntry(h(), toBase58String(value(ae))), DeleteEntry(i())]
198+ else throw("Strict value is not equal to itself.")
199+ }
200+ else throw("Strict value is not equal to itself.")
201+ }
202+
203+
204+@Verifier(ah)
205+func ai () = {
206+ let aj = {
207+ let q = v()
208+ if ($isInstanceOf(q, "ByteVector"))
209+ then {
210+ let A = q
211+ A
212+ }
213+ else if ($isInstanceOf(q, "Unit"))
214+ then ah.senderPublicKey
215+ else throw("Match error")
216+ }
217+ sigVerify(ah.bodyBytes, ah.proofs[0], aj)
218+ }
6219

github/deemru/w8io/169f3d6 
50.00 ms