tx · yUDjTK8Mxo6qXqBVphvznrfopTtYhCcAr7vuTir4cWQ

3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL:  -0.01000000 Waves

2021.08.31 23:57 [1683027] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves

{ "type": 13, "id": "yUDjTK8Mxo6qXqBVphvznrfopTtYhCcAr7vuTir4cWQ", "fee": 1000000, "feeAssetId": null, "timestamp": 1630443478742, "version": 2, "chainId": 84, "sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL", "senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx", "proofs": [ "4tTTHHfHtYUcGNLGvg3ovt3uw3WGPkxfo7wMnftvsuojKswJvZZqdkkUwPYwWv8bixYZvbQCbWR26Ywtev7Rmp5j" ], "script": "base64:AAIFAAAAAAAAAoQIAhIGCgQYEQIBGgcKAmExEgFpGhAKAmEyEgpleGNoYW5nZXJzGgoKAmEzEgRhcmdzGhQKAmE0Eg5yZWNlaXZlQXNzZXRJZBoYCgJhNRISbWluQW1vdW50VG9SZWNlaXZlGhEKAmE2Egtyb3V0aW5nU2l6ZRoSCgJhNxIMZXhjaGFuZ2VGb2xkGhEKAmE4EgthY2N1bXVsYXRlZBoPCgJhORIJZXhjaGFuZ2VyGg8KAmIxEgkkdDA5MzU5OTgaFQoCYjISD2V4Y2hhbmdlQ291bnRlchoUCgJiMxIOYW1vdW50c1dpdGhGZWUaEgoCYjQSDGFzc2V0c0lkU2VuZBoWCgJiNRIQZXhjaGFuZ2VyQWRkcmVzcxoRCgJiNhILJHQwMTExODExOTIaDwoCYjcSCXBtdEFtb3VudBoQCgJiOBIKcG10QXNzZXRJZBoJCgJiORIDaW52Gg0KAmMxEgckbWF0Y2gwGhEKAmMyEgskdDAxNDIwMTQ1OBoTCgJjMxINYW1vdW50V2l0aEZlZRoRCgJjNBILYXNzZXRJZFNlbmQaEQoCYzUSC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AAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAACYTEAAAAGY2FsbGVyBQAAAAJkNgUAAAACYTQFAAAAA25pbAkAAAIAAAABAgAAAD5yb3V0aW5nICE9IHJvdXRpbmdTaXplIG9yIGFtb3VudFRvUmVjaWV2ZSA8IG1pbkFtb3VudFRvUmVjZWl2ZQAAAAD6xIl/", "height": 1683027, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 92LQnViqFimBstBSHFmNpj1Ck87neh2RQNus9pgfXVWy Next: A1ZDU2ANYWTXDxtW17in4oXu7pqJwECmePUDonYE9fF3 Diff:
OldNewDifferences
3030 }
3131 else throw("Strict value is not equal to itself.")
3232 }
33- else if ((exchangeCounter > 1))
33+ else if ((exchangeCounter == 1))
3434 then throw(((((toString(exchangeCounter) + " ") + toBase58String(assetsIdSend)) + " ") + toString(amountsWithFee)))
3535 else if (if ((exchangeCounter > 0))
3636 then (routingSize > exchangeCounter)
3737 else false)
3838 then {
3939 let exchangerAddress = addressFromStringValue(exchanger)
40- let $t019632115 = $Tuple2(assetsIdSend, amountsWithFee)
41- let pmtAssetId = $t019632115._1
42- let pmtAmount = $t019632115._2
40+ let $t019642116 = $Tuple2(assetsIdSend, amountsWithFee)
41+ let pmtAssetId = $t019642116._1
42+ let pmtAmount = $t019642116._2
4343 let inv = invoke(exchangerAddress, "exchange", [args[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)])
4444 if ((inv == inv))
4545 then match inv {
4646 case inv: (Int, ByteVector) =>
47- let $t023432381 = inv
48- let amountWithFee = $t023432381._1
49- let assetIdSend = $t023432381._2
47+ let $t023442382 = inv
48+ let amountWithFee = $t023442382._1
49+ let assetIdSend = $t023442382._2
5050 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
5151 case _ =>
5252 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
5656 else accumulated
5757 }
5858
59- let $t026192720 = {
60- let $list26712720 = exchangers
61- let $size26712720 = size($list26712720)
62- let $acc026712720 = $Tuple3(0, 0, base58'')
63- if (($size26712720 == 0))
64- then $acc026712720
59+ let $t026202721 = {
60+ let $list26722721 = exchangers
61+ let $size26722721 = size($list26722721)
62+ let $acc026722721 = $Tuple3(0, 0, base58'')
63+ if (($size26722721 == 0))
64+ then $acc026722721
6565 else {
66- let $acc126712720 = exchangeFold($acc026712720, $list26712720[0])
67- if (($size26712720 == 1))
68- then $acc126712720
66+ let $acc126722721 = exchangeFold($acc026722721, $list26722721[0])
67+ if (($size26722721 == 1))
68+ then $acc126722721
6969 else {
70- let $acc226712720 = exchangeFold($acc126712720, $list26712720[1])
71- if (($size26712720 == 2))
72- then $acc226712720
70+ let $acc226722721 = exchangeFold($acc126722721, $list26722721[1])
71+ if (($size26722721 == 2))
72+ then $acc226722721
7373 else {
74- let $acc326712720 = exchangeFold($acc226712720, $list26712720[2])
75- if (($size26712720 == 3))
76- then $acc326712720
74+ let $acc326722721 = exchangeFold($acc226722721, $list26722721[2])
75+ if (($size26722721 == 3))
76+ then $acc326722721
7777 else {
78- let $acc426712720 = exchangeFold($acc326712720, $list26712720[3])
78+ let $acc426722721 = exchangeFold($acc326722721, $list26722721[3])
7979 throw("List size exceed 3")
8080 }
8181 }
8282 }
8383 }
8484 }
85- let exchangeCounter = $t026192720._1
86- let amountsWithFee = $t026192720._2
87- let assetsIdSend = $t026192720._3
85+ let exchangeCounter = $t026202721._1
86+ let amountsWithFee = $t026202721._2
87+ let assetsIdSend = $t026202721._3
8888 let amountToRecieve = assetBalance(this, receiveAssetId)
8989 if (if ((exchangeCounter == routingSize))
9090 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 }
33- else if ((exchangeCounter > 1))
33+ else if ((exchangeCounter == 1))
3434 then throw(((((toString(exchangeCounter) + " ") + toBase58String(assetsIdSend)) + " ") + toString(amountsWithFee)))
3535 else if (if ((exchangeCounter > 0))
3636 then (routingSize > exchangeCounter)
3737 else false)
3838 then {
3939 let exchangerAddress = addressFromStringValue(exchanger)
40- let $t019632115 = $Tuple2(assetsIdSend, amountsWithFee)
41- let pmtAssetId = $t019632115._1
42- let pmtAmount = $t019632115._2
40+ let $t019642116 = $Tuple2(assetsIdSend, amountsWithFee)
41+ let pmtAssetId = $t019642116._1
42+ let pmtAmount = $t019642116._2
4343 let inv = invoke(exchangerAddress, "exchange", [args[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)])
4444 if ((inv == inv))
4545 then match inv {
4646 case inv: (Int, ByteVector) =>
47- let $t023432381 = inv
48- let amountWithFee = $t023432381._1
49- let assetIdSend = $t023432381._2
47+ let $t023442382 = inv
48+ let amountWithFee = $t023442382._1
49+ let assetIdSend = $t023442382._2
5050 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
5151 case _ =>
5252 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
5353 }
5454 else throw("Strict value is not equal to itself.")
5555 }
5656 else accumulated
5757 }
5858
59- let $t026192720 = {
60- let $list26712720 = exchangers
61- let $size26712720 = size($list26712720)
62- let $acc026712720 = $Tuple3(0, 0, base58'')
63- if (($size26712720 == 0))
64- then $acc026712720
59+ let $t026202721 = {
60+ let $list26722721 = exchangers
61+ let $size26722721 = size($list26722721)
62+ let $acc026722721 = $Tuple3(0, 0, base58'')
63+ if (($size26722721 == 0))
64+ then $acc026722721
6565 else {
66- let $acc126712720 = exchangeFold($acc026712720, $list26712720[0])
67- if (($size26712720 == 1))
68- then $acc126712720
66+ let $acc126722721 = exchangeFold($acc026722721, $list26722721[0])
67+ if (($size26722721 == 1))
68+ then $acc126722721
6969 else {
70- let $acc226712720 = exchangeFold($acc126712720, $list26712720[1])
71- if (($size26712720 == 2))
72- then $acc226712720
70+ let $acc226722721 = exchangeFold($acc126722721, $list26722721[1])
71+ if (($size26722721 == 2))
72+ then $acc226722721
7373 else {
74- let $acc326712720 = exchangeFold($acc226712720, $list26712720[2])
75- if (($size26712720 == 3))
76- then $acc326712720
74+ let $acc326722721 = exchangeFold($acc226722721, $list26722721[2])
75+ if (($size26722721 == 3))
76+ then $acc326722721
7777 else {
78- let $acc426712720 = exchangeFold($acc326712720, $list26712720[3])
78+ let $acc426722721 = exchangeFold($acc326722721, $list26722721[3])
7979 throw("List size exceed 3")
8080 }
8181 }
8282 }
8383 }
8484 }
85- let exchangeCounter = $t026192720._1
86- let amountsWithFee = $t026192720._2
87- let assetsIdSend = $t026192720._3
85+ let exchangeCounter = $t026202721._1
86+ let amountsWithFee = $t026202721._2
87+ let assetsIdSend = $t026202721._3
8888 let amountToRecieve = assetBalance(this, receiveAssetId)
8989 if (if ((exchangeCounter == routingSize))
9090 then (amountToRecieve >= minAmountToReceive)
9191 else false)
9292 then [ScriptTransfer(i.caller, amountToRecieve, receiveAssetId)]
9393 else throw("routing != routingSize or amountToRecieve < minAmountToReceive")
9494 }
9595
9696

github/deemru/w8io/026f985 
32.82 ms