tx · Eex18D8BYFBPnqRLQKrg5yMj4Wow2uSkap5XsGFEsLK6

3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL:  -0.01000000 Waves

2021.08.31 23:47 [1683018] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves

{ "type": 13, "id": "Eex18D8BYFBPnqRLQKrg5yMj4Wow2uSkap5XsGFEsLK6", "fee": 1000000, "feeAssetId": null, "timestamp": 1630442891959, "version": 2, "chainId": 84, "sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL", "senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx", "proofs": [ "2vAcKjsuiQiCeVgYdzNXavVhKUKBtTiN27edP1hVBzqm3dsoQH9mxTFMr2uUBnB2FLBjrTwXXdyCpY9izVzWzd8" ], "script": "base64:AAIFAAAAAAAAAoQIAhIGCgQYEQIBGgcKAmExEgFpGhAKAmEyEgpleGNoYW5nZXJzGgoKAmEzEgRhcmdzGhQKAmE0Eg5yZWNlaXZlQXNzZXRJZBoYCgJhNRISbWluQW1vdW50VG9SZWNlaXZlGhEKAmE2Egtyb3V0aW5nU2l6ZRoSCgJhNxIMZXhjaGFuZ2VGb2xkGhEKAmE4EgthY2N1bXVsYXRlZBoPCgJhORIJZXhjaGFuZ2VyGg8KAmIxEgkkdDA5MzU5OTgaFQoCYjISD2V4Y2hhbmdlQ291bnRlchoUCgJiMxIOYW1vdW50c1dpdGhGZWUaEgoCYjQSDGFzc2V0c0lkU2VuZBoWCgJiNRIQZXhjaGFuZ2VyQWRkcmVzcxoRCgJiNhILJHQwMTExODExOTIaDwoCYjcSCXBtdEFtb3VudBoQCgJiOBIKcG10QXNzZXRJZBoJCgJiORIDaW52Gg0KAmMxEgckbWF0Y2gwGhEKAmMyEgskdDAxNDIwMTQ1OBoTCgJjMxINYW1vdW50V2l0aEZlZRoRCgJjNBILYXNzZXRJZFNlbmQaEQoCYzUS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1JlY2VpdmUAAAAANdmH4g==", "height": 1683018, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Etm5MQN1TzsssDx3HaSNwdHysxHzgFXEhZNvUD4ysCCG Next: CqQyoaBgcUWSLSt3WHWNGEgCK2vf4qhu17BwAtZJeQ24 Diff:
OldNewDifferences
3333 else if (if ((exchangeCounter > 0))
3434 then (routingSize > exchangeCounter)
3535 else false)
36- then throw(((toBase58String(assetsIdSend) + " ") + toString(amountsWithFee)))
36+ then {
37+ let exchangerAddress = addressFromStringValue(exchanger)
38+ let $t018041956 = $Tuple2(assetsIdSend, amountsWithFee)
39+ let pmtAssetId = $t018041956._1
40+ let pmtAmount = $t018041956._2
41+ let inv = invoke(exchangerAddress, "exchange", [args[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)])
42+ if ((inv == inv))
43+ then match inv {
44+ case inv: (Int, ByteVector) =>
45+ let $t021842222 = inv
46+ let amountWithFee = $t021842222._1
47+ let assetIdSend = $t021842222._2
48+ $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
49+ case _ =>
50+ throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
51+ }
52+ else throw("Strict value is not equal to itself.")
53+ }
3754 else accumulated
3855 }
3956
40- let $t025982699 = {
41- let $list26502699 = exchangers
42- let $size26502699 = size($list26502699)
43- let $acc026502699 = $Tuple3(0, 0, base58'')
44- if (($size26502699 == 0))
45- then $acc026502699
57+ let $t024602561 = {
58+ let $list25122561 = exchangers
59+ let $size25122561 = size($list25122561)
60+ let $acc025122561 = $Tuple3(0, 0, base58'')
61+ if (($size25122561 == 0))
62+ then $acc025122561
4663 else {
47- let $acc126502699 = exchangeFold($acc026502699, $list26502699[0])
48- if (($size26502699 == 1))
49- then $acc126502699
64+ let $acc125122561 = exchangeFold($acc025122561, $list25122561[0])
65+ if (($size25122561 == 1))
66+ then $acc125122561
5067 else {
51- let $acc226502699 = exchangeFold($acc126502699, $list26502699[1])
52- if (($size26502699 == 2))
53- then $acc226502699
68+ let $acc225122561 = exchangeFold($acc125122561, $list25122561[1])
69+ if (($size25122561 == 2))
70+ then $acc225122561
5471 else {
55- let $acc326502699 = exchangeFold($acc226502699, $list26502699[2])
56- if (($size26502699 == 3))
57- then $acc326502699
72+ let $acc325122561 = exchangeFold($acc225122561, $list25122561[2])
73+ if (($size25122561 == 3))
74+ then $acc325122561
5875 else {
59- let $acc426502699 = exchangeFold($acc326502699, $list26502699[3])
76+ let $acc425122561 = exchangeFold($acc325122561, $list25122561[3])
6077 throw("List size exceed 3")
6178 }
6279 }
6380 }
6481 }
6582 }
66- let exchangeCounter = $t025982699._1
67- let amountsWithFee = $t025982699._2
68- let assetsIdSend = $t025982699._3
83+ let exchangeCounter = $t024602561._1
84+ let amountsWithFee = $t024602561._2
85+ let assetsIdSend = $t024602561._3
6986 let amountToRecieve = assetBalance(this, receiveAssetId)
7087 if (if ((exchangeCounter == routingSize))
7188 then (amountToRecieve >= minAmountToReceive)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func routingTrade (exchangers,args,receiveAssetId,minAmountToReceive) = {
88 let routingSize = size(exchangers)
99 func exchangeFold (accumulated,exchanger) = {
1010 let $t0935998 = accumulated
1111 let exchangeCounter = $t0935998._1
1212 let amountsWithFee = $t0935998._2
1313 let assetsIdSend = $t0935998._3
1414 if ((exchangeCounter == 0))
1515 then {
1616 let exchangerAddress = addressFromStringValue(exchanger)
1717 let $t011181192 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
1818 let pmtAmount = $t011181192._1
1919 let pmtAssetId = $t011181192._2
2020 let inv = invoke(exchangerAddress, "exchange", [args[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)])
2121 if ((inv == inv))
2222 then match inv {
2323 case inv: (Int, ByteVector) =>
2424 let $t014201458 = inv
2525 let amountWithFee = $t014201458._1
2626 let assetIdSend = $t014201458._2
2727 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
2828 case _ =>
2929 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
3030 }
3131 else throw("Strict value is not equal to itself.")
3232 }
3333 else if (if ((exchangeCounter > 0))
3434 then (routingSize > exchangeCounter)
3535 else false)
36- then throw(((toBase58String(assetsIdSend) + " ") + toString(amountsWithFee)))
36+ then {
37+ let exchangerAddress = addressFromStringValue(exchanger)
38+ let $t018041956 = $Tuple2(assetsIdSend, amountsWithFee)
39+ let pmtAssetId = $t018041956._1
40+ let pmtAmount = $t018041956._2
41+ let inv = invoke(exchangerAddress, "exchange", [args[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)])
42+ if ((inv == inv))
43+ then match inv {
44+ case inv: (Int, ByteVector) =>
45+ let $t021842222 = inv
46+ let amountWithFee = $t021842222._1
47+ let assetIdSend = $t021842222._2
48+ $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
49+ case _ =>
50+ throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
51+ }
52+ else throw("Strict value is not equal to itself.")
53+ }
3754 else accumulated
3855 }
3956
40- let $t025982699 = {
41- let $list26502699 = exchangers
42- let $size26502699 = size($list26502699)
43- let $acc026502699 = $Tuple3(0, 0, base58'')
44- if (($size26502699 == 0))
45- then $acc026502699
57+ let $t024602561 = {
58+ let $list25122561 = exchangers
59+ let $size25122561 = size($list25122561)
60+ let $acc025122561 = $Tuple3(0, 0, base58'')
61+ if (($size25122561 == 0))
62+ then $acc025122561
4663 else {
47- let $acc126502699 = exchangeFold($acc026502699, $list26502699[0])
48- if (($size26502699 == 1))
49- then $acc126502699
64+ let $acc125122561 = exchangeFold($acc025122561, $list25122561[0])
65+ if (($size25122561 == 1))
66+ then $acc125122561
5067 else {
51- let $acc226502699 = exchangeFold($acc126502699, $list26502699[1])
52- if (($size26502699 == 2))
53- then $acc226502699
68+ let $acc225122561 = exchangeFold($acc125122561, $list25122561[1])
69+ if (($size25122561 == 2))
70+ then $acc225122561
5471 else {
55- let $acc326502699 = exchangeFold($acc226502699, $list26502699[2])
56- if (($size26502699 == 3))
57- then $acc326502699
72+ let $acc325122561 = exchangeFold($acc225122561, $list25122561[2])
73+ if (($size25122561 == 3))
74+ then $acc325122561
5875 else {
59- let $acc426502699 = exchangeFold($acc326502699, $list26502699[3])
76+ let $acc425122561 = exchangeFold($acc325122561, $list25122561[3])
6077 throw("List size exceed 3")
6178 }
6279 }
6380 }
6481 }
6582 }
66- let exchangeCounter = $t025982699._1
67- let amountsWithFee = $t025982699._2
68- let assetsIdSend = $t025982699._3
83+ let exchangeCounter = $t024602561._1
84+ let amountsWithFee = $t024602561._2
85+ let assetsIdSend = $t024602561._3
6986 let amountToRecieve = assetBalance(this, receiveAssetId)
7087 if (if ((exchangeCounter == routingSize))
7188 then (amountToRecieve >= minAmountToReceive)
7289 else false)
7390 then [ScriptTransfer(i.caller, amountToRecieve, receiveAssetId)]
7491 else throw("routing != routingSize or amountToRecieve < minAmountToReceive")
7592 }
7693
7794

github/deemru/w8io/026f985 
30.97 ms