tx · 8ymj6hzeVJHuMzMvKGZC62TPWBytjr1WRWoRtavBd6WH

3N8bnD2caKnxdcTqvrJUEkDe3XebgfwWjSV:  -0.01500000 Waves

2022.09.02 11:04 [2211254] smart account 3N8bnD2caKnxdcTqvrJUEkDe3XebgfwWjSV > SELF 0.00000000 Waves

{ "type": 13, "id": "8ymj6hzeVJHuMzMvKGZC62TPWBytjr1WRWoRtavBd6WH", "fee": 1500000, "feeAssetId": null, "timestamp": 1662105862730, "version": 2, "chainId": 84, "sender": "3N8bnD2caKnxdcTqvrJUEkDe3XebgfwWjSV", "senderPublicKey": "8KXPjDuC8ffL9qjNuDBLnkvJKbMojhZYcnm2o75UCyun", "proofs": [ "33fzBK5fDRraXg5NbePFgxJWwKjx3wrzhozPvprnYmwBC8NejAYq9G6n2hkqZq94gu2ZJ1PaAUpLYDrhRHftFMA7" ], "script": "base64:AAIFAAAAAAAAACwIAhIDCgEIEgMKAQgSABIDCgEYEggKBgEBAQEIARIDCgEIEgMKAQgSAwoBCAAAACMAAAAAA1NFUAIAAAACX18AAAAABUVNUFRZAgAAAAAAAAAADmlkeFBvb2xBZGRyZXNzAAAAAAAAAAABAAAAAAlpZHhMUEFzSWQAAAAAAAAAAAMAAAAACWlkeEFtQXNJZAAAAAAAAAAABAAAAAAJaWR4UHJBc0lkAAAAAAAAAAAFAAAAAA9pZHhGYWN0U3Rha0NudHIAAAAAAAAAAAEAAAAABWRlbGF5AgAAAAklc19fZGVsYXkBAAAAC2tleUZhY3RDbnRyAAAAAAIAAAATJXNfX2ZhY3RvcnlDb250cmFjdAEAAAATa2V5TWFuYWdlclB1YmxpY0tleQAAAAACAAAAFCVzX19tYW5hZ2VyUHVibGljS2V5AQAAABprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQAAAAACAAAAGyVzX19wZW5kaW5nTWFuYWdlclB1YmxpY0tleQEAAAALa2V5UG9vbEFkZHIAAAAAAgAAAA8lc19fcG9vbEFkZHJlc3MBAAAAC2tleUFtdEFzc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YWN0aW9uBAAAAAFzBQAAAAckbWF0Y2gwBAAAAAduZXdIYXNoCQAB9gAAAAEJAQAAAAV2YWx1ZQAAAAEIBQAAAAFzAAAABnNjcmlwdAQAAAALYWxsb3dlZEhhc2gJAAJbAAAAAQkBAAAABXZhbHVlAAAAAQkABB0AAAACBQAAAA9mYWN0b3J5Q29udHJhY3QJAQAAACFrZXlBbGxvd2VkTHBTdGFibGVBZGRvblNjcmlwdEhhc2gAAAAABAAAAAtjdXJyZW50SGFzaAkAA/EAAAABBQAAAAR0aGlzAwMJAAAAAAAAAgUAAAALYWxsb3dlZEhhc2gFAAAAB25ld0hhc2gJAQAAAAIhPQAAAAIFAAAAC2N1cnJlbnRIYXNoBQAAAAduZXdIYXNoBwYJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA90YXJnZXRQdWJsaWNLZXkJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA90YXJnZXRQdWJsaWNLZXkEAUwr", "height": 2211254, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HGW6D3CpavRxM9jodJHUydkjwT4bSZPe9Q7FqUJwMTMd Next: 8ejagzni4ZP8hdKbfST6QzK9ZvUgYoDjpHGNPqeJDwb4 Diff:
OldNewDifferences
1414 let idxPrAsId = 5
1515
1616 let idxFactStakCntr = 1
17+
18+let delay = "%s__delay"
1719
1820 func keyFactCntr () = "%s__factoryContract"
1921
4244 func keyAmpHistory (height) = ("%s%d__amp__" + toString(height))
4345
4446
47+func lastGetOneTknCall (caller) = makeString(["%s%s__lastGetOneTknCall", caller], SEP)
48+
49+
50+func lastPutOneTknCall (caller) = makeString(["%s%s__lastPutOneTknCall", caller], SEP)
51+
52+
4553 func keyFactoryConfig () = "%s__factoryConfig"
4654
4755
4957
5058
5159 func keyMappingsBaseAsset2internalId (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
60+
61+
62+func keyAllowedLpStableAddonScriptHash () = "%s__allowedLpStableAddonScriptHash"
5263
5364
5465 func getStringOrFail (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
199210 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
200211 if ((unstakeInv == unstakeInv))
201212 then {
202- let getOneTkn = invoke(poolContract, "getOneTkn", [exchResult, notUsed, outAmount, outAssetId, slippage], [AttachedPayment(lpAssetId, amount)])
213+ let getOneTkn = reentrantInvoke(poolContract, "getOneTkn", [exchResult, notUsed, outAmount, outAssetId, slippage], [AttachedPayment(lpAssetId, amount)])
203214 if ((getOneTkn == getOneTkn))
204215 then nil
205216 else throw("Strict value is not equal to itself.")
224235 }
225236
226237
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.")
323+ }
324+ else throw("Strict value is not equal to itself.")
325+ }
326+
327+
227328 @Verifier(tx)
228329 func verify () = {
229330 let targetPublicKey = match managerPublicKeyOrUnit() {
234335 case _ =>
235336 throw("Match error")
236337 }
237- sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
338+ match tx {
339+ case s: SetScriptTransaction =>
340+ let newHash = blake2b256(value(s.script))
341+ let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpStableAddonScriptHash())))
342+ let currentHash = scriptHash(this)
343+ if (if ((allowedHash == newHash))
344+ then (currentHash != newHash)
345+ else false)
346+ then true
347+ else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
348+ case _ =>
349+ sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
350+ }
238351 }
239352
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"
1719
1820 func keyFactCntr () = "%s__factoryContract"
1921
2022
2123 func keyManagerPublicKey () = "%s__managerPublicKey"
2224
2325
2426 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
2527
2628
2729 func keyPoolAddr () = "%s__poolAddress"
2830
2931
3032 func keyAmtAsset () = "%s__amountAsset"
3133
3234
3335 func keyPriceAsset () = "%s__priceAsset"
3436
3537
3638 func keyAdminPubKeys () = "%s__adminPubKeys"
3739
3840
3941 func keyAmp () = "%s__amp"
4042
4143
4244 func keyAmpHistory (height) = ("%s%d__amp__" + toString(height))
4345
4446
47+func lastGetOneTknCall (caller) = makeString(["%s%s__lastGetOneTknCall", caller], SEP)
48+
49+
50+func lastPutOneTknCall (caller) = makeString(["%s%s__lastPutOneTknCall", caller], SEP)
51+
52+
4553 func keyFactoryConfig () = "%s__factoryConfig"
4654
4755
4856 func keyPoolConfig (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config")
4957
5058
5159 func keyMappingsBaseAsset2internalId (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
60+
61+
62+func keyAllowedLpStableAddonScriptHash () = "%s__allowedLpStableAddonScriptHash"
5263
5364
5465 func getStringOrFail (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
5566
5667
5768 func getIntOrFail (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
5869
5970
6071 let poolContract = addressFromStringValue(getStringOrFail(this, keyPoolAddr()))
6172
6273 let factoryContract = addressFromStringValue(getStringOrFail(poolContract, keyFactCntr()))
6374
6475 func getPoolConfig () = {
6576 let amtAs = getStringOrFail(poolContract, keyAmtAsset())
6677 let priceAs = getStringOrFail(poolContract, keyPriceAsset())
6778 let iPriceAs = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAs))
6879 let iAmtAs = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAs))
6980 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAs), toString(iPriceAs))), SEP)
7081 }
7182
7283
7384 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
7485
7586
7687 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
7788 case s: String =>
7889 fromBase58String(s)
7990 case _: Unit =>
8091 unit
8192 case _ =>
8293 throw("Match error")
8394 }
8495
8596
8697 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
8798 case s: String =>
8899 fromBase58String(s)
89100 case _: Unit =>
90101 unit
91102 case _ =>
92103 throw("Match error")
93104 }
94105
95106
96107 func mustManager (i) = {
97108 let pd = throw("Permission denied")
98109 match managerPublicKeyOrUnit() {
99110 case pk: ByteVector =>
100111 if ((i.callerPublicKey == pk))
101112 then true
102113 else pd
103114 case _: Unit =>
104115 if ((i.caller == this))
105116 then true
106117 else pd
107118 case _ =>
108119 throw("Match error")
109120 }
110121 }
111122
112123
113124 func getAdmins () = match getString(keyAdminPubKeys()) {
114125 case s: String =>
115126 if ((size(s) == 0))
116127 then nil
117128 else split(s, SEP)
118129 case _ =>
119130 nil
120131 }
121132
122133
123134 func mustAdmin (i) = if (containsElement(getAdmins(), toBase58String(i.callerPublicKey)))
124135 then true
125136 else mustManager(i)
126137
127138
128139 func mustPool (i) = if ((i.caller == poolContract))
129140 then true
130141 else throw("caller must be the pool")
131142
132143
133144 @Callable(i)
134145 func constructor (poolAddress) = {
135146 let checkCaller = mustManager(i)
136147 if ((checkCaller == checkCaller))
137148 then [StringEntry(keyPoolAddr(), poolAddress)]
138149 else throw("Strict value is not equal to itself.")
139150 }
140151
141152
142153
143154 @Callable(i)
144155 func setManager (pendingManagerPublicKey) = {
145156 let checkCaller = mustManager(i)
146157 if ((checkCaller == checkCaller))
147158 then {
148159 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
149160 if ((checkManagerPublicKey == checkManagerPublicKey))
150161 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
151162 else throw("Strict value is not equal to itself.")
152163 }
153164 else throw("Strict value is not equal to itself.")
154165 }
155166
156167
157168
158169 @Callable(i)
159170 func confirmManager () = {
160171 let pm = pendingManagerPublicKeyOrUnit()
161172 let hasPM = if (isDefined(pm))
162173 then true
163174 else throw("No pending manager")
164175 if ((hasPM == hasPM))
165176 then {
166177 let checkPM = if ((i.callerPublicKey == value(pm)))
167178 then true
168179 else throw("You are not pending manager")
169180 if ((checkPM == checkPM))
170181 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
171182 else throw("Strict value is not equal to itself.")
172183 }
173184 else throw("Strict value is not equal to itself.")
174185 }
175186
176187
177188
178189 @Callable(i)
179190 func setAdmins (adminPubKeys) = {
180191 let checkCaller = mustManager(i)
181192 if ((checkCaller == checkCaller))
182193 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
183194 else throw("Strict value is not equal to itself.")
184195 }
185196
186197
187198
188199 @Callable(i)
189200 func unstakeAndGetOneTkn (amount,exchResult,notUsed,outAmount,outAssetId,slippage) = {
190201 let checkPayments = if ((size(i.payments) != 0))
191202 then throw("No pmnts expd")
192203 else true
193204 if ((checkPayments == checkPayments))
194205 then {
195206 let cfg = getPoolConfig()
196207 let factoryCfg = getFactoryConfig()
197208 let lpAssetId = fromBase58String(cfg[idxLPAsId])
198209 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
199210 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
200211 if ((unstakeInv == unstakeInv))
201212 then {
202- let getOneTkn = invoke(poolContract, "getOneTkn", [exchResult, notUsed, outAmount, outAssetId, slippage], [AttachedPayment(lpAssetId, amount)])
213+ let getOneTkn = reentrantInvoke(poolContract, "getOneTkn", [exchResult, notUsed, outAmount, outAssetId, slippage], [AttachedPayment(lpAssetId, amount)])
203214 if ((getOneTkn == getOneTkn))
204215 then nil
205216 else throw("Strict value is not equal to itself.")
206217 }
207218 else throw("Strict value is not equal to itself.")
208219 }
209220 else throw("Strict value is not equal to itself.")
210221 }
211222
212223
213224
214225 @Callable(i)
215226 func setAmp (amp) = {
216227 let checkCaller = mustAdmin(i)
217228 if ((checkCaller == checkCaller))
218229 then {
219230 let res1 = invoke(poolContract, "setS", [keyAmp(), amp], nil)
220231 let res2 = invoke(poolContract, "setS", [keyAmpHistory(height), amp], nil)
221232 $Tuple2(nil, $Tuple2(res1, res2))
222233 }
223234 else throw("Strict value is not equal to itself.")
224235 }
225236
226237
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.")
323+ }
324+ else throw("Strict value is not equal to itself.")
325+ }
326+
327+
227328 @Verifier(tx)
228329 func verify () = {
229330 let targetPublicKey = match managerPublicKeyOrUnit() {
230331 case pk: ByteVector =>
231332 pk
232333 case _: Unit =>
233334 tx.senderPublicKey
234335 case _ =>
235336 throw("Match error")
236337 }
237- sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
338+ match tx {
339+ case s: SetScriptTransaction =>
340+ let newHash = blake2b256(value(s.script))
341+ let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpStableAddonScriptHash())))
342+ let currentHash = scriptHash(this)
343+ if (if ((allowedHash == newHash))
344+ then (currentHash != newHash)
345+ else false)
346+ then true
347+ else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
348+ case _ =>
349+ sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
350+ }
238351 }
239352

github/deemru/w8io/169f3d6 
37.46 ms