tx · 8ejagzni4ZP8hdKbfST6QzK9ZvUgYoDjpHGNPqeJDwb4

3N8bnD2caKnxdcTqvrJUEkDe3XebgfwWjSV:  -0.01300000 Waves

2022.09.02 13:01 [2211359] smart account 3N8bnD2caKnxdcTqvrJUEkDe3XebgfwWjSV > SELF 0.00000000 Waves

{ "type": 13, "id": "8ejagzni4ZP8hdKbfST6QzK9ZvUgYoDjpHGNPqeJDwb4", "fee": 1300000, "feeAssetId": null, "timestamp": 1662112895378, "version": 1, "sender": "3N8bnD2caKnxdcTqvrJUEkDe3XebgfwWjSV", "senderPublicKey": "8KXPjDuC8ffL9qjNuDBLnkvJKbMojhZYcnm2o75UCyun", "proofs": [ "npaAjxRxiPPJGgvbMFmtsmMj9kZ4TMvySL9R1U9wGeWw4iyoBDavZK1Nepaj75Yby2jYmA9vf7ZKezhdu9uiMxQ" ], "script": "base64:AAIFAAAAAAAAACIIAhIDCgEIEgMKAQgSABIDCgEYEggKBgEBAQEIARIDCgEIAAAAIAAAAAADU0VQAgAAAAJfXwAAAAAFRU1QVFkCAAAAAAAAAAAOaWR4UG9vbEFkZHJlc3MAAAAAAAAAAAEAAAAACWlkeExQQXNJZAAAAAAAAAAAAwAAAAAJaWR4QW1Bc0lkAAAAAAAAAAAEAAAAAAlpZHhQckFzSWQAAAAAAAAAAAUAAAAAD2lkeEZhY3RTdGFrQ250cgAAAAAAAAAAAQEAAAALa2V5RmFjdENudHIAAAAAAgAAABMlc19fZmFjdG9yeUNvbnRyYWN0AQAAABNrZXlNYW5hZ2VyUHVibGljS2V5AAAAAAIAAAAUJXNfX21hbmFnZXJQdWJsaWNLZXkBAAAAGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAAAAAIAAAAbJXNfX3BlbmRpbmdNYW5hZ2VyUHVibGljS2V5AQAAAAtrZXlQb29sQWRkcgAAAAACAAAADyVzX19wb29sQWRkcmVzcwEAAAALa2V5QW10QXNzZXQAAAAAAgAAAA8lc19fYW1vdW50QXNzZXQBAA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IYXNoAAAAAAQAAAALY3VycmVudEhhc2gJAAPxAAAAAQUAAAAEdGhpcwMDCQAAAAAAAAIFAAAAC2FsbG93ZWRIYXNoBQAAAAduZXdIYXNoCQEAAAACIT0AAAACBQAAAAtjdXJyZW50SGFzaAUAAAAHbmV3SGFzaAcGCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAPdGFyZ2V0UHVibGljS2V5CQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAPdGFyZ2V0UHVibGljS2V51LJ/2g==", "chainId": 84, "height": 2211359, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8ymj6hzeVJHuMzMvKGZC62TPWBytjr1WRWoRtavBd6WH Next: ANasxk5k8isdGPnbR8LzoQmwtqMKdpqMtowKow5KqHGb Diff:
OldNewDifferences
1414 let idxPrAsId = 5
1515
1616 let idxFactStakCntr = 1
17-
18-let delay = "%s__delay"
1917
2018 func keyFactCntr () = "%s__factoryContract"
2119
4240
4341
4442 func keyAmpHistory (height) = ("%s%d__amp__" + toString(height))
45-
46-
47-func lastGetOneTknCall (caller) = makeString(["%s%s__lastGetOneTknCall", caller], SEP)
48-
49-
50-func lastPutOneTknCall (caller) = makeString(["%s%s__lastPutOneTknCall", caller], SEP)
5143
5244
5345 func keyFactoryConfig () = "%s__factoryConfig"
210202 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
211203 if ((unstakeInv == unstakeInv))
212204 then {
213- let getOneTkn = reentrantInvoke(poolContract, "getOneTkn", [exchResult, notUsed, outAmount, outAssetId, slippage], [AttachedPayment(lpAssetId, amount)])
205+ let getOneTkn = invoke(poolContract, "getOneTkn", [exchResult, notUsed, outAmount, outAssetId, slippage], [AttachedPayment(lpAssetId, amount)])
214206 if ((getOneTkn == getOneTkn))
215207 then nil
216208 else throw("Strict value is not equal to itself.")
230222 let res1 = invoke(poolContract, "setS", [keyAmp(), amp], nil)
231223 let res2 = invoke(poolContract, "setS", [keyAmpHistory(height), amp], nil)
232224 $Tuple2(nil, $Tuple2(res1, res2))
233- }
234- else throw("Strict value is not equal to itself.")
235- }
236-
237-
238-
239-@Callable(i)
240-func ensureCanGetOneTkn (caller) = {
241- let checkCaller = mustPool(i)
242- if ((checkCaller == checkCaller))
243- then {
244- let ensureCanPut = match getInteger(poolContract, lastPutOneTknCall(caller)) {
245- case int: Int =>
246- let permittedHeight = (int + value(getInteger(poolContract, delay)))
247- let isReadyforPutOneTkn = (height >= permittedHeight)
248- let needBlocks = (permittedHeight - height)
249- if (isReadyforPutOneTkn)
250- then true
251- else throw(makeString(["you should wait", toString(needBlocks), "blocks more to perform the action"], " "))
252- case _ =>
253- true
254- }
255- if ((ensureCanPut == ensureCanPut))
256- then {
257- let ensureCanGet = match getInteger(poolContract, lastGetOneTknCall(caller)) {
258- case int: Int =>
259- let permittedHeight = (int + value(getInteger(poolContract, delay)))
260- let isReadyforGetOneTkn = (height >= permittedHeight)
261- let needBlocks = (permittedHeight - height)
262- if (isReadyforGetOneTkn)
263- then true
264- else throw(makeString(["you should wait", toString(needBlocks), "blocks more to perform the action"], " "))
265- case _ =>
266- true
267- }
268- if ((ensureCanGet == ensureCanGet))
269- then {
270- let setI = invoke(poolContract, "setI", [lastPutOneTknCall(caller), height], nil)
271- if ((setI == setI))
272- then nil
273- else throw("Strict value is not equal to itself.")
274- }
275- else throw("Strict value is not equal to itself.")
276- }
277- else throw("Strict value is not equal to itself.")
278- }
279- else throw("Strict value is not equal to itself.")
280- }
281-
282-
283-
284-@Callable(i)
285-func ensureCanPutOneTkn (caller) = {
286- let checkCaller = mustPool(i)
287- if ((checkCaller == checkCaller))
288- then {
289- let ensureCanPut = match getInteger(poolContract, lastPutOneTknCall(caller)) {
290- case int: Int =>
291- let permittedHeight = (int + value(getInteger(poolContract, delay)))
292- let isReadyforPutOneTkn = (height >= permittedHeight)
293- let needBlocks = (permittedHeight - height)
294- if (isReadyforPutOneTkn)
295- then true
296- else throw(makeString(["you should wait", toString(needBlocks), "blocks more to perform the action"], " "))
297- case _ =>
298- true
299- }
300- if ((ensureCanPut == ensureCanPut))
301- then {
302- let ensureCanGet = match getInteger(poolContract, lastGetOneTknCall(caller)) {
303- case int: Int =>
304- let permittedHeight = (int + value(getInteger(poolContract, delay)))
305- let isReadyforGetOneTkn = (height >= permittedHeight)
306- let needBlocks = (permittedHeight - height)
307- if (isReadyforGetOneTkn)
308- then true
309- else throw(makeString(["you should wait", toString(needBlocks), "blocks more to perform the action"], " "))
310- case _ =>
311- true
312- }
313- if ((ensureCanGet == ensureCanGet))
314- then {
315- let setI = invoke(poolContract, "setI", [lastPutOneTknCall(caller), height], nil)
316- if ((setI == setI))
317- then nil
318- else throw("Strict value is not equal to itself.")
319- }
320- else throw("Strict value is not equal to itself.")
321- }
322- else throw("Strict value is not equal to itself.")
323225 }
324226 else throw("Strict value is not equal to itself.")
325227 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let EMPTY = ""
77
88 let idxPoolAddress = 1
99
1010 let idxLPAsId = 3
1111
1212 let idxAmAsId = 4
1313
1414 let idxPrAsId = 5
1515
1616 let idxFactStakCntr = 1
17-
18-let delay = "%s__delay"
1917
2018 func keyFactCntr () = "%s__factoryContract"
2119
2220
2321 func keyManagerPublicKey () = "%s__managerPublicKey"
2422
2523
2624 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
2725
2826
2927 func keyPoolAddr () = "%s__poolAddress"
3028
3129
3230 func keyAmtAsset () = "%s__amountAsset"
3331
3432
3533 func keyPriceAsset () = "%s__priceAsset"
3634
3735
3836 func keyAdminPubKeys () = "%s__adminPubKeys"
3937
4038
4139 func keyAmp () = "%s__amp"
4240
4341
4442 func keyAmpHistory (height) = ("%s%d__amp__" + toString(height))
45-
46-
47-func lastGetOneTknCall (caller) = makeString(["%s%s__lastGetOneTknCall", caller], SEP)
48-
49-
50-func lastPutOneTknCall (caller) = makeString(["%s%s__lastPutOneTknCall", caller], SEP)
5143
5244
5345 func keyFactoryConfig () = "%s__factoryConfig"
5446
5547
5648 func keyPoolConfig (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config")
5749
5850
5951 func keyMappingsBaseAsset2internalId (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
6052
6153
6254 func keyAllowedLpStableAddonScriptHash () = "%s__allowedLpStableAddonScriptHash"
6355
6456
6557 func getStringOrFail (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
6658
6759
6860 func getIntOrFail (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
6961
7062
7163 let poolContract = addressFromStringValue(getStringOrFail(this, keyPoolAddr()))
7264
7365 let factoryContract = addressFromStringValue(getStringOrFail(poolContract, keyFactCntr()))
7466
7567 func getPoolConfig () = {
7668 let amtAs = getStringOrFail(poolContract, keyAmtAsset())
7769 let priceAs = getStringOrFail(poolContract, keyPriceAsset())
7870 let iPriceAs = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAs))
7971 let iAmtAs = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAs))
8072 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAs), toString(iPriceAs))), SEP)
8173 }
8274
8375
8476 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
8577
8678
8779 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
8880 case s: String =>
8981 fromBase58String(s)
9082 case _: Unit =>
9183 unit
9284 case _ =>
9385 throw("Match error")
9486 }
9587
9688
9789 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
9890 case s: String =>
9991 fromBase58String(s)
10092 case _: Unit =>
10193 unit
10294 case _ =>
10395 throw("Match error")
10496 }
10597
10698
10799 func mustManager (i) = {
108100 let pd = throw("Permission denied")
109101 match managerPublicKeyOrUnit() {
110102 case pk: ByteVector =>
111103 if ((i.callerPublicKey == pk))
112104 then true
113105 else pd
114106 case _: Unit =>
115107 if ((i.caller == this))
116108 then true
117109 else pd
118110 case _ =>
119111 throw("Match error")
120112 }
121113 }
122114
123115
124116 func getAdmins () = match getString(keyAdminPubKeys()) {
125117 case s: String =>
126118 if ((size(s) == 0))
127119 then nil
128120 else split(s, SEP)
129121 case _ =>
130122 nil
131123 }
132124
133125
134126 func mustAdmin (i) = if (containsElement(getAdmins(), toBase58String(i.callerPublicKey)))
135127 then true
136128 else mustManager(i)
137129
138130
139131 func mustPool (i) = if ((i.caller == poolContract))
140132 then true
141133 else throw("caller must be the pool")
142134
143135
144136 @Callable(i)
145137 func constructor (poolAddress) = {
146138 let checkCaller = mustManager(i)
147139 if ((checkCaller == checkCaller))
148140 then [StringEntry(keyPoolAddr(), poolAddress)]
149141 else throw("Strict value is not equal to itself.")
150142 }
151143
152144
153145
154146 @Callable(i)
155147 func setManager (pendingManagerPublicKey) = {
156148 let checkCaller = mustManager(i)
157149 if ((checkCaller == checkCaller))
158150 then {
159151 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
160152 if ((checkManagerPublicKey == checkManagerPublicKey))
161153 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
162154 else throw("Strict value is not equal to itself.")
163155 }
164156 else throw("Strict value is not equal to itself.")
165157 }
166158
167159
168160
169161 @Callable(i)
170162 func confirmManager () = {
171163 let pm = pendingManagerPublicKeyOrUnit()
172164 let hasPM = if (isDefined(pm))
173165 then true
174166 else throw("No pending manager")
175167 if ((hasPM == hasPM))
176168 then {
177169 let checkPM = if ((i.callerPublicKey == value(pm)))
178170 then true
179171 else throw("You are not pending manager")
180172 if ((checkPM == checkPM))
181173 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
182174 else throw("Strict value is not equal to itself.")
183175 }
184176 else throw("Strict value is not equal to itself.")
185177 }
186178
187179
188180
189181 @Callable(i)
190182 func setAdmins (adminPubKeys) = {
191183 let checkCaller = mustManager(i)
192184 if ((checkCaller == checkCaller))
193185 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
194186 else throw("Strict value is not equal to itself.")
195187 }
196188
197189
198190
199191 @Callable(i)
200192 func unstakeAndGetOneTkn (amount,exchResult,notUsed,outAmount,outAssetId,slippage) = {
201193 let checkPayments = if ((size(i.payments) != 0))
202194 then throw("No pmnts expd")
203195 else true
204196 if ((checkPayments == checkPayments))
205197 then {
206198 let cfg = getPoolConfig()
207199 let factoryCfg = getFactoryConfig()
208200 let lpAssetId = fromBase58String(cfg[idxLPAsId])
209201 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
210202 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
211203 if ((unstakeInv == unstakeInv))
212204 then {
213- let getOneTkn = reentrantInvoke(poolContract, "getOneTkn", [exchResult, notUsed, outAmount, outAssetId, slippage], [AttachedPayment(lpAssetId, amount)])
205+ let getOneTkn = invoke(poolContract, "getOneTkn", [exchResult, notUsed, outAmount, outAssetId, slippage], [AttachedPayment(lpAssetId, amount)])
214206 if ((getOneTkn == getOneTkn))
215207 then nil
216208 else throw("Strict value is not equal to itself.")
217209 }
218210 else throw("Strict value is not equal to itself.")
219211 }
220212 else throw("Strict value is not equal to itself.")
221213 }
222214
223215
224216
225217 @Callable(i)
226218 func setAmp (amp) = {
227219 let checkCaller = mustAdmin(i)
228220 if ((checkCaller == checkCaller))
229221 then {
230222 let res1 = invoke(poolContract, "setS", [keyAmp(), amp], nil)
231223 let res2 = invoke(poolContract, "setS", [keyAmpHistory(height), amp], nil)
232224 $Tuple2(nil, $Tuple2(res1, res2))
233- }
234- else throw("Strict value is not equal to itself.")
235- }
236-
237-
238-
239-@Callable(i)
240-func ensureCanGetOneTkn (caller) = {
241- let checkCaller = mustPool(i)
242- if ((checkCaller == checkCaller))
243- then {
244- let ensureCanPut = match getInteger(poolContract, lastPutOneTknCall(caller)) {
245- case int: Int =>
246- let permittedHeight = (int + value(getInteger(poolContract, delay)))
247- let isReadyforPutOneTkn = (height >= permittedHeight)
248- let needBlocks = (permittedHeight - height)
249- if (isReadyforPutOneTkn)
250- then true
251- else throw(makeString(["you should wait", toString(needBlocks), "blocks more to perform the action"], " "))
252- case _ =>
253- true
254- }
255- if ((ensureCanPut == ensureCanPut))
256- then {
257- let ensureCanGet = match getInteger(poolContract, lastGetOneTknCall(caller)) {
258- case int: Int =>
259- let permittedHeight = (int + value(getInteger(poolContract, delay)))
260- let isReadyforGetOneTkn = (height >= permittedHeight)
261- let needBlocks = (permittedHeight - height)
262- if (isReadyforGetOneTkn)
263- then true
264- else throw(makeString(["you should wait", toString(needBlocks), "blocks more to perform the action"], " "))
265- case _ =>
266- true
267- }
268- if ((ensureCanGet == ensureCanGet))
269- then {
270- let setI = invoke(poolContract, "setI", [lastPutOneTknCall(caller), height], nil)
271- if ((setI == setI))
272- then nil
273- else throw("Strict value is not equal to itself.")
274- }
275- else throw("Strict value is not equal to itself.")
276- }
277- else throw("Strict value is not equal to itself.")
278- }
279- else throw("Strict value is not equal to itself.")
280- }
281-
282-
283-
284-@Callable(i)
285-func ensureCanPutOneTkn (caller) = {
286- let checkCaller = mustPool(i)
287- if ((checkCaller == checkCaller))
288- then {
289- let ensureCanPut = match getInteger(poolContract, lastPutOneTknCall(caller)) {
290- case int: Int =>
291- let permittedHeight = (int + value(getInteger(poolContract, delay)))
292- let isReadyforPutOneTkn = (height >= permittedHeight)
293- let needBlocks = (permittedHeight - height)
294- if (isReadyforPutOneTkn)
295- then true
296- else throw(makeString(["you should wait", toString(needBlocks), "blocks more to perform the action"], " "))
297- case _ =>
298- true
299- }
300- if ((ensureCanPut == ensureCanPut))
301- then {
302- let ensureCanGet = match getInteger(poolContract, lastGetOneTknCall(caller)) {
303- case int: Int =>
304- let permittedHeight = (int + value(getInteger(poolContract, delay)))
305- let isReadyforGetOneTkn = (height >= permittedHeight)
306- let needBlocks = (permittedHeight - height)
307- if (isReadyforGetOneTkn)
308- then true
309- else throw(makeString(["you should wait", toString(needBlocks), "blocks more to perform the action"], " "))
310- case _ =>
311- true
312- }
313- if ((ensureCanGet == ensureCanGet))
314- then {
315- let setI = invoke(poolContract, "setI", [lastPutOneTknCall(caller), height], nil)
316- if ((setI == setI))
317- then nil
318- else throw("Strict value is not equal to itself.")
319- }
320- else throw("Strict value is not equal to itself.")
321- }
322- else throw("Strict value is not equal to itself.")
323225 }
324226 else throw("Strict value is not equal to itself.")
325227 }
326228
327229
328230 @Verifier(tx)
329231 func verify () = {
330232 let targetPublicKey = match managerPublicKeyOrUnit() {
331233 case pk: ByteVector =>
332234 pk
333235 case _: Unit =>
334236 tx.senderPublicKey
335237 case _ =>
336238 throw("Match error")
337239 }
338240 match tx {
339241 case s: SetScriptTransaction =>
340242 let newHash = blake2b256(value(s.script))
341243 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpStableAddonScriptHash())))
342244 let currentHash = scriptHash(this)
343245 if (if ((allowedHash == newHash))
344246 then (currentHash != newHash)
345247 else false)
346248 then true
347249 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
348250 case _ =>
349251 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
350252 }
351253 }
352254

github/deemru/w8io/026f985 
67.68 ms