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:AAIFAAAAAAAAACIIAhIDCgEIEgMKAQgSABIDCgEYEggKBgEBAQEIARIDCgEIAAAAIAAAAAADU0VQAgAAAAJfXwAAAAAFRU1QVFkCAAAAAAAAAAAOaWR4UG9vbEFkZHJlc3MAAAAAAAAAAAEAAAAACWlkeExQQXNJZAAAAAAAAAAAAwAAAAAJaWR4QW1Bc0lkAAAAAAAAAAAEAAAAAAlpZHhQckFzSWQAAAAAAAAAAAUAAAAAD2lkeEZhY3RTdGFrQ250cgAAAAAAAAAAAQEAAAALa2V5RmFjdENudHIAAAAAAgAAABMlc19fZmFjdG9yeUNvbnRyYWN0AQAAABNrZXlNYW5hZ2VyUHVibGljS2V5AAAAAAIAAAAUJXNfX21hbmFnZXJQdWJsaWNLZXkBAAAAGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAAAAAIAAAAbJXNfX3BlbmRpbmdNYW5hZ2VyUHVibGljS2V5AQAAAAtrZXlQb29sQWRkcgAAAAACAAAADyVzX19wb29sQWRkcmVzcwEAAAALa2V5QW10QXNzZXQAAAAAAgAAAA8lc19fYW1vdW50QXNzZXQBAAA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YXNoAAAAAAQAAAALY3VycmVudEhhc2gJAAPxAAAAAQUAAAAEdGhpcwMDCQAAAAAAAAIFAAAAC2FsbG93ZWRIYXNoBQAAAAduZXdIYXNoCQEAAAACIT0AAAACBQAAAAtjdXJyZW50SGFzaAUAAAAHbmV3SGFzaAcGCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAPdGFyZ2V0UHVibGljS2V5CQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAPdGFyZ2V0UHVibGljS2V51LJ/2g==", "chainId": 84, "height": 2211359, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8ymj6hzeVJHuMzMvKGZC62TPWBytjr1WRWoRtavBd6WH Next: ANasxk5k8isdGPnbR8LzoQmwtqMKdpqMtowKow5KqHGb Diff:
Old | New | Differences | |
---|---|---|---|
14 | 14 | let idxPrAsId = 5 | |
15 | 15 | ||
16 | 16 | let idxFactStakCntr = 1 | |
17 | - | ||
18 | - | let delay = "%s__delay" | |
19 | 17 | ||
20 | 18 | func keyFactCntr () = "%s__factoryContract" | |
21 | 19 | ||
42 | 40 | ||
43 | 41 | ||
44 | 42 | 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) | |
51 | 43 | ||
52 | 44 | ||
53 | 45 | func keyFactoryConfig () = "%s__factoryConfig" | |
210 | 202 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
211 | 203 | if ((unstakeInv == unstakeInv)) | |
212 | 204 | then { | |
213 | - | let getOneTkn = | |
205 | + | let getOneTkn = invoke(poolContract, "getOneTkn", [exchResult, notUsed, outAmount, outAssetId, slippage], [AttachedPayment(lpAssetId, amount)]) | |
214 | 206 | if ((getOneTkn == getOneTkn)) | |
215 | 207 | then nil | |
216 | 208 | else throw("Strict value is not equal to itself.") | |
230 | 222 | let res1 = invoke(poolContract, "setS", [keyAmp(), amp], nil) | |
231 | 223 | let res2 = invoke(poolContract, "setS", [keyAmpHistory(height), amp], nil) | |
232 | 224 | $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.") | |
323 | 225 | } | |
324 | 226 | else throw("Strict value is not equal to itself.") | |
325 | 227 | } |
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 | - | ||
18 | - | let delay = "%s__delay" | |
19 | 17 | ||
20 | 18 | func keyFactCntr () = "%s__factoryContract" | |
21 | 19 | ||
22 | 20 | ||
23 | 21 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
24 | 22 | ||
25 | 23 | ||
26 | 24 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
27 | 25 | ||
28 | 26 | ||
29 | 27 | func keyPoolAddr () = "%s__poolAddress" | |
30 | 28 | ||
31 | 29 | ||
32 | 30 | func keyAmtAsset () = "%s__amountAsset" | |
33 | 31 | ||
34 | 32 | ||
35 | 33 | func keyPriceAsset () = "%s__priceAsset" | |
36 | 34 | ||
37 | 35 | ||
38 | 36 | func keyAdminPubKeys () = "%s__adminPubKeys" | |
39 | 37 | ||
40 | 38 | ||
41 | 39 | func keyAmp () = "%s__amp" | |
42 | 40 | ||
43 | 41 | ||
44 | 42 | 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) | |
51 | 43 | ||
52 | 44 | ||
53 | 45 | func keyFactoryConfig () = "%s__factoryConfig" | |
54 | 46 | ||
55 | 47 | ||
56 | 48 | func keyPoolConfig (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config") | |
57 | 49 | ||
58 | 50 | ||
59 | 51 | func keyMappingsBaseAsset2internalId (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr) | |
60 | 52 | ||
61 | 53 | ||
62 | 54 | func keyAllowedLpStableAddonScriptHash () = "%s__allowedLpStableAddonScriptHash" | |
63 | 55 | ||
64 | 56 | ||
65 | 57 | func getStringOrFail (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
66 | 58 | ||
67 | 59 | ||
68 | 60 | func getIntOrFail (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
69 | 61 | ||
70 | 62 | ||
71 | 63 | let poolContract = addressFromStringValue(getStringOrFail(this, keyPoolAddr())) | |
72 | 64 | ||
73 | 65 | let factoryContract = addressFromStringValue(getStringOrFail(poolContract, keyFactCntr())) | |
74 | 66 | ||
75 | 67 | func getPoolConfig () = { | |
76 | 68 | let amtAs = getStringOrFail(poolContract, keyAmtAsset()) | |
77 | 69 | let priceAs = getStringOrFail(poolContract, keyPriceAsset()) | |
78 | 70 | let iPriceAs = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAs)) | |
79 | 71 | let iAmtAs = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAs)) | |
80 | 72 | split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAs), toString(iPriceAs))), SEP) | |
81 | 73 | } | |
82 | 74 | ||
83 | 75 | ||
84 | 76 | func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP) | |
85 | 77 | ||
86 | 78 | ||
87 | 79 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
88 | 80 | case s: String => | |
89 | 81 | fromBase58String(s) | |
90 | 82 | case _: Unit => | |
91 | 83 | unit | |
92 | 84 | case _ => | |
93 | 85 | throw("Match error") | |
94 | 86 | } | |
95 | 87 | ||
96 | 88 | ||
97 | 89 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
98 | 90 | case s: String => | |
99 | 91 | fromBase58String(s) | |
100 | 92 | case _: Unit => | |
101 | 93 | unit | |
102 | 94 | case _ => | |
103 | 95 | throw("Match error") | |
104 | 96 | } | |
105 | 97 | ||
106 | 98 | ||
107 | 99 | func mustManager (i) = { | |
108 | 100 | let pd = throw("Permission denied") | |
109 | 101 | match managerPublicKeyOrUnit() { | |
110 | 102 | case pk: ByteVector => | |
111 | 103 | if ((i.callerPublicKey == pk)) | |
112 | 104 | then true | |
113 | 105 | else pd | |
114 | 106 | case _: Unit => | |
115 | 107 | if ((i.caller == this)) | |
116 | 108 | then true | |
117 | 109 | else pd | |
118 | 110 | case _ => | |
119 | 111 | throw("Match error") | |
120 | 112 | } | |
121 | 113 | } | |
122 | 114 | ||
123 | 115 | ||
124 | 116 | func getAdmins () = match getString(keyAdminPubKeys()) { | |
125 | 117 | case s: String => | |
126 | 118 | if ((size(s) == 0)) | |
127 | 119 | then nil | |
128 | 120 | else split(s, SEP) | |
129 | 121 | case _ => | |
130 | 122 | nil | |
131 | 123 | } | |
132 | 124 | ||
133 | 125 | ||
134 | 126 | func mustAdmin (i) = if (containsElement(getAdmins(), toBase58String(i.callerPublicKey))) | |
135 | 127 | then true | |
136 | 128 | else mustManager(i) | |
137 | 129 | ||
138 | 130 | ||
139 | 131 | func mustPool (i) = if ((i.caller == poolContract)) | |
140 | 132 | then true | |
141 | 133 | else throw("caller must be the pool") | |
142 | 134 | ||
143 | 135 | ||
144 | 136 | @Callable(i) | |
145 | 137 | func constructor (poolAddress) = { | |
146 | 138 | let checkCaller = mustManager(i) | |
147 | 139 | if ((checkCaller == checkCaller)) | |
148 | 140 | then [StringEntry(keyPoolAddr(), poolAddress)] | |
149 | 141 | else throw("Strict value is not equal to itself.") | |
150 | 142 | } | |
151 | 143 | ||
152 | 144 | ||
153 | 145 | ||
154 | 146 | @Callable(i) | |
155 | 147 | func setManager (pendingManagerPublicKey) = { | |
156 | 148 | let checkCaller = mustManager(i) | |
157 | 149 | if ((checkCaller == checkCaller)) | |
158 | 150 | then { | |
159 | 151 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
160 | 152 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
161 | 153 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
162 | 154 | else throw("Strict value is not equal to itself.") | |
163 | 155 | } | |
164 | 156 | else throw("Strict value is not equal to itself.") | |
165 | 157 | } | |
166 | 158 | ||
167 | 159 | ||
168 | 160 | ||
169 | 161 | @Callable(i) | |
170 | 162 | func confirmManager () = { | |
171 | 163 | let pm = pendingManagerPublicKeyOrUnit() | |
172 | 164 | let hasPM = if (isDefined(pm)) | |
173 | 165 | then true | |
174 | 166 | else throw("No pending manager") | |
175 | 167 | if ((hasPM == hasPM)) | |
176 | 168 | then { | |
177 | 169 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
178 | 170 | then true | |
179 | 171 | else throw("You are not pending manager") | |
180 | 172 | if ((checkPM == checkPM)) | |
181 | 173 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
182 | 174 | else throw("Strict value is not equal to itself.") | |
183 | 175 | } | |
184 | 176 | else throw("Strict value is not equal to itself.") | |
185 | 177 | } | |
186 | 178 | ||
187 | 179 | ||
188 | 180 | ||
189 | 181 | @Callable(i) | |
190 | 182 | func setAdmins (adminPubKeys) = { | |
191 | 183 | let checkCaller = mustManager(i) | |
192 | 184 | if ((checkCaller == checkCaller)) | |
193 | 185 | then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))] | |
194 | 186 | else throw("Strict value is not equal to itself.") | |
195 | 187 | } | |
196 | 188 | ||
197 | 189 | ||
198 | 190 | ||
199 | 191 | @Callable(i) | |
200 | 192 | func unstakeAndGetOneTkn (amount,exchResult,notUsed,outAmount,outAssetId,slippage) = { | |
201 | 193 | let checkPayments = if ((size(i.payments) != 0)) | |
202 | 194 | then throw("No pmnts expd") | |
203 | 195 | else true | |
204 | 196 | if ((checkPayments == checkPayments)) | |
205 | 197 | then { | |
206 | 198 | let cfg = getPoolConfig() | |
207 | 199 | let factoryCfg = getFactoryConfig() | |
208 | 200 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
209 | 201 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
210 | 202 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
211 | 203 | if ((unstakeInv == unstakeInv)) | |
212 | 204 | then { | |
213 | - | let getOneTkn = | |
205 | + | let getOneTkn = invoke(poolContract, "getOneTkn", [exchResult, notUsed, outAmount, outAssetId, slippage], [AttachedPayment(lpAssetId, amount)]) | |
214 | 206 | if ((getOneTkn == getOneTkn)) | |
215 | 207 | then nil | |
216 | 208 | else throw("Strict value is not equal to itself.") | |
217 | 209 | } | |
218 | 210 | else throw("Strict value is not equal to itself.") | |
219 | 211 | } | |
220 | 212 | else throw("Strict value is not equal to itself.") | |
221 | 213 | } | |
222 | 214 | ||
223 | 215 | ||
224 | 216 | ||
225 | 217 | @Callable(i) | |
226 | 218 | func setAmp (amp) = { | |
227 | 219 | let checkCaller = mustAdmin(i) | |
228 | 220 | if ((checkCaller == checkCaller)) | |
229 | 221 | then { | |
230 | 222 | let res1 = invoke(poolContract, "setS", [keyAmp(), amp], nil) | |
231 | 223 | let res2 = invoke(poolContract, "setS", [keyAmpHistory(height), amp], nil) | |
232 | 224 | $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.") | |
323 | 225 | } | |
324 | 226 | else throw("Strict value is not equal to itself.") | |
325 | 227 | } | |
326 | 228 | ||
327 | 229 | ||
328 | 230 | @Verifier(tx) | |
329 | 231 | func verify () = { | |
330 | 232 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
331 | 233 | case pk: ByteVector => | |
332 | 234 | pk | |
333 | 235 | case _: Unit => | |
334 | 236 | tx.senderPublicKey | |
335 | 237 | case _ => | |
336 | 238 | throw("Match error") | |
337 | 239 | } | |
338 | 240 | match tx { | |
339 | 241 | case s: SetScriptTransaction => | |
340 | 242 | let newHash = blake2b256(value(s.script)) | |
341 | 243 | let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpStableAddonScriptHash()))) | |
342 | 244 | let currentHash = scriptHash(this) | |
343 | 245 | if (if ((allowedHash == newHash)) | |
344 | 246 | then (currentHash != newHash) | |
345 | 247 | else false) | |
346 | 248 | then true | |
347 | 249 | else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
348 | 250 | case _ => | |
349 | 251 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
350 | 252 | } | |
351 | 253 | } | |
352 | 254 |
github/deemru/w8io/169f3d6 46.16 ms ◑