tx · CLk4CVvdQTVRU3ieWRkRFxpCDa1h1QrAJPCPCMGJaSTo 3NCCbzmJYurqgXL9bh85G7gzASswGVjkfRU: -0.01400000 Waves 2024.03.22 15:03 [3029218] smart account 3NCCbzmJYurqgXL9bh85G7gzASswGVjkfRU > SELF 0.00000000 Waves
{ "type": 13, "id": "CLk4CVvdQTVRU3ieWRkRFxpCDa1h1QrAJPCPCMGJaSTo", "fee": 1400000, "feeAssetId": null, "timestamp": 1711109009754, "version": 2, "chainId": 84, "sender": "3NCCbzmJYurqgXL9bh85G7gzASswGVjkfRU", "senderPublicKey": "7dYS4cBUtMS3qg16og5S9C9U6ygyVxgTqhJGoYcsuYzr", "proofs": [ "Mn4wqxxQrjjrvPwVvSSWpRh6P4dZbMmQaWP5gGjCsrCgt3TPm84PornGaotHqwSrwWs3vtm8XfGFyY3Uu7H2Ny4" ], "script": "base64:BwJPCAISBgoECAgICBIICgYICAgICAgSCQoHCAgBCAgBCBIICgYICAEICAgSCAoGCAgBCAgIEgUKAwEICBIFCgMBCAgSABIAEgMKAQgSAwoBCD4ACVNFUEFSQVRPUgICX18ADEtFWV9NVUxUSVNJRwIITVVMVElTSUcACktFWV9TVEFUVVMCBlNUQVRVUwAIS0VZX0lOSVQCBElOSVQACktFWV9QQVVTRUQCBlBBVVNFRAAKS0VZX1BBVVNFUgIGUEFVU0VSAAxLRVlfRVhFQ1VUT1ICCEVYRUNVVE9SABNLRVlfQ0FMTEVSX0NPTlRSQUNUAg9DQUxMRVJfQ09OVFJBQ1QAD0tFWV9XQVZFU19WQVVMVAILV0FWRVNfVkFVTFQAE0tFWV9BQ0NPVU5UX1NUT1JBR0UCD0FDQ09VTlRfU1RPUkFHRQAJS0VZX0NIQUlOAgVDSEFJTgAQS0VZX0FTU0VUX1RJQ0tFUgIMQVNTRVRfVElDS0VSABJLRVlfQVNTRVRfUkVTRVJWRVMCDkFTU0VUX1JFU0VSVkVTABNLRVlfVElDS0VSX1JFU0VSVkVTAg9USUNLRVJfU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UVVMJAMwIAgkApQgBBQR0aGlzCQDMCAIJANgEAQgFAnR4AmlkBQNuaWwFCVNFUEFSQVRPUgcJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXm+J7zf", "height": 3029218, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ByNGaMUqkErvMddgj5c9BX2Yf5iToVH6CA8ppUs1G9WZ Next: 22iAgtg8xCHx5adVyxLGAv5tWQKJ682BjqeSoN2eYzLL Diff:
Old | New | Differences | |
---|---|---|---|
250 | 250 | else true | |
251 | 251 | ||
252 | 252 | ||
253 | + | func _chainNotExist (chainId_,err_) = if ((size(_loadChain(chainId_)) > 0)) | |
254 | + | then throw(err_) | |
255 | + | else true | |
256 | + | ||
257 | + | ||
253 | 258 | func _assetTickerExists (chainId_,asset_,err_) = if ((0 >= size(_loadAssetTicker(chainId_, asset_)))) | |
259 | + | then throw(err_) | |
260 | + | else true | |
261 | + | ||
262 | + | ||
263 | + | func _assetTickerNotExist (chainId_,asset_,err_) = if ((size(_loadAssetTicker(chainId_, asset_)) > 0)) | |
254 | 264 | then throw(err_) | |
255 | 265 | else true | |
256 | 266 | ||
349 | 359 | else false) | |
350 | 360 | then _validateString(callerContract_, "addChain: invalid callerContract") | |
351 | 361 | else false) | |
352 | - | then | |
362 | + | then _chainNotExist(chainId_, "addChain: already exists") | |
353 | 363 | else false | |
354 | 364 | if ((err == err)) | |
355 | 365 | then $Tuple2((_saveChain(chainId_, name_) ++ _saveCallerContract(chainId_, callerContract_)), unit) | |
369 | 379 | else false) | |
370 | 380 | then _validateString(ticker_, "addAsset: invalid ticker") | |
371 | 381 | else false) | |
372 | - | then | |
382 | + | then _assetTickerNotExist(chainId_, asset_, "addAsset: already exists") | |
373 | 383 | else false | |
374 | 384 | if ((err == err)) | |
375 | 385 | then $Tuple2(_saveAssetTicker(chainId_, asset_, ticker_), unit) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 7 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEPARATOR = "__" | |
5 | 5 | ||
6 | 6 | let KEY_MULTISIG = "MULTISIG" | |
7 | 7 | ||
8 | 8 | let KEY_STATUS = "STATUS" | |
9 | 9 | ||
10 | 10 | let KEY_INIT = "INIT" | |
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_CALLER_CONTRACT = "CALLER_CONTRACT" | |
19 | 19 | ||
20 | 20 | let KEY_WAVES_VAULT = "WAVES_VAULT" | |
21 | 21 | ||
22 | 22 | let KEY_ACCOUNT_STORAGE = "ACCOUNT_STORAGE" | |
23 | 23 | ||
24 | 24 | let KEY_CHAIN = "CHAIN" | |
25 | 25 | ||
26 | 26 | let KEY_ASSET_TICKER = "ASSET_TICKER" | |
27 | 27 | ||
28 | 28 | let KEY_ASSET_RESERVES = "ASSET_RESERVES" | |
29 | 29 | ||
30 | 30 | let KEY_TICKER_RESERVES = "TICKER_RESERVES" | |
31 | 31 | ||
32 | 32 | let FUNC_DEPOSIT = "deposit" | |
33 | 33 | ||
34 | 34 | let WAVES = "WAVES" | |
35 | 35 | ||
36 | 36 | let SPOT_WALLET = "SPOT" | |
37 | 37 | ||
38 | 38 | let MAX_INT = 9223372036854775807 | |
39 | 39 | ||
40 | 40 | let ZERO_BIGINT = toBigInt(0) | |
41 | 41 | ||
42 | 42 | let ONE_BIGINT = toBigInt(1) | |
43 | 43 | ||
44 | 44 | func _validateAddress (address_,err_) = match addressFromString(address_) { | |
45 | 45 | case a: Address => | |
46 | 46 | true | |
47 | 47 | case _ => | |
48 | 48 | throw(err_) | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func _validateInt (val_,lowerBoundary_,upperBoundary_,err_) = if (if ((lowerBoundary_ > val_)) | |
53 | 53 | then true | |
54 | 54 | else (val_ > upperBoundary_)) | |
55 | 55 | then throw(err_) | |
56 | 56 | else true | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func _validateBigInt (val_,lowerBoundary_,err_) = if ((lowerBoundary_ > val_)) | |
60 | 60 | then throw(err_) | |
61 | 61 | else true | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func _validateString (val_,err_) = if (if ((0 >= size(val_))) | |
65 | 65 | then true | |
66 | 66 | else contains(val_, SEPARATOR)) | |
67 | 67 | then throw(err_) | |
68 | 68 | else true | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func _loadInit () = match getBoolean(KEY_INIT) { | |
72 | 72 | case a: Boolean => | |
73 | 73 | a | |
74 | 74 | case _ => | |
75 | 75 | false | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func _saveInit (isInit_) = [BooleanEntry(KEY_INIT, isInit_)] | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func _loadPause () = match getBoolean(KEY_PAUSED) { | |
83 | 83 | case a: Boolean => | |
84 | 84 | a | |
85 | 85 | case _ => | |
86 | 86 | false | |
87 | 87 | } | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func _savePause (isPaused_) = [BooleanEntry(KEY_PAUSED, isPaused_)] | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func _loadPauser () = match getString(KEY_PAUSER) { | |
94 | 94 | case a: String => | |
95 | 95 | addressFromStringValue(a) | |
96 | 96 | case _ => | |
97 | 97 | Address(base58'') | |
98 | 98 | } | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func _savePauser (pauser_) = [StringEntry(KEY_PAUSER, toString(pauser_))] | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func _loadMultisig () = match getString(KEY_MULTISIG) { | |
105 | 105 | case a: String => | |
106 | 106 | addressFromStringValue(a) | |
107 | 107 | case _ => | |
108 | 108 | Address(base58'') | |
109 | 109 | } | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func _saveMultisig (multisig_) = [StringEntry(KEY_MULTISIG, toString(multisig_))] | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func _loadCallerContract (chainId_) = match getString(makeString([KEY_CALLER_CONTRACT, toString(chainId_)], SEPARATOR)) { | |
116 | 116 | case a: String => | |
117 | 117 | a | |
118 | 118 | case _ => | |
119 | 119 | "" | |
120 | 120 | } | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func _saveCallerContract (chainId_,callerContract_) = [StringEntry(makeString([KEY_CALLER_CONTRACT, toString(chainId_)], SEPARATOR), callerContract_)] | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func _loadExecutor () = match getString(KEY_EXECUTOR) { | |
127 | 127 | case a: String => | |
128 | 128 | addressFromStringValue(a) | |
129 | 129 | case _ => | |
130 | 130 | Address(base58'') | |
131 | 131 | } | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func _saveExecutor (executor_) = [StringEntry(KEY_EXECUTOR, toString(executor_))] | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func _loadAccountStorage () = match getString(KEY_ACCOUNT_STORAGE) { | |
138 | 138 | case a: String => | |
139 | 139 | addressFromStringValue(a) | |
140 | 140 | case _ => | |
141 | 141 | Address(base58'') | |
142 | 142 | } | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func _saveAccountStorage (accountStorage_) = [StringEntry(KEY_ACCOUNT_STORAGE, toString(accountStorage_))] | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func _loadWavesVault () = match getString(KEY_WAVES_VAULT) { | |
149 | 149 | case a: String => | |
150 | 150 | addressFromStringValue(a) | |
151 | 151 | case _ => | |
152 | 152 | Address(base58'') | |
153 | 153 | } | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func _saveWavesVault (wavesVault_) = [StringEntry(KEY_WAVES_VAULT, toString(wavesVault_))] | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func _loadChain (chainId_) = match getString(makeString([KEY_CHAIN, toString(chainId_)], SEPARATOR)) { | |
160 | 160 | case a: String => | |
161 | 161 | a | |
162 | 162 | case _ => | |
163 | 163 | "" | |
164 | 164 | } | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | func _saveChain (chainId_,name_) = [StringEntry(makeString([KEY_CHAIN, toString(chainId_)], SEPARATOR), name_)] | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func _loadAssetTicker (chainId_,asset_) = match getString(makeString([KEY_ASSET_TICKER, toString(chainId_), asset_], SEPARATOR)) { | |
171 | 171 | case a: String => | |
172 | 172 | a | |
173 | 173 | case _ => | |
174 | 174 | "" | |
175 | 175 | } | |
176 | 176 | ||
177 | 177 | ||
178 | 178 | func _saveAssetTicker (chainId_,asset_,ticker_) = [StringEntry(makeString([KEY_ASSET_TICKER, toString(chainId_), asset_], SEPARATOR), ticker_)] | |
179 | 179 | ||
180 | 180 | ||
181 | 181 | func _loadAssetReserves (chainId_,asset_) = match getString(makeString([KEY_ASSET_RESERVES, toString(chainId_), asset_], SEPARATOR)) { | |
182 | 182 | case a: String => | |
183 | 183 | parseBigIntValue(a) | |
184 | 184 | case _ => | |
185 | 185 | ZERO_BIGINT | |
186 | 186 | } | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func _saveAssetReserves (chainId_,asset_,reserves_) = [StringEntry(makeString([KEY_ASSET_RESERVES, toString(chainId_), asset_], SEPARATOR), toString(reserves_))] | |
190 | 190 | ||
191 | 191 | ||
192 | 192 | func _loadTickerReserves (ticker_) = match getString(makeString([KEY_TICKER_RESERVES, ticker_], SEPARATOR)) { | |
193 | 193 | case a: String => | |
194 | 194 | parseBigIntValue(a) | |
195 | 195 | case _ => | |
196 | 196 | ZERO_BIGINT | |
197 | 197 | } | |
198 | 198 | ||
199 | 199 | ||
200 | 200 | func _saveTickerReserves (ticker_,reserves_) = [StringEntry(makeString([KEY_TICKER_RESERVES, ticker_], SEPARATOR), toString(reserves_))] | |
201 | 201 | ||
202 | 202 | ||
203 | 203 | func _onlyThisContract (caller_) = if ((caller_ != this)) | |
204 | 204 | then throw("_onlyThisContract: revert") | |
205 | 205 | else true | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | func _whenMultisigSet () = if ((_loadMultisig() == Address(base58''))) | |
209 | 209 | then throw("_whenMultisigSet: revert") | |
210 | 210 | else true | |
211 | 211 | ||
212 | 212 | ||
213 | 213 | func _whenNotInitialized () = if (_loadInit()) | |
214 | 214 | then throw("_whenNotInitialized: revert") | |
215 | 215 | else true | |
216 | 216 | ||
217 | 217 | ||
218 | 218 | func _whenInitialized () = if (!(_loadInit())) | |
219 | 219 | then throw("_whenInitialized: revert") | |
220 | 220 | else true | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | func _whenNotPaused () = if (_loadPause()) | |
224 | 224 | then throw("_whenNotPaused: revert") | |
225 | 225 | else true | |
226 | 226 | ||
227 | 227 | ||
228 | 228 | func _whenPaused () = if (!(_loadPause())) | |
229 | 229 | then throw("_whenPaused: revert") | |
230 | 230 | else true | |
231 | 231 | ||
232 | 232 | ||
233 | 233 | func _onlyPauser (caller_) = if ((caller_ != _loadPauser())) | |
234 | 234 | then throw("_onlyPauser: revert") | |
235 | 235 | else true | |
236 | 236 | ||
237 | 237 | ||
238 | 238 | func _validateExecutor (val_,err_) = if ((val_ != _loadExecutor())) | |
239 | 239 | then throw(err_) | |
240 | 240 | else true | |
241 | 241 | ||
242 | 242 | ||
243 | 243 | func _validateCallerContract (chainId_,callerContract_,err_) = if ((_loadCallerContract(chainId_) != callerContract_)) | |
244 | 244 | then throw(err_) | |
245 | 245 | else true | |
246 | 246 | ||
247 | 247 | ||
248 | 248 | func _chainExists (chainId_,err_) = if ((0 >= size(_loadChain(chainId_)))) | |
249 | 249 | then throw(err_) | |
250 | 250 | else true | |
251 | 251 | ||
252 | 252 | ||
253 | + | func _chainNotExist (chainId_,err_) = if ((size(_loadChain(chainId_)) > 0)) | |
254 | + | then throw(err_) | |
255 | + | else true | |
256 | + | ||
257 | + | ||
253 | 258 | func _assetTickerExists (chainId_,asset_,err_) = if ((0 >= size(_loadAssetTicker(chainId_, asset_)))) | |
259 | + | then throw(err_) | |
260 | + | else true | |
261 | + | ||
262 | + | ||
263 | + | func _assetTickerNotExist (chainId_,asset_,err_) = if ((size(_loadAssetTicker(chainId_, asset_)) > 0)) | |
254 | 264 | then throw(err_) | |
255 | 265 | else true | |
256 | 266 | ||
257 | 267 | ||
258 | 268 | func _validateWavesVault (caller,err_) = if ((_loadWavesVault() != caller)) | |
259 | 269 | then throw(err_) | |
260 | 270 | else true | |
261 | 271 | ||
262 | 272 | ||
263 | 273 | @Callable(i) | |
264 | 274 | func init (executor_,pauser_,accountStorage_,wavesVault_) = { | |
265 | 275 | let err = if (if (if (if (if (if (_onlyThisContract(i.caller)) | |
266 | 276 | then _whenNotInitialized() | |
267 | 277 | else false) | |
268 | 278 | then _whenMultisigSet() | |
269 | 279 | else false) | |
270 | 280 | then _validateAddress(executor_, "init: invalid executor") | |
271 | 281 | else false) | |
272 | 282 | then _validateAddress(pauser_, "init: invalid pauser") | |
273 | 283 | else false) | |
274 | 284 | then _validateAddress(accountStorage_, "init: invalid accountStorage") | |
275 | 285 | else false) | |
276 | 286 | then _validateAddress(wavesVault_, "init: invalid wavesVault") | |
277 | 287 | else false | |
278 | 288 | if ((err == err)) | |
279 | 289 | then $Tuple2(((((_saveInit(true) ++ _saveExecutor(addressFromStringValue(executor_))) ++ _savePauser(addressFromStringValue(pauser_))) ++ _saveAccountStorage(addressFromStringValue(accountStorage_))) ++ _saveWavesVault(addressFromStringValue(wavesVault_))), unit) | |
280 | 290 | else throw("Strict value is not equal to itself.") | |
281 | 291 | } | |
282 | 292 | ||
283 | 293 | ||
284 | 294 | ||
285 | 295 | @Callable(i) | |
286 | 296 | func deposit (callerContract_,from_,to_,chainId_,asset_,amount_) = { | |
287 | 297 | let chainId = valueOrErrorMessage(parseInt(chainId_), "deposit: chainId not int") | |
288 | 298 | let amount = valueOrErrorMessage(parseBigInt(amount_), "deposit: amount not int") | |
289 | 299 | let err = if (if (if (if (if (if (_whenInitialized()) | |
290 | 300 | then _whenNotPaused() | |
291 | 301 | else false) | |
292 | 302 | then _chainExists(chainId, "deposit: invalid chainId") | |
293 | 303 | else false) | |
294 | 304 | then _validateString(from_, "deposit: invalid from") | |
295 | 305 | else false) | |
296 | 306 | then _validateString(to_, "deposit: invalid to") | |
297 | 307 | else false) | |
298 | 308 | then _assetTickerExists(chainId, asset_, "deposit: invalid asset") | |
299 | 309 | else false) | |
300 | 310 | then _validateBigInt(amount, ZERO_BIGINT, "deposit: invalid amount") | |
301 | 311 | else false | |
302 | 312 | if ((err == err)) | |
303 | 313 | then { | |
304 | 314 | let err1 = if ((_loadChain(chainId) == WAVES)) | |
305 | 315 | then _validateWavesVault(i.caller, "deposit: invalid waves vault") | |
306 | 316 | else if (_validateExecutor(i.caller, "deposit: invalid executor")) | |
307 | 317 | then _validateCallerContract(chainId, callerContract_, "deposit: invalid caller contract") | |
308 | 318 | else false | |
309 | 319 | if ((err1 == err1)) | |
310 | 320 | then { | |
311 | 321 | let newAssetReserves = (_loadAssetReserves(chainId, asset_) + amount) | |
312 | 322 | let ticker = _loadAssetTicker(chainId, asset_) | |
313 | 323 | let newTickerReserves = (_loadTickerReserves(ticker) + amount) | |
314 | 324 | let invocation = invoke(_loadAccountStorage(), FUNC_DEPOSIT, [to_, SPOT_WALLET, ticker, amount_], nil) | |
315 | 325 | if ((invocation == invocation)) | |
316 | 326 | then $Tuple2((_saveAssetReserves(chainId, asset_, newAssetReserves) ++ _saveTickerReserves(ticker, newTickerReserves)), unit) | |
317 | 327 | else throw("Strict value is not equal to itself.") | |
318 | 328 | } | |
319 | 329 | else throw("Strict value is not equal to itself.") | |
320 | 330 | } | |
321 | 331 | else throw("Strict value is not equal to itself.") | |
322 | 332 | } | |
323 | 333 | ||
324 | 334 | ||
325 | 335 | ||
326 | 336 | @Callable(i) | |
327 | 337 | func withdraw (from_,to_,chainId_,asset_,amount_,timestamp_,signature_) = $Tuple2(nil, unit) | |
328 | 338 | ||
329 | 339 | ||
330 | 340 | ||
331 | 341 | @Callable(i) | |
332 | 342 | func requestWithdrawal (from_,to_,chainId_,asset_,amount_,signature_) = $Tuple2(nil, unit) | |
333 | 343 | ||
334 | 344 | ||
335 | 345 | ||
336 | 346 | @Callable(i) | |
337 | 347 | func executeWithdrawal (from_,to_,chainId_,asset_,amount_,signature_) = $Tuple2(nil, unit) | |
338 | 348 | ||
339 | 349 | ||
340 | 350 | ||
341 | 351 | @Callable(i) | |
342 | 352 | func addChain (chainId_,name_,callerContract_) = { | |
343 | 353 | let err = if (if (if (if (if (_onlyThisContract(i.caller)) | |
344 | 354 | then _whenInitialized() | |
345 | 355 | else false) | |
346 | 356 | then _validateInt(chainId_, 0, MAX_INT, "addChain: invalid chainId") | |
347 | 357 | else false) | |
348 | 358 | then _validateString(name_, "addChain: invalid name") | |
349 | 359 | else false) | |
350 | 360 | then _validateString(callerContract_, "addChain: invalid callerContract") | |
351 | 361 | else false) | |
352 | - | then | |
362 | + | then _chainNotExist(chainId_, "addChain: already exists") | |
353 | 363 | else false | |
354 | 364 | if ((err == err)) | |
355 | 365 | then $Tuple2((_saveChain(chainId_, name_) ++ _saveCallerContract(chainId_, callerContract_)), unit) | |
356 | 366 | else throw("Strict value is not equal to itself.") | |
357 | 367 | } | |
358 | 368 | ||
359 | 369 | ||
360 | 370 | ||
361 | 371 | @Callable(i) | |
362 | 372 | func addAsset (chainId_,asset_,ticker_) = { | |
363 | 373 | let err = if (if (if (if (if (_onlyThisContract(i.caller)) | |
364 | 374 | then _whenInitialized() | |
365 | 375 | else false) | |
366 | 376 | then _chainExists(chainId_, "addAsset: invalid chainId") | |
367 | 377 | else false) | |
368 | 378 | then _validateString(asset_, "addAsset: invalid asset") | |
369 | 379 | else false) | |
370 | 380 | then _validateString(ticker_, "addAsset: invalid ticker") | |
371 | 381 | else false) | |
372 | - | then | |
382 | + | then _assetTickerNotExist(chainId_, asset_, "addAsset: already exists") | |
373 | 383 | else false | |
374 | 384 | if ((err == err)) | |
375 | 385 | then $Tuple2(_saveAssetTicker(chainId_, asset_, ticker_), unit) | |
376 | 386 | else throw("Strict value is not equal to itself.") | |
377 | 387 | } | |
378 | 388 | ||
379 | 389 | ||
380 | 390 | ||
381 | 391 | @Callable(i) | |
382 | 392 | func pause () = { | |
383 | 393 | let err = if (if (_onlyPauser(i.caller)) | |
384 | 394 | then _whenInitialized() | |
385 | 395 | else false) | |
386 | 396 | then _whenNotPaused() | |
387 | 397 | else false | |
388 | 398 | if ((err == err)) | |
389 | 399 | then $Tuple2(_savePause(true), unit) | |
390 | 400 | else throw("Strict value is not equal to itself.") | |
391 | 401 | } | |
392 | 402 | ||
393 | 403 | ||
394 | 404 | ||
395 | 405 | @Callable(i) | |
396 | 406 | func unpause () = { | |
397 | 407 | let err = if (if (_onlyPauser(i.caller)) | |
398 | 408 | then _whenInitialized() | |
399 | 409 | else false) | |
400 | 410 | then _whenPaused() | |
401 | 411 | else false | |
402 | 412 | if ((err == err)) | |
403 | 413 | then $Tuple2(_savePause(false), unit) | |
404 | 414 | else throw("Strict value is not equal to itself.") | |
405 | 415 | } | |
406 | 416 | ||
407 | 417 | ||
408 | 418 | ||
409 | 419 | @Callable(i) | |
410 | 420 | func updatePauser (pauser_) = { | |
411 | 421 | let err = if (if (_onlyThisContract(i.caller)) | |
412 | 422 | then _whenInitialized() | |
413 | 423 | else false) | |
414 | 424 | then _validateAddress(pauser_, "updatePauser: invalid pauser") | |
415 | 425 | else false | |
416 | 426 | if ((err == err)) | |
417 | 427 | then $Tuple2(_savePauser(addressFromStringValue(pauser_)), unit) | |
418 | 428 | else throw("Strict value is not equal to itself.") | |
419 | 429 | } | |
420 | 430 | ||
421 | 431 | ||
422 | 432 | ||
423 | 433 | @Callable(i) | |
424 | 434 | func setMultisig (multisig_) = { | |
425 | 435 | let err = if (_onlyThisContract(i.caller)) | |
426 | 436 | then _validateAddress(multisig_, "setMultisig: invalid multisig") | |
427 | 437 | else false | |
428 | 438 | if ((err == err)) | |
429 | 439 | then $Tuple2(_saveMultisig(addressFromStringValue(multisig_)), unit) | |
430 | 440 | else throw("Strict value is not equal to itself.") | |
431 | 441 | } | |
432 | 442 | ||
433 | 443 | ||
434 | 444 | @Verifier(tx) | |
435 | 445 | func verify () = match getString(KEY_MULTISIG) { | |
436 | 446 | case multisig: String => | |
437 | 447 | valueOrElse(getBoolean(addressFromStringValue(multisig), makeString([KEY_STATUS, toString(this), toBase58String(tx.id)], SEPARATOR)), false) | |
438 | 448 | case _ => | |
439 | 449 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
440 | 450 | } | |
441 | 451 |
github/deemru/w8io/026f985 41.86 ms ◑