tx · Fq7uou197Q9k8koFefhwwTRk2rBcpfaLFiuZ7aXXqJSN 3N8et6WznLg1aBK8WVHSY1oWHtoyEiDx3SV: -0.01400000 Waves 2023.04.21 10:41 [2544037] smart account 3N8et6WznLg1aBK8WVHSY1oWHtoyEiDx3SV > SELF 0.00000000 Waves
{ "type": 13, "id": "Fq7uou197Q9k8koFefhwwTRk2rBcpfaLFiuZ7aXXqJSN", "fee": 1400000, "feeAssetId": null, "timestamp": 1682062938809, "version": 2, "chainId": 84, "sender": "3N8et6WznLg1aBK8WVHSY1oWHtoyEiDx3SV", "senderPublicKey": "AynEswuW3gNkK56xYF19SRbhwxHMeTgDL8R8CgCCzL4y", "proofs": [ "3Px9DQR2BfRsZ4GT6pK1akY4H9PvMpYy8DUSLs5WWZ6gvygr8PN7TZsZrpq5AsmJn4J1Mhfk3y237n6TePjVeRpx" ], "script": "base64:BgJNCAISBgoECAgICBIJCgcICAgICAgIEgUKAwEIARIECgIBCBIDCgEIEgQKAgEEEgMKAQgSCwoJAQgIAQEBAQEEEgASABIDCgEIEgMKAQg7AAlTRVBBUkFUT1ICAl9fAAhLRVlfSU5JVAIESU5JVAAMS0VZX01VTFRJU0lHAghNVUxUSVNJRwAKS0VZX1NUQVRVUwIGU1RBVFVTAApLRVlfUEFVU0VEAgZQQVVTRUQACktFWV9QQVVTRVICBlBBVVNFUgAMS0VZX0VYRUNVVE9SAghFWEVDVVRPUgAQS0VZX1JPT1RfQURBUFRFUgIMUk9PVF9BREFQVEVSABNLRVlfQ0FMTEVSX0NPTlRSQUNUAg9DQUxMRVJfQ09OVFJBQ1QACUtFWV9DSEFJTgIFQ0hBSU4AC0tFWV9CSU5ESU5HAgdCSU5ESU5HAAdLRVlfRkVFAgNGRUUAEUtFWV9GRUVfUkVDSVBJRU5UAg1GRUVfUkVDSVBJRU5UABNGVU5DX1JFTEVBU0VfVE9LRU5TAg1yZWxlYXNlVG9rZW5zAAVXQVZFUwIFV0FWRVMADldBVkVTX0RFQ0lNQU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AAHCQEQX3ZhbGlkYXRlQWRkcmVzcwIFB3BhdXNlcl8CFGluaXQ6IGludmFsaWQgcGF1c2VyBwMJAAACBQNlcnIFA2VycgkAlAoCCQELX3NhdmVQYXVzZXIBCQERQGV4dHJOYXRpdmUoMTA2MikBBQdwYXVzZXJfBQR1bml0CQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAWkBC3NldE11bHRpc2lnAQltdWx0aXNpZ18EA2VycgMJARFfb25seVRoaXNDb250cmFjdAEIBQFpBmNhbGxlcgkBEF92YWxpZGF0ZUFkZHJlc3MCBQltdWx0aXNpZ18CHXNldE11bHRpc2lnOiBpbnZhbGlkIG11bHRpc2lnBwMJAAACBQNlcnIFA2VycgkAlAoCCQENX3NhdmVNdWx0aXNpZwEJARFAZXh0ck5hdGl2ZSgxMDYyKQEFCW11bHRpc2lnXwUEdW5pdAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAEByRtYXRjaDAJAKIIAQUMS0VZX01VTFRJU0lHAwkAAQIFByRtYXRjaDACBlN0cmluZwQIbXVsdGlzaWcFByRtYXRjaDAJAQt2YWx1ZU9yRWxzZQIJAJsIAgkBEUBleHRyTmF0aXZlKDEwNjIpAQUIbXVsdGlzaWcJALkJAgkAzAgCBQpLRVlfU1RBVFVTCQDMCAIJAKUIAQUEdGhpcwkAzAgCCQDYBAEIBQJ0eAJpZAUDbmlsBQlTRVBBUkFUT1IHCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5HRbLwQ==", "height": 2544037, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: EdWDTrzeSetmduHEBZjQHd5ufAQS2xHx99Lqm2t69W7t Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let SEPARATOR = "__" | |
5 | + | ||
6 | + | let KEY_INIT = "INIT" | |
7 | + | ||
8 | + | let KEY_MULTISIG = "MULTISIG" | |
9 | + | ||
10 | + | let KEY_STATUS = "STATUS" | |
11 | + | ||
12 | + | let KEY_PAUSED = "PAUSED" | |
13 | + | ||
14 | + | let KEY_PAUSER = "PAUSER" | |
15 | + | ||
16 | + | let KEY_EXECUTOR = "EXECUTOR" | |
17 | + | ||
18 | + | let KEY_ROOT_ADAPTER = "ROOT_ADAPTER" | |
19 | + | ||
20 | + | let KEY_CALLER_CONTRACT = "CALLER_CONTRACT" | |
21 | + | ||
22 | + | let KEY_CHAIN = "CHAIN" | |
23 | + | ||
24 | + | let KEY_BINDING = "BINDING" | |
25 | + | ||
26 | + | let KEY_FEE = "FEE" | |
27 | + | ||
28 | + | let KEY_FEE_RECIPIENT = "FEE_RECIPIENT" | |
29 | + | ||
30 | + | let FUNC_RELEASE_TOKENS = "releaseTokens" | |
31 | + | ||
32 | + | let WAVES = "WAVES" | |
33 | + | ||
34 | + | let WAVES_DECIMALS = 8 | |
35 | + | ||
36 | + | let DECIMALS = 6 | |
37 | + | ||
38 | + | let PERCENT_FACTOR = 1000000 | |
39 | + | ||
40 | + | let MAX_INT = 9223372036854775807 | |
41 | + | ||
42 | + | func _validateAddress (address_,err_) = match addressFromString(address_) { | |
43 | + | case a: Address => | |
44 | + | true | |
45 | + | case _ => | |
46 | + | throw(err_) | |
47 | + | } | |
48 | + | ||
49 | + | ||
50 | + | func _validateAsset (assetId_,err_) = match assetInfo(fromBase58String(assetId_)) { | |
51 | + | case a: Asset => | |
52 | + | true | |
53 | + | case _ => | |
54 | + | throw(err_) | |
55 | + | } | |
56 | + | ||
57 | + | ||
58 | + | func _validateInt (val_,lowerBoundary_,upperBoundary_,err_) = if (if ((lowerBoundary_ > val_)) | |
59 | + | then true | |
60 | + | else (val_ > upperBoundary_)) | |
61 | + | then throw(err_) | |
62 | + | else true | |
63 | + | ||
64 | + | ||
65 | + | func _validateBool (val_,target_,err_) = if ((val_ != target_)) | |
66 | + | then throw(err_) | |
67 | + | else true | |
68 | + | ||
69 | + | ||
70 | + | func _validatePaymentsSize (payments_,target_,err_) = if ((size(payments_) != target_)) | |
71 | + | then throw(err_) | |
72 | + | else true | |
73 | + | ||
74 | + | ||
75 | + | func _normalizeDecimals (amount_,sourceDecimals_,targetDecimals_) = if ((sourceDecimals_ >= targetDecimals_)) | |
76 | + | then (amount_ / pow(10, 0, (sourceDecimals_ - targetDecimals_), 0, 0, DOWN)) | |
77 | + | else (amount_ * pow(10, 0, (targetDecimals_ - sourceDecimals_), 0, 0, DOWN)) | |
78 | + | ||
79 | + | ||
80 | + | func _loadInit () = match getBoolean(KEY_INIT) { | |
81 | + | case a: Boolean => | |
82 | + | a | |
83 | + | case _ => | |
84 | + | false | |
85 | + | } | |
86 | + | ||
87 | + | ||
88 | + | func _saveInit (isInit_) = [BooleanEntry(KEY_INIT, isInit_)] | |
89 | + | ||
90 | + | ||
91 | + | func _loadPause () = match getBoolean(KEY_PAUSED) { | |
92 | + | case a: Boolean => | |
93 | + | a | |
94 | + | case _ => | |
95 | + | false | |
96 | + | } | |
97 | + | ||
98 | + | ||
99 | + | func _savePause (isPaused_) = [BooleanEntry(KEY_PAUSED, isPaused_)] | |
100 | + | ||
101 | + | ||
102 | + | func _loadPauser () = match getString(KEY_PAUSER) { | |
103 | + | case a: String => | |
104 | + | addressFromStringValue(a) | |
105 | + | case _ => | |
106 | + | Address(base58'') | |
107 | + | } | |
108 | + | ||
109 | + | ||
110 | + | func _savePauser (pauser_) = [StringEntry(KEY_PAUSER, toString(pauser_))] | |
111 | + | ||
112 | + | ||
113 | + | func _loadMultisig () = match getString(KEY_MULTISIG) { | |
114 | + | case a: String => | |
115 | + | addressFromStringValue(a) | |
116 | + | case _ => | |
117 | + | Address(base58'') | |
118 | + | } | |
119 | + | ||
120 | + | ||
121 | + | func _saveMultisig (multisig_) = [StringEntry(KEY_MULTISIG, toString(multisig_))] | |
122 | + | ||
123 | + | ||
124 | + | func _loadExecutor () = match getString(KEY_EXECUTOR) { | |
125 | + | case a: String => | |
126 | + | addressFromStringValue(a) | |
127 | + | case _ => | |
128 | + | Address(base58'') | |
129 | + | } | |
130 | + | ||
131 | + | ||
132 | + | func _saveExecutor (executor_) = [StringEntry(KEY_EXECUTOR, toString(executor_))] | |
133 | + | ||
134 | + | ||
135 | + | func _loadCallerContract () = match getString(KEY_CALLER_CONTRACT) { | |
136 | + | case a: String => | |
137 | + | a | |
138 | + | case _ => | |
139 | + | "" | |
140 | + | } | |
141 | + | ||
142 | + | ||
143 | + | func _saveCallerContract (caller_) = [StringEntry(KEY_CALLER_CONTRACT, caller_)] | |
144 | + | ||
145 | + | ||
146 | + | func _loadChain (chainId_) = match getBoolean(makeString([KEY_CHAIN, toString(chainId_)], SEPARATOR)) { | |
147 | + | case a: Boolean => | |
148 | + | a | |
149 | + | case _ => | |
150 | + | false | |
151 | + | } | |
152 | + | ||
153 | + | ||
154 | + | func _saveChain (chainId_,val_) = [BooleanEntry(makeString([KEY_CHAIN, toString(chainId_)], SEPARATOR), val_)] | |
155 | + | ||
156 | + | ||
157 | + | func _loadBinding (executionChainId_,assetId_) = match getString(makeString([KEY_BINDING, toString(executionChainId_), toBase58String(assetId_)], SEPARATOR)) { | |
158 | + | case a: String => | |
159 | + | let struct = split(a, SEPARATOR) | |
160 | + | $Tuple8(addressFromStringValue(struct[0]), struct[1], parseIntValue(struct[2]), parseIntValue(struct[3]), parseIntValue(struct[4]), parseIntValue(struct[5]), parseIntValue(struct[6]), if ((struct[7] == "1")) | |
161 | + | then true | |
162 | + | else false) | |
163 | + | case _ => | |
164 | + | $Tuple8(Address(base58''), "", 0, 0, 0, 0, 0, false) | |
165 | + | } | |
166 | + | ||
167 | + | ||
168 | + | func _saveBinding (executionChainId_,assetId_,binding_) = [StringEntry(makeString([KEY_BINDING, toString(executionChainId_), toBase58String(assetId_)], SEPARATOR), makeString([toString(binding_._1), binding_._2, toString(binding_._3), toString(binding_._4), toString(binding_._5), toString(binding_._6), toString(binding_._7), if (binding_._8) | |
169 | + | then "1" | |
170 | + | else "0"], SEPARATOR))] | |
171 | + | ||
172 | + | ||
173 | + | func _loadFee (assetId_) = match getInteger(makeString([KEY_FEE, toBase58String(assetId_)], SEPARATOR)) { | |
174 | + | case a: Int => | |
175 | + | a | |
176 | + | case _ => | |
177 | + | 0 | |
178 | + | } | |
179 | + | ||
180 | + | ||
181 | + | func _saveFee (assetId_,val_) = [IntegerEntry(makeString([KEY_FEE, toBase58String(assetId_)], SEPARATOR), val_)] | |
182 | + | ||
183 | + | ||
184 | + | func _loadRootAdapter () = match getString(KEY_ROOT_ADAPTER) { | |
185 | + | case a: String => | |
186 | + | addressFromStringValue(a) | |
187 | + | case _ => | |
188 | + | Address(base58'') | |
189 | + | } | |
190 | + | ||
191 | + | ||
192 | + | func _saveRootAdapter (adapter_) = [StringEntry(KEY_ROOT_ADAPTER, toString(adapter_))] | |
193 | + | ||
194 | + | ||
195 | + | func _loadFeeRecipient () = match getString(KEY_FEE_RECIPIENT) { | |
196 | + | case a: String => | |
197 | + | addressFromStringValue(a) | |
198 | + | case _ => | |
199 | + | Address(base58'') | |
200 | + | } | |
201 | + | ||
202 | + | ||
203 | + | func _saveFeeRecipient (val_) = [StringEntry(KEY_FEE_RECIPIENT, toString(val_))] | |
204 | + | ||
205 | + | ||
206 | + | func _onlyThisContract (caller_) = if ((caller_ != this)) | |
207 | + | then throw("_onlyThisContract: revert") | |
208 | + | else true | |
209 | + | ||
210 | + | ||
211 | + | func _whenMultisigSet () = if ((_loadMultisig() == Address(base58''))) | |
212 | + | then throw("_whenMultisigSet: revert") | |
213 | + | else true | |
214 | + | ||
215 | + | ||
216 | + | func _whenNotInitialized () = if (_loadInit()) | |
217 | + | then throw("_whenNotInitialized: revert") | |
218 | + | else true | |
219 | + | ||
220 | + | ||
221 | + | func _whenInitialized () = if (!(_loadInit())) | |
222 | + | then throw("_whenInitialized: revert") | |
223 | + | else true | |
224 | + | ||
225 | + | ||
226 | + | func _whenNotPaused () = if (_loadPause()) | |
227 | + | then throw("_whenNotPaused: revert") | |
228 | + | else true | |
229 | + | ||
230 | + | ||
231 | + | func _whenPaused () = if (!(_loadPause())) | |
232 | + | then throw("_whenPaused: revert") | |
233 | + | else true | |
234 | + | ||
235 | + | ||
236 | + | func _onlyPauser (caller_) = if ((caller_ != _loadPauser())) | |
237 | + | then throw("_onlyPauser: revert") | |
238 | + | else true | |
239 | + | ||
240 | + | ||
241 | + | func _asInt (val_) = match val_ { | |
242 | + | case a: Int => | |
243 | + | a | |
244 | + | case _ => | |
245 | + | throw("_asInt: revert") | |
246 | + | } | |
247 | + | ||
248 | + | ||
249 | + | func _asBytes (val_) = match val_ { | |
250 | + | case a: ByteVector => | |
251 | + | a | |
252 | + | case _ => | |
253 | + | throw("_asBytes: revert") | |
254 | + | } | |
255 | + | ||
256 | + | ||
257 | + | func _validateExecutor (val_,err_) = if ((val_ != _loadExecutor())) | |
258 | + | then throw(err_) | |
259 | + | else true | |
260 | + | ||
261 | + | ||
262 | + | func _validateCaller (val_,err_) = if ((val_ != _loadCallerContract())) | |
263 | + | then throw(err_) | |
264 | + | else true | |
265 | + | ||
266 | + | ||
267 | + | func _validateChain (executionChainId_,err_) = if (!(_loadChain(executionChainId_))) | |
268 | + | then throw(err_) | |
269 | + | else true | |
270 | + | ||
271 | + | ||
272 | + | @Callable(i) | |
273 | + | func init (executor_,adapter_,pauser_,feeRecipient_) = { | |
274 | + | let err = if (if (if (if (if (if (_onlyThisContract(i.caller)) | |
275 | + | then _whenNotInitialized() | |
276 | + | else false) | |
277 | + | then _whenMultisigSet() | |
278 | + | else false) | |
279 | + | then _validateAddress(executor_, "init: invalid executor") | |
280 | + | else false) | |
281 | + | then _validateAddress(adapter_, "init: invalid adapter") | |
282 | + | else false) | |
283 | + | then _validateAddress(pauser_, "init: invalid pauser") | |
284 | + | else false) | |
285 | + | then _validateAddress(feeRecipient_, "init: invalid feeRecipient") | |
286 | + | else false | |
287 | + | if ((err == err)) | |
288 | + | then $Tuple2(((((_saveInit(true) ++ _saveExecutor(addressFromStringValue(executor_))) ++ _saveRootAdapter(addressFromStringValue(adapter_))) ++ _savePauser(addressFromStringValue(pauser_))) ++ _saveFeeRecipient(addressFromStringValue(feeRecipient_))), unit) | |
289 | + | else throw("Strict value is not equal to itself.") | |
290 | + | } | |
291 | + | ||
292 | + | ||
293 | + | ||
294 | + | @Callable(i) | |
295 | + | func mintTokens (callerContract_,assetContract_,amount_,recipient_,gaslessReward_,referrer_,referrerFee_) = { | |
296 | + | let amount = valueOrErrorMessage(parseInt(amount_), "mint: amount is not Int") | |
297 | + | let gaslessReward = valueOrErrorMessage(parseInt(gaslessReward_), "mint: gaslessReward is not Int") | |
298 | + | let referrerFee = valueOrErrorMessage(parseInt(referrerFee_), "mint: referrerFee is not Int") | |
299 | + | let err = if (if (if (if (if (if (if (if (_whenInitialized()) | |
300 | + | then _whenNotPaused() | |
301 | + | else false) | |
302 | + | then _validateAddress(assetContract_, "mint: invalid asset contract") | |
303 | + | else false) | |
304 | + | then _validateExecutor(i.caller, "mint: invalid executor") | |
305 | + | else false) | |
306 | + | then _validateCaller(callerContract_, "mint: invalid caller") | |
307 | + | else false) | |
308 | + | then _validateAddress(recipient_, "mint: invalid recipient address") | |
309 | + | else false) | |
310 | + | then _validateInt(amount, 0, MAX_INT, "mint: invalid amount") | |
311 | + | else false) | |
312 | + | then _validateInt(gaslessReward, 0, MAX_INT, "mint: invalid gaslessReward") | |
313 | + | else false) | |
314 | + | then _validateInt(referrerFee, 0, MAX_INT, "mint: invalid referrer fee") | |
315 | + | else false | |
316 | + | if ((err == err)) | |
317 | + | then { | |
318 | + | let assetId = _asBytes(invoke(addressFromStringValue(assetContract_), "getAssetId", nil, nil)) | |
319 | + | if ((assetId == assetId)) | |
320 | + | then { | |
321 | + | let assetDecimals = _asInt(invoke(addressFromStringValue(assetContract_), "getDecimals", nil, nil)) | |
322 | + | if ((assetDecimals == assetDecimals)) | |
323 | + | then { | |
324 | + | let normalizedAmount = _normalizeDecimals(amount, DECIMALS, assetDecimals) | |
325 | + | let normalizedGasless = _normalizeDecimals(gaslessReward, DECIMALS, assetDecimals) | |
326 | + | let referrer = match addressFromString(referrer_) { | |
327 | + | case refererAddress: Address => | |
328 | + | let normalizedReferrerFee = _normalizeDecimals(referrerFee, DECIMALS, assetDecimals) | |
329 | + | $Tuple2(normalizedReferrerFee, [ScriptTransfer(refererAddress, normalizedReferrerFee, assetId)]) | |
330 | + | case _ => | |
331 | + | $Tuple2(0, nil) | |
332 | + | } | |
333 | + | let normalizedReferrerFee = referrer._1 | |
334 | + | let referrerActions = referrer._2 | |
335 | + | let invocation = invoke(addressFromStringValue(assetContract_), "mint", [(normalizedAmount + normalizedReferrerFee), toString(this)], nil) | |
336 | + | if ((invocation == invocation)) | |
337 | + | then { | |
338 | + | let actions = if (if ((normalizedGasless > 0)) | |
339 | + | then (addressFromStringValue(recipient_) != i.originCaller) | |
340 | + | else false) | |
341 | + | then [ScriptTransfer(addressFromStringValue(recipient_), (normalizedAmount - normalizedGasless), assetId), ScriptTransfer(i.originCaller, normalizedGasless, assetId)] | |
342 | + | else [ScriptTransfer(addressFromStringValue(recipient_), normalizedAmount, assetId)] | |
343 | + | $Tuple2((actions ++ referrerActions), unit) | |
344 | + | } | |
345 | + | else throw("Strict value is not equal to itself.") | |
346 | + | } | |
347 | + | else throw("Strict value is not equal to itself.") | |
348 | + | } | |
349 | + | else throw("Strict value is not equal to itself.") | |
350 | + | } | |
351 | + | else throw("Strict value is not equal to itself.") | |
352 | + | } | |
353 | + | ||
354 | + | ||
355 | + | ||
356 | + | @Callable(i) | |
357 | + | func burnTokens (executionChainId_,recipient_,gaslessReward_) = { | |
358 | + | let err = if (if (if (if (_whenInitialized()) | |
359 | + | then _whenNotPaused() | |
360 | + | else false) | |
361 | + | then _validateChain(executionChainId_, "burn: invalid execution chain") | |
362 | + | else false) | |
363 | + | then _validatePaymentsSize(i.payments, 1, "burn: no payment") | |
364 | + | else false) | |
365 | + | then _validateInt(i.payments[0].amount, 0, MAX_INT, "burn: invalid payment amount") | |
366 | + | else false | |
367 | + | if ((err == err)) | |
368 | + | then { | |
369 | + | let amount = i.payments[0].amount | |
370 | + | let assetId = match i.payments[0].assetId { | |
371 | + | case a: ByteVector => | |
372 | + | a | |
373 | + | case _ => | |
374 | + | throw("burn: invalid asset") | |
375 | + | } | |
376 | + | let binding = _loadBinding(executionChainId_, assetId) | |
377 | + | let assetContract = binding._1 | |
378 | + | let executionAsset = binding._2 | |
379 | + | let minAmount = binding._3 | |
380 | + | let minFee = binding._4 | |
381 | + | let thresholdFee = binding._5 | |
382 | + | let beforePercentFee = binding._6 | |
383 | + | let afterPercentFee = binding._7 | |
384 | + | let enabled = binding._8 | |
385 | + | let err1 = if (if (_validateAddress(toString(assetContract), "burn: no such binding")) | |
386 | + | then _validateInt(amount, minAmount, MAX_INT, "burn: less than min") | |
387 | + | else false) | |
388 | + | then _validateBool(enabled, true, "burn: token is disabled") | |
389 | + | else false | |
390 | + | if ((err1 == err1)) | |
391 | + | then { | |
392 | + | let assetDecimals = _asInt(invoke(assetContract, "getDecimals", nil, nil)) | |
393 | + | if ((assetDecimals == assetDecimals)) | |
394 | + | then { | |
395 | + | let percent = if ((amount > thresholdFee)) | |
396 | + | then afterPercentFee | |
397 | + | else beforePercentFee | |
398 | + | let fee = (minFee + fraction(amount, percent, PERCENT_FACTOR)) | |
399 | + | let err2 = _validateInt(amount, (fee + 1), MAX_INT, "burn: fee more than amount") | |
400 | + | if ((err2 == err2)) | |
401 | + | then { | |
402 | + | let amountToSend = (amount - fee) | |
403 | + | let err3 = _validateInt(amountToSend, (gaslessReward_ + 1), MAX_INT, "burn: reward more than amount") | |
404 | + | if ((err3 == err3)) | |
405 | + | then { | |
406 | + | let updateFee = (_loadFee(assetId) + fee) | |
407 | + | let normalizedAmount = _normalizeDecimals(amountToSend, assetDecimals, DECIMALS) | |
408 | + | let normalizedGasless = _normalizeDecimals(gaslessReward_, assetDecimals, DECIMALS) | |
409 | + | let invocation = invoke(_loadRootAdapter(), FUNC_RELEASE_TOKENS, [executionChainId_, executionAsset, normalizedAmount, recipient_, normalizedGasless], nil) | |
410 | + | if ((invocation == invocation)) | |
411 | + | then $Tuple2((_saveFee(assetId, updateFee) ++ [Burn(assetId, amountToSend)]), unit) | |
412 | + | else throw("Strict value is not equal to itself.") | |
413 | + | } | |
414 | + | else throw("Strict value is not equal to itself.") | |
415 | + | } | |
416 | + | else throw("Strict value is not equal to itself.") | |
417 | + | } | |
418 | + | else throw("Strict value is not equal to itself.") | |
419 | + | } | |
420 | + | else throw("Strict value is not equal to itself.") | |
421 | + | } | |
422 | + | else throw("Strict value is not equal to itself.") | |
423 | + | } | |
424 | + | ||
425 | + | ||
426 | + | ||
427 | + | @Callable(i) | |
428 | + | func transferFee (executionChainId_,assetId_) = { | |
429 | + | let err = if (if (_whenInitialized()) | |
430 | + | then _whenNotPaused() | |
431 | + | else false) | |
432 | + | then _validateAsset(assetId_, "transferFee: invalid asset") | |
433 | + | else false | |
434 | + | if ((err == err)) | |
435 | + | then { | |
436 | + | let assetId = fromBase58String(assetId_) | |
437 | + | let binding = _loadBinding(executionChainId_, assetId) | |
438 | + | let assetContract = binding._1 | |
439 | + | let enabled = binding._8 | |
440 | + | let err1 = if (_validateAddress(toString(assetContract), "transferFee: no such binding")) | |
441 | + | then _validateBool(enabled, true, "transferFee: token is disabled") | |
442 | + | else false | |
443 | + | if ((err1 == err1)) | |
444 | + | then $Tuple2((_saveFee(assetId, 0) ++ [ScriptTransfer(_loadFeeRecipient(), _loadFee(assetId), assetId)]), unit) | |
445 | + | else throw("Strict value is not equal to itself.") | |
446 | + | } | |
447 | + | else throw("Strict value is not equal to itself.") | |
448 | + | } | |
449 | + | ||
450 | + | ||
451 | + | ||
452 | + | @Callable(i) | |
453 | + | func updateCallerContract (callerContract_) = { | |
454 | + | let err = if (_onlyThisContract(i.caller)) | |
455 | + | then _whenInitialized() | |
456 | + | else false | |
457 | + | if ((err == err)) | |
458 | + | then $Tuple2(_saveCallerContract(callerContract_), unit) | |
459 | + | else throw("Strict value is not equal to itself.") | |
460 | + | } | |
461 | + | ||
462 | + | ||
463 | + | ||
464 | + | @Callable(i) | |
465 | + | func updateExecutionChain (executionChainId_,enabled_) = { | |
466 | + | let err = if (if (_onlyThisContract(i.caller)) | |
467 | + | then _whenInitialized() | |
468 | + | else false) | |
469 | + | then _validateInt(executionChainId_, 0, MAX_INT, "updateExecutionChain: invalid executionChainId") | |
470 | + | else false | |
471 | + | if ((err == err)) | |
472 | + | then $Tuple2(_saveChain(executionChainId_, enabled_), unit) | |
473 | + | else throw("Strict value is not equal to itself.") | |
474 | + | } | |
475 | + | ||
476 | + | ||
477 | + | ||
478 | + | @Callable(i) | |
479 | + | func updateFeeRecipient (feeRecipient_) = { | |
480 | + | let err = if (if (_onlyThisContract(i.caller)) | |
481 | + | then _whenInitialized() | |
482 | + | else false) | |
483 | + | then _validateAddress(feeRecipient_, "updateFeeRecipient: invalid feeRecipient") | |
484 | + | else false | |
485 | + | if ((err == err)) | |
486 | + | then $Tuple2(_saveFeeRecipient(addressFromStringValue(feeRecipient_)), unit) | |
487 | + | else throw("Strict value is not equal to itself.") | |
488 | + | } | |
489 | + | ||
490 | + | ||
491 | + | ||
492 | + | @Callable(i) | |
493 | + | func updateBindingInfo (executionChainId_,assetContract_,executionAsset_,minAmount_,minFee_,thresholdFee_,beforePercentFee_,afterPercentFee_,enabled_) = { | |
494 | + | let err = if (if (if (if (if (if (if (if (_onlyThisContract(i.caller)) | |
495 | + | then _whenInitialized() | |
496 | + | else false) | |
497 | + | then _validateAddress(assetContract_, "updateBindingInfo: invalid asset contract") | |
498 | + | else false) | |
499 | + | then _validateInt(executionChainId_, 0, MAX_INT, "updateBindingInfo: invalid executionChainId") | |
500 | + | else false) | |
501 | + | then _validateInt(minAmount_, 0, MAX_INT, "updateBindingInfo: invalid minAmount") | |
502 | + | else false) | |
503 | + | then _validateInt(minFee_, 0, MAX_INT, "updateBindingInfo: invalid minFee") | |
504 | + | else false) | |
505 | + | then _validateInt(thresholdFee_, 0, MAX_INT, "updateBindingInfo: invalid thresholdFee") | |
506 | + | else false) | |
507 | + | then _validateInt(beforePercentFee_, 0, MAX_INT, "updateBindingInfo: invalid beforePercentFee") | |
508 | + | else false) | |
509 | + | then _validateInt(afterPercentFee_, 0, MAX_INT, "updateBindingInfo: invalid afterPercentFee") | |
510 | + | else false | |
511 | + | if ((err == err)) | |
512 | + | then { | |
513 | + | let assetId = _asBytes(invoke(addressFromStringValue(assetContract_), "getAssetId", nil, nil)) | |
514 | + | if ((assetId == assetId)) | |
515 | + | then { | |
516 | + | let binding = $Tuple8(addressFromStringValue(assetContract_), executionAsset_, minAmount_, minFee_, thresholdFee_, beforePercentFee_, afterPercentFee_, enabled_) | |
517 | + | $Tuple2(_saveBinding(executionChainId_, assetId, binding), unit) | |
518 | + | } | |
519 | + | else throw("Strict value is not equal to itself.") | |
520 | + | } | |
521 | + | else throw("Strict value is not equal to itself.") | |
522 | + | } | |
523 | + | ||
524 | + | ||
525 | + | ||
526 | + | @Callable(i) | |
527 | + | func pause () = { | |
528 | + | let err = if (if (_onlyPauser(i.caller)) | |
529 | + | then _whenInitialized() | |
530 | + | else false) | |
531 | + | then _whenNotPaused() | |
532 | + | else false | |
533 | + | if ((err == err)) | |
534 | + | then $Tuple2(_savePause(true), unit) | |
535 | + | else throw("Strict value is not equal to itself.") | |
536 | + | } | |
537 | + | ||
538 | + | ||
539 | + | ||
540 | + | @Callable(i) | |
541 | + | func unpause () = { | |
542 | + | let err = if (if (_onlyPauser(i.caller)) | |
543 | + | then _whenInitialized() | |
544 | + | else false) | |
545 | + | then _whenPaused() | |
546 | + | else false | |
547 | + | if ((err == err)) | |
548 | + | then $Tuple2(_savePause(false), unit) | |
549 | + | else throw("Strict value is not equal to itself.") | |
550 | + | } | |
551 | + | ||
552 | + | ||
553 | + | ||
554 | + | @Callable(i) | |
555 | + | func updatePauser (pauser_) = { | |
556 | + | let err = if (if (_onlyThisContract(i.caller)) | |
557 | + | then _whenInitialized() | |
558 | + | else false) | |
559 | + | then _validateAddress(pauser_, "init: invalid pauser") | |
560 | + | else false | |
561 | + | if ((err == err)) | |
562 | + | then $Tuple2(_savePauser(addressFromStringValue(pauser_)), unit) | |
563 | + | else throw("Strict value is not equal to itself.") | |
564 | + | } | |
565 | + | ||
566 | + | ||
567 | + | ||
568 | + | @Callable(i) | |
569 | + | func setMultisig (multisig_) = { | |
570 | + | let err = if (_onlyThisContract(i.caller)) | |
571 | + | then _validateAddress(multisig_, "setMultisig: invalid multisig") | |
572 | + | else false | |
573 | + | if ((err == err)) | |
574 | + | then $Tuple2(_saveMultisig(addressFromStringValue(multisig_)), unit) | |
575 | + | else throw("Strict value is not equal to itself.") | |
576 | + | } | |
577 | + | ||
578 | + | ||
579 | + | @Verifier(tx) | |
580 | + | func verify () = match getString(KEY_MULTISIG) { | |
581 | + | case multisig: String => | |
582 | + | valueOrElse(getBoolean(addressFromStringValue(multisig), makeString([KEY_STATUS, toString(this), toBase58String(tx.id)], SEPARATOR)), false) | |
583 | + | case _ => | |
584 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
585 | + | } | |
586 | + |
github/deemru/w8io/169f3d6 39.07 ms ◑