tx · 4vgyaGQhnumaZYfqqhMGFKJG2Tgh3uqg7VzhaHu7PpWc 3MrtFvvc7QBGaNXke4B8T7brYidircMU8pM: -0.01400000 Waves 2023.02.22 23:50 [2461360] smart account 3MrtFvvc7QBGaNXke4B8T7brYidircMU8pM > SELF 0.00000000 Waves
{ "type": 13, "id": "4vgyaGQhnumaZYfqqhMGFKJG2Tgh3uqg7VzhaHu7PpWc", "fee": 1400000, "feeAssetId": null, "timestamp": 1677098849785, "version": 2, "chainId": 84, "sender": "3MrtFvvc7QBGaNXke4B8T7brYidircMU8pM", "senderPublicKey": "A3DknTXNtQRgyx5yLE3L1YUXipPTqbF3qQrCvp8ZbFPq", "proofs": [ "2a6GimP4F56QMUGE43Yp4aMgUm3Au3HzM4RJ74mzFAddJXq5QuTrJpvXu3rfmxU3KsPYP52ncwut1ocry6HoS17Y" ], "script": "base64:BgJOCAISBgoECAgICBIJCgcICAEIAQgBEgcKBQEIAQgBEgMKAQgSAwoBCBIECgIBBBIDCgEIEgsKCQEICAEBAQEBBBIAEgASAwoBCBIDCgEIPAAJU0VQQVJBVE9SAgJfXwAIS0VZX0lOSVQCBElOSVQADEtFWV9NVUxUSVNJRwIITVVMVElTSUcACktFWV9TVEFUVVMCBlNUQVRVUwAKS0VZX1BBVVNFRAIGUEFVU0VEAApLRVlfUEFVU0VSAgZQQVVTRVIADEtFWV9FWEVDVVRPUgIIRVhFQ1VUT1IAEEtFWV9ST09UX0FEQVBURVICDFJPT1RfQURBUFRFUgATS0VZX0NBTExFUl9DT05UUkFDVAIPQ0FMTEVSX0NPTlRSQUNUAAlLRVlfQ0hBSU4CBUNIQUlOAAtLRVlfQklORElORwIHQklORElORwAHS0VZX0ZFRQIDRkVFABFLRVlfRkVFX1JFQ0lQSUVOVAINRkVFX1JFQ0lQSUVOVAATRlVOQ19SRUxFQVNFX1RPS0VOUwINcmVsZWFzZVRva2VucwAFV0FWRVMCBVdBVkVTAA5XQVZFU19ERUNJTUFMUwAIAAhERUNJTUF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hbGlkYXRlQWRkcmVzcwIFCW11bHRpc2lnXwIdc2V0TXVsdGlzaWc6IGludmFsaWQgbXVsdGlzaWcHAwkAAAIFA2VycgUDZXJyCQCUCgIJAQ1fc2F2ZU11bHRpc2lnAQkBEUBleHRyTmF0aXZlKDEwNjIpAQUJbXVsdGlzaWdfBQR1bml0CQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJ0eAEGdmVyaWZ5AAQHJG1hdGNoMAkAoggBBQxLRVlfTVVMVElTSUcDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAhtdWx0aXNpZwUHJG1hdGNoMAkBC3ZhbHVlT3JFbHNlAgkAmwgCCQERQGV4dHJOYXRpdmUoMTA2MikBBQhtdWx0aXNpZwkAuQkCCQDMCAIFCktFWV9TVEFUVVMJAMwIAgkApQgBBQR0aGlzCQDMCAIJANgEAQgFAnR4AmlkBQNuaWwFCVNFUEFSQVRPUgcJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXlv+W7b", "height": 2461360, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FsdhTvBcNQP2rmCVB1YZBh73ndKK1yJ3aB5YUg3L9ZLR Next: 3QmGLKYytno6jaX9QVTynJDtKtEAE6Tg7FMMXKHuNsQm Diff:
Old | New | Differences | |
---|---|---|---|
275 | 275 | ||
276 | 276 | ||
277 | 277 | @Callable(i) | |
278 | - | func init (executor_,adapter_,pauser_) = { | |
279 | - | let err = if (if (if (if (if (_onlyThisContract(i.caller)) | |
278 | + | func init (executor_,adapter_,pauser_,feeRecipient_) = { | |
279 | + | let err = if (if (if (if (if (if (_onlyThisContract(i.caller)) | |
280 | 280 | then _whenNotInitialized() | |
281 | 281 | else false) | |
282 | 282 | then _whenMultisigSet() | |
286 | 286 | then _validateAddress(adapter_, "init: invalid adapter") | |
287 | 287 | else false) | |
288 | 288 | then _validateAddress(pauser_, "init: invalid pauser") | |
289 | + | else false) | |
290 | + | then _validateAddress(feeRecipient_, "init: invalid feeRecipient") | |
289 | 291 | else false | |
290 | 292 | if ((err == err)) | |
291 | - | then $Tuple2((((_saveInit(true) ++ _saveExecutor(addressFromStringValue(executor_))) ++ _saveRootAdapter(addressFromStringValue(adapter_))) ++ _savePauser(addressFromStringValue(pauser_))), unit) | |
293 | + | then $Tuple2(((((_saveInit(true) ++ _saveExecutor(addressFromStringValue(executor_))) ++ _saveRootAdapter(addressFromStringValue(adapter_))) ++ _savePauser(addressFromStringValue(pauser_))) ++ _saveFeeRecipient(addressFromStringValue(feeRecipient_))), unit) | |
292 | 294 | else throw("Strict value is not equal to itself.") | |
293 | 295 | } | |
294 | 296 |
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_,pauser_) = { | |
279 | - | let err = if (if (if (if (if (_onlyThisContract(i.caller)) | |
278 | + | func init (executor_,adapter_,pauser_,feeRecipient_) = { | |
279 | + | let err = if (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 | 287 | else false) | |
288 | 288 | then _validateAddress(pauser_, "init: invalid pauser") | |
289 | + | else false) | |
290 | + | then _validateAddress(feeRecipient_, "init: invalid feeRecipient") | |
289 | 291 | else false | |
290 | 292 | if ((err == err)) | |
291 | - | then $Tuple2((((_saveInit(true) ++ _saveExecutor(addressFromStringValue(executor_))) ++ _saveRootAdapter(addressFromStringValue(adapter_))) ++ _savePauser(addressFromStringValue(pauser_))), unit) | |
293 | + | then $Tuple2(((((_saveInit(true) ++ _saveExecutor(addressFromStringValue(executor_))) ++ _saveRootAdapter(addressFromStringValue(adapter_))) ++ _savePauser(addressFromStringValue(pauser_))) ++ _saveFeeRecipient(addressFromStringValue(feeRecipient_))), unit) | |
292 | 294 | else throw("Strict value is not equal to itself.") | |
293 | 295 | } | |
294 | 296 | ||
295 | 297 | ||
296 | 298 | ||
297 | 299 | @Callable(i) | |
298 | 300 | func mintTokens (callerContract_,assetContract_,amount_,recipient_,gaslessReward_,referrer_,referrerFee_) = { | |
299 | 301 | let err = if (if (if (if (if (if (if (_whenInitialized()) | |
300 | 302 | then _whenNotPaused() | |
301 | 303 | else false) | |
302 | 304 | then _validateAddress(assetContract_, "mint: invalid asset contract") | |
303 | 305 | else false) | |
304 | 306 | then _validateExecutor(i.caller, "mint: invalid executor") | |
305 | 307 | else false) | |
306 | 308 | then _validateCaller(callerContract_, "mint: invalid caller") | |
307 | 309 | else false) | |
308 | 310 | then _validateAddress(recipient_, "mint: invalid recipient address") | |
309 | 311 | else false) | |
310 | 312 | then _validateInt(amount_, 0, MAX_INT, "mint: invalid amount") | |
311 | 313 | else false) | |
312 | 314 | then _validateInt(gaslessReward_, 0, MAX_INT, "mint: invalid gaslessReward") | |
313 | 315 | else false | |
314 | 316 | if ((err == err)) | |
315 | 317 | then { | |
316 | 318 | let assetId = _asBytes(invoke(addressFromStringValue(assetContract_), "getAssetId", nil, nil)) | |
317 | 319 | if ((assetId == assetId)) | |
318 | 320 | then { | |
319 | 321 | let assetDecimals = _asInt(invoke(addressFromStringValue(assetContract_), "getDecimals", nil, nil)) | |
320 | 322 | if ((assetDecimals == assetDecimals)) | |
321 | 323 | then { | |
322 | 324 | let normalizedAmount = _normalizeDecimals(amount_, DECIMALS, assetDecimals) | |
323 | 325 | let normalizedGasless = _normalizeDecimals(gaslessReward_, DECIMALS, assetDecimals) | |
324 | 326 | let referrer = if ((size(referrer_) > 0)) | |
325 | 327 | then { | |
326 | 328 | let err1 = if (_validateAddress(referrer_, "mint: invalid referrer address")) | |
327 | 329 | then _validateInt(referrerFee_, 0, MAX_INT, "mint: invalid referrer fee") | |
328 | 330 | else false | |
329 | 331 | if ((err1 == err1)) | |
330 | 332 | then { | |
331 | 333 | let normalizedReferrerFee = _normalizeDecimals(referrerFee_, DECIMALS, assetDecimals) | |
332 | 334 | $Tuple2(normalizedReferrerFee, [ScriptTransfer(addressFromStringValue(referrer_), normalizedReferrerFee, assetId)]) | |
333 | 335 | } | |
334 | 336 | else throw("Strict value is not equal to itself.") | |
335 | 337 | } | |
336 | 338 | else $Tuple2(0, nil) | |
337 | 339 | let referrerFee = referrer._1 | |
338 | 340 | let referrerActions = referrer._2 | |
339 | 341 | let invocation = invoke(addressFromStringValue(assetContract_), "mint", [(normalizedAmount + referrerFee), toString(this)], nil) | |
340 | 342 | if ((invocation == invocation)) | |
341 | 343 | then { | |
342 | 344 | let actions = if (if ((normalizedGasless > 0)) | |
343 | 345 | then (addressFromStringValue(recipient_) != i.originCaller) | |
344 | 346 | else false) | |
345 | 347 | then [ScriptTransfer(addressFromStringValue(recipient_), (normalizedAmount - normalizedGasless), assetId), ScriptTransfer(i.originCaller, normalizedGasless, assetId)] | |
346 | 348 | else [ScriptTransfer(addressFromStringValue(recipient_), normalizedAmount, assetId)] | |
347 | 349 | $Tuple2((actions ++ referrerActions), unit) | |
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 | else throw("Strict value is not equal to itself.") | |
356 | 358 | } | |
357 | 359 | ||
358 | 360 | ||
359 | 361 | ||
360 | 362 | @Callable(i) | |
361 | 363 | func burnTokens (executionChainId_,assetContract_,amount_,recipient_,gaslessReward_) = { | |
362 | 364 | let err = if (if (if (if (if (_whenInitialized()) | |
363 | 365 | then _whenNotPaused() | |
364 | 366 | else false) | |
365 | 367 | then _validateAddress(assetContract_, "burn: invalid asset contract") | |
366 | 368 | else false) | |
367 | 369 | then _validateChain(executionChainId_, "burn: invalid execution chain") | |
368 | 370 | else false) | |
369 | 371 | then _validatePaymentsSize(i.payments, 1, "burn: no payment") | |
370 | 372 | else false) | |
371 | 373 | then _validateInt(i.payments[0].amount, amount_, MAX_INT, "burn: invalid payment amount") | |
372 | 374 | else false | |
373 | 375 | if ((err == err)) | |
374 | 376 | then { | |
375 | 377 | let assetId = _asBytes(invoke(addressFromStringValue(assetContract_), "getAssetId", nil, nil)) | |
376 | 378 | if ((assetId == assetId)) | |
377 | 379 | then { | |
378 | 380 | let assetDecimals = _asInt(invoke(addressFromStringValue(assetContract_), "getDecimals", nil, nil)) | |
379 | 381 | if ((assetDecimals == assetDecimals)) | |
380 | 382 | then { | |
381 | 383 | let binding = _loadBinding(executionChainId_, assetId) | |
382 | 384 | let executionAsset = binding._1 | |
383 | 385 | let minAmount = binding._2 | |
384 | 386 | let minFee = binding._3 | |
385 | 387 | let thresholdFee = binding._4 | |
386 | 388 | let beforePercentFee = binding._5 | |
387 | 389 | let afterPercentFee = binding._6 | |
388 | 390 | let enabled = binding._7 | |
389 | 391 | let err1 = if (if (_validatePaymentAsset(i.payments[0], assetId, "burn: invalid payment asset")) | |
390 | 392 | then _validateInt(amount_, minAmount, MAX_INT, "burn: less than min") | |
391 | 393 | else false) | |
392 | 394 | then _validateBool(enabled, true, "burn: token is disabled") | |
393 | 395 | else false | |
394 | 396 | if ((err1 == err1)) | |
395 | 397 | then { | |
396 | 398 | let percent = if ((amount_ > thresholdFee)) | |
397 | 399 | then afterPercentFee | |
398 | 400 | else beforePercentFee | |
399 | 401 | let fee = (minFee + ((amount_ * percent) / PERCENT_FACTOR)) | |
400 | 402 | let err2 = _validateInt(amount_, (fee + 1), MAX_INT, "burn: fee more than amount") | |
401 | 403 | if ((err2 == err2)) | |
402 | 404 | then { | |
403 | 405 | let amountToSend = (amount_ - fee) | |
404 | 406 | let err3 = _validateInt(amountToSend, (gaslessReward_ + 1), MAX_INT, "burn: reward more than amount") | |
405 | 407 | if ((err3 == err3)) | |
406 | 408 | then { | |
407 | 409 | let updateFee = (_loadFee(assetId) + fee) | |
408 | 410 | let normalizedAmount = _normalizeDecimals(amountToSend, assetDecimals, DECIMALS) | |
409 | 411 | let normalizedGasless = _normalizeDecimals(gaslessReward_, assetDecimals, DECIMALS) | |
410 | 412 | let invocation = invoke(_loadRootAdapter(), FUNC_RELEASE_TOKENS, [executionChainId_, executionAsset, normalizedAmount, recipient_, normalizedGasless], nil) | |
411 | 413 | if ((invocation == invocation)) | |
412 | 414 | then $Tuple2((_saveFee(assetId, updateFee) ++ [Burn(assetId, amountToSend)]), unit) | |
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 | else throw("Strict value is not equal to itself.") | |
426 | 428 | } | |
427 | 429 | ||
428 | 430 | ||
429 | 431 | ||
430 | 432 | @Callable(i) | |
431 | 433 | func transferFee (assetContract_) = { | |
432 | 434 | let err = if (if (_whenInitialized()) | |
433 | 435 | then _whenNotPaused() | |
434 | 436 | else false) | |
435 | 437 | then _validateAddress(assetContract_, "burnFee: invalid asset contract") | |
436 | 438 | else false | |
437 | 439 | if ((err == err)) | |
438 | 440 | then { | |
439 | 441 | let assetId = _asBytes(invoke(addressFromStringValue(assetContract_), "getAssetId", nil, nil)) | |
440 | 442 | if ((assetId == assetId)) | |
441 | 443 | then $Tuple2((_saveFee(assetId, 0) ++ [ScriptTransfer(_loadFeeRecipient(), _loadFee(assetId), assetId)]), unit) | |
442 | 444 | else throw("Strict value is not equal to itself.") | |
443 | 445 | } | |
444 | 446 | else throw("Strict value is not equal to itself.") | |
445 | 447 | } | |
446 | 448 | ||
447 | 449 | ||
448 | 450 | ||
449 | 451 | @Callable(i) | |
450 | 452 | func updateCallerContract (callerContract_) = { | |
451 | 453 | let err = if (_onlyThisContract(i.caller)) | |
452 | 454 | then _whenInitialized() | |
453 | 455 | else false | |
454 | 456 | if ((err == err)) | |
455 | 457 | then $Tuple2(_saveCallerContract(callerContract_), unit) | |
456 | 458 | else throw("Strict value is not equal to itself.") | |
457 | 459 | } | |
458 | 460 | ||
459 | 461 | ||
460 | 462 | ||
461 | 463 | @Callable(i) | |
462 | 464 | func updateExecutionChain (executionChainId_,enabled_) = { | |
463 | 465 | let err = if (if (_onlyThisContract(i.caller)) | |
464 | 466 | then _whenInitialized() | |
465 | 467 | else false) | |
466 | 468 | then _validateInt(executionChainId_, 0, MAX_INT, "updateExecutionChain: invalid executionChainId") | |
467 | 469 | else false | |
468 | 470 | if ((err == err)) | |
469 | 471 | then $Tuple2(_saveChain(executionChainId_, enabled_), unit) | |
470 | 472 | else throw("Strict value is not equal to itself.") | |
471 | 473 | } | |
472 | 474 | ||
473 | 475 | ||
474 | 476 | ||
475 | 477 | @Callable(i) | |
476 | 478 | func updateFeeRecipient (feeRecipient_) = { | |
477 | 479 | let err = if (if (_onlyThisContract(i.caller)) | |
478 | 480 | then _whenInitialized() | |
479 | 481 | else false) | |
480 | 482 | then _validateAddress(feeRecipient_, "updateFeeRecipient: invalid feeRecipient") | |
481 | 483 | else false | |
482 | 484 | if ((err == err)) | |
483 | 485 | then $Tuple2(_saveFeeRecipient(addressFromStringValue(feeRecipient_)), unit) | |
484 | 486 | else throw("Strict value is not equal to itself.") | |
485 | 487 | } | |
486 | 488 | ||
487 | 489 | ||
488 | 490 | ||
489 | 491 | @Callable(i) | |
490 | 492 | func updateBindingInfo (executionChainId_,assetContract_,executionAsset_,minAmount_,minFee_,thresholdFee_,beforePercentFee_,afterPercentFee_,enabled_) = { | |
491 | 493 | let err = if (if (if (if (if (if (if (if (_onlyThisContract(i.caller)) | |
492 | 494 | then _whenInitialized() | |
493 | 495 | else false) | |
494 | 496 | then _validateAddress(assetContract_, "updateBindingInfo: invalid asset contract") | |
495 | 497 | else false) | |
496 | 498 | then _validateInt(executionChainId_, 0, MAX_INT, "updateBindingInfo: invalid executionChainId") | |
497 | 499 | else false) | |
498 | 500 | then _validateInt(minAmount_, 0, MAX_INT, "updateBindingInfo: invalid minAmount") | |
499 | 501 | else false) | |
500 | 502 | then _validateInt(minFee_, 0, MAX_INT, "updateBindingInfo: invalid minFee") | |
501 | 503 | else false) | |
502 | 504 | then _validateInt(thresholdFee_, 0, MAX_INT, "updateBindingInfo: invalid thresholdFee") | |
503 | 505 | else false) | |
504 | 506 | then _validateInt(beforePercentFee_, 0, MAX_INT, "updateBindingInfo: invalid beforePercentFee") | |
505 | 507 | else false) | |
506 | 508 | then _validateInt(afterPercentFee_, 0, MAX_INT, "updateBindingInfo: invalid afterPercentFee") | |
507 | 509 | else false | |
508 | 510 | if ((err == err)) | |
509 | 511 | then { | |
510 | 512 | let assetId = _asBytes(invoke(addressFromStringValue(assetContract_), "getAssetId", nil, nil)) | |
511 | 513 | if ((assetId == assetId)) | |
512 | 514 | then { | |
513 | 515 | let binding = $Tuple7(executionAsset_, minAmount_, minFee_, thresholdFee_, beforePercentFee_, afterPercentFee_, enabled_) | |
514 | 516 | $Tuple2(_saveBinding(executionChainId_, assetId, binding), unit) | |
515 | 517 | } | |
516 | 518 | else throw("Strict value is not equal to itself.") | |
517 | 519 | } | |
518 | 520 | else throw("Strict value is not equal to itself.") | |
519 | 521 | } | |
520 | 522 | ||
521 | 523 | ||
522 | 524 | ||
523 | 525 | @Callable(i) | |
524 | 526 | func pause () = { | |
525 | 527 | let err = if (if (_onlyPauser(i.caller)) | |
526 | 528 | then _whenInitialized() | |
527 | 529 | else false) | |
528 | 530 | then _whenNotPaused() | |
529 | 531 | else false | |
530 | 532 | if ((err == err)) | |
531 | 533 | then $Tuple2(_savePause(true), unit) | |
532 | 534 | else throw("Strict value is not equal to itself.") | |
533 | 535 | } | |
534 | 536 | ||
535 | 537 | ||
536 | 538 | ||
537 | 539 | @Callable(i) | |
538 | 540 | func unpause () = { | |
539 | 541 | let err = if (if (_onlyPauser(i.caller)) | |
540 | 542 | then _whenInitialized() | |
541 | 543 | else false) | |
542 | 544 | then _whenPaused() | |
543 | 545 | else false | |
544 | 546 | if ((err == err)) | |
545 | 547 | then $Tuple2(_savePause(false), unit) | |
546 | 548 | else throw("Strict value is not equal to itself.") | |
547 | 549 | } | |
548 | 550 | ||
549 | 551 | ||
550 | 552 | ||
551 | 553 | @Callable(i) | |
552 | 554 | func updatePauser (pauser_) = { | |
553 | 555 | let err = if (if (_onlyThisContract(i.caller)) | |
554 | 556 | then _whenInitialized() | |
555 | 557 | else false) | |
556 | 558 | then _validateAddress(pauser_, "init: invalid pauser") | |
557 | 559 | else false | |
558 | 560 | if ((err == err)) | |
559 | 561 | then $Tuple2(_savePauser(addressFromStringValue(pauser_)), unit) | |
560 | 562 | else throw("Strict value is not equal to itself.") | |
561 | 563 | } | |
562 | 564 | ||
563 | 565 | ||
564 | 566 | ||
565 | 567 | @Callable(i) | |
566 | 568 | func setMultisig (multisig_) = { | |
567 | 569 | let err = if (_onlyThisContract(i.caller)) | |
568 | 570 | then _validateAddress(multisig_, "setMultisig: invalid multisig") | |
569 | 571 | else false | |
570 | 572 | if ((err == err)) | |
571 | 573 | then $Tuple2(_saveMultisig(addressFromStringValue(multisig_)), unit) | |
572 | 574 | else throw("Strict value is not equal to itself.") | |
573 | 575 | } | |
574 | 576 | ||
575 | 577 | ||
576 | 578 | @Verifier(tx) | |
577 | 579 | func verify () = match getString(KEY_MULTISIG) { | |
578 | 580 | case multisig: String => | |
579 | 581 | valueOrElse(getBoolean(addressFromStringValue(multisig), makeString([KEY_STATUS, toString(this), toBase58String(tx.id)], SEPARATOR)), false) | |
580 | 582 | case _ => | |
581 | 583 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
582 | 584 | } | |
583 | 585 |
github/deemru/w8io/169f3d6 85.05 ms ◑