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