tx · CYqqpf62NWrwDvH6LzYBmAiydaXNgaW1g8sZxWdzuTFn

3MpiUwTkYopBwQEjyTf8sqy7iWLNwyq9Md4:  -0.01800000 Waves

2024.12.09 16:59 [3407158] smart account 3MpiUwTkYopBwQEjyTf8sqy7iWLNwyq9Md4 > SELF 0.00000000 Waves

{ "type": 13, "id": "CYqqpf62NWrwDvH6LzYBmAiydaXNgaW1g8sZxWdzuTFn", "fee": 1800000, "feeAssetId": null, "timestamp": 1733752761399, "version": 2, "chainId": 84, "sender": "3MpiUwTkYopBwQEjyTf8sqy7iWLNwyq9Md4", "senderPublicKey": "9eCupW2UoCBhmiF1N9qWACCzkWT885DVzb65b8zxcSii", "proofs": [ "33WDepP6rkqbE7MBEEM8h4vTzZ5QqQfHMUFcQSAsdDwcdKxdMZGwZgynvN5MX2TzzvHq2tbRdd9c5eH7G9N2ww6p" ], "script": "base64:BwItCAISBQoDCAgIEgYKBAgICAgSBQoDCAgIEgQKAggEEgMKAQgSAwoBCBIDCgEIPwAJU0VQQVJBVE9SAgJfXwAMS0VZX01VTFRJU0lHAghNVUxUSVNJRwAKS0VZX1NUQVRVUwIGU1RBVFVTAAhLRVlfSU5JVAIESU5JVAANS0VZX1NFUVVFTkNFUgIJU0VRVUVOQ0VSABNLRVlfQUNDT1VOVF9TVE9SQUdFAg9BQ0NPVU5UX1NUT1JBR0UAEUtFWV9GRUVfUkVDSVBJRU5UAg1GRUVfUkVDSVBJRU5UAApLRVlfU1lNQk9MAgZTWU1CT0wAF0tFWV9PUkRFUl9GSUxMRURfQU1PVU5UAhNPUkRFUl9GSUxMRURfQU1PVU5UABZLRVlfUkVXQVJEX0RJU1RSSUJVVE9SAhJSRVdBUkRfRElTVFJJQlVUT1IAFkZVTkNfRVhURVJOQUxfVFJBTlNGRVICEGV4dGVybmFsVHJhbnNmZXIAEUZVTkNfQ0xBSU1fUkVXQVJEAgtjbGFpbVJld2FyZAALU1BPVF9XQUxMRVQCBFNQT1QAEE9SREVSX1RZUEVf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entComplexity": 0 } View: original | compacted Prev: FQi5iBpKorRvf6vjMgJwf5hwCYC9sPPCHSY6tXNi5q2T Next: 3uJdmYkbWwVbFaNh4BJLywXMi3vfWU4DmTqXD2xJPkvD Diff:
OldNewDifferences
4848 let MULTIPLIER = toBigInt(100000000)
4949
5050 let FEE_MAX_TOLERANCE = toBigInt(100000)
51+
52+let WAVES_PREFIX = base58'7YXq4t'
5153
5254 let EVM_PREFIX = base58'G5Nu92G2p7moXW9qjjN3na7gtq4dWCeVdaSjry'
5355
265267
266268 func _validateOrderSignature (orderHash_,signature_,web3Id_,alg_,err_) = {
267269 let result = if ((alg_ == ALG_TYPE_WAVES))
268- then sigVerify(orderHash_, signature_, web3Id_)
270+ then {
271+ let hashWithPrefix = keccak256_16Kb((WAVES_PREFIX + toBytes(toBase58String(orderHash_))))
272+ sigVerify(hashWithPrefix, signature_, web3Id_)
273+ }
269274 else if ((alg_ == ALG_TYPE_EVM))
270275 then {
271276 let hashWithPrefix = keccak256_16Kb((EVM_PREFIX + orderHash_))
293298 let web3Id = fromBase58String(fields[5])
294299 let alg = valueOrErrorMessage(parseInt(fields[6]), (err_ + ": inv alg"))
295300 let signature = fromBase58String(fields[7])
296- let $t083589396 = if (if ((type == ORDER_TYPE_LIMIT))
301+ let $t085009538 = if (if ((type == ORDER_TYPE_LIMIT))
297302 then (version == ORDER_VERSION_1)
298303 else false)
299304 then {
315320 else $Tuple4(ZERO_BIGINT, ZERO_BIGINT, amount, (toBytes(amount) + toBytes(ZERO_BIGINT)))
316321 }
317322 else throw((err_ + ": inv type & version"))
318- let price = $t083589396._1
319- let baseAmount = $t083589396._2
320- let quoteAmount = $t083589396._3
321- let orderDetailsBytes = $t083589396._4
323+ let price = $t085009538._1
324+ let baseAmount = $t085009538._2
325+ let quoteAmount = $t085009538._3
326+ let orderDetailsBytes = $t085009538._4
322327 let orderBytes = ((((((((toBytes(type) + toBytes(version)) + toBytes(size(symbol))) + toBytes(symbol)) + toBytes(side)) + toBytes(ts)) + web3Id) + toBytes(alg)) + orderDetailsBytes)
323328 let orderHash = keccak256_32Kb(orderBytes)
324329 let err = if (if (if (if (if (if (if (_validateOrderType(type, version, (err_ + ": inv order type")))
364369
365370 @Callable(i)
366371 func trade (makerOrder_,takerOrder_,baseFee_,quoteFee_) = {
367- let $t01121211541 = _parseOrder(makerOrder_, "trade: invalid maker order")
368- let makerOrderType = $t01121211541._1
369- let makerOrderSymbol = $t01121211541._2
370- let makerOrderSide = $t01121211541._3
371- let makerOrderPrice = $t01121211541._4
372- let makerOrderBaseAmount = $t01121211541._5
373- let makerOrderQuoteAmount = $t01121211541._6
374- let makerOrderHash = $t01121211541._7
375- let makerOrderWeb3Id = $t01121211541._8
376- let makerOrderAlg = $t01121211541._9
377- let makerOrderSignature = $t01121211541._10
378- let $t01154711876 = _parseOrder(takerOrder_, "trade: invalid taker order")
379- let takerOrderType = $t01154711876._1
380- let takerOrderSymbol = $t01154711876._2
381- let takerOrderSide = $t01154711876._3
382- let takerOrderPrice = $t01154711876._4
383- let takerOrderBaseAmount = $t01154711876._5
384- let takerOrderQuoteAmount = $t01154711876._6
385- let takerOrderHash = $t01154711876._7
386- let takerOrderWeb3Id = $t01154711876._8
387- let takerOrderAlg = $t01154711876._9
388- let takerOrderSignature = $t01154711876._10
372+ let $t01135411683 = _parseOrder(makerOrder_, "trade: invalid maker order")
373+ let makerOrderType = $t01135411683._1
374+ let makerOrderSymbol = $t01135411683._2
375+ let makerOrderSide = $t01135411683._3
376+ let makerOrderPrice = $t01135411683._4
377+ let makerOrderBaseAmount = $t01135411683._5
378+ let makerOrderQuoteAmount = $t01135411683._6
379+ let makerOrderHash = $t01135411683._7
380+ let makerOrderWeb3Id = $t01135411683._8
381+ let makerOrderAlg = $t01135411683._9
382+ let makerOrderSignature = $t01135411683._10
383+ let $t01168912018 = _parseOrder(takerOrder_, "trade: invalid taker order")
384+ let takerOrderType = $t01168912018._1
385+ let takerOrderSymbol = $t01168912018._2
386+ let takerOrderSide = $t01168912018._3
387+ let takerOrderPrice = $t01168912018._4
388+ let takerOrderBaseAmount = $t01168912018._5
389+ let takerOrderQuoteAmount = $t01168912018._6
390+ let takerOrderHash = $t01168912018._7
391+ let takerOrderWeb3Id = $t01168912018._8
392+ let takerOrderAlg = $t01168912018._9
393+ let takerOrderSignature = $t01168912018._10
389394 let baseFee = valueOrErrorMessage(parseBigInt(baseFee_), "trade: baseFee not int")
390395 let quoteFee = valueOrErrorMessage(parseBigInt(quoteFee_), "trade: quoteFee not int")
391396 let tradePrice = makerOrderPrice
420425 then {
421426 let makerAddress = _convertWeb3IdToAddress(makerOrderWeb3Id, makerOrderAlg)
422427 let takerAddress = _convertWeb3IdToAddress(takerOrderWeb3Id, takerOrderAlg)
423- let $t01403314456 = if ((makerOrderSide == ORDER_SIDE_BUY))
428+ let $t01417514598 = if ((makerOrderSide == ORDER_SIDE_BUY))
424429 then $Tuple2(makerAddress, takerAddress)
425430 else $Tuple2(takerAddress, makerAddress)
426- let buyer = $t01403314456._1
427- let seller = $t01403314456._2
431+ let buyer = $t01417514598._1
432+ let seller = $t01417514598._2
428433 let assets = split(makerOrderSymbol, "-")
429434 let baseAsset = assets[0]
430435 let quoteAsset = assets[1]
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 7 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEPARATOR = "__"
55
66 let KEY_MULTISIG = "MULTISIG"
77
88 let KEY_STATUS = "STATUS"
99
1010 let KEY_INIT = "INIT"
1111
1212 let KEY_SEQUENCER = "SEQUENCER"
1313
1414 let KEY_ACCOUNT_STORAGE = "ACCOUNT_STORAGE"
1515
1616 let KEY_FEE_RECIPIENT = "FEE_RECIPIENT"
1717
1818 let KEY_SYMBOL = "SYMBOL"
1919
2020 let KEY_ORDER_FILLED_AMOUNT = "ORDER_FILLED_AMOUNT"
2121
2222 let KEY_REWARD_DISTRIBUTOR = "REWARD_DISTRIBUTOR"
2323
2424 let FUNC_EXTERNAL_TRANSFER = "externalTransfer"
2525
2626 let FUNC_CLAIM_REWARD = "claimReward"
2727
2828 let SPOT_WALLET = "SPOT"
2929
3030 let ORDER_TYPE_LIMIT = 1
3131
3232 let ORDER_TYPE_MARKET = 2
3333
3434 let ORDER_VERSION_1 = 1
3535
3636 let ORDER_SIDE_BUY = 1
3737
3838 let ORDER_SIDE_SELL = 2
3939
4040 let ALG_TYPE_WAVES = 1
4141
4242 let ALG_TYPE_EVM = 2
4343
4444 let ZERO_BIGINT = toBigInt(0)
4545
4646 let ONE_BIGINT = toBigInt(1)
4747
4848 let MULTIPLIER = toBigInt(100000000)
4949
5050 let FEE_MAX_TOLERANCE = toBigInt(100000)
51+
52+let WAVES_PREFIX = base58'7YXq4t'
5153
5254 let EVM_PREFIX = base58'G5Nu92G2p7moXW9qjjN3na7gtq4dWCeVdaSjry'
5355
5456 func _validateAddress (address_,err_) = match addressFromString(address_) {
5557 case a: Address =>
5658 true
5759 case _ =>
5860 throw(err_)
5961 }
6062
6163
6264 func _validateBigInt (val_,lowerBoundary_,err_) = if ((lowerBoundary_ > val_))
6365 then throw(err_)
6466 else true
6567
6668
6769 func _validateIntEqual (val1_,val2_,err_) = if ((val1_ != val2_))
6870 then throw(err_)
6971 else true
7072
7173
7274 func _validateIntNotEqual (val1_,val2_,err_) = if ((val1_ == val2_))
7375 then throw(err_)
7476 else true
7577
7678
7779 func _validateString (val_,err_) = if (if ((0 >= size(val_)))
7880 then true
7981 else contains(val_, SEPARATOR))
8082 then throw(err_)
8183 else true
8284
8385
8486 func _validateStringEqual (val1_,val2_,err_) = if ((val1_ != val2_))
8587 then throw(err_)
8688 else true
8789
8890
8991 func _loadInit () = match getBoolean(KEY_INIT) {
9092 case a: Boolean =>
9193 a
9294 case _ =>
9395 false
9496 }
9597
9698
9799 func _saveInit (isInit_) = [BooleanEntry(KEY_INIT, isInit_)]
98100
99101
100102 func _loadMultisig () = match getString(KEY_MULTISIG) {
101103 case a: String =>
102104 addressFromStringValue(a)
103105 case _ =>
104106 Address(base58'')
105107 }
106108
107109
108110 func _saveMultisig (multisig_) = [StringEntry(KEY_MULTISIG, toString(multisig_))]
109111
110112
111113 func _loadSequencer () = match getString(KEY_SEQUENCER) {
112114 case a: String =>
113115 addressFromStringValue(a)
114116 case _ =>
115117 Address(base58'')
116118 }
117119
118120
119121 func _saveSequencer (sequencer_) = [StringEntry(KEY_SEQUENCER, toString(sequencer_))]
120122
121123
122124 func _loadAccountStorage () = match getString(KEY_ACCOUNT_STORAGE) {
123125 case a: String =>
124126 addressFromStringValue(a)
125127 case _ =>
126128 Address(base58'')
127129 }
128130
129131
130132 func _saveAccountStorage (accountStorage_) = [StringEntry(KEY_ACCOUNT_STORAGE, toString(accountStorage_))]
131133
132134
133135 func _loadFeeRecipient () = match getString(KEY_FEE_RECIPIENT) {
134136 case a: String =>
135137 a
136138 case _ =>
137139 ""
138140 }
139141
140142
141143 func _saveFeeRecipient (feeRecipient_) = [StringEntry(KEY_FEE_RECIPIENT, feeRecipient_)]
142144
143145
144146 func _loadRewardDistributor () = match getString(KEY_REWARD_DISTRIBUTOR) {
145147 case a: String =>
146148 a
147149 case _ =>
148150 ""
149151 }
150152
151153
152154 func _saveRewardDistributor (distributor_) = [StringEntry(KEY_REWARD_DISTRIBUTOR, distributor_)]
153155
154156
155157 func _loadSymbol (symbol_) = match getBoolean(makeString([KEY_SYMBOL, symbol_], SEPARATOR)) {
156158 case a: Boolean =>
157159 a
158160 case _ =>
159161 false
160162 }
161163
162164
163165 func _saveSymbol (symbol_,val_) = [BooleanEntry(makeString([KEY_SYMBOL, symbol_], SEPARATOR), val_)]
164166
165167
166168 func _loadOrderFilledAmount (orderHash_) = match getString(makeString([KEY_ORDER_FILLED_AMOUNT, toBase58String(orderHash_)], SEPARATOR)) {
167169 case a: String =>
168170 parseBigIntValue(a)
169171 case _ =>
170172 ZERO_BIGINT
171173 }
172174
173175
174176 func _saveOrderFilledAmount (orderHash_,amount_) = [StringEntry(makeString([KEY_ORDER_FILLED_AMOUNT, toBase58String(orderHash_)], SEPARATOR), toString(amount_))]
175177
176178
177179 func _onlyThisContract (caller_) = if ((caller_ != this))
178180 then throw("_onlyThisContract: revert")
179181 else true
180182
181183
182184 func _whenMultisigSet () = if ((_loadMultisig() == Address(base58'')))
183185 then throw("_whenMultisigSet: revert")
184186 else true
185187
186188
187189 func _whenNotInitialized () = if (_loadInit())
188190 then throw("_whenNotInitialized: revert")
189191 else true
190192
191193
192194 func _whenInitialized () = if (!(_loadInit()))
193195 then throw("_whenInitialized: revert")
194196 else true
195197
196198
197199 func _validateSequencer (caller,err_) = if ((_loadSequencer() != caller))
198200 then throw(err_)
199201 else true
200202
201203
202204 func _validateOrderType (type_,version_,err_) = if (if ((type_ != ORDER_TYPE_LIMIT))
203205 then (type_ != ORDER_TYPE_MARKET)
204206 else false)
205207 then throw(err_)
206208 else if ((version_ != ORDER_VERSION_1))
207209 then throw(err_)
208210 else true
209211
210212
211213 func _validateOrderSymbol (symbol_,err_) = if (!(_loadSymbol(symbol_)))
212214 then throw(err_)
213215 else true
214216
215217
216218 func _validateOrderSide (side_,err_) = if (if ((side_ != ORDER_SIDE_BUY))
217219 then (side_ != ORDER_SIDE_SELL)
218220 else false)
219221 then throw(err_)
220222 else true
221223
222224
223225 func _validateOrderPrices (makerOrderPrice_,takerOrderPrice_,takerOrderSide_,takerOrderType_,err_) = {
224226 let result = if ((takerOrderType_ == ORDER_TYPE_MARKET))
225227 then true
226228 else if ((takerOrderSide_ == ORDER_SIDE_BUY))
227229 then (takerOrderPrice_ >= makerOrderPrice_)
228230 else if ((takerOrderSide_ == ORDER_SIDE_SELL))
229231 then (makerOrderPrice_ >= takerOrderPrice_)
230232 else false
231233 if (!(result))
232234 then throw(err_)
233235 else true
234236 }
235237
236238
237239 func _validateSignatureFormat (signature_,alg_,err_) = if ((alg_ == ALG_TYPE_WAVES))
238240 then if ((size(signature_) != 64))
239241 then throw(err_)
240242 else true
241243 else if ((alg_ == ALG_TYPE_EVM))
242244 then if ((size(signature_) != 65))
243245 then throw(err_)
244246 else true
245247 else throw((err_ + ": inv alg"))
246248
247249
248250 func _validateWeb3Id (web3Id_,alg_,err_) = if ((alg_ == ALG_TYPE_WAVES))
249251 then if ((size(web3Id_) != 32))
250252 then throw(err_)
251253 else true
252254 else if ((alg_ == ALG_TYPE_EVM))
253255 then if ((size(web3Id_) != 20))
254256 then throw(err_)
255257 else true
256258 else throw((err_ + ": inv alg"))
257259
258260
259261 func _convertWeb3IdToAddress (web3Id_,alg_) = if ((alg_ == ALG_TYPE_WAVES))
260262 then toString(addressFromPublicKey(web3Id_))
261263 else if ((alg_ == ALG_TYPE_EVM))
262264 then ("0x" + toBase16String(web3Id_))
263265 else throw("_convertWeb3IdToAddress: revert")
264266
265267
266268 func _validateOrderSignature (orderHash_,signature_,web3Id_,alg_,err_) = {
267269 let result = if ((alg_ == ALG_TYPE_WAVES))
268- then sigVerify(orderHash_, signature_, web3Id_)
270+ then {
271+ let hashWithPrefix = keccak256_16Kb((WAVES_PREFIX + toBytes(toBase58String(orderHash_))))
272+ sigVerify(hashWithPrefix, signature_, web3Id_)
273+ }
269274 else if ((alg_ == ALG_TYPE_EVM))
270275 then {
271276 let hashWithPrefix = keccak256_16Kb((EVM_PREFIX + orderHash_))
272277 (takeRight(keccak256_16Kb(ecrecover(hashWithPrefix, signature_)), 20) == web3Id_)
273278 }
274279 else throw((err_ + ": inv alg"))
275280 if (!(result))
276281 then throw(err_)
277282 else true
278283 }
279284
280285
281286 func _validateFeeTolerance (amount_,fee_,err_) = if ((fee_ > fraction(amount_, FEE_MAX_TOLERANCE, MULTIPLIER, DOWN)))
282287 then throw(err_)
283288 else true
284289
285290
286291 func _parseOrder (order_,err_) = {
287292 let fields = split(order_, SEPARATOR)
288293 let type = valueOrErrorMessage(parseInt(fields[0]), (err_ + ": inv type"))
289294 let version = valueOrErrorMessage(parseInt(fields[1]), (err_ + ": inv version"))
290295 let symbol = fields[2]
291296 let side = valueOrErrorMessage(parseInt(fields[3]), (err_ + ": inv side"))
292297 let ts = valueOrErrorMessage(parseInt(fields[4]), (err_ + ": inv ts"))
293298 let web3Id = fromBase58String(fields[5])
294299 let alg = valueOrErrorMessage(parseInt(fields[6]), (err_ + ": inv alg"))
295300 let signature = fromBase58String(fields[7])
296- let $t083589396 = if (if ((type == ORDER_TYPE_LIMIT))
301+ let $t085009538 = if (if ((type == ORDER_TYPE_LIMIT))
297302 then (version == ORDER_VERSION_1)
298303 else false)
299304 then {
300305 let price = valueOrErrorMessage(parseBigInt(fields[8]), (err_ + ": inv price"))
301306 let amount = valueOrErrorMessage(parseBigInt(fields[9]), (err_ + ": inv amount"))
302307 let orderDetailsBytes = (toBytes(price) + toBytes(amount))
303308 $Tuple4(price, amount, ZERO_BIGINT, orderDetailsBytes)
304309 }
305310 else if (if ((type == ORDER_TYPE_MARKET))
306311 then (version == ORDER_VERSION_1)
307312 else false)
308313 then {
309314 let amount = valueOrErrorMessage(parseBigInt(fields[8]), (err_ + ": inv amount"))
310315 let isBaseAmount = if ((valueOrErrorMessage(parseBigInt(fields[9]), (err_ + ": inv isBaseAmount")) == ZERO_BIGINT))
311316 then false
312317 else true
313318 if (isBaseAmount)
314319 then $Tuple4(ZERO_BIGINT, amount, ZERO_BIGINT, (toBytes(amount) + toBytes(ONE_BIGINT)))
315320 else $Tuple4(ZERO_BIGINT, ZERO_BIGINT, amount, (toBytes(amount) + toBytes(ZERO_BIGINT)))
316321 }
317322 else throw((err_ + ": inv type & version"))
318- let price = $t083589396._1
319- let baseAmount = $t083589396._2
320- let quoteAmount = $t083589396._3
321- let orderDetailsBytes = $t083589396._4
323+ let price = $t085009538._1
324+ let baseAmount = $t085009538._2
325+ let quoteAmount = $t085009538._3
326+ let orderDetailsBytes = $t085009538._4
322327 let orderBytes = ((((((((toBytes(type) + toBytes(version)) + toBytes(size(symbol))) + toBytes(symbol)) + toBytes(side)) + toBytes(ts)) + web3Id) + toBytes(alg)) + orderDetailsBytes)
323328 let orderHash = keccak256_32Kb(orderBytes)
324329 let err = if (if (if (if (if (if (if (_validateOrderType(type, version, (err_ + ": inv order type")))
325330 then _validateOrderSymbol(symbol, (err_ + ": inv order symbol"))
326331 else false)
327332 then _validateOrderSide(side, (err_ + ": inv order side"))
328333 else false)
329334 then _validateWeb3Id(web3Id, alg, (err_ + ": inv order web3Id"))
330335 else false)
331336 then _validateSignatureFormat(signature, alg, (err_ + ": inv sig format"))
332337 else false)
333338 then _validateBigInt(price, ZERO_BIGINT, (err_ + ": neg price"))
334339 else false)
335340 then _validateBigInt(baseAmount, ZERO_BIGINT, (err_ + ": neg base amount"))
336341 else false)
337342 then _validateBigInt(quoteAmount, ZERO_BIGINT, (err_ + ": neg quote amount"))
338343 else false
339344 if ((err == err))
340345 then $Tuple10(type, symbol, side, price, baseAmount, quoteAmount, orderHash, web3Id, alg, signature)
341346 else throw("Strict value is not equal to itself.")
342347 }
343348
344349
345350 @Callable(i)
346351 func init (sequencer_,accountStorage_,feeRecipient_) = {
347352 let err = if (if (if (if (if (_onlyThisContract(i.caller))
348353 then _whenNotInitialized()
349354 else false)
350355 then _whenMultisigSet()
351356 else false)
352357 then _validateAddress(sequencer_, "init: invalid sequencer")
353358 else false)
354359 then _validateAddress(accountStorage_, "init: invalid accountStorage")
355360 else false)
356361 then _validateString(feeRecipient_, "init: invalid feeRecipient")
357362 else false
358363 if ((err == err))
359364 then $Tuple2((((_saveInit(true) ++ _saveSequencer(addressFromStringValue(sequencer_))) ++ _saveAccountStorage(addressFromStringValue(accountStorage_))) ++ _saveFeeRecipient(feeRecipient_)), unit)
360365 else throw("Strict value is not equal to itself.")
361366 }
362367
363368
364369
365370 @Callable(i)
366371 func trade (makerOrder_,takerOrder_,baseFee_,quoteFee_) = {
367- let $t01121211541 = _parseOrder(makerOrder_, "trade: invalid maker order")
368- let makerOrderType = $t01121211541._1
369- let makerOrderSymbol = $t01121211541._2
370- let makerOrderSide = $t01121211541._3
371- let makerOrderPrice = $t01121211541._4
372- let makerOrderBaseAmount = $t01121211541._5
373- let makerOrderQuoteAmount = $t01121211541._6
374- let makerOrderHash = $t01121211541._7
375- let makerOrderWeb3Id = $t01121211541._8
376- let makerOrderAlg = $t01121211541._9
377- let makerOrderSignature = $t01121211541._10
378- let $t01154711876 = _parseOrder(takerOrder_, "trade: invalid taker order")
379- let takerOrderType = $t01154711876._1
380- let takerOrderSymbol = $t01154711876._2
381- let takerOrderSide = $t01154711876._3
382- let takerOrderPrice = $t01154711876._4
383- let takerOrderBaseAmount = $t01154711876._5
384- let takerOrderQuoteAmount = $t01154711876._6
385- let takerOrderHash = $t01154711876._7
386- let takerOrderWeb3Id = $t01154711876._8
387- let takerOrderAlg = $t01154711876._9
388- let takerOrderSignature = $t01154711876._10
372+ let $t01135411683 = _parseOrder(makerOrder_, "trade: invalid maker order")
373+ let makerOrderType = $t01135411683._1
374+ let makerOrderSymbol = $t01135411683._2
375+ let makerOrderSide = $t01135411683._3
376+ let makerOrderPrice = $t01135411683._4
377+ let makerOrderBaseAmount = $t01135411683._5
378+ let makerOrderQuoteAmount = $t01135411683._6
379+ let makerOrderHash = $t01135411683._7
380+ let makerOrderWeb3Id = $t01135411683._8
381+ let makerOrderAlg = $t01135411683._9
382+ let makerOrderSignature = $t01135411683._10
383+ let $t01168912018 = _parseOrder(takerOrder_, "trade: invalid taker order")
384+ let takerOrderType = $t01168912018._1
385+ let takerOrderSymbol = $t01168912018._2
386+ let takerOrderSide = $t01168912018._3
387+ let takerOrderPrice = $t01168912018._4
388+ let takerOrderBaseAmount = $t01168912018._5
389+ let takerOrderQuoteAmount = $t01168912018._6
390+ let takerOrderHash = $t01168912018._7
391+ let takerOrderWeb3Id = $t01168912018._8
392+ let takerOrderAlg = $t01168912018._9
393+ let takerOrderSignature = $t01168912018._10
389394 let baseFee = valueOrErrorMessage(parseBigInt(baseFee_), "trade: baseFee not int")
390395 let quoteFee = valueOrErrorMessage(parseBigInt(quoteFee_), "trade: quoteFee not int")
391396 let tradePrice = makerOrderPrice
392397 let makerOrderFilledAmount = _loadOrderFilledAmount(makerOrderHash)
393398 let makerOrderBaseAmountFree = (makerOrderBaseAmount - makerOrderFilledAmount)
394399 let takerOrderFilledAmount = _loadOrderFilledAmount(takerOrderHash)
395400 let takerOrderBaseAmountFree = if ((takerOrderBaseAmount == ZERO_BIGINT))
396401 then fraction((takerOrderQuoteAmount - takerOrderFilledAmount), MULTIPLIER, tradePrice, DOWN)
397402 else (takerOrderBaseAmount - takerOrderFilledAmount)
398403 let tradeBaseAmount = min([makerOrderBaseAmountFree, takerOrderBaseAmountFree])
399404 let tradeQuoteAmount = fraction(tradeBaseAmount, tradePrice, MULTIPLIER, DOWN)
400405 let err = if (if (if (if (if (if (if (if (if (_validateSequencer(i.caller, "trade: invalid sequencer"))
401406 then _validateBigInt(tradeBaseAmount, ZERO_BIGINT, "trade: neg trade amount")
402407 else false)
403408 then _validateIntEqual(makerOrderType, ORDER_TYPE_LIMIT, "trade: maker is not limit")
404409 else false)
405410 then _validateStringEqual(makerOrderSymbol, takerOrderSymbol, "trade: symbol mismatch")
406411 else false)
407412 then _validateIntNotEqual(makerOrderSide, takerOrderSide, "trade: side mismatch")
408413 else false)
409414 then _validateOrderSignature(makerOrderHash, makerOrderSignature, makerOrderWeb3Id, makerOrderAlg, "trade: invalid maker sig")
410415 else false)
411416 then _validateOrderSignature(takerOrderHash, takerOrderSignature, takerOrderWeb3Id, takerOrderAlg, "trade: invalid taker sig")
412417 else false)
413418 then _validateFeeTolerance(tradeBaseAmount, baseFee, "trade: base fee too much")
414419 else false)
415420 then _validateFeeTolerance(tradeQuoteAmount, quoteFee, "trade: quote fee too much")
416421 else false)
417422 then _validateOrderPrices(makerOrderPrice, takerOrderPrice, takerOrderSide, takerOrderType, "trade: prices mismatch")
418423 else false
419424 if ((err == err))
420425 then {
421426 let makerAddress = _convertWeb3IdToAddress(makerOrderWeb3Id, makerOrderAlg)
422427 let takerAddress = _convertWeb3IdToAddress(takerOrderWeb3Id, takerOrderAlg)
423- let $t01403314456 = if ((makerOrderSide == ORDER_SIDE_BUY))
428+ let $t01417514598 = if ((makerOrderSide == ORDER_SIDE_BUY))
424429 then $Tuple2(makerAddress, takerAddress)
425430 else $Tuple2(takerAddress, makerAddress)
426- let buyer = $t01403314456._1
427- let seller = $t01403314456._2
431+ let buyer = $t01417514598._1
432+ let seller = $t01417514598._2
428433 let assets = split(makerOrderSymbol, "-")
429434 let baseAsset = assets[0]
430435 let quoteAsset = assets[1]
431436 let feeRecipient = _loadFeeRecipient()
432437 let storageInvocation = invoke(_loadAccountStorage(), FUNC_EXTERNAL_TRANSFER, [SPOT_WALLET, baseAsset, seller, buyer, toString(tradeBaseAmount), toString(baseFee), feeRecipient], nil)
433438 if ((storageInvocation == storageInvocation))
434439 then {
435440 let storageInvocation1 = invoke(_loadAccountStorage(), FUNC_EXTERNAL_TRANSFER, [SPOT_WALLET, quoteAsset, buyer, seller, toString(tradeQuoteAmount), toString(quoteFee), feeRecipient], nil)
436441 if ((storageInvocation1 == storageInvocation1))
437442 then {
438443 let newMakerOrderFilledAmount = (makerOrderFilledAmount + tradeBaseAmount)
439444 let newTakerOrderFilledAmount = if ((takerOrderBaseAmount == ZERO_BIGINT))
440445 then (takerOrderFilledAmount + tradeQuoteAmount)
441446 else (takerOrderFilledAmount + tradeBaseAmount)
442447 $Tuple2((_saveOrderFilledAmount(makerOrderHash, newMakerOrderFilledAmount) ++ _saveOrderFilledAmount(takerOrderHash, newTakerOrderFilledAmount)), unit)
443448 }
444449 else throw("Strict value is not equal to itself.")
445450 }
446451 else throw("Strict value is not equal to itself.")
447452 }
448453 else throw("Strict value is not equal to itself.")
449454 }
450455
451456
452457
453458 @Callable(i)
454459 func claimReward (user_,currency_,amount_) = {
455460 let amount = valueOrErrorMessage(parseBigInt(amount_), "claimReward: amount not int")
456461 let err = if (if (if (_validateSequencer(i.caller, "claimReward: invalid sequencer"))
457462 then _validateString(user_, "claimReward: invalid user")
458463 else false)
459464 then _validateString(currency_, "claimReward: invalid currency")
460465 else false)
461466 then _validateBigInt(amount, ZERO_BIGINT, "claimReward: neg amount")
462467 else false
463468 if ((err == err))
464469 then {
465470 let storageInvocation = invoke(_loadAccountStorage(), FUNC_CLAIM_REWARD, [_loadRewardDistributor(), user_, currency_, amount_], nil)
466471 if ((storageInvocation == storageInvocation))
467472 then $Tuple2(nil, unit)
468473 else throw("Strict value is not equal to itself.")
469474 }
470475 else throw("Strict value is not equal to itself.")
471476 }
472477
473478
474479
475480 @Callable(i)
476481 func updateSymbol (symbol_,allowance_) = {
477482 let err = if (_onlyThisContract(i.caller))
478483 then _validateString(symbol_, "updateSymbol: invalid symbol")
479484 else false
480485 if ((err == err))
481486 then $Tuple2(_saveSymbol(symbol_, allowance_), unit)
482487 else throw("Strict value is not equal to itself.")
483488 }
484489
485490
486491
487492 @Callable(i)
488493 func updateFeeRecipient (feeRecipient_) = {
489494 let err = if (if (_onlyThisContract(i.caller))
490495 then _whenInitialized()
491496 else false)
492497 then _validateString(feeRecipient_, "updateFeeRecipient: invalid feeRecipient")
493498 else false
494499 if ((err == err))
495500 then $Tuple2(_saveFeeRecipient(feeRecipient_), unit)
496501 else throw("Strict value is not equal to itself.")
497502 }
498503
499504
500505
501506 @Callable(i)
502507 func updateRewardDistributor (rewardDistributor_) = {
503508 let err = if (if (_onlyThisContract(i.caller))
504509 then _whenInitialized()
505510 else false)
506511 then _validateString(rewardDistributor_, "updateRewardDistributor: invalid rewardDistributor")
507512 else false
508513 if ((err == err))
509514 then $Tuple2(_saveRewardDistributor(rewardDistributor_), unit)
510515 else throw("Strict value is not equal to itself.")
511516 }
512517
513518
514519
515520 @Callable(i)
516521 func setMultisig (multisig_) = {
517522 let err = if (_onlyThisContract(i.caller))
518523 then _validateAddress(multisig_, "setMultisig: invalid multisig")
519524 else false
520525 if ((err == err))
521526 then $Tuple2(_saveMultisig(addressFromStringValue(multisig_)), unit)
522527 else throw("Strict value is not equal to itself.")
523528 }
524529
525530
526531 @Verifier(tx)
527532 func verify () = match getString(KEY_MULTISIG) {
528533 case multisig: String =>
529534 valueOrElse(getBoolean(addressFromStringValue(multisig), makeString([KEY_STATUS, toString(this), toBase58String(tx.id)], SEPARATOR)), false)
530535 case _ =>
531536 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
532537 }
533538

github/deemru/w8io/169f3d6 
50.35 ms