tx · AYFnp5rYW8kJxTU3XfHTS36TQmnTRmvNWWLoDDyZfUDy

3Mx4GxjrawhKHBgMKH9C5Hmbj8ePZDrs8ed:  -0.01400000 Waves

2023.04.18 17:01 [2540073] smart account 3Mx4GxjrawhKHBgMKH9C5Hmbj8ePZDrs8ed > SELF 0.00000000 Waves

{ "type": 13, "id": "AYFnp5rYW8kJxTU3XfHTS36TQmnTRmvNWWLoDDyZfUDy", "fee": 1400000, "feeAssetId": null, "timestamp": 1681826148359, "version": 2, "chainId": 84, "sender": "3Mx4GxjrawhKHBgMKH9C5Hmbj8ePZDrs8ed", "senderPublicKey": "9DpEgmia9fGpxtGGDeSMtER4g9qB7WQPPYTKTHzqSFuX", "proofs": [ "55A3Pkg1sZfrSxfFNUnViscLeULjWRXzFLig9eeKbXoyfXir346B8vEHLivJi9q3H2kn7KvY1vizhDafm2H4krgX" ], "script": "base64:BgJNCAISBgoECAgICBIJCgcICAgICAgIEgUKAwEIARIECgIBCBIDCgEIEgQKAgEEEgMKAQgSCwoJAQgIAQEBAQEEEgASABIDCgEIEgMKAQg7AAlTRVBBUkFUT1ICAl9fAAhLRVlfSU5JVAIESU5JVAAMS0VZX01VTFRJU0lHAghNVUxUSVNJRwAKS0VZX1NUQVRVUwIGU1RBVFVTAApLRVlfUEFVU0VEAgZQQVVTRUQACktFWV9QQVVTRVICBlBBVVNFUgAMS0VZX0VYRUNVVE9SAghFWEVDVVRPUgAQS0VZX1JPT1RfQURBUFRFUgIMUk9PVF9BREFQVEVSABNLRVlfQ0FMTEVSX0NPTlRSQUNUAg9DQUxMRVJfQ09OVFJBQ1QACUtFWV9DSEFJTgIFQ0hBSU4AC0tFWV9CSU5ESU5HAgdCSU5ESU5HAAdLRVlfRkVFAgNGRUUAEUtFWV9GRUVfUkVDSVBJRU5UAg1GRUVfUkVDSVBJRU5UABNGVU5DX1JFTEVBU0VfVE9LRU5TAg1yZWxlYXNlVG9rZW5zAAVXQVZFUwIFV0FWRVMADldBVkVTX0RFQ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saXplZAAHCQEQX3ZhbGlkYXRlQWRkcmVzcwIFB3BhdXNlcl8CFGluaXQ6IGludmFsaWQgcGF1c2VyBwMJAAACBQNlcnIFA2VycgkAlAoCCQELX3NhdmVQYXVzZXIBCQERQGV4dHJOYXRpdmUoMTA2MikBBQdwYXVzZXJfBQR1bml0CQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAWkBC3NldE11bHRpc2lnAQltdWx0aXNpZ18EA2VycgMJARFfb25seVRoaXNDb250cmFjdAEIBQFpBmNhbGxlcgkBEF92YWxpZGF0ZUFkZHJlc3MCBQltdWx0aXNpZ18CHXNldE11bHRpc2lnOiBpbnZhbGlkIG11bHRpc2lnBwMJAAACBQNlcnIFA2VycgkAlAoCCQENX3NhdmVNdWx0aXNpZwEJARFAZXh0ck5hdGl2ZSgxMDYyKQEFCW11bHRpc2lnXwUEdW5pdAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAEByRtYXRjaDAJAKIIAQUMS0VZX01VTFRJU0lHAwkAAQIFByRtYXRjaDACBlN0cmluZwQIbXVsdGlzaWcFByRtYXRjaDAJAQt2YWx1ZU9yRWxzZQIJAJsIAgkBEUBleHRyTmF0aXZlKDEwNjIpAQUIbXVsdGlzaWcJALkJAgkAzAgCBQpLRVlfU1RBVFVTCQDMCAIJAKUIAQUEdGhpcwkAzAgCCQDYBAEIBQJ0eAJpZAUDbmlsBQlTRVBBUkFUT1IHCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5HRbLwQ==", "height": 2540073, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EkmnDMW7YNFu146auHdnCg627annJ8gVjiBk9kdQm5GR Next: 5Z1JkyR2dz4cb2Dj5tp9UrMtWcPMpuen9D5L3xvJzgxu Diff:
OldNewDifferences
395395 let percent = if ((amount > thresholdFee))
396396 then afterPercentFee
397397 else beforePercentFee
398- let fee = (minFee + ((amount * percent) / PERCENT_FACTOR))
398+ let fee = (minFee + fraction(amount, percent, PERCENT_FACTOR))
399399 let err2 = _validateInt(amount, (fee + 1), MAX_INT, "burn: fee more than amount")
400400 if ((err2 == err2))
401401 then {
425425
426426
427427 @Callable(i)
428-func transferFee (assetContract_) = {
428+func transferFee (executionChainId_,assetId_) = {
429429 let err = if (if (_whenInitialized())
430430 then _whenNotPaused()
431431 else false)
432- then _validateAddress(assetContract_, "burnFee: invalid asset contract")
432+ then _validateAsset(assetId_, "transferFee: invalid asset")
433433 else false
434434 if ((err == err))
435435 then {
436- let assetId = _asBytes(invoke(addressFromStringValue(assetContract_), "getAssetId", nil, nil))
437- if ((assetId == assetId))
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))
438444 then $Tuple2((_saveFee(assetId, 0) ++ [ScriptTransfer(_loadFeeRecipient(), _loadFee(assetId), assetId)]), unit)
439445 else throw("Strict value is not equal to itself.")
440446 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEPARATOR = "__"
55
66 let KEY_INIT = "INIT"
77
88 let KEY_MULTISIG = "MULTISIG"
99
1010 let KEY_STATUS = "STATUS"
1111
1212 let KEY_PAUSED = "PAUSED"
1313
1414 let KEY_PAUSER = "PAUSER"
1515
1616 let KEY_EXECUTOR = "EXECUTOR"
1717
1818 let KEY_ROOT_ADAPTER = "ROOT_ADAPTER"
1919
2020 let KEY_CALLER_CONTRACT = "CALLER_CONTRACT"
2121
2222 let KEY_CHAIN = "CHAIN"
2323
2424 let KEY_BINDING = "BINDING"
2525
2626 let KEY_FEE = "FEE"
2727
2828 let KEY_FEE_RECIPIENT = "FEE_RECIPIENT"
2929
3030 let FUNC_RELEASE_TOKENS = "releaseTokens"
3131
3232 let WAVES = "WAVES"
3333
3434 let WAVES_DECIMALS = 8
3535
3636 let DECIMALS = 6
3737
3838 let PERCENT_FACTOR = 1000000
3939
4040 let MAX_INT = 9223372036854775807
4141
4242 func _validateAddress (address_,err_) = match addressFromString(address_) {
4343 case a: Address =>
4444 true
4545 case _ =>
4646 throw(err_)
4747 }
4848
4949
5050 func _validateAsset (assetId_,err_) = match assetInfo(fromBase58String(assetId_)) {
5151 case a: Asset =>
5252 true
5353 case _ =>
5454 throw(err_)
5555 }
5656
5757
5858 func _validateInt (val_,lowerBoundary_,upperBoundary_,err_) = if (if ((lowerBoundary_ > val_))
5959 then true
6060 else (val_ > upperBoundary_))
6161 then throw(err_)
6262 else true
6363
6464
6565 func _validateBool (val_,target_,err_) = if ((val_ != target_))
6666 then throw(err_)
6767 else true
6868
6969
7070 func _validatePaymentsSize (payments_,target_,err_) = if ((size(payments_) != target_))
7171 then throw(err_)
7272 else true
7373
7474
7575 func _normalizeDecimals (amount_,sourceDecimals_,targetDecimals_) = if ((sourceDecimals_ >= targetDecimals_))
7676 then (amount_ / pow(10, 0, (sourceDecimals_ - targetDecimals_), 0, 0, DOWN))
7777 else (amount_ * pow(10, 0, (targetDecimals_ - sourceDecimals_), 0, 0, DOWN))
7878
7979
8080 func _loadInit () = match getBoolean(KEY_INIT) {
8181 case a: Boolean =>
8282 a
8383 case _ =>
8484 false
8585 }
8686
8787
8888 func _saveInit (isInit_) = [BooleanEntry(KEY_INIT, isInit_)]
8989
9090
9191 func _loadPause () = match getBoolean(KEY_PAUSED) {
9292 case a: Boolean =>
9393 a
9494 case _ =>
9595 false
9696 }
9797
9898
9999 func _savePause (isPaused_) = [BooleanEntry(KEY_PAUSED, isPaused_)]
100100
101101
102102 func _loadPauser () = match getString(KEY_PAUSER) {
103103 case a: String =>
104104 addressFromStringValue(a)
105105 case _ =>
106106 Address(base58'')
107107 }
108108
109109
110110 func _savePauser (pauser_) = [StringEntry(KEY_PAUSER, toString(pauser_))]
111111
112112
113113 func _loadMultisig () = match getString(KEY_MULTISIG) {
114114 case a: String =>
115115 addressFromStringValue(a)
116116 case _ =>
117117 Address(base58'')
118118 }
119119
120120
121121 func _saveMultisig (multisig_) = [StringEntry(KEY_MULTISIG, toString(multisig_))]
122122
123123
124124 func _loadExecutor () = match getString(KEY_EXECUTOR) {
125125 case a: String =>
126126 addressFromStringValue(a)
127127 case _ =>
128128 Address(base58'')
129129 }
130130
131131
132132 func _saveExecutor (executor_) = [StringEntry(KEY_EXECUTOR, toString(executor_))]
133133
134134
135135 func _loadCallerContract () = match getString(KEY_CALLER_CONTRACT) {
136136 case a: String =>
137137 a
138138 case _ =>
139139 ""
140140 }
141141
142142
143143 func _saveCallerContract (caller_) = [StringEntry(KEY_CALLER_CONTRACT, caller_)]
144144
145145
146146 func _loadChain (chainId_) = match getBoolean(makeString([KEY_CHAIN, toString(chainId_)], SEPARATOR)) {
147147 case a: Boolean =>
148148 a
149149 case _ =>
150150 false
151151 }
152152
153153
154154 func _saveChain (chainId_,val_) = [BooleanEntry(makeString([KEY_CHAIN, toString(chainId_)], SEPARATOR), val_)]
155155
156156
157157 func _loadBinding (executionChainId_,assetId_) = match getString(makeString([KEY_BINDING, toString(executionChainId_), toBase58String(assetId_)], SEPARATOR)) {
158158 case a: String =>
159159 let struct = split(a, SEPARATOR)
160160 $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"))
161161 then true
162162 else false)
163163 case _ =>
164164 $Tuple8(Address(base58''), "", 0, 0, 0, 0, 0, false)
165165 }
166166
167167
168168 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)
169169 then "1"
170170 else "0"], SEPARATOR))]
171171
172172
173173 func _loadFee (assetId_) = match getInteger(makeString([KEY_FEE, toBase58String(assetId_)], SEPARATOR)) {
174174 case a: Int =>
175175 a
176176 case _ =>
177177 0
178178 }
179179
180180
181181 func _saveFee (assetId_,val_) = [IntegerEntry(makeString([KEY_FEE, toBase58String(assetId_)], SEPARATOR), val_)]
182182
183183
184184 func _loadRootAdapter () = match getString(KEY_ROOT_ADAPTER) {
185185 case a: String =>
186186 addressFromStringValue(a)
187187 case _ =>
188188 Address(base58'')
189189 }
190190
191191
192192 func _saveRootAdapter (adapter_) = [StringEntry(KEY_ROOT_ADAPTER, toString(adapter_))]
193193
194194
195195 func _loadFeeRecipient () = match getString(KEY_FEE_RECIPIENT) {
196196 case a: String =>
197197 addressFromStringValue(a)
198198 case _ =>
199199 Address(base58'')
200200 }
201201
202202
203203 func _saveFeeRecipient (val_) = [StringEntry(KEY_FEE_RECIPIENT, toString(val_))]
204204
205205
206206 func _onlyThisContract (caller_) = if ((caller_ != this))
207207 then throw("_onlyThisContract: revert")
208208 else true
209209
210210
211211 func _whenMultisigSet () = if ((_loadMultisig() == Address(base58'')))
212212 then throw("_whenMultisigSet: revert")
213213 else true
214214
215215
216216 func _whenNotInitialized () = if (_loadInit())
217217 then throw("_whenNotInitialized: revert")
218218 else true
219219
220220
221221 func _whenInitialized () = if (!(_loadInit()))
222222 then throw("_whenInitialized: revert")
223223 else true
224224
225225
226226 func _whenNotPaused () = if (_loadPause())
227227 then throw("_whenNotPaused: revert")
228228 else true
229229
230230
231231 func _whenPaused () = if (!(_loadPause()))
232232 then throw("_whenPaused: revert")
233233 else true
234234
235235
236236 func _onlyPauser (caller_) = if ((caller_ != _loadPauser()))
237237 then throw("_onlyPauser: revert")
238238 else true
239239
240240
241241 func _asInt (val_) = match val_ {
242242 case a: Int =>
243243 a
244244 case _ =>
245245 throw("_asInt: revert")
246246 }
247247
248248
249249 func _asBytes (val_) = match val_ {
250250 case a: ByteVector =>
251251 a
252252 case _ =>
253253 throw("_asBytes: revert")
254254 }
255255
256256
257257 func _validateExecutor (val_,err_) = if ((val_ != _loadExecutor()))
258258 then throw(err_)
259259 else true
260260
261261
262262 func _validateCaller (val_,err_) = if ((val_ != _loadCallerContract()))
263263 then throw(err_)
264264 else true
265265
266266
267267 func _validateChain (executionChainId_,err_) = if (!(_loadChain(executionChainId_)))
268268 then throw(err_)
269269 else true
270270
271271
272272 @Callable(i)
273273 func init (executor_,adapter_,pauser_,feeRecipient_) = {
274274 let err = if (if (if (if (if (if (_onlyThisContract(i.caller))
275275 then _whenNotInitialized()
276276 else false)
277277 then _whenMultisigSet()
278278 else false)
279279 then _validateAddress(executor_, "init: invalid executor")
280280 else false)
281281 then _validateAddress(adapter_, "init: invalid adapter")
282282 else false)
283283 then _validateAddress(pauser_, "init: invalid pauser")
284284 else false)
285285 then _validateAddress(feeRecipient_, "init: invalid feeRecipient")
286286 else false
287287 if ((err == err))
288288 then $Tuple2(((((_saveInit(true) ++ _saveExecutor(addressFromStringValue(executor_))) ++ _saveRootAdapter(addressFromStringValue(adapter_))) ++ _savePauser(addressFromStringValue(pauser_))) ++ _saveFeeRecipient(addressFromStringValue(feeRecipient_))), unit)
289289 else throw("Strict value is not equal to itself.")
290290 }
291291
292292
293293
294294 @Callable(i)
295295 func mintTokens (callerContract_,assetContract_,amount_,recipient_,gaslessReward_,referrer_,referrerFee_) = {
296296 let amount = valueOrErrorMessage(parseInt(amount_), "mint: amount is not Int")
297297 let gaslessReward = valueOrErrorMessage(parseInt(gaslessReward_), "mint: gaslessReward is not Int")
298298 let referrerFee = valueOrErrorMessage(parseInt(referrerFee_), "mint: referrerFee is not Int")
299299 let err = if (if (if (if (if (if (if (if (_whenInitialized())
300300 then _whenNotPaused()
301301 else false)
302302 then _validateAddress(assetContract_, "mint: invalid asset contract")
303303 else false)
304304 then _validateExecutor(i.caller, "mint: invalid executor")
305305 else false)
306306 then _validateCaller(callerContract_, "mint: invalid caller")
307307 else false)
308308 then _validateAddress(recipient_, "mint: invalid recipient address")
309309 else false)
310310 then _validateInt(amount, 0, MAX_INT, "mint: invalid amount")
311311 else false)
312312 then _validateInt(gaslessReward, 0, MAX_INT, "mint: invalid gaslessReward")
313313 else false)
314314 then _validateInt(referrerFee, 0, MAX_INT, "mint: invalid referrer fee")
315315 else false
316316 if ((err == err))
317317 then {
318318 let assetId = _asBytes(invoke(addressFromStringValue(assetContract_), "getAssetId", nil, nil))
319319 if ((assetId == assetId))
320320 then {
321321 let assetDecimals = _asInt(invoke(addressFromStringValue(assetContract_), "getDecimals", nil, nil))
322322 if ((assetDecimals == assetDecimals))
323323 then {
324324 let normalizedAmount = _normalizeDecimals(amount, DECIMALS, assetDecimals)
325325 let normalizedGasless = _normalizeDecimals(gaslessReward, DECIMALS, assetDecimals)
326326 let referrer = match addressFromString(referrer_) {
327327 case refererAddress: Address =>
328328 let normalizedReferrerFee = _normalizeDecimals(referrerFee, DECIMALS, assetDecimals)
329329 $Tuple2(normalizedReferrerFee, [ScriptTransfer(refererAddress, normalizedReferrerFee, assetId)])
330330 case _ =>
331331 $Tuple2(0, nil)
332332 }
333333 let normalizedReferrerFee = referrer._1
334334 let referrerActions = referrer._2
335335 let invocation = invoke(addressFromStringValue(assetContract_), "mint", [(normalizedAmount + normalizedReferrerFee), toString(this)], nil)
336336 if ((invocation == invocation))
337337 then {
338338 let actions = if (if ((normalizedGasless > 0))
339339 then (addressFromStringValue(recipient_) != i.originCaller)
340340 else false)
341341 then [ScriptTransfer(addressFromStringValue(recipient_), (normalizedAmount - normalizedGasless), assetId), ScriptTransfer(i.originCaller, normalizedGasless, assetId)]
342342 else [ScriptTransfer(addressFromStringValue(recipient_), normalizedAmount, assetId)]
343343 $Tuple2((actions ++ referrerActions), unit)
344344 }
345345 else throw("Strict value is not equal to itself.")
346346 }
347347 else throw("Strict value is not equal to itself.")
348348 }
349349 else throw("Strict value is not equal to itself.")
350350 }
351351 else throw("Strict value is not equal to itself.")
352352 }
353353
354354
355355
356356 @Callable(i)
357357 func burnTokens (executionChainId_,recipient_,gaslessReward_) = {
358358 let err = if (if (if (if (_whenInitialized())
359359 then _whenNotPaused()
360360 else false)
361361 then _validateChain(executionChainId_, "burn: invalid execution chain")
362362 else false)
363363 then _validatePaymentsSize(i.payments, 1, "burn: no payment")
364364 else false)
365365 then _validateInt(i.payments[0].amount, 0, MAX_INT, "burn: invalid payment amount")
366366 else false
367367 if ((err == err))
368368 then {
369369 let amount = i.payments[0].amount
370370 let assetId = match i.payments[0].assetId {
371371 case a: ByteVector =>
372372 a
373373 case _ =>
374374 throw("burn: invalid asset")
375375 }
376376 let binding = _loadBinding(executionChainId_, assetId)
377377 let assetContract = binding._1
378378 let executionAsset = binding._2
379379 let minAmount = binding._3
380380 let minFee = binding._4
381381 let thresholdFee = binding._5
382382 let beforePercentFee = binding._6
383383 let afterPercentFee = binding._7
384384 let enabled = binding._8
385385 let err1 = if (if (_validateAddress(toString(assetContract), "burn: no such binding"))
386386 then _validateInt(amount, minAmount, MAX_INT, "burn: less than min")
387387 else false)
388388 then _validateBool(enabled, true, "burn: token is disabled")
389389 else false
390390 if ((err1 == err1))
391391 then {
392392 let assetDecimals = _asInt(invoke(assetContract, "getDecimals", nil, nil))
393393 if ((assetDecimals == assetDecimals))
394394 then {
395395 let percent = if ((amount > thresholdFee))
396396 then afterPercentFee
397397 else beforePercentFee
398- let fee = (minFee + ((amount * percent) / PERCENT_FACTOR))
398+ let fee = (minFee + fraction(amount, percent, PERCENT_FACTOR))
399399 let err2 = _validateInt(amount, (fee + 1), MAX_INT, "burn: fee more than amount")
400400 if ((err2 == err2))
401401 then {
402402 let amountToSend = (amount - fee)
403403 let err3 = _validateInt(amountToSend, (gaslessReward_ + 1), MAX_INT, "burn: reward more than amount")
404404 if ((err3 == err3))
405405 then {
406406 let updateFee = (_loadFee(assetId) + fee)
407407 let normalizedAmount = _normalizeDecimals(amountToSend, assetDecimals, DECIMALS)
408408 let normalizedGasless = _normalizeDecimals(gaslessReward_, assetDecimals, DECIMALS)
409409 let invocation = invoke(_loadRootAdapter(), FUNC_RELEASE_TOKENS, [executionChainId_, executionAsset, normalizedAmount, recipient_, normalizedGasless], nil)
410410 if ((invocation == invocation))
411411 then $Tuple2((_saveFee(assetId, updateFee) ++ [Burn(assetId, amountToSend)]), unit)
412412 else throw("Strict value is not equal to itself.")
413413 }
414414 else throw("Strict value is not equal to itself.")
415415 }
416416 else throw("Strict value is not equal to itself.")
417417 }
418418 else throw("Strict value is not equal to itself.")
419419 }
420420 else throw("Strict value is not equal to itself.")
421421 }
422422 else throw("Strict value is not equal to itself.")
423423 }
424424
425425
426426
427427 @Callable(i)
428-func transferFee (assetContract_) = {
428+func transferFee (executionChainId_,assetId_) = {
429429 let err = if (if (_whenInitialized())
430430 then _whenNotPaused()
431431 else false)
432- then _validateAddress(assetContract_, "burnFee: invalid asset contract")
432+ then _validateAsset(assetId_, "transferFee: invalid asset")
433433 else false
434434 if ((err == err))
435435 then {
436- let assetId = _asBytes(invoke(addressFromStringValue(assetContract_), "getAssetId", nil, nil))
437- if ((assetId == assetId))
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))
438444 then $Tuple2((_saveFee(assetId, 0) ++ [ScriptTransfer(_loadFeeRecipient(), _loadFee(assetId), assetId)]), unit)
439445 else throw("Strict value is not equal to itself.")
440446 }
441447 else throw("Strict value is not equal to itself.")
442448 }
443449
444450
445451
446452 @Callable(i)
447453 func updateCallerContract (callerContract_) = {
448454 let err = if (_onlyThisContract(i.caller))
449455 then _whenInitialized()
450456 else false
451457 if ((err == err))
452458 then $Tuple2(_saveCallerContract(callerContract_), unit)
453459 else throw("Strict value is not equal to itself.")
454460 }
455461
456462
457463
458464 @Callable(i)
459465 func updateExecutionChain (executionChainId_,enabled_) = {
460466 let err = if (if (_onlyThisContract(i.caller))
461467 then _whenInitialized()
462468 else false)
463469 then _validateInt(executionChainId_, 0, MAX_INT, "updateExecutionChain: invalid executionChainId")
464470 else false
465471 if ((err == err))
466472 then $Tuple2(_saveChain(executionChainId_, enabled_), unit)
467473 else throw("Strict value is not equal to itself.")
468474 }
469475
470476
471477
472478 @Callable(i)
473479 func updateFeeRecipient (feeRecipient_) = {
474480 let err = if (if (_onlyThisContract(i.caller))
475481 then _whenInitialized()
476482 else false)
477483 then _validateAddress(feeRecipient_, "updateFeeRecipient: invalid feeRecipient")
478484 else false
479485 if ((err == err))
480486 then $Tuple2(_saveFeeRecipient(addressFromStringValue(feeRecipient_)), unit)
481487 else throw("Strict value is not equal to itself.")
482488 }
483489
484490
485491
486492 @Callable(i)
487493 func updateBindingInfo (executionChainId_,assetContract_,executionAsset_,minAmount_,minFee_,thresholdFee_,beforePercentFee_,afterPercentFee_,enabled_) = {
488494 let err = if (if (if (if (if (if (if (if (_onlyThisContract(i.caller))
489495 then _whenInitialized()
490496 else false)
491497 then _validateAddress(assetContract_, "updateBindingInfo: invalid asset contract")
492498 else false)
493499 then _validateInt(executionChainId_, 0, MAX_INT, "updateBindingInfo: invalid executionChainId")
494500 else false)
495501 then _validateInt(minAmount_, 0, MAX_INT, "updateBindingInfo: invalid minAmount")
496502 else false)
497503 then _validateInt(minFee_, 0, MAX_INT, "updateBindingInfo: invalid minFee")
498504 else false)
499505 then _validateInt(thresholdFee_, 0, MAX_INT, "updateBindingInfo: invalid thresholdFee")
500506 else false)
501507 then _validateInt(beforePercentFee_, 0, MAX_INT, "updateBindingInfo: invalid beforePercentFee")
502508 else false)
503509 then _validateInt(afterPercentFee_, 0, MAX_INT, "updateBindingInfo: invalid afterPercentFee")
504510 else false
505511 if ((err == err))
506512 then {
507513 let assetId = _asBytes(invoke(addressFromStringValue(assetContract_), "getAssetId", nil, nil))
508514 if ((assetId == assetId))
509515 then {
510516 let binding = $Tuple8(addressFromStringValue(assetContract_), executionAsset_, minAmount_, minFee_, thresholdFee_, beforePercentFee_, afterPercentFee_, enabled_)
511517 $Tuple2(_saveBinding(executionChainId_, assetId, binding), unit)
512518 }
513519 else throw("Strict value is not equal to itself.")
514520 }
515521 else throw("Strict value is not equal to itself.")
516522 }
517523
518524
519525
520526 @Callable(i)
521527 func pause () = {
522528 let err = if (if (_onlyPauser(i.caller))
523529 then _whenInitialized()
524530 else false)
525531 then _whenNotPaused()
526532 else false
527533 if ((err == err))
528534 then $Tuple2(_savePause(true), unit)
529535 else throw("Strict value is not equal to itself.")
530536 }
531537
532538
533539
534540 @Callable(i)
535541 func unpause () = {
536542 let err = if (if (_onlyPauser(i.caller))
537543 then _whenInitialized()
538544 else false)
539545 then _whenPaused()
540546 else false
541547 if ((err == err))
542548 then $Tuple2(_savePause(false), unit)
543549 else throw("Strict value is not equal to itself.")
544550 }
545551
546552
547553
548554 @Callable(i)
549555 func updatePauser (pauser_) = {
550556 let err = if (if (_onlyThisContract(i.caller))
551557 then _whenInitialized()
552558 else false)
553559 then _validateAddress(pauser_, "init: invalid pauser")
554560 else false
555561 if ((err == err))
556562 then $Tuple2(_savePauser(addressFromStringValue(pauser_)), unit)
557563 else throw("Strict value is not equal to itself.")
558564 }
559565
560566
561567
562568 @Callable(i)
563569 func setMultisig (multisig_) = {
564570 let err = if (_onlyThisContract(i.caller))
565571 then _validateAddress(multisig_, "setMultisig: invalid multisig")
566572 else false
567573 if ((err == err))
568574 then $Tuple2(_saveMultisig(addressFromStringValue(multisig_)), unit)
569575 else throw("Strict value is not equal to itself.")
570576 }
571577
572578
573579 @Verifier(tx)
574580 func verify () = match getString(KEY_MULTISIG) {
575581 case multisig: String =>
576582 valueOrElse(getBoolean(addressFromStringValue(multisig), makeString([KEY_STATUS, toString(this), toBase58String(tx.id)], SEPARATOR)), false)
577583 case _ =>
578584 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
579585 }
580586

github/deemru/w8io/026f985 
57.94 ms