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