tx · CwyAVDxn6WL1X21cybqzDytguZjGTVjYp4WBHE4uzfTM 3MxUSyFKcKESBg3Nf4Gwj1Qn15Jr9NTJE1a: -0.01500000 Waves 2022.08.31 11:31 [2208389] smart account 3MxUSyFKcKESBg3Nf4Gwj1Qn15Jr9NTJE1a > SELF 0.00000000 Waves
{ "type": 13, "id": "CwyAVDxn6WL1X21cybqzDytguZjGTVjYp4WBHE4uzfTM", "fee": 1500000, "feeAssetId": null, "timestamp": 1661934668188, "version": 2, "chainId": 84, "sender": "3MxUSyFKcKESBg3Nf4Gwj1Qn15Jr9NTJE1a", "senderPublicKey": "Gz38AcUCTd55TqzHQABThf42Sb9M2s8VmPT4u68hNZhA", "proofs": [ "3UutEpTWAJgzuhYeTLbz4FYu2EFs7TJdfkiUrC5QQYeDMDkvgPhsCW68sUjf15CQagMmJFwvcD7KWrZEcHtiBES8" ], "script": "base64:AAIFAAAAAAAAACwIAhIDCgEIEgMKAQgSABIDCgEYEggKBgEBAQEIARIDCgEIEgMKAQgSAwoBCAAAACMAAAAAA1NFUAIAAAACX18AAAAABUVNUFRZAgAAAAAAAAAADmlkeFBvb2xBZGRyZXNzAAAAAAAAAAABAAAAAAlpZHhMUEFzSWQAAAAAAAAAAAMAAAAACWlkeEFtQXNJZAAAAAAAAAAABAAAAAAJaWR4UHJBc0lkAAAAAAAAAAAFAAAAAA9pZHhGYWN0U3Rha0NudHIAAAAAAAAAAAEAAAAABWRlbGF5AgAAAAklc19fZGVsYXkBAAAAC2tleUZhY3RDbnRyAAAAAAIAAAATJXNfX2ZhY3RvcnlDb250cmFjdAEAAAATa2V5TWFuYWdlclB1YmxpY0tleQAAAAACAAAAFCVzX19tYW5hZ2VyUHVibGljS2V5AQAAABprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQAAAAACAAAAGyVzX19wZW5kaW5nTWFuYWdlclB1YmxpY0tleQEAAAALa2V5UG9vbEFkZHIAAAAAAgAAAA8lc19fcG9vbEFkZHJlc3MBAAAAC2tle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dFRyYW5zYWN0aW9uBAAAAAFzBQAAAAckbWF0Y2gwBAAAAAduZXdIYXNoCQAB9gAAAAEJAQAAAAV2YWx1ZQAAAAEIBQAAAAFzAAAABnNjcmlwdAQAAAALYWxsb3dlZEhhc2gJAAJbAAAAAQkBAAAABXZhbHVlAAAAAQkABB0AAAACBQAAAA9mYWN0b3J5Q29udHJhY3QJAQAAACFrZXlBbGxvd2VkTHBTdGFibGVBZGRvblNjcmlwdEhhc2gAAAAABAAAAAtjdXJyZW50SGFzaAkAA/EAAAABBQAAAAR0aGlzAwMJAAAAAAAAAgUAAAALYWxsb3dlZEhhc2gFAAAAB25ld0hhc2gJAQAAAAIhPQAAAAIFAAAAC2N1cnJlbnRIYXNoBQAAAAduZXdIYXNoBwYJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA90YXJnZXRQdWJsaWNLZXkJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA90YXJnZXRQdWJsaWNLZXkEAUwr", "height": 2208389, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 14fvgQJZhmYMBEVGJeUNLLLtJkNy4W5CbDMCvxbELPZX Next: H13XSQEbXpkYhnqjJZ6CGdVADGXRpy5sAGxZfggtkmaf Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let EMPTY = "" | |
7 | 7 | ||
8 | 8 | let idxPoolAddress = 1 | |
9 | 9 | ||
10 | 10 | let idxLPAsId = 3 | |
11 | 11 | ||
12 | 12 | let idxAmAsId = 4 | |
13 | 13 | ||
14 | 14 | let idxPrAsId = 5 | |
15 | 15 | ||
16 | 16 | let idxFactStakCntr = 1 | |
17 | 17 | ||
18 | 18 | let delay = "%s__delay" | |
19 | 19 | ||
20 | 20 | func keyFactCntr () = "%s__factoryContract" | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func keyPoolAddr () = "%s__poolAddress" | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func keyAmtAsset () = "%s__amountAsset" | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func keyPriceAsset () = "%s__priceAsset" | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func keyAdminPubKeys () = "%s__adminPubKeys" | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func keyAmp () = "%s__amp" | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func keyAmpHistory (height) = ("%s%d__amp__" + toString(height)) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func lastGetOneTknCall (caller) = makeString(["%s%s__lastGetOneTknCall", caller], SEP) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func lastPutOneTknCall (caller) = makeString(["%s%s__lastPutOneTknCall", caller], SEP) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func keyFactoryConfig () = "%s__factoryConfig" | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func keyPoolConfig (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config") | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func keyMappingsBaseAsset2internalId (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func keyAllowedLpStableAddonScriptHash () = "%s__allowedLpStableAddonScriptHash" | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func getStringOrFail (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func getIntOrFail (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | let poolContract = addressFromStringValue(getStringOrFail(this, keyPoolAddr())) | |
72 | 72 | ||
73 | 73 | let factoryContract = addressFromStringValue(getStringOrFail(poolContract, keyFactCntr())) | |
74 | 74 | ||
75 | 75 | func getPoolConfig () = { | |
76 | 76 | let amtAs = getStringOrFail(poolContract, keyAmtAsset()) | |
77 | 77 | let priceAs = getStringOrFail(poolContract, keyPriceAsset()) | |
78 | 78 | let iPriceAs = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAs)) | |
79 | 79 | let iAmtAs = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAs)) | |
80 | 80 | split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAs), toString(iPriceAs))), SEP) | |
81 | 81 | } | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
88 | 88 | case s: String => | |
89 | 89 | fromBase58String(s) | |
90 | 90 | case _: Unit => | |
91 | 91 | unit | |
92 | 92 | case _ => | |
93 | 93 | throw("Match error") | |
94 | 94 | } | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
98 | 98 | case s: String => | |
99 | 99 | fromBase58String(s) | |
100 | 100 | case _: Unit => | |
101 | 101 | unit | |
102 | 102 | case _ => | |
103 | 103 | throw("Match error") | |
104 | 104 | } | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func mustManager (i) = { | |
108 | 108 | let pd = throw("Permission denied") | |
109 | 109 | match managerPublicKeyOrUnit() { | |
110 | 110 | case pk: ByteVector => | |
111 | 111 | if ((i.callerPublicKey == pk)) | |
112 | 112 | then true | |
113 | 113 | else pd | |
114 | 114 | case _: Unit => | |
115 | 115 | if ((i.caller == this)) | |
116 | 116 | then true | |
117 | 117 | else pd | |
118 | 118 | case _ => | |
119 | 119 | throw("Match error") | |
120 | 120 | } | |
121 | 121 | } | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func getAdmins () = match getString(keyAdminPubKeys()) { | |
125 | 125 | case s: String => | |
126 | 126 | if ((size(s) == 0)) | |
127 | 127 | then nil | |
128 | 128 | else split(s, SEP) | |
129 | 129 | case _ => | |
130 | 130 | nil | |
131 | 131 | } | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func mustAdmin (i) = if (containsElement(getAdmins(), toBase58String(i.callerPublicKey))) | |
135 | 135 | then true | |
136 | 136 | else mustManager(i) | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func mustPool (i) = if ((i.caller == poolContract)) | |
140 | 140 | then true | |
141 | 141 | else throw("caller must be the pool") | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | @Callable(i) | |
145 | 145 | func constructor (poolAddress) = { | |
146 | 146 | let checkCaller = mustManager(i) | |
147 | 147 | if ((checkCaller == checkCaller)) | |
148 | 148 | then [StringEntry(keyPoolAddr(), poolAddress)] | |
149 | 149 | else throw("Strict value is not equal to itself.") | |
150 | 150 | } | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | ||
154 | 154 | @Callable(i) | |
155 | 155 | func setManager (pendingManagerPublicKey) = { | |
156 | 156 | let checkCaller = mustManager(i) | |
157 | 157 | if ((checkCaller == checkCaller)) | |
158 | 158 | then { | |
159 | 159 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
160 | 160 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
161 | 161 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
162 | 162 | else throw("Strict value is not equal to itself.") | |
163 | 163 | } | |
164 | 164 | else throw("Strict value is not equal to itself.") | |
165 | 165 | } | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | ||
169 | 169 | @Callable(i) | |
170 | 170 | func confirmManager () = { | |
171 | 171 | let pm = pendingManagerPublicKeyOrUnit() | |
172 | 172 | let hasPM = if (isDefined(pm)) | |
173 | 173 | then true | |
174 | 174 | else throw("No pending manager") | |
175 | 175 | if ((hasPM == hasPM)) | |
176 | 176 | then { | |
177 | 177 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
178 | 178 | then true | |
179 | 179 | else throw("You are not pending manager") | |
180 | 180 | if ((checkPM == checkPM)) | |
181 | 181 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
182 | 182 | else throw("Strict value is not equal to itself.") | |
183 | 183 | } | |
184 | 184 | else throw("Strict value is not equal to itself.") | |
185 | 185 | } | |
186 | 186 | ||
187 | 187 | ||
188 | 188 | ||
189 | 189 | @Callable(i) | |
190 | 190 | func setAdmins (adminPubKeys) = { | |
191 | 191 | let checkCaller = mustManager(i) | |
192 | 192 | if ((checkCaller == checkCaller)) | |
193 | 193 | then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))] | |
194 | 194 | else throw("Strict value is not equal to itself.") | |
195 | 195 | } | |
196 | 196 | ||
197 | 197 | ||
198 | 198 | ||
199 | 199 | @Callable(i) | |
200 | 200 | func unstakeAndGetOneTkn (amount,exchResult,notUsed,outAmount,outAssetId,slippage) = { | |
201 | 201 | let checkPayments = if ((size(i.payments) != 0)) | |
202 | 202 | then throw("No pmnts expd") | |
203 | 203 | else true | |
204 | 204 | if ((checkPayments == checkPayments)) | |
205 | 205 | then { | |
206 | 206 | let cfg = getPoolConfig() | |
207 | 207 | let factoryCfg = getFactoryConfig() | |
208 | 208 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
209 | 209 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
210 | 210 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
211 | 211 | if ((unstakeInv == unstakeInv)) | |
212 | 212 | then { | |
213 | 213 | let getOneTkn = reentrantInvoke(poolContract, "getOneTkn", [exchResult, notUsed, outAmount, outAssetId, slippage], [AttachedPayment(lpAssetId, amount)]) | |
214 | 214 | if ((getOneTkn == getOneTkn)) | |
215 | 215 | then nil | |
216 | 216 | else throw("Strict value is not equal to itself.") | |
217 | 217 | } | |
218 | 218 | else throw("Strict value is not equal to itself.") | |
219 | 219 | } | |
220 | 220 | else throw("Strict value is not equal to itself.") | |
221 | 221 | } | |
222 | 222 | ||
223 | 223 | ||
224 | 224 | ||
225 | 225 | @Callable(i) | |
226 | 226 | func setAmp (amp) = { | |
227 | 227 | let checkCaller = mustAdmin(i) | |
228 | 228 | if ((checkCaller == checkCaller)) | |
229 | 229 | then { | |
230 | 230 | let res1 = invoke(poolContract, "setS", [keyAmp(), amp], nil) | |
231 | 231 | let res2 = invoke(poolContract, "setS", [keyAmpHistory(height), amp], nil) | |
232 | 232 | $Tuple2(nil, $Tuple2(res1, res2)) | |
233 | 233 | } | |
234 | 234 | else throw("Strict value is not equal to itself.") | |
235 | 235 | } | |
236 | 236 | ||
237 | 237 | ||
238 | 238 | ||
239 | 239 | @Callable(i) | |
240 | 240 | func ensureCanGetOneTkn (caller) = { | |
241 | 241 | let checkCaller = mustPool(i) | |
242 | 242 | if ((checkCaller == checkCaller)) | |
243 | 243 | then { | |
244 | 244 | let ensureCanPut = match getInteger(poolContract, lastPutOneTknCall(caller)) { | |
245 | 245 | case int: Int => | |
246 | 246 | let permittedHeight = (int + value(getInteger(poolContract, delay))) | |
247 | 247 | let isReadyforPutOneTkn = (height >= permittedHeight) | |
248 | 248 | let needBlocks = (permittedHeight - height) | |
249 | 249 | if (isReadyforPutOneTkn) | |
250 | 250 | then true | |
251 | 251 | else throw(makeString(["you should wait", toString(needBlocks), "blocks more to perform the action"], " ")) | |
252 | 252 | case _ => | |
253 | 253 | true | |
254 | 254 | } | |
255 | 255 | if ((ensureCanPut == ensureCanPut)) | |
256 | 256 | then { | |
257 | 257 | let ensureCanGet = match getInteger(poolContract, lastGetOneTknCall(caller)) { | |
258 | 258 | case int: Int => | |
259 | 259 | let permittedHeight = (int + value(getInteger(poolContract, delay))) | |
260 | 260 | let isReadyforGetOneTkn = (height >= permittedHeight) | |
261 | 261 | let needBlocks = (permittedHeight - height) | |
262 | 262 | if (isReadyforGetOneTkn) | |
263 | 263 | then true | |
264 | 264 | else throw(makeString(["you should wait", toString(needBlocks), "blocks more to perform the action"], " ")) | |
265 | 265 | case _ => | |
266 | 266 | true | |
267 | 267 | } | |
268 | 268 | if ((ensureCanGet == ensureCanGet)) | |
269 | 269 | then { | |
270 | 270 | let setI = invoke(poolContract, "setI", [lastPutOneTknCall(caller), height], nil) | |
271 | 271 | if ((setI == setI)) | |
272 | 272 | then nil | |
273 | 273 | else throw("Strict value is not equal to itself.") | |
274 | 274 | } | |
275 | 275 | else throw("Strict value is not equal to itself.") | |
276 | 276 | } | |
277 | 277 | else throw("Strict value is not equal to itself.") | |
278 | 278 | } | |
279 | 279 | else throw("Strict value is not equal to itself.") | |
280 | 280 | } | |
281 | 281 | ||
282 | 282 | ||
283 | 283 | ||
284 | 284 | @Callable(i) | |
285 | 285 | func ensureCanPutOneTkn (caller) = { | |
286 | 286 | let checkCaller = mustPool(i) | |
287 | 287 | if ((checkCaller == checkCaller)) | |
288 | 288 | then { | |
289 | 289 | let ensureCanPut = match getInteger(poolContract, lastPutOneTknCall(caller)) { | |
290 | 290 | case int: Int => | |
291 | 291 | let permittedHeight = (int + value(getInteger(poolContract, delay))) | |
292 | 292 | let isReadyforPutOneTkn = (height >= permittedHeight) | |
293 | 293 | let needBlocks = (permittedHeight - height) | |
294 | 294 | if (isReadyforPutOneTkn) | |
295 | 295 | then true | |
296 | 296 | else throw(makeString(["you should wait", toString(needBlocks), "blocks more to perform the action"], " ")) | |
297 | 297 | case _ => | |
298 | 298 | true | |
299 | 299 | } | |
300 | 300 | if ((ensureCanPut == ensureCanPut)) | |
301 | 301 | then { | |
302 | 302 | let ensureCanGet = match getInteger(poolContract, lastGetOneTknCall(caller)) { | |
303 | 303 | case int: Int => | |
304 | 304 | let permittedHeight = (int + value(getInteger(poolContract, delay))) | |
305 | 305 | let isReadyforGetOneTkn = (height >= permittedHeight) | |
306 | 306 | let needBlocks = (permittedHeight - height) | |
307 | 307 | if (isReadyforGetOneTkn) | |
308 | 308 | then true | |
309 | 309 | else throw(makeString(["you should wait", toString(needBlocks), "blocks more to perform the action"], " ")) | |
310 | 310 | case _ => | |
311 | 311 | true | |
312 | 312 | } | |
313 | 313 | if ((ensureCanGet == ensureCanGet)) | |
314 | 314 | then { | |
315 | 315 | let setI = invoke(poolContract, "setI", [lastPutOneTknCall(caller), height], nil) | |
316 | 316 | if ((setI == setI)) | |
317 | 317 | then nil | |
318 | 318 | else throw("Strict value is not equal to itself.") | |
319 | 319 | } | |
320 | 320 | else throw("Strict value is not equal to itself.") | |
321 | 321 | } | |
322 | 322 | else throw("Strict value is not equal to itself.") | |
323 | 323 | } | |
324 | 324 | else throw("Strict value is not equal to itself.") | |
325 | 325 | } | |
326 | 326 | ||
327 | 327 | ||
328 | 328 | @Verifier(tx) | |
329 | 329 | func verify () = { | |
330 | 330 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
331 | 331 | case pk: ByteVector => | |
332 | 332 | pk | |
333 | 333 | case _: Unit => | |
334 | 334 | tx.senderPublicKey | |
335 | 335 | case _ => | |
336 | 336 | throw("Match error") | |
337 | 337 | } | |
338 | 338 | match tx { | |
339 | 339 | case s: SetScriptTransaction => | |
340 | 340 | let newHash = blake2b256(value(s.script)) | |
341 | 341 | let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpStableAddonScriptHash()))) | |
342 | 342 | let currentHash = scriptHash(this) | |
343 | 343 | if (if ((allowedHash == newHash)) | |
344 | 344 | then (currentHash != newHash) | |
345 | 345 | else false) | |
346 | 346 | then true | |
347 | 347 | else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
348 | 348 | case _ => | |
349 | 349 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
350 | 350 | } | |
351 | 351 | } | |
352 | 352 |
github/deemru/w8io/169f3d6 32.79 ms ◑