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