tx · 6yneKwVnCjbjZUpiA1UZNRgH23tGANzEaF7vCBHr8htr

3NCCxt72qfGYBPUNx6zM49UDV9r4LvrtzeY:  -0.01800000 Waves

2024.11.21 12:40 [3381042] smart account 3NCCxt72qfGYBPUNx6zM49UDV9r4LvrtzeY > SELF 0.00000000 Waves

{ "type": 13, "id": "6yneKwVnCjbjZUpiA1UZNRgH23tGANzEaF7vCBHr8htr", "fee": 1800000, "feeAssetId": null, "timestamp": 1732181951578, "version": 2, "chainId": 84, "sender": "3NCCxt72qfGYBPUNx6zM49UDV9r4LvrtzeY", "senderPublicKey": "D14bs2ieC42BPAapbooQT637A3iD7mXwJ9bgfDGXBHcX", "proofs": [ "3MRTX2Ad8HntJMepsUCRumuS6MR9kxoC2eKtgfcY9FJt6ecFjVk2NVsUeKnL4967UgBTKmaP5G5ybDCWUBkd2Wf9" ], "script": "base64:BwItCAISBQoDCAgIEgYKBAgICAgSBQoDCAgIEgQKAggEEgMKAQgSAwoBCBIDCgEIPgAJU0VQQVJBVE9SAgJfXwAMS0VZX01VTFRJU0lHAghNVUxUSVNJRwAKS0VZX1NUQVRVUwIGU1RBVFVTAAhLRVlfSU5JVAIESU5JVAANS0VZX1NFUVVFTkNFUgIJU0VRVUVOQ0VSABNLRVlfQUNDT1VOVF9TVE9SQUdFAg9BQ0NPVU5UX1NUT1JBR0UAEUtFWV9GRUVfUkVDSVBJRU5UAg1GRUVfUkVDSVBJRU5UAApLRVlfU1lNQk9MAgZTWU1CT0wAF0tFWV9PUkRFUl9GSUxMRURfQU1PVU5UAhNPUkRFUl9GSUxMRURfQU1PVU5UABZLRVlfUkVXQVJEX0RJU1RSSUJVVE9SAhJSRVdBUkRfRElTVFJJQlVUT1IAFkZVTkNfRVhURVJOQUxfVFJBTlNGRVICEGV4dGVybmFsVHJhbnNmZXIAEUZVTkNfQ0xBSU1fUkVXQVJEAgtjbGFpbVJld2FyZAALU1BPVF9XQUxMRVQCBFNQT1QAEE9SREVSX1RZUEVfTElNSVQA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UqG6LqJN5fkVxdEayVeEnhuH5qtM3 Diff:
OldNewDifferences
245245 else throw((err_ + ": inv alg"))
246246
247247
248-func _validatePublicKey (publicKey_,alg_,err_) = if ((alg_ == ALG_TYPE_WAVES))
249- then if ((size(publicKey_) != 32))
248+func _validateWeb3Id (web3Id_,alg_,err_) = if ((alg_ == ALG_TYPE_WAVES))
249+ then if ((size(web3Id_) != 32))
250250 then throw(err_)
251251 else true
252252 else if ((alg_ == ALG_TYPE_EVM))
253- then if ((size(publicKey_) != 20))
253+ then if ((size(web3Id_) != 20))
254254 then throw(err_)
255255 else true
256256 else throw((err_ + ": inv alg"))
257257
258258
259-func _convertPublicKeyToAddress (publicKey_,alg_) = if ((alg_ == ALG_TYPE_WAVES))
260- then toString(addressFromPublicKey(publicKey_))
259+func _convertWeb3IdToAddress (web3Id_,alg_) = if ((alg_ == ALG_TYPE_WAVES))
260+ then toString(addressFromPublicKey(web3Id_))
261261 else if ((alg_ == ALG_TYPE_EVM))
262- then ("0x" + toBase16String(publicKey_))
263- else throw("_convertPublicKeyToAddress: revert")
262+ then ("0x" + toBase16String(web3Id_))
263+ else throw("_convertWeb3IdToAddress: revert")
264264
265265
266-func _validateOrderSignature (orderHash_,signature_,publicKey_,alg_,err_) = {
266+func _validateOrderSignature (orderHash_,signature_,web3Id_,alg_,err_) = {
267267 let result = if ((alg_ == ALG_TYPE_WAVES))
268- then sigVerify(orderHash_, signature_, publicKey_)
268+ then sigVerify(orderHash_, signature_, web3Id_)
269269 else if ((alg_ == ALG_TYPE_EVM))
270270 then {
271271 let hashWithPrefix = keccak256_16Kb((EVM_PREFIX + orderHash_))
272- (takeRight(keccak256_16Kb(ecrecover(hashWithPrefix, signature_)), 20) == publicKey_)
272+ (takeRight(keccak256_16Kb(ecrecover(hashWithPrefix, signature_)), 20) == web3Id_)
273273 }
274274 else throw((err_ + ": inv alg"))
275275 if (!(result))
290290 let symbol = fields[2]
291291 let side = valueOrErrorMessage(parseInt(fields[3]), (err_ + ": inv side"))
292292 let ts = valueOrErrorMessage(parseInt(fields[4]), (err_ + ": inv ts"))
293- let publicKey = fromBase58String(fields[5])
293+ let web3Id = fromBase58String(fields[5])
294294 let alg = valueOrErrorMessage(parseInt(fields[6]), (err_ + ": inv alg"))
295295 let signature = fromBase58String(fields[7])
296- let $t083579395 = if (if ((type == ORDER_TYPE_LIMIT))
296+ let $t083589396 = if (if ((type == ORDER_TYPE_LIMIT))
297297 then (version == ORDER_VERSION_1)
298298 else false)
299299 then {
315315 else $Tuple4(ZERO_BIGINT, ZERO_BIGINT, amount, (toBytes(amount) + toBytes(ZERO_BIGINT)))
316316 }
317317 else throw((err_ + ": inv type & version"))
318- let price = $t083579395._1
319- let baseAmount = $t083579395._2
320- let quoteAmount = $t083579395._3
321- let orderDetailsBytes = $t083579395._4
322- let orderBytes = ((((((((toBytes(type) + toBytes(version)) + toBytes(size(symbol))) + toBytes(symbol)) + toBytes(side)) + toBytes(ts)) + publicKey) + toBytes(alg)) + orderDetailsBytes)
318+ let price = $t083589396._1
319+ let baseAmount = $t083589396._2
320+ let quoteAmount = $t083589396._3
321+ let orderDetailsBytes = $t083589396._4
322+ let orderBytes = ((((((((toBytes(type) + toBytes(version)) + toBytes(size(symbol))) + toBytes(symbol)) + toBytes(side)) + toBytes(ts)) + web3Id) + toBytes(alg)) + orderDetailsBytes)
323323 let orderHash = keccak256_32Kb(orderBytes)
324324 let err = if (if (if (if (if (if (if (_validateOrderType(type, version, (err_ + ": inv order type")))
325325 then _validateOrderSymbol(symbol, (err_ + ": inv order symbol"))
326326 else false)
327327 then _validateOrderSide(side, (err_ + ": inv order side"))
328328 else false)
329- then _validatePublicKey(publicKey, alg, (err_ + ": inv order public key"))
329+ then _validateWeb3Id(web3Id, alg, (err_ + ": inv order web3Id"))
330330 else false)
331331 then _validateSignatureFormat(signature, alg, (err_ + ": inv sig format"))
332332 else false)
337337 then _validateBigInt(quoteAmount, ZERO_BIGINT, (err_ + ": neg quote amount"))
338338 else false
339339 if ((err == err))
340- then $Tuple10(type, symbol, side, price, baseAmount, quoteAmount, orderHash, publicKey, alg, signature)
340+ then $Tuple10(type, symbol, side, price, baseAmount, quoteAmount, orderHash, web3Id, alg, signature)
341341 else throw("Strict value is not equal to itself.")
342342 }
343343
364364
365365 @Callable(i)
366366 func trade (makerOrder_,takerOrder_,baseFee_,quoteFee_) = {
367- let $t01122711559 = _parseOrder(makerOrder_, "trade: invalid maker order")
368- let makerOrderType = $t01122711559._1
369- let makerOrderSymbol = $t01122711559._2
370- let makerOrderSide = $t01122711559._3
371- let makerOrderPrice = $t01122711559._4
372- let makerOrderBaseAmount = $t01122711559._5
373- let makerOrderQuoteAmount = $t01122711559._6
374- let makerOrderHash = $t01122711559._7
375- let makerOrderPublicKey = $t01122711559._8
376- let makerOrderAlg = $t01122711559._9
377- let makerOrderSignature = $t01122711559._10
378- let $t01156511897 = _parseOrder(takerOrder_, "trade: invalid taker order")
379- let takerOrderType = $t01156511897._1
380- let takerOrderSymbol = $t01156511897._2
381- let takerOrderSide = $t01156511897._3
382- let takerOrderPrice = $t01156511897._4
383- let takerOrderBaseAmount = $t01156511897._5
384- let takerOrderQuoteAmount = $t01156511897._6
385- let takerOrderHash = $t01156511897._7
386- let takerOrderPublicKey = $t01156511897._8
387- let takerOrderAlg = $t01156511897._9
388- let takerOrderSignature = $t01156511897._10
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
389389 let baseFee = valueOrErrorMessage(parseBigInt(baseFee_), "trade: baseFee not int")
390390 let quoteFee = valueOrErrorMessage(parseBigInt(quoteFee_), "trade: quoteFee not int")
391391 let tradePrice = makerOrderPrice
406406 else false)
407407 then _validateIntNotEqual(makerOrderSide, takerOrderSide, "trade: side mismatch")
408408 else false)
409- then _validateOrderSignature(makerOrderHash, makerOrderSignature, makerOrderPublicKey, makerOrderAlg, "trade: invalid maker sig")
409+ then _validateOrderSignature(makerOrderHash, makerOrderSignature, makerOrderWeb3Id, makerOrderAlg, "trade: invalid maker sig")
410410 else false)
411- then _validateOrderSignature(takerOrderHash, takerOrderSignature, takerOrderPublicKey, takerOrderAlg, "trade: invalid taker sig")
411+ then _validateOrderSignature(takerOrderHash, takerOrderSignature, takerOrderWeb3Id, takerOrderAlg, "trade: invalid taker sig")
412412 else false)
413413 then _validateFeeTolerance(tradeBaseAmount, baseFee, "trade: base fee too much")
414414 else false)
418418 else false
419419 if ((err == err))
420420 then {
421- let makerAddress = _convertPublicKeyToAddress(makerOrderPublicKey, makerOrderAlg)
422- let takerAddress = _convertPublicKeyToAddress(takerOrderPublicKey, takerOrderAlg)
423- let $t01407214495 = if ((makerOrderSide == ORDER_SIDE_BUY))
421+ let makerAddress = _convertWeb3IdToAddress(makerOrderWeb3Id, makerOrderAlg)
422+ let takerAddress = _convertWeb3IdToAddress(takerOrderWeb3Id, takerOrderAlg)
423+ let $t01403314456 = if ((makerOrderSide == ORDER_SIDE_BUY))
424424 then $Tuple2(makerAddress, takerAddress)
425425 else $Tuple2(takerAddress, makerAddress)
426- let buyer = $t01407214495._1
427- let seller = $t01407214495._2
426+ let buyer = $t01403314456._1
427+ let seller = $t01403314456._2
428428 let assets = split(makerOrderSymbol, "-")
429429 let baseAsset = assets[0]
430430 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)
5151
5252 let EVM_PREFIX = base58'G5Nu92G2p7moXW9qjjN3na7gtq4dWCeVdaSjry'
5353
5454 func _validateAddress (address_,err_) = match addressFromString(address_) {
5555 case a: Address =>
5656 true
5757 case _ =>
5858 throw(err_)
5959 }
6060
6161
6262 func _validateBigInt (val_,lowerBoundary_,err_) = if ((lowerBoundary_ > val_))
6363 then throw(err_)
6464 else true
6565
6666
6767 func _validateIntEqual (val1_,val2_,err_) = if ((val1_ != val2_))
6868 then throw(err_)
6969 else true
7070
7171
7272 func _validateIntNotEqual (val1_,val2_,err_) = if ((val1_ == val2_))
7373 then throw(err_)
7474 else true
7575
7676
7777 func _validateString (val_,err_) = if (if ((0 >= size(val_)))
7878 then true
7979 else contains(val_, SEPARATOR))
8080 then throw(err_)
8181 else true
8282
8383
8484 func _validateStringEqual (val1_,val2_,err_) = if ((val1_ != val2_))
8585 then throw(err_)
8686 else true
8787
8888
8989 func _loadInit () = match getBoolean(KEY_INIT) {
9090 case a: Boolean =>
9191 a
9292 case _ =>
9393 false
9494 }
9595
9696
9797 func _saveInit (isInit_) = [BooleanEntry(KEY_INIT, isInit_)]
9898
9999
100100 func _loadMultisig () = match getString(KEY_MULTISIG) {
101101 case a: String =>
102102 addressFromStringValue(a)
103103 case _ =>
104104 Address(base58'')
105105 }
106106
107107
108108 func _saveMultisig (multisig_) = [StringEntry(KEY_MULTISIG, toString(multisig_))]
109109
110110
111111 func _loadSequencer () = match getString(KEY_SEQUENCER) {
112112 case a: String =>
113113 addressFromStringValue(a)
114114 case _ =>
115115 Address(base58'')
116116 }
117117
118118
119119 func _saveSequencer (sequencer_) = [StringEntry(KEY_SEQUENCER, toString(sequencer_))]
120120
121121
122122 func _loadAccountStorage () = match getString(KEY_ACCOUNT_STORAGE) {
123123 case a: String =>
124124 addressFromStringValue(a)
125125 case _ =>
126126 Address(base58'')
127127 }
128128
129129
130130 func _saveAccountStorage (accountStorage_) = [StringEntry(KEY_ACCOUNT_STORAGE, toString(accountStorage_))]
131131
132132
133133 func _loadFeeRecipient () = match getString(KEY_FEE_RECIPIENT) {
134134 case a: String =>
135135 a
136136 case _ =>
137137 ""
138138 }
139139
140140
141141 func _saveFeeRecipient (feeRecipient_) = [StringEntry(KEY_FEE_RECIPIENT, feeRecipient_)]
142142
143143
144144 func _loadRewardDistributor () = match getString(KEY_REWARD_DISTRIBUTOR) {
145145 case a: String =>
146146 a
147147 case _ =>
148148 ""
149149 }
150150
151151
152152 func _saveRewardDistributor (distributor_) = [StringEntry(KEY_REWARD_DISTRIBUTOR, distributor_)]
153153
154154
155155 func _loadSymbol (symbol_) = match getBoolean(makeString([KEY_SYMBOL, symbol_], SEPARATOR)) {
156156 case a: Boolean =>
157157 a
158158 case _ =>
159159 false
160160 }
161161
162162
163163 func _saveSymbol (symbol_,val_) = [BooleanEntry(makeString([KEY_SYMBOL, symbol_], SEPARATOR), val_)]
164164
165165
166166 func _loadOrderFilledAmount (orderHash_) = match getString(makeString([KEY_ORDER_FILLED_AMOUNT, toBase58String(orderHash_)], SEPARATOR)) {
167167 case a: String =>
168168 parseBigIntValue(a)
169169 case _ =>
170170 ZERO_BIGINT
171171 }
172172
173173
174174 func _saveOrderFilledAmount (orderHash_,amount_) = [StringEntry(makeString([KEY_ORDER_FILLED_AMOUNT, toBase58String(orderHash_)], SEPARATOR), toString(amount_))]
175175
176176
177177 func _onlyThisContract (caller_) = if ((caller_ != this))
178178 then throw("_onlyThisContract: revert")
179179 else true
180180
181181
182182 func _whenMultisigSet () = if ((_loadMultisig() == Address(base58'')))
183183 then throw("_whenMultisigSet: revert")
184184 else true
185185
186186
187187 func _whenNotInitialized () = if (_loadInit())
188188 then throw("_whenNotInitialized: revert")
189189 else true
190190
191191
192192 func _whenInitialized () = if (!(_loadInit()))
193193 then throw("_whenInitialized: revert")
194194 else true
195195
196196
197197 func _validateSequencer (caller,err_) = if ((_loadSequencer() != caller))
198198 then throw(err_)
199199 else true
200200
201201
202202 func _validateOrderType (type_,version_,err_) = if (if ((type_ != ORDER_TYPE_LIMIT))
203203 then (type_ != ORDER_TYPE_MARKET)
204204 else false)
205205 then throw(err_)
206206 else if ((version_ != ORDER_VERSION_1))
207207 then throw(err_)
208208 else true
209209
210210
211211 func _validateOrderSymbol (symbol_,err_) = if (!(_loadSymbol(symbol_)))
212212 then throw(err_)
213213 else true
214214
215215
216216 func _validateOrderSide (side_,err_) = if (if ((side_ != ORDER_SIDE_BUY))
217217 then (side_ != ORDER_SIDE_SELL)
218218 else false)
219219 then throw(err_)
220220 else true
221221
222222
223223 func _validateOrderPrices (makerOrderPrice_,takerOrderPrice_,takerOrderSide_,takerOrderType_,err_) = {
224224 let result = if ((takerOrderType_ == ORDER_TYPE_MARKET))
225225 then true
226226 else if ((takerOrderSide_ == ORDER_SIDE_BUY))
227227 then (takerOrderPrice_ >= makerOrderPrice_)
228228 else if ((takerOrderSide_ == ORDER_SIDE_SELL))
229229 then (makerOrderPrice_ >= takerOrderPrice_)
230230 else false
231231 if (!(result))
232232 then throw(err_)
233233 else true
234234 }
235235
236236
237237 func _validateSignatureFormat (signature_,alg_,err_) = if ((alg_ == ALG_TYPE_WAVES))
238238 then if ((size(signature_) != 64))
239239 then throw(err_)
240240 else true
241241 else if ((alg_ == ALG_TYPE_EVM))
242242 then if ((size(signature_) != 65))
243243 then throw(err_)
244244 else true
245245 else throw((err_ + ": inv alg"))
246246
247247
248-func _validatePublicKey (publicKey_,alg_,err_) = if ((alg_ == ALG_TYPE_WAVES))
249- then if ((size(publicKey_) != 32))
248+func _validateWeb3Id (web3Id_,alg_,err_) = if ((alg_ == ALG_TYPE_WAVES))
249+ then if ((size(web3Id_) != 32))
250250 then throw(err_)
251251 else true
252252 else if ((alg_ == ALG_TYPE_EVM))
253- then if ((size(publicKey_) != 20))
253+ then if ((size(web3Id_) != 20))
254254 then throw(err_)
255255 else true
256256 else throw((err_ + ": inv alg"))
257257
258258
259-func _convertPublicKeyToAddress (publicKey_,alg_) = if ((alg_ == ALG_TYPE_WAVES))
260- then toString(addressFromPublicKey(publicKey_))
259+func _convertWeb3IdToAddress (web3Id_,alg_) = if ((alg_ == ALG_TYPE_WAVES))
260+ then toString(addressFromPublicKey(web3Id_))
261261 else if ((alg_ == ALG_TYPE_EVM))
262- then ("0x" + toBase16String(publicKey_))
263- else throw("_convertPublicKeyToAddress: revert")
262+ then ("0x" + toBase16String(web3Id_))
263+ else throw("_convertWeb3IdToAddress: revert")
264264
265265
266-func _validateOrderSignature (orderHash_,signature_,publicKey_,alg_,err_) = {
266+func _validateOrderSignature (orderHash_,signature_,web3Id_,alg_,err_) = {
267267 let result = if ((alg_ == ALG_TYPE_WAVES))
268- then sigVerify(orderHash_, signature_, publicKey_)
268+ then sigVerify(orderHash_, signature_, web3Id_)
269269 else if ((alg_ == ALG_TYPE_EVM))
270270 then {
271271 let hashWithPrefix = keccak256_16Kb((EVM_PREFIX + orderHash_))
272- (takeRight(keccak256_16Kb(ecrecover(hashWithPrefix, signature_)), 20) == publicKey_)
272+ (takeRight(keccak256_16Kb(ecrecover(hashWithPrefix, signature_)), 20) == web3Id_)
273273 }
274274 else throw((err_ + ": inv alg"))
275275 if (!(result))
276276 then throw(err_)
277277 else true
278278 }
279279
280280
281281 func _validateFeeTolerance (amount_,fee_,err_) = if ((fee_ > fraction(amount_, FEE_MAX_TOLERANCE, MULTIPLIER, DOWN)))
282282 then throw(err_)
283283 else true
284284
285285
286286 func _parseOrder (order_,err_) = {
287287 let fields = split(order_, SEPARATOR)
288288 let type = valueOrErrorMessage(parseInt(fields[0]), (err_ + ": inv type"))
289289 let version = valueOrErrorMessage(parseInt(fields[1]), (err_ + ": inv version"))
290290 let symbol = fields[2]
291291 let side = valueOrErrorMessage(parseInt(fields[3]), (err_ + ": inv side"))
292292 let ts = valueOrErrorMessage(parseInt(fields[4]), (err_ + ": inv ts"))
293- let publicKey = fromBase58String(fields[5])
293+ let web3Id = fromBase58String(fields[5])
294294 let alg = valueOrErrorMessage(parseInt(fields[6]), (err_ + ": inv alg"))
295295 let signature = fromBase58String(fields[7])
296- let $t083579395 = if (if ((type == ORDER_TYPE_LIMIT))
296+ let $t083589396 = if (if ((type == ORDER_TYPE_LIMIT))
297297 then (version == ORDER_VERSION_1)
298298 else false)
299299 then {
300300 let price = valueOrErrorMessage(parseBigInt(fields[8]), (err_ + ": inv price"))
301301 let amount = valueOrErrorMessage(parseBigInt(fields[9]), (err_ + ": inv amount"))
302302 let orderDetailsBytes = (toBytes(price) + toBytes(amount))
303303 $Tuple4(price, amount, ZERO_BIGINT, orderDetailsBytes)
304304 }
305305 else if (if ((type == ORDER_TYPE_MARKET))
306306 then (version == ORDER_VERSION_1)
307307 else false)
308308 then {
309309 let amount = valueOrErrorMessage(parseBigInt(fields[8]), (err_ + ": inv amount"))
310310 let isBaseAmount = if ((valueOrErrorMessage(parseBigInt(fields[9]), (err_ + ": inv isBaseAmount")) == ZERO_BIGINT))
311311 then false
312312 else true
313313 if (isBaseAmount)
314314 then $Tuple4(ZERO_BIGINT, amount, ZERO_BIGINT, (toBytes(amount) + toBytes(ONE_BIGINT)))
315315 else $Tuple4(ZERO_BIGINT, ZERO_BIGINT, amount, (toBytes(amount) + toBytes(ZERO_BIGINT)))
316316 }
317317 else throw((err_ + ": inv type & version"))
318- let price = $t083579395._1
319- let baseAmount = $t083579395._2
320- let quoteAmount = $t083579395._3
321- let orderDetailsBytes = $t083579395._4
322- let orderBytes = ((((((((toBytes(type) + toBytes(version)) + toBytes(size(symbol))) + toBytes(symbol)) + toBytes(side)) + toBytes(ts)) + publicKey) + toBytes(alg)) + orderDetailsBytes)
318+ let price = $t083589396._1
319+ let baseAmount = $t083589396._2
320+ let quoteAmount = $t083589396._3
321+ let orderDetailsBytes = $t083589396._4
322+ let orderBytes = ((((((((toBytes(type) + toBytes(version)) + toBytes(size(symbol))) + toBytes(symbol)) + toBytes(side)) + toBytes(ts)) + web3Id) + toBytes(alg)) + orderDetailsBytes)
323323 let orderHash = keccak256_32Kb(orderBytes)
324324 let err = if (if (if (if (if (if (if (_validateOrderType(type, version, (err_ + ": inv order type")))
325325 then _validateOrderSymbol(symbol, (err_ + ": inv order symbol"))
326326 else false)
327327 then _validateOrderSide(side, (err_ + ": inv order side"))
328328 else false)
329- then _validatePublicKey(publicKey, alg, (err_ + ": inv order public key"))
329+ then _validateWeb3Id(web3Id, alg, (err_ + ": inv order web3Id"))
330330 else false)
331331 then _validateSignatureFormat(signature, alg, (err_ + ": inv sig format"))
332332 else false)
333333 then _validateBigInt(price, ZERO_BIGINT, (err_ + ": neg price"))
334334 else false)
335335 then _validateBigInt(baseAmount, ZERO_BIGINT, (err_ + ": neg base amount"))
336336 else false)
337337 then _validateBigInt(quoteAmount, ZERO_BIGINT, (err_ + ": neg quote amount"))
338338 else false
339339 if ((err == err))
340- then $Tuple10(type, symbol, side, price, baseAmount, quoteAmount, orderHash, publicKey, alg, signature)
340+ then $Tuple10(type, symbol, side, price, baseAmount, quoteAmount, orderHash, web3Id, alg, signature)
341341 else throw("Strict value is not equal to itself.")
342342 }
343343
344344
345345 @Callable(i)
346346 func init (sequencer_,accountStorage_,feeRecipient_) = {
347347 let err = if (if (if (if (if (_onlyThisContract(i.caller))
348348 then _whenNotInitialized()
349349 else false)
350350 then _whenMultisigSet()
351351 else false)
352352 then _validateAddress(sequencer_, "init: invalid sequencer")
353353 else false)
354354 then _validateAddress(accountStorage_, "init: invalid accountStorage")
355355 else false)
356356 then _validateString(feeRecipient_, "init: invalid feeRecipient")
357357 else false
358358 if ((err == err))
359359 then $Tuple2((((_saveInit(true) ++ _saveSequencer(addressFromStringValue(sequencer_))) ++ _saveAccountStorage(addressFromStringValue(accountStorage_))) ++ _saveFeeRecipient(feeRecipient_)), unit)
360360 else throw("Strict value is not equal to itself.")
361361 }
362362
363363
364364
365365 @Callable(i)
366366 func trade (makerOrder_,takerOrder_,baseFee_,quoteFee_) = {
367- let $t01122711559 = _parseOrder(makerOrder_, "trade: invalid maker order")
368- let makerOrderType = $t01122711559._1
369- let makerOrderSymbol = $t01122711559._2
370- let makerOrderSide = $t01122711559._3
371- let makerOrderPrice = $t01122711559._4
372- let makerOrderBaseAmount = $t01122711559._5
373- let makerOrderQuoteAmount = $t01122711559._6
374- let makerOrderHash = $t01122711559._7
375- let makerOrderPublicKey = $t01122711559._8
376- let makerOrderAlg = $t01122711559._9
377- let makerOrderSignature = $t01122711559._10
378- let $t01156511897 = _parseOrder(takerOrder_, "trade: invalid taker order")
379- let takerOrderType = $t01156511897._1
380- let takerOrderSymbol = $t01156511897._2
381- let takerOrderSide = $t01156511897._3
382- let takerOrderPrice = $t01156511897._4
383- let takerOrderBaseAmount = $t01156511897._5
384- let takerOrderQuoteAmount = $t01156511897._6
385- let takerOrderHash = $t01156511897._7
386- let takerOrderPublicKey = $t01156511897._8
387- let takerOrderAlg = $t01156511897._9
388- let takerOrderSignature = $t01156511897._10
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
389389 let baseFee = valueOrErrorMessage(parseBigInt(baseFee_), "trade: baseFee not int")
390390 let quoteFee = valueOrErrorMessage(parseBigInt(quoteFee_), "trade: quoteFee not int")
391391 let tradePrice = makerOrderPrice
392392 let makerOrderFilledAmount = _loadOrderFilledAmount(makerOrderHash)
393393 let makerOrderBaseAmountFree = (makerOrderBaseAmount - makerOrderFilledAmount)
394394 let takerOrderFilledAmount = _loadOrderFilledAmount(takerOrderHash)
395395 let takerOrderBaseAmountFree = if ((takerOrderBaseAmount == ZERO_BIGINT))
396396 then fraction((takerOrderQuoteAmount - takerOrderFilledAmount), MULTIPLIER, tradePrice, DOWN)
397397 else (takerOrderBaseAmount - takerOrderFilledAmount)
398398 let tradeBaseAmount = min([makerOrderBaseAmountFree, takerOrderBaseAmountFree])
399399 let tradeQuoteAmount = fraction(tradeBaseAmount, tradePrice, MULTIPLIER, DOWN)
400400 let err = if (if (if (if (if (if (if (if (if (_validateSequencer(i.caller, "trade: invalid sequencer"))
401401 then _validateBigInt(tradeBaseAmount, ZERO_BIGINT, "trade: neg trade amount")
402402 else false)
403403 then _validateIntEqual(makerOrderType, ORDER_TYPE_LIMIT, "trade: maker is not limit")
404404 else false)
405405 then _validateStringEqual(makerOrderSymbol, takerOrderSymbol, "trade: symbol mismatch")
406406 else false)
407407 then _validateIntNotEqual(makerOrderSide, takerOrderSide, "trade: side mismatch")
408408 else false)
409- then _validateOrderSignature(makerOrderHash, makerOrderSignature, makerOrderPublicKey, makerOrderAlg, "trade: invalid maker sig")
409+ then _validateOrderSignature(makerOrderHash, makerOrderSignature, makerOrderWeb3Id, makerOrderAlg, "trade: invalid maker sig")
410410 else false)
411- then _validateOrderSignature(takerOrderHash, takerOrderSignature, takerOrderPublicKey, takerOrderAlg, "trade: invalid taker sig")
411+ then _validateOrderSignature(takerOrderHash, takerOrderSignature, takerOrderWeb3Id, takerOrderAlg, "trade: invalid taker sig")
412412 else false)
413413 then _validateFeeTolerance(tradeBaseAmount, baseFee, "trade: base fee too much")
414414 else false)
415415 then _validateFeeTolerance(tradeQuoteAmount, quoteFee, "trade: quote fee too much")
416416 else false)
417417 then _validateOrderPrices(makerOrderPrice, takerOrderPrice, takerOrderSide, takerOrderType, "trade: prices mismatch")
418418 else false
419419 if ((err == err))
420420 then {
421- let makerAddress = _convertPublicKeyToAddress(makerOrderPublicKey, makerOrderAlg)
422- let takerAddress = _convertPublicKeyToAddress(takerOrderPublicKey, takerOrderAlg)
423- let $t01407214495 = if ((makerOrderSide == ORDER_SIDE_BUY))
421+ let makerAddress = _convertWeb3IdToAddress(makerOrderWeb3Id, makerOrderAlg)
422+ let takerAddress = _convertWeb3IdToAddress(takerOrderWeb3Id, takerOrderAlg)
423+ let $t01403314456 = if ((makerOrderSide == ORDER_SIDE_BUY))
424424 then $Tuple2(makerAddress, takerAddress)
425425 else $Tuple2(takerAddress, makerAddress)
426- let buyer = $t01407214495._1
427- let seller = $t01407214495._2
426+ let buyer = $t01403314456._1
427+ let seller = $t01403314456._2
428428 let assets = split(makerOrderSymbol, "-")
429429 let baseAsset = assets[0]
430430 let quoteAsset = assets[1]
431431 let feeRecipient = _loadFeeRecipient()
432432 let storageInvocation = invoke(_loadAccountStorage(), FUNC_EXTERNAL_TRANSFER, [SPOT_WALLET, baseAsset, seller, buyer, toString(tradeBaseAmount), toString(baseFee), feeRecipient], nil)
433433 if ((storageInvocation == storageInvocation))
434434 then {
435435 let storageInvocation1 = invoke(_loadAccountStorage(), FUNC_EXTERNAL_TRANSFER, [SPOT_WALLET, quoteAsset, buyer, seller, toString(tradeQuoteAmount), toString(quoteFee), feeRecipient], nil)
436436 if ((storageInvocation1 == storageInvocation1))
437437 then {
438438 let newMakerOrderFilledAmount = (makerOrderFilledAmount + tradeBaseAmount)
439439 let newTakerOrderFilledAmount = if ((takerOrderBaseAmount == ZERO_BIGINT))
440440 then (takerOrderFilledAmount + tradeQuoteAmount)
441441 else (takerOrderFilledAmount + tradeBaseAmount)
442442 $Tuple2((_saveOrderFilledAmount(makerOrderHash, newMakerOrderFilledAmount) ++ _saveOrderFilledAmount(takerOrderHash, newTakerOrderFilledAmount)), unit)
443443 }
444444 else throw("Strict value is not equal to itself.")
445445 }
446446 else throw("Strict value is not equal to itself.")
447447 }
448448 else throw("Strict value is not equal to itself.")
449449 }
450450
451451
452452
453453 @Callable(i)
454454 func claimReward (user_,currency_,amount_) = {
455455 let amount = valueOrErrorMessage(parseBigInt(amount_), "claimReward: amount not int")
456456 let err = if (if (if (_validateSequencer(i.caller, "claimReward: invalid sequencer"))
457457 then _validateString(user_, "claimReward: invalid user")
458458 else false)
459459 then _validateString(currency_, "claimReward: invalid currency")
460460 else false)
461461 then _validateBigInt(amount, ZERO_BIGINT, "claimReward: neg amount")
462462 else false
463463 if ((err == err))
464464 then {
465465 let storageInvocation = invoke(_loadAccountStorage(), FUNC_CLAIM_REWARD, [_loadRewardDistributor(), user_, currency_, amount_], nil)
466466 if ((storageInvocation == storageInvocation))
467467 then $Tuple2(nil, unit)
468468 else throw("Strict value is not equal to itself.")
469469 }
470470 else throw("Strict value is not equal to itself.")
471471 }
472472
473473
474474
475475 @Callable(i)
476476 func updateSymbol (symbol_,allowance_) = {
477477 let err = if (_onlyThisContract(i.caller))
478478 then _validateString(symbol_, "updateSymbol: invalid symbol")
479479 else false
480480 if ((err == err))
481481 then $Tuple2(_saveSymbol(symbol_, allowance_), unit)
482482 else throw("Strict value is not equal to itself.")
483483 }
484484
485485
486486
487487 @Callable(i)
488488 func updateFeeRecipient (feeRecipient_) = {
489489 let err = if (if (_onlyThisContract(i.caller))
490490 then _whenInitialized()
491491 else false)
492492 then _validateString(feeRecipient_, "updateFeeRecipient: invalid feeRecipient")
493493 else false
494494 if ((err == err))
495495 then $Tuple2(_saveFeeRecipient(feeRecipient_), unit)
496496 else throw("Strict value is not equal to itself.")
497497 }
498498
499499
500500
501501 @Callable(i)
502502 func updateRewardDistributor (rewardDistributor_) = {
503503 let err = if (if (_onlyThisContract(i.caller))
504504 then _whenInitialized()
505505 else false)
506506 then _validateString(rewardDistributor_, "updateRewardDistributor: invalid rewardDistributor")
507507 else false
508508 if ((err == err))
509509 then $Tuple2(_saveRewardDistributor(rewardDistributor_), unit)
510510 else throw("Strict value is not equal to itself.")
511511 }
512512
513513
514514
515515 @Callable(i)
516516 func setMultisig (multisig_) = {
517517 let err = if (_onlyThisContract(i.caller))
518518 then _validateAddress(multisig_, "setMultisig: invalid multisig")
519519 else false
520520 if ((err == err))
521521 then $Tuple2(_saveMultisig(addressFromStringValue(multisig_)), unit)
522522 else throw("Strict value is not equal to itself.")
523523 }
524524
525525
526526 @Verifier(tx)
527527 func verify () = match getString(KEY_MULTISIG) {
528528 case multisig: String =>
529529 valueOrElse(getBoolean(addressFromStringValue(multisig), makeString([KEY_STATUS, toString(this), toBase58String(tx.id)], SEPARATOR)), false)
530530 case _ =>
531531 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
532532 }
533533

github/deemru/w8io/169f3d6 
65.52 ms