tx · AoR2fqfJtmJwG43qQ7D4iC8JXfDatwQvre3TSj8qg4F2 3MvR8ZD65rVQ7ho1LuZFMNmqnQs38SjFzvz: -0.01800000 Waves 2024.07.04 10:25 [3178971] smart account 3MvR8ZD65rVQ7ho1LuZFMNmqnQs38SjFzvz > SELF 0.00000000 Waves
{ "type": 13, "id": "AoR2fqfJtmJwG43qQ7D4iC8JXfDatwQvre3TSj8qg4F2", "fee": 1800000, "feeAssetId": null, "timestamp": 1720077981804, "version": 2, "chainId": 84, "sender": "3MvR8ZD65rVQ7ho1LuZFMNmqnQs38SjFzvz", "senderPublicKey": "EEqjCemrPmbE6rVdu2pgq2hcW4J8ecASNHy7TMnfYmuZ", "proofs": [ "3i7ZoxJJ8nVPupv2mLvfXVSorbM94hdDJM97vSvL3tKk4LG66wzZfDYsqa7H7tRGjUSZfFkHVhmwrsQtYUt5kt2B" ], "script": "base64:BwJCCAISBgoEAQgICBIAEgMKAQgSBQoDAQgIEgMKAQESBQoDCAgIEgMKAQgSBAoCCAgSAwoBCBIAEgASAwoBCBIDCgEIRQAJU0VQQVJBVE9SAgJfXwAMS0VZX01VTFRJU0lHAghNVUxUSVNJRwAKS0VZX1NUQVRVUwIGU1RBVFVTAAhLRVlfSU5JVAIESU5JVAAKS0VZX1BBVVNFRAIGUEFVU0VEAApLRVlfUEFVU0VSAgZQQVVTRVIACUtFWV9DSEFJTgIFQ0hBSU4AFEtFWV9HQVRFV0FZX0NPTlRSQUNUAhBHQVRFV0FZX0NPTlRSQUNUABNLRVlfU1dBVkVTX0NPTlRSQUNUAg9TV0FWRVNfQ09OVFJBQ1QAEEtFWV9TV0FWRVNfQVNTRVQCBUFTU0VUAAxLRVlfUkVTRVJWRVMCCFJFU0VSVkVTABJLRVlfU1RBS0lOR19BU1NFVFMCDlNUQUtJTkdfQVNTRVRTABRLRVlfU1RBS0lOR19DT05UUkFDVAIQU1RBS0lOR19DT05UUkFDVAAMRlVOQ19ERVBPU0lUAgdkZXBvc2l0ABdGV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cwAACAUCdHgPc2VuZGVyUHVibGljS2V5cgk9Ng==", "height": 3178971, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 7 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let SEPARATOR = "__" | |
5 | + | ||
6 | + | let KEY_MULTISIG = "MULTISIG" | |
7 | + | ||
8 | + | let KEY_STATUS = "STATUS" | |
9 | + | ||
10 | + | let KEY_INIT = "INIT" | |
11 | + | ||
12 | + | let KEY_PAUSED = "PAUSED" | |
13 | + | ||
14 | + | let KEY_PAUSER = "PAUSER" | |
15 | + | ||
16 | + | let KEY_CHAIN = "CHAIN" | |
17 | + | ||
18 | + | let KEY_GATEWAY_CONTRACT = "GATEWAY_CONTRACT" | |
19 | + | ||
20 | + | let KEY_SWAVES_CONTRACT = "SWAVES_CONTRACT" | |
21 | + | ||
22 | + | let KEY_SWAVES_ASSET = "ASSET" | |
23 | + | ||
24 | + | let KEY_RESERVES = "RESERVES" | |
25 | + | ||
26 | + | let KEY_STAKING_ASSETS = "STAKING_ASSETS" | |
27 | + | ||
28 | + | let KEY_STAKING_CONTRACT = "STAKING_CONTRACT" | |
29 | + | ||
30 | + | let FUNC_DEPOSIT = "deposit" | |
31 | + | ||
32 | + | let FUNC_REQUEST_WITHDRAWAL = "requestWithdrawal" | |
33 | + | ||
34 | + | let FUNC_EXECUTE_WITHDRAWAL = "executeWithdrawal" | |
35 | + | ||
36 | + | let FUNC_GET_RATE = "getRate" | |
37 | + | ||
38 | + | let FUNC_WITHDRAW = "withdraw" | |
39 | + | ||
40 | + | let FUNC_STAKE = "stake" | |
41 | + | ||
42 | + | let FUNC_UNSTAKE = "unstake" | |
43 | + | ||
44 | + | let FUNC_CLAIM_ALL = "claimAll" | |
45 | + | ||
46 | + | let FUNC_DEPOSIT_STAKING_REWARD = "depositStakingReward" | |
47 | + | ||
48 | + | let WAVES = "WAVES" | |
49 | + | ||
50 | + | let WAVES_DECIMALS = 8 | |
51 | + | ||
52 | + | let DEX_DECIMALS = 8 | |
53 | + | ||
54 | + | let MAX_INT = 9223372036854775807 | |
55 | + | ||
56 | + | let ZERO_BIGINT = toBigInt(0) | |
57 | + | ||
58 | + | let ONE_BIGINT = toBigInt(1) | |
59 | + | ||
60 | + | let SWAVES_RATE_FACTOR = toBigInt(1000000000000) | |
61 | + | ||
62 | + | func _validateAddress (address_,err_) = match addressFromString(address_) { | |
63 | + | case a: Address => | |
64 | + | true | |
65 | + | case _ => | |
66 | + | throw(err_) | |
67 | + | } | |
68 | + | ||
69 | + | ||
70 | + | func _validateAsset (assetId_,err_) = if ((assetId_ == WAVES)) | |
71 | + | then true | |
72 | + | else match assetInfo(fromBase58String(assetId_)) { | |
73 | + | case a: Asset => | |
74 | + | true | |
75 | + | case _ => | |
76 | + | throw(err_) | |
77 | + | } | |
78 | + | ||
79 | + | ||
80 | + | func _validateInt (val_,lowerBoundary_,upperBoundary_,err_) = if (if ((lowerBoundary_ > val_)) | |
81 | + | then true | |
82 | + | else (val_ > upperBoundary_)) | |
83 | + | then throw(err_) | |
84 | + | else true | |
85 | + | ||
86 | + | ||
87 | + | func _validateBigInt (val_,lowerBoundary_,err_) = if ((lowerBoundary_ > val_)) | |
88 | + | then throw(err_) | |
89 | + | else true | |
90 | + | ||
91 | + | ||
92 | + | func _validateString (val_,err_) = if (if ((0 >= size(val_))) | |
93 | + | then true | |
94 | + | else contains(val_, SEPARATOR)) | |
95 | + | then throw(err_) | |
96 | + | else true | |
97 | + | ||
98 | + | ||
99 | + | func _validatePaymentsSize (payments_,target_,err_) = if ((size(payments_) != target_)) | |
100 | + | then throw(err_) | |
101 | + | else true | |
102 | + | ||
103 | + | ||
104 | + | func _assetToStr (asset_) = match asset_ { | |
105 | + | case a: ByteVector => | |
106 | + | toBase58String(a) | |
107 | + | case _ => | |
108 | + | WAVES | |
109 | + | } | |
110 | + | ||
111 | + | ||
112 | + | func _strToAsset (asset_) = if ((asset_ == WAVES)) | |
113 | + | then unit | |
114 | + | else fromBase58String(asset_) | |
115 | + | ||
116 | + | ||
117 | + | func _getDecimals (assetId_) = if ((assetId_ == WAVES)) | |
118 | + | then WAVES_DECIMALS | |
119 | + | else match assetInfo(fromBase58String(assetId_)) { | |
120 | + | case a: Asset => | |
121 | + | a.decimals | |
122 | + | case _ => | |
123 | + | throw(("_getDecimals: no asset=" + assetId_)) | |
124 | + | } | |
125 | + | ||
126 | + | ||
127 | + | func _normalizeDecimals (amount_,sourceDecimals_,targetDecimals_) = if ((sourceDecimals_ >= targetDecimals_)) | |
128 | + | then (amount_ / pow(10, 0, (sourceDecimals_ - targetDecimals_), 0, 0, DOWN)) | |
129 | + | else (amount_ * pow(10, 0, (targetDecimals_ - sourceDecimals_), 0, 0, DOWN)) | |
130 | + | ||
131 | + | ||
132 | + | func _loadInit () = match getBoolean(KEY_INIT) { | |
133 | + | case a: Boolean => | |
134 | + | a | |
135 | + | case _ => | |
136 | + | false | |
137 | + | } | |
138 | + | ||
139 | + | ||
140 | + | func _saveInit (isInit_) = [BooleanEntry(KEY_INIT, isInit_)] | |
141 | + | ||
142 | + | ||
143 | + | func _loadPause () = match getBoolean(KEY_PAUSED) { | |
144 | + | case a: Boolean => | |
145 | + | a | |
146 | + | case _ => | |
147 | + | false | |
148 | + | } | |
149 | + | ||
150 | + | ||
151 | + | func _savePause (isPaused_) = [BooleanEntry(KEY_PAUSED, isPaused_)] | |
152 | + | ||
153 | + | ||
154 | + | func _loadPauser () = match getString(KEY_PAUSER) { | |
155 | + | case a: String => | |
156 | + | addressFromStringValue(a) | |
157 | + | case _ => | |
158 | + | Address(base58'') | |
159 | + | } | |
160 | + | ||
161 | + | ||
162 | + | func _savePauser (pauser_) = [StringEntry(KEY_PAUSER, toString(pauser_))] | |
163 | + | ||
164 | + | ||
165 | + | func _loadMultisig () = match getString(KEY_MULTISIG) { | |
166 | + | case a: String => | |
167 | + | addressFromStringValue(a) | |
168 | + | case _ => | |
169 | + | Address(base58'') | |
170 | + | } | |
171 | + | ||
172 | + | ||
173 | + | func _saveMultisig (multisig_) = [StringEntry(KEY_MULTISIG, toString(multisig_))] | |
174 | + | ||
175 | + | ||
176 | + | func _loadChainId () = match getInteger(KEY_CHAIN) { | |
177 | + | case a: Int => | |
178 | + | a | |
179 | + | case _ => | |
180 | + | 0 | |
181 | + | } | |
182 | + | ||
183 | + | ||
184 | + | func _saveChainId (chainId_) = [IntegerEntry(KEY_CHAIN, chainId_)] | |
185 | + | ||
186 | + | ||
187 | + | func _loadGatewayContract () = match getString(KEY_GATEWAY_CONTRACT) { | |
188 | + | case a: String => | |
189 | + | addressFromStringValue(a) | |
190 | + | case _ => | |
191 | + | Address(base58'') | |
192 | + | } | |
193 | + | ||
194 | + | ||
195 | + | func _saveGatewayContract (gatewayContract_) = [StringEntry(KEY_GATEWAY_CONTRACT, toString(gatewayContract_))] | |
196 | + | ||
197 | + | ||
198 | + | func _loadSWavesContract () = match getString(KEY_SWAVES_CONTRACT) { | |
199 | + | case a: String => | |
200 | + | addressFromStringValue(a) | |
201 | + | case _ => | |
202 | + | Address(base58'') | |
203 | + | } | |
204 | + | ||
205 | + | ||
206 | + | func _saveSWavesContract (sWavesContract_) = [StringEntry(KEY_SWAVES_CONTRACT, toString(sWavesContract_))] | |
207 | + | ||
208 | + | ||
209 | + | func _loadSWavesAsset (contract_) = match getString(contract_, KEY_SWAVES_ASSET) { | |
210 | + | case a: String => | |
211 | + | fromBase58String(a) | |
212 | + | case _ => | |
213 | + | throw("_loadSWavesAsset: revert") | |
214 | + | } | |
215 | + | ||
216 | + | ||
217 | + | func _loadReserves (asset_) = match getInteger(makeString([KEY_RESERVES, asset_], SEPARATOR)) { | |
218 | + | case a: Int => | |
219 | + | a | |
220 | + | case _ => | |
221 | + | 0 | |
222 | + | } | |
223 | + | ||
224 | + | ||
225 | + | func _saveReserves (asset_,reserves_) = [IntegerEntry(makeString([KEY_RESERVES, asset_], SEPARATOR), reserves_)] | |
226 | + | ||
227 | + | ||
228 | + | func _loadStakingAssets () = match getString(KEY_STAKING_ASSETS) { | |
229 | + | case a: String => | |
230 | + | if ((size(a) > 0)) | |
231 | + | then split_51C(a, SEPARATOR) | |
232 | + | else nil | |
233 | + | case _ => | |
234 | + | nil | |
235 | + | } | |
236 | + | ||
237 | + | ||
238 | + | func _saveStakingAssets (assets_) = [StringEntry(KEY_STAKING_ASSETS, makeString(assets_, SEPARATOR))] | |
239 | + | ||
240 | + | ||
241 | + | func _loadStakingContract (asset_) = match getString(makeString([KEY_STAKING_CONTRACT, asset_], SEPARATOR)) { | |
242 | + | case a: String => | |
243 | + | addressFromStringValue(a) | |
244 | + | case _ => | |
245 | + | Address(base58'') | |
246 | + | } | |
247 | + | ||
248 | + | ||
249 | + | func _saveStakingContract (asset_,contract_) = [StringEntry(makeString([KEY_STAKING_CONTRACT, asset_], SEPARATOR), toString(contract_))] | |
250 | + | ||
251 | + | ||
252 | + | func _onlyThisContract (caller_) = if ((caller_ != this)) | |
253 | + | then throw("_onlyThisContract: revert") | |
254 | + | else true | |
255 | + | ||
256 | + | ||
257 | + | func _whenMultisigSet () = if ((_loadMultisig() == Address(base58''))) | |
258 | + | then throw("_whenMultisigSet: revert") | |
259 | + | else true | |
260 | + | ||
261 | + | ||
262 | + | func _whenNotInitialized () = if (_loadInit()) | |
263 | + | then throw("_whenNotInitialized: revert") | |
264 | + | else true | |
265 | + | ||
266 | + | ||
267 | + | func _whenInitialized () = if (!(_loadInit())) | |
268 | + | then throw("_whenInitialized: revert") | |
269 | + | else true | |
270 | + | ||
271 | + | ||
272 | + | func _whenNotPaused () = if (_loadPause()) | |
273 | + | then throw("_whenNotPaused: revert") | |
274 | + | else true | |
275 | + | ||
276 | + | ||
277 | + | func _whenPaused () = if (!(_loadPause())) | |
278 | + | then throw("_whenPaused: revert") | |
279 | + | else true | |
280 | + | ||
281 | + | ||
282 | + | func _onlyPauser (caller_) = if ((caller_ != _loadPauser())) | |
283 | + | then throw("_onlyPauser: revert") | |
284 | + | else true | |
285 | + | ||
286 | + | ||
287 | + | func _validateGateway (caller,err_) = if ((_loadGatewayContract() != caller)) | |
288 | + | then throw(err_) | |
289 | + | else true | |
290 | + | ||
291 | + | ||
292 | + | func _deposit (from_,to_,asset_,amount_) = { | |
293 | + | let assetDecimals = _getDecimals(asset_) | |
294 | + | let amount = _normalizeDecimals(amount_, assetDecimals, DEX_DECIMALS) | |
295 | + | let err = _validateInt(amount, 1, MAX_INT, "_deposit: invalid payment amount") | |
296 | + | if ((err == err)) | |
297 | + | then { | |
298 | + | let gatewayInvocation = invoke(_loadGatewayContract(), FUNC_DEPOSIT, [toString(this), from_, to_, toString(_loadChainId()), asset_, toString(amount)], nil) | |
299 | + | if ((gatewayInvocation == gatewayInvocation)) | |
300 | + | then { | |
301 | + | let stakingAssets = _loadStakingAssets() | |
302 | + | let stakingInvocation = if ((asset_ == WAVES)) | |
303 | + | then invoke(_loadSWavesContract(), FUNC_DEPOSIT, nil, [AttachedPayment(unit, amount_)]) | |
304 | + | else if (containsElement(stakingAssets, asset_)) | |
305 | + | then invoke(_loadStakingContract(asset_), FUNC_STAKE, nil, [AttachedPayment(_strToAsset(asset_), amount_)]) | |
306 | + | else unit | |
307 | + | if ((stakingInvocation == stakingInvocation)) | |
308 | + | then _saveReserves(asset_, (_loadReserves(asset_) + amount)) | |
309 | + | else throw("Strict value is not equal to itself.") | |
310 | + | } | |
311 | + | else throw("Strict value is not equal to itself.") | |
312 | + | } | |
313 | + | else throw("Strict value is not equal to itself.") | |
314 | + | } | |
315 | + | ||
316 | + | ||
317 | + | @Callable(i) | |
318 | + | func init (chainId_,pauser_,gatewayContract_,sWavesContract_) = { | |
319 | + | let err = if (if (if (if (if (if (_onlyThisContract(i.caller)) | |
320 | + | then _whenNotInitialized() | |
321 | + | else false) | |
322 | + | then _whenMultisigSet() | |
323 | + | else false) | |
324 | + | then _validateInt(chainId_, 0, MAX_INT, "init: invalid chainId") | |
325 | + | else false) | |
326 | + | then _validateAddress(pauser_, "init: invalid pauser") | |
327 | + | else false) | |
328 | + | then _validateAddress(gatewayContract_, "init: invalid gatewayContract") | |
329 | + | else false) | |
330 | + | then _validateAddress(sWavesContract_, "init: invalid sWavesContract") | |
331 | + | else false | |
332 | + | if ((err == err)) | |
333 | + | then $Tuple2(((((_saveInit(true) ++ _saveChainId(chainId_)) ++ _savePauser(addressFromStringValue(pauser_))) ++ _saveGatewayContract(addressFromStringValue(gatewayContract_))) ++ _saveSWavesContract(addressFromStringValue(sWavesContract_))), unit) | |
334 | + | else throw("Strict value is not equal to itself.") | |
335 | + | } | |
336 | + | ||
337 | + | ||
338 | + | ||
339 | + | @Callable(i) | |
340 | + | func deposit () = { | |
341 | + | let err = if (if (if (_whenInitialized()) | |
342 | + | then _whenNotPaused() | |
343 | + | else false) | |
344 | + | then _validatePaymentsSize(i.payments, 1, "deposit: no payment") | |
345 | + | else false) | |
346 | + | then _validateInt(i.payments[0].amount, 0, MAX_INT, "deposit: negative payment") | |
347 | + | else false | |
348 | + | if ((err == err)) | |
349 | + | then $Tuple2(_deposit(toString(i.caller), toString(i.caller), _assetToStr(i.payments[0].assetId), i.payments[0].amount), unit) | |
350 | + | else throw("Strict value is not equal to itself.") | |
351 | + | } | |
352 | + | ||
353 | + | ||
354 | + | ||
355 | + | @Callable(i) | |
356 | + | func depositTo (to_) = { | |
357 | + | let err = if (if (if (if (_whenInitialized()) | |
358 | + | then _whenNotPaused() | |
359 | + | else false) | |
360 | + | then _validatePaymentsSize(i.payments, 1, "depositTo: no payment") | |
361 | + | else false) | |
362 | + | then _validateInt(i.payments[0].amount, 0, MAX_INT, "depositTo: negative payment") | |
363 | + | else false) | |
364 | + | then _validateString(to_, "depositTo: invalid to") | |
365 | + | else false | |
366 | + | if ((err == err)) | |
367 | + | then $Tuple2(_deposit(toString(i.caller), to_, _assetToStr(i.payments[0].assetId), i.payments[0].amount), unit) | |
368 | + | else throw("Strict value is not equal to itself.") | |
369 | + | } | |
370 | + | ||
371 | + | ||
372 | + | ||
373 | + | @Callable(i) | |
374 | + | func requestWithdrawal (toChainId_,asset_,amount_) = { | |
375 | + | let amount = valueOrErrorMessage(parseBigInt(amount_), "requestWithdrawal: amount not int") | |
376 | + | let err = if (if (if (_whenInitialized()) | |
377 | + | then _validateInt(toChainId_, 0, MAX_INT, "requestWithdrawal: invalid toChainId") | |
378 | + | else false) | |
379 | + | then _validateString(asset_, "requestWithdrawal: invalid asset") | |
380 | + | else false) | |
381 | + | then _validateBigInt(amount, ONE_BIGINT, "requestWithdrawal: negative amount") | |
382 | + | else false | |
383 | + | if ((err == err)) | |
384 | + | then { | |
385 | + | let caller = toString(i.caller) | |
386 | + | let requestWithdrawalId = match invoke(_loadGatewayContract(), FUNC_REQUEST_WITHDRAWAL, [toString(this), caller, caller, toString(_loadChainId()), toString(toChainId_), asset_, amount_], nil) { | |
387 | + | case a: Int => | |
388 | + | a | |
389 | + | case _ => | |
390 | + | throw("requestWithdrawal: call reverted from gw") | |
391 | + | } | |
392 | + | if ((requestWithdrawalId == requestWithdrawalId)) | |
393 | + | then $Tuple2(nil, requestWithdrawalId) | |
394 | + | else throw("Strict value is not equal to itself.") | |
395 | + | } | |
396 | + | else throw("Strict value is not equal to itself.") | |
397 | + | } | |
398 | + | ||
399 | + | ||
400 | + | ||
401 | + | @Callable(i) | |
402 | + | func executeWithdrawal (requestWithdrawalId_) = { | |
403 | + | let err = if (_whenInitialized()) | |
404 | + | then _validateInt(requestWithdrawalId_, 0, MAX_INT, "executeWithdrawal: invalid requestId") | |
405 | + | else false | |
406 | + | if ((err == err)) | |
407 | + | then { | |
408 | + | let gatewayInvocation = reentrantInvoke(_loadGatewayContract(), FUNC_EXECUTE_WITHDRAWAL, [toString(this), toString(_loadChainId()), toString(requestWithdrawalId_)], nil) | |
409 | + | if ((gatewayInvocation == gatewayInvocation)) | |
410 | + | then $Tuple2(nil, unit) | |
411 | + | else throw("Strict value is not equal to itself.") | |
412 | + | } | |
413 | + | else throw("Strict value is not equal to itself.") | |
414 | + | } | |
415 | + | ||
416 | + | ||
417 | + | ||
418 | + | @Callable(i) | |
419 | + | func withdraw (to_,asset_,amount_) = { | |
420 | + | let amount = valueOrErrorMessage(parseInt(amount_), "withdraw: amount not int") | |
421 | + | let err = if (if (if (if (_whenInitialized()) | |
422 | + | then _validateGateway(i.caller, "withdraw: invalid gateway") | |
423 | + | else false) | |
424 | + | then _validateAddress(to_, "withdraw: invalid address") | |
425 | + | else false) | |
426 | + | then _validateAsset(asset_, "withdraw: invalid asset") | |
427 | + | else false) | |
428 | + | then _validateInt(amount, 0, MAX_INT, "withdraw: negative amount") | |
429 | + | else false | |
430 | + | if ((err == err)) | |
431 | + | then { | |
432 | + | let assetDecimals = _getDecimals(asset_) | |
433 | + | let amountNormalized = _normalizeDecimals(amount, DEX_DECIMALS, assetDecimals) | |
434 | + | let newReserves = (_loadReserves(asset_) - amount) | |
435 | + | let err1 = if (_validateInt(amountNormalized, 1, MAX_INT, "withdraw: invalid amount")) | |
436 | + | then _validateInt(newReserves, 0, MAX_INT, "withdraw: negative newReserves") | |
437 | + | else false | |
438 | + | if ((err1 == err1)) | |
439 | + | then { | |
440 | + | let stakingAssets = _loadStakingAssets() | |
441 | + | let unstakingInvocation = if ((asset_ == WAVES)) | |
442 | + | then { | |
443 | + | let sWavesContract = _loadSWavesContract() | |
444 | + | let sWavesAsset = _loadSWavesAsset(sWavesContract) | |
445 | + | let invocation = invoke(sWavesContract, FUNC_GET_RATE, nil, nil) | |
446 | + | let rate = match invocation { | |
447 | + | case a: String => | |
448 | + | parseBigIntValue(a) | |
449 | + | case _ => | |
450 | + | throw("withdraw: sWaves getRate() revert") | |
451 | + | } | |
452 | + | let sWavesToWithdraw = toInt(fraction(toBigInt(amountNormalized), SWAVES_RATE_FACTOR, rate, CEILING)) | |
453 | + | invoke(sWavesContract, FUNC_WITHDRAW, nil, [AttachedPayment(sWavesAsset, sWavesToWithdraw)]) | |
454 | + | } | |
455 | + | else if (containsElement(stakingAssets, asset_)) | |
456 | + | then invoke(_loadStakingContract(asset_), FUNC_UNSTAKE, [amountNormalized], nil) | |
457 | + | else unit | |
458 | + | if ((unstakingInvocation == unstakingInvocation)) | |
459 | + | then $Tuple2(([ScriptTransfer(addressFromStringValue(to_), amountNormalized, _strToAsset(asset_))] ++ _saveReserves(asset_, newReserves)), unit) | |
460 | + | else throw("Strict value is not equal to itself.") | |
461 | + | } | |
462 | + | else throw("Strict value is not equal to itself.") | |
463 | + | } | |
464 | + | else throw("Strict value is not equal to itself.") | |
465 | + | } | |
466 | + | ||
467 | + | ||
468 | + | ||
469 | + | @Callable(i) | |
470 | + | func depositStakingReward (asset_) = { | |
471 | + | let err = if (_whenInitialized()) | |
472 | + | then _validateAsset(asset_, "depositStakingReward: invalid asset") | |
473 | + | else false | |
474 | + | if ((err == err)) | |
475 | + | then { | |
476 | + | let stakingAssets = _loadStakingAssets() | |
477 | + | let updatedReserves = if ((asset_ == WAVES)) | |
478 | + | then { | |
479 | + | let sWavesContract = _loadSWavesContract() | |
480 | + | let sWavesAsset = _loadSWavesAsset(sWavesContract) | |
481 | + | let invocation = invoke(sWavesContract, FUNC_GET_RATE, nil, nil) | |
482 | + | let rate = match invocation { | |
483 | + | case a: String => | |
484 | + | parseBigIntValue(a) | |
485 | + | case _ => | |
486 | + | throw("depositStakingReward: sWaves getRate() revert") | |
487 | + | } | |
488 | + | let swavesAmount = assetBalance(this, sWavesAsset) | |
489 | + | toInt(fraction(toBigInt(swavesAmount), rate, SWAVES_RATE_FACTOR, DOWN)) | |
490 | + | } | |
491 | + | else if (containsElement(stakingAssets, asset_)) | |
492 | + | then { | |
493 | + | let invocation = invoke(_loadStakingContract(asset_), FUNC_CLAIM_ALL, [toString(this)], nil) | |
494 | + | if ((invocation == invocation)) | |
495 | + | then assetBalance(this, fromBase58String(asset_)) | |
496 | + | else throw("Strict value is not equal to itself.") | |
497 | + | } | |
498 | + | else throw("depositStakingReward: no staking for asset") | |
499 | + | let assetDecimals = _getDecimals(asset_) | |
500 | + | let updatedReservesNormalized = _normalizeDecimals(updatedReserves, assetDecimals, DEX_DECIMALS) | |
501 | + | let stakingProfit = (updatedReservesNormalized - _loadReserves(asset_)) | |
502 | + | let err1 = _validateInt(stakingProfit, 1, MAX_INT, "depositStakingReward: no reward") | |
503 | + | if ((err1 == err1)) | |
504 | + | then { | |
505 | + | let gatewayInvocation = invoke(_loadGatewayContract(), FUNC_DEPOSIT_STAKING_REWARD, [toString(this), toString(_loadChainId()), asset_, toString(stakingProfit)], nil) | |
506 | + | if ((gatewayInvocation == gatewayInvocation)) | |
507 | + | then $Tuple2(_saveReserves(asset_, updatedReservesNormalized), unit) | |
508 | + | else throw("Strict value is not equal to itself.") | |
509 | + | } | |
510 | + | else throw("Strict value is not equal to itself.") | |
511 | + | } | |
512 | + | else throw("Strict value is not equal to itself.") | |
513 | + | } | |
514 | + | ||
515 | + | ||
516 | + | ||
517 | + | @Callable(i) | |
518 | + | func addStakingAsset (asset_,contract_) = { | |
519 | + | let err = if (if (_onlyThisContract(i.caller)) | |
520 | + | then _validateAsset(asset_, "addStakingAsset: invalid asset") | |
521 | + | else false) | |
522 | + | then _validateAddress(contract_, "addStakingAsset: invalid contract") | |
523 | + | else false | |
524 | + | if ((err == err)) | |
525 | + | then { | |
526 | + | let assets = _loadStakingAssets() | |
527 | + | let err1 = if (containsElement(assets, asset_)) | |
528 | + | then throw("addStakingAsset: duplicate asset") | |
529 | + | else unit | |
530 | + | if ((err1 == err1)) | |
531 | + | then $Tuple2((_saveStakingAssets((assets :+ asset_)) ++ _saveStakingContract(asset_, addressFromStringValue(contract_))), unit) | |
532 | + | else throw("Strict value is not equal to itself.") | |
533 | + | } | |
534 | + | else throw("Strict value is not equal to itself.") | |
535 | + | } | |
536 | + | ||
537 | + | ||
538 | + | ||
539 | + | @Callable(i) | |
540 | + | func rmStakingAsset (asset_) = { | |
541 | + | let err = if (_onlyThisContract(i.caller)) | |
542 | + | then _validateAsset(asset_, "rmStakingAsset: invalid asset") | |
543 | + | else false | |
544 | + | if ((err == err)) | |
545 | + | then { | |
546 | + | let assets = _loadStakingAssets() | |
547 | + | let err1 = if (!(containsElement(assets, asset_))) | |
548 | + | then throw("rmStakingAsset: no asset") | |
549 | + | else unit | |
550 | + | if ((err1 == err1)) | |
551 | + | then { | |
552 | + | let index = value(indexOf(assets, asset_)) | |
553 | + | $Tuple2(_saveStakingAssets(removeByIndex(assets, index)), unit) | |
554 | + | } | |
555 | + | else throw("Strict value is not equal to itself.") | |
556 | + | } | |
557 | + | else throw("Strict value is not equal to itself.") | |
558 | + | } | |
559 | + | ||
560 | + | ||
561 | + | ||
562 | + | @Callable(i) | |
563 | + | func pause () = { | |
564 | + | let err = if (if (_onlyPauser(i.caller)) | |
565 | + | then _whenInitialized() | |
566 | + | else false) | |
567 | + | then _whenNotPaused() | |
568 | + | else false | |
569 | + | if ((err == err)) | |
570 | + | then $Tuple2(_savePause(true), unit) | |
571 | + | else throw("Strict value is not equal to itself.") | |
572 | + | } | |
573 | + | ||
574 | + | ||
575 | + | ||
576 | + | @Callable(i) | |
577 | + | func unpause () = { | |
578 | + | let err = if (if (_onlyPauser(i.caller)) | |
579 | + | then _whenInitialized() | |
580 | + | else false) | |
581 | + | then _whenPaused() | |
582 | + | else false | |
583 | + | if ((err == err)) | |
584 | + | then $Tuple2(_savePause(false), unit) | |
585 | + | else throw("Strict value is not equal to itself.") | |
586 | + | } | |
587 | + | ||
588 | + | ||
589 | + | ||
590 | + | @Callable(i) | |
591 | + | func updatePauser (pauser_) = { | |
592 | + | let err = if (if (_onlyThisContract(i.caller)) | |
593 | + | then _whenInitialized() | |
594 | + | else false) | |
595 | + | then _validateAddress(pauser_, "updatePauser: invalid pauser") | |
596 | + | else false | |
597 | + | if ((err == err)) | |
598 | + | then $Tuple2(_savePauser(addressFromStringValue(pauser_)), unit) | |
599 | + | else throw("Strict value is not equal to itself.") | |
600 | + | } | |
601 | + | ||
602 | + | ||
603 | + | ||
604 | + | @Callable(i) | |
605 | + | func setMultisig (multisig_) = { | |
606 | + | let err = if (_onlyThisContract(i.caller)) | |
607 | + | then _validateAddress(multisig_, "setMultisig: invalid multisig") | |
608 | + | else false | |
609 | + | if ((err == err)) | |
610 | + | then $Tuple2(_saveMultisig(addressFromStringValue(multisig_)), unit) | |
611 | + | else throw("Strict value is not equal to itself.") | |
612 | + | } | |
613 | + | ||
614 | + | ||
615 | + | @Verifier(tx) | |
616 | + | func verify () = match getString(KEY_MULTISIG) { | |
617 | + | case multisig: String => | |
618 | + | valueOrElse(getBoolean(addressFromStringValue(multisig), makeString([KEY_STATUS, toString(this), toBase58String(tx.id)], SEPARATOR)), false) | |
619 | + | case _ => | |
620 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
621 | + | } | |
622 | + |
github/deemru/w8io/169f3d6 31.45 ms ◑