tx · A1ZDU2ANYWTXDxtW17in4oXu7pqJwECmePUDonYE9fF3

3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL:  -0.01000000 Waves

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

{ "type": 13, "id": "A1ZDU2ANYWTXDxtW17in4oXu7pqJwECmePUDonYE9fF3", "fee": 1000000, "feeAssetId": null, "timestamp": 1630443501353, "version": 2, "chainId": 84, "sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL", "senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx", "proofs": [ "pYjBssPsw7PDYHMbajacfG3XFnutt4BjRK6rTrw8m1EKXMJt8zDcjqLNTZiMrdtD4PySb5TiGjf69ZQCthHvTZN" ], "script": "base64:AAIFAAAAAAAAAoQIAhIGCgQYEQIBGgcKAmExEgFpGhAKAmEyEgpleGNoYW5nZXJzGgoKAmEzEgRhcmdzGhQKAmE0Eg5yZWNlaXZlQXNzZXRJZBoYCgJhNRISbWluQW1vdW50VG9SZWNlaXZlGhEKAmE2Egtyb3V0aW5nU2l6ZRoSCgJhNxIMZXhjaGFuZ2VGb2xkGhEKAmE4EgthY2N1bXVsYXRlZBoPCgJhORIJZXhjaGFuZ2VyGg8KAmIxEgkkdDA5MzU5OTgaFQoCYjISD2V4Y2hhbmdlQ291bnRlchoUCgJiMxIOYW1vdW50c1dpdGhGZWUaEgoCYjQSDGFzc2V0c0lkU2VuZBoWCgJiNRIQZXhjaGFuZ2VyQWRkcmVzcxoRCgJiNhILJHQwMTExODExOTIaDwoCYjcSCXBtdEFtb3VudBoQCgJiOBIKcG10QXNzZXRJZBoJCgJiORIDaW52Gg0KAmMxEgckbWF0Y2gwGhEKAmMyEgskdDAxNDIwMTQ1OBoTCgJjMxINYW1vdW50V2l0aEZlZRoRCgJjNBILYXNzZXRJZFNlbmQaEQoCYzUSCyR0MD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pdmUAAAAAoFwAEQ==", "height": 1683027, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: yUDjTK8Mxo6qXqBVphvznrfopTtYhCcAr7vuTir4cWQ Next: 8sNaCFNCrzctmBirkdS8qvhfdhLqBehxbR7GiGKyQ1Jx Diff:
OldNewDifferences
3030 }
3131 else throw("Strict value is not equal to itself.")
3232 }
33- else if ((exchangeCounter == 1))
34- then throw(((((toString(exchangeCounter) + " ") + toBase58String(assetsIdSend)) + " ") + toString(amountsWithFee)))
35- else if (if ((exchangeCounter > 0))
36- then (routingSize > exchangeCounter)
37- else false)
38- then {
39- let exchangerAddress = addressFromStringValue(exchanger)
40- let $t019642116 = $Tuple2(assetsIdSend, amountsWithFee)
41- let pmtAssetId = $t019642116._1
42- let pmtAmount = $t019642116._2
43- let inv = invoke(exchangerAddress, "exchange", [args[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)])
44- if ((inv == inv))
45- then match inv {
46- case inv: (Int, ByteVector) =>
47- let $t023442382 = inv
48- let amountWithFee = $t023442382._1
49- let assetIdSend = $t023442382._2
50- $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
51- case _ =>
52- throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
53- }
54- else throw("Strict value is not equal to itself.")
33+ else if (if ((exchangeCounter > 0))
34+ then (routingSize > exchangeCounter)
35+ else false)
36+ then {
37+ let exchangerAddress = addressFromStringValue(exchanger)
38+ let $t019682120 = $Tuple2(assetsIdSend, amountsWithFee)
39+ let pmtAssetId = $t019682120._1
40+ let pmtAmount = $t019682120._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 $t023482386 = inv
46+ let amountWithFee = $t023482386._1
47+ let assetIdSend = $t023482386._2
48+ $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
49+ case _ =>
50+ throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
5551 }
56- else accumulated
52+ else throw("Strict value is not equal to itself.")
53+ }
54+ else accumulated
5755 }
5856
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
57+ let $t026242725 = {
58+ let $list26762725 = exchangers
59+ let $size26762725 = size($list26762725)
60+ let $acc026762725 = $Tuple3(0, 0, base58'')
61+ if (($size26762725 == 0))
62+ then $acc026762725
6563 else {
66- let $acc126722721 = exchangeFold($acc026722721, $list26722721[0])
67- if (($size26722721 == 1))
68- then $acc126722721
64+ let $acc126762725 = exchangeFold($acc026762725, $list26762725[0])
65+ if (($size26762725 == 1))
66+ then $acc126762725
6967 else {
70- let $acc226722721 = exchangeFold($acc126722721, $list26722721[1])
71- if (($size26722721 == 2))
72- then $acc226722721
68+ let $acc226762725 = exchangeFold($acc126762725, $list26762725[1])
69+ if (($size26762725 == 2))
70+ then $acc226762725
7371 else {
74- let $acc326722721 = exchangeFold($acc226722721, $list26722721[2])
75- if (($size26722721 == 3))
76- then $acc326722721
72+ let $acc326762725 = exchangeFold($acc226762725, $list26762725[2])
73+ if (($size26762725 == 3))
74+ then $acc326762725
7775 else {
78- let $acc426722721 = exchangeFold($acc326722721, $list26722721[3])
76+ let $acc426762725 = exchangeFold($acc326762725, $list26762725[3])
7977 throw("List size exceed 3")
8078 }
8179 }
8280 }
8381 }
8482 }
85- let exchangeCounter = $t026202721._1
86- let amountsWithFee = $t026202721._2
87- let assetsIdSend = $t026202721._3
83+ let exchangeCounter = $t026242725._1
84+ let amountsWithFee = $t026242725._2
85+ let assetsIdSend = $t026242725._3
8886 let amountToRecieve = assetBalance(this, receiveAssetId)
8987 if (if ((exchangeCounter == routingSize))
9088 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))
34- then throw(((((toString(exchangeCounter) + " ") + toBase58String(assetsIdSend)) + " ") + toString(amountsWithFee)))
35- else if (if ((exchangeCounter > 0))
36- then (routingSize > exchangeCounter)
37- else false)
38- then {
39- let exchangerAddress = addressFromStringValue(exchanger)
40- let $t019642116 = $Tuple2(assetsIdSend, amountsWithFee)
41- let pmtAssetId = $t019642116._1
42- let pmtAmount = $t019642116._2
43- let inv = invoke(exchangerAddress, "exchange", [args[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)])
44- if ((inv == inv))
45- then match inv {
46- case inv: (Int, ByteVector) =>
47- let $t023442382 = inv
48- let amountWithFee = $t023442382._1
49- let assetIdSend = $t023442382._2
50- $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
51- case _ =>
52- throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
53- }
54- else throw("Strict value is not equal to itself.")
33+ else if (if ((exchangeCounter > 0))
34+ then (routingSize > exchangeCounter)
35+ else false)
36+ then {
37+ let exchangerAddress = addressFromStringValue(exchanger)
38+ let $t019682120 = $Tuple2(assetsIdSend, amountsWithFee)
39+ let pmtAssetId = $t019682120._1
40+ let pmtAmount = $t019682120._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 $t023482386 = inv
46+ let amountWithFee = $t023482386._1
47+ let assetIdSend = $t023482386._2
48+ $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
49+ case _ =>
50+ throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
5551 }
56- else accumulated
52+ else throw("Strict value is not equal to itself.")
53+ }
54+ else accumulated
5755 }
5856
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
57+ let $t026242725 = {
58+ let $list26762725 = exchangers
59+ let $size26762725 = size($list26762725)
60+ let $acc026762725 = $Tuple3(0, 0, base58'')
61+ if (($size26762725 == 0))
62+ then $acc026762725
6563 else {
66- let $acc126722721 = exchangeFold($acc026722721, $list26722721[0])
67- if (($size26722721 == 1))
68- then $acc126722721
64+ let $acc126762725 = exchangeFold($acc026762725, $list26762725[0])
65+ if (($size26762725 == 1))
66+ then $acc126762725
6967 else {
70- let $acc226722721 = exchangeFold($acc126722721, $list26722721[1])
71- if (($size26722721 == 2))
72- then $acc226722721
68+ let $acc226762725 = exchangeFold($acc126762725, $list26762725[1])
69+ if (($size26762725 == 2))
70+ then $acc226762725
7371 else {
74- let $acc326722721 = exchangeFold($acc226722721, $list26722721[2])
75- if (($size26722721 == 3))
76- then $acc326722721
72+ let $acc326762725 = exchangeFold($acc226762725, $list26762725[2])
73+ if (($size26762725 == 3))
74+ then $acc326762725
7775 else {
78- let $acc426722721 = exchangeFold($acc326722721, $list26722721[3])
76+ let $acc426762725 = exchangeFold($acc326762725, $list26762725[3])
7977 throw("List size exceed 3")
8078 }
8179 }
8280 }
8381 }
8482 }
85- let exchangeCounter = $t026202721._1
86- let amountsWithFee = $t026202721._2
87- let assetsIdSend = $t026202721._3
83+ let exchangeCounter = $t026242725._1
84+ let amountsWithFee = $t026242725._2
85+ let assetsIdSend = $t026242725._3
8886 let amountToRecieve = assetBalance(this, receiveAssetId)
8987 if (if ((exchangeCounter == routingSize))
9088 then (amountToRecieve >= minAmountToReceive)
9189 else false)
9290 then [ScriptTransfer(i.caller, amountToRecieve, receiveAssetId)]
9391 else throw("routing != routingSize or amountToRecieve < minAmountToReceive")
9492 }
9593
9694

github/deemru/w8io/169f3d6 
44.20 ms