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