tx · FY5V8rz5rLaMr94r5G68yKVrdwpwiE5sYjHMP9c1Jf6W 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL: -0.01000000 Waves 2021.09.09 23:56 [1696020] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves
{ "type": 13, "id": "FY5V8rz5rLaMr94r5G68yKVrdwpwiE5sYjHMP9c1Jf6W", "fee": 1000000, "feeAssetId": null, "timestamp": 1631220990606, "version": 2, "chainId": 84, "sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL", "senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx", "proofs": [ "WVRh5hdzV9joAsV132Zy2uVNN4kRi8BruYtvrckFcvcrpqrJC67xoyABWgGJLYesUTn8PnoRo3CDitkovTcjwpH" ], "script": "base64:AAIFAAAAAAAAA+EIAhIICgYYGBEYAgEaFQoCYTESD2NoZWNrUG9zc2liaWx0eRoPCgJhMhIJcG10QW1vdW50GhgKAmEzEhJtaW5BbW91bnRUb1JlY2VpdmUaEAoCYTQSCmV4Y2hhbmdlcnMaFAoCYTUSDmV4Y2hhbmdlcnNUeXBlGhcKAmE2EhFyb3V0aW5nQXNzZXRzS2V5cxoQCgJhNxIKY29tbWlzc2lvbhoeCgJhOBIYY29tbWlzc2lvblNjYWxlRGVsaW1pdGVyGhMKAmE5Eg1kQXBwMVRva2VuUGF5GhMKAmIxEg1kQXBwMVRva2VuR2V0GhMKAmIyEg1kQXBwMlRva2VuUGF5GhMKAmIzEg1kQXBwMlRva2VuR2V0GhMKAmI0Eg1nZXRGcm9tMVRyYWRlGhoKAmI1EhRnZXRGcm9tMVRyYWRlV2l0aEZlZRoTCgJiNhINZ2V0RnJvbTJUcmFkZRoaCgJiNxIUZ2V0RnJvbTJUcmFkZVdpdGhGZWUaBwoCYjgSAWkaCgoCYjkSBGFyZ3MaFAoCYzESDnJlY2VpdmVBc3NldElkGhEKAmM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ABkQAAAAIFAAAAAmU1AAAAAAAAAAACAwkAAAAAAAACBQAAAAJlNgAAAAAAAAAAAwUAAAACZjEEAAAAAmYyCQEAAAACYzUAAAACBQAAAAJmMQkAAZEAAAACBQAAAAJlNQAAAAAAAAAAAwkAAAIAAAABAgAAABJMaXN0IHNpemUgZXhjZWVkIDMEAAAAAmM5CAUAAAACZTQAAAACXzEEAAAAAmQxCAUAAAACZTQAAAACXzIEAAAAAmQyCAUAAAACZTQAAAACXzMEAAAAAmYzCQAD8AAAAAIFAAAABHRoaXMFAAAAAmMxAwMJAAAAAAAAAgUAAAACYzkFAAAAAmM0CQAAZwAAAAIFAAAAAmYzBQAAAAJhMwcJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAmI4AAAABmNhbGxlcgUAAAACZjMFAAAAAmMxBQAAAANuaWwJAAACAAAAAQIAAAA+cm91dGluZyAhPSByb3V0aW5nU2l6ZSBvciBhbW91bnRUb1JlY2lldmUgPCBtaW5BbW91bnRUb1JlY2VpdmUAAAAAO/ywIQ==", "height": 1696020, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8vLJDmwemBYi1bSduvX2PWf37yBFJShX9PyPb3tSvbar Next: CdZYon4JJbf1r9uhhso9PRSwSiUCNPGZ4aFQtib4u91i Diff:
Old | New | Differences | |
---|---|---|---|
12 | 12 | let getFrom1TradeWithFee = fraction(getFrom1Trade, (commissionScaleDelimiter - commission), commissionScaleDelimiter) | |
13 | 13 | let getFrom2Trade = fraction(dApp2TokenGet, getFrom1TradeWithFee, (getFrom1TradeWithFee + dApp2TokenPay)) | |
14 | 14 | let getFrom2TradeWithFee = fraction(getFrom2Trade, (commissionScaleDelimiter - commission), commissionScaleDelimiter) | |
15 | - | if (true) | |
16 | - | then throw(toString(getFrom1TradeWithFee)) | |
17 | - | else if ((getFrom2TradeWithFee >= minAmountToReceive)) | |
18 | - | then true | |
19 | - | else false | |
15 | + | if ((getFrom2TradeWithFee >= minAmountToReceive)) | |
16 | + | then true | |
17 | + | else false | |
20 | 18 | } | |
21 | 19 | ||
22 | 20 | ||
23 | 21 | @Callable(i) | |
24 | 22 | func routingTrade (exchangers,exchangersType,args,routingAssetsKeys,receiveAssetId,minAmountToReceive) = { | |
25 | - | let $ | |
26 | - | let pmtAmount = $ | |
27 | - | let pmtAssetId = $ | |
23 | + | let $t019642038 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
24 | + | let pmtAmount = $t019642038._1 | |
25 | + | let pmtAssetId = $t019642038._2 | |
28 | 26 | if (!(checkPossibilty(pmtAmount, minAmountToReceive, exchangers, exchangersType, routingAssetsKeys))) | |
29 | 27 | then throw("Check transaction possibilty: declined") | |
30 | 28 | else { | |
31 | 29 | let routingSize = size(exchangers) | |
32 | 30 | func exchangeFold (accumulated,exchanger) = { | |
33 | - | let $ | |
34 | - | let exchangeCounter = $ | |
35 | - | let amountsWithFee = $ | |
36 | - | let assetsIdSend = $ | |
31 | + | let $t023282391 = accumulated | |
32 | + | let exchangeCounter = $t023282391._1 | |
33 | + | let amountsWithFee = $t023282391._2 | |
34 | + | let assetsIdSend = $t023282391._3 | |
37 | 35 | if ((exchangeCounter == 0)) | |
38 | 36 | then { | |
39 | 37 | let exchangerAddress = addressFromStringValue(exchanger) | |
41 | 39 | if ((inv == inv)) | |
42 | 40 | then match inv { | |
43 | 41 | case inv: (Int, ByteVector) => | |
44 | - | let $ | |
45 | - | let amountWithFee = $ | |
46 | - | let assetIdSend = $ | |
42 | + | let $t027262764 = inv | |
43 | + | let amountWithFee = $t027262764._1 | |
44 | + | let assetIdSend = $t027262764._2 | |
47 | 45 | $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend) | |
48 | 46 | case _ => | |
49 | 47 | throw("Incorrect invoke result: expected amountWithFee and assetsIdSend") | |
55 | 53 | else false) | |
56 | 54 | then { | |
57 | 55 | let exchangerAddress = addressFromStringValue(exchanger) | |
58 | - | let $ | |
59 | - | let pmtAssetIdRout = $ | |
60 | - | let pmtAmountRout = $ | |
56 | + | let $t031103176 = $Tuple2(assetsIdSend, amountsWithFee) | |
57 | + | let pmtAssetIdRout = $t031103176._1 | |
58 | + | let pmtAmountRout = $t031103176._2 | |
61 | 59 | let inv = invoke(exchangerAddress, "exchange", [args[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)]) | |
62 | 60 | if ((inv == inv)) | |
63 | 61 | then match inv { | |
64 | 62 | case inv: (Int, ByteVector) => | |
65 | - | let $ | |
66 | - | let amountWithFee = $ | |
67 | - | let assetIdSend = $ | |
63 | + | let $t034253463 = inv | |
64 | + | let amountWithFee = $t034253463._1 | |
65 | + | let assetIdSend = $t034253463._2 | |
68 | 66 | $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend) | |
69 | 67 | case _ => | |
70 | 68 | throw("Incorrect invoke result: expected amountWithFee and assetsIdSend") | |
74 | 72 | else accumulated | |
75 | 73 | } | |
76 | 74 | ||
77 | - | let $ | |
78 | - | let $ | |
79 | - | let $ | |
80 | - | let $ | |
81 | - | if (($ | |
82 | - | then $ | |
75 | + | let $t037013802 = { | |
76 | + | let $list37533802 = exchangers | |
77 | + | let $size37533802 = size($list37533802) | |
78 | + | let $acc037533802 = $Tuple3(0, 0, base58'') | |
79 | + | if (($size37533802 == 0)) | |
80 | + | then $acc037533802 | |
83 | 81 | else { | |
84 | - | let $ | |
85 | - | if (($ | |
86 | - | then $ | |
82 | + | let $acc137533802 = exchangeFold($acc037533802, $list37533802[0]) | |
83 | + | if (($size37533802 == 1)) | |
84 | + | then $acc137533802 | |
87 | 85 | else { | |
88 | - | let $ | |
89 | - | if (($ | |
90 | - | then $ | |
86 | + | let $acc237533802 = exchangeFold($acc137533802, $list37533802[1]) | |
87 | + | if (($size37533802 == 2)) | |
88 | + | then $acc237533802 | |
91 | 89 | else { | |
92 | - | let $ | |
93 | - | if (($ | |
94 | - | then $ | |
90 | + | let $acc337533802 = exchangeFold($acc237533802, $list37533802[2]) | |
91 | + | if (($size37533802 == 3)) | |
92 | + | then $acc337533802 | |
95 | 93 | else { | |
96 | - | let $ | |
94 | + | let $acc437533802 = exchangeFold($acc337533802, $list37533802[3]) | |
97 | 95 | throw("List size exceed 3") | |
98 | 96 | } | |
99 | 97 | } | |
100 | 98 | } | |
101 | 99 | } | |
102 | 100 | } | |
103 | - | let exchangeCounter = $ | |
104 | - | let amountsWithFee = $ | |
105 | - | let assetsIdSend = $ | |
101 | + | let exchangeCounter = $t037013802._1 | |
102 | + | let amountsWithFee = $t037013802._2 | |
103 | + | let assetsIdSend = $t037013802._3 | |
106 | 104 | let amountToRecieve = assetBalance(this, receiveAssetId) | |
107 | 105 | if (if ((exchangeCounter == routingSize)) | |
108 | 106 | then (amountToRecieve >= minAmountToReceive) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func checkPossibilty (pmtAmount,minAmountToReceive,exchangers,exchangersType,routingAssetsKeys) = { | |
5 | 5 | let commission = 3000 | |
6 | 6 | let commissionScaleDelimiter = 1000000 | |
7 | 7 | let dApp1TokenPay = getIntegerValue(addressFromStringValue(exchangers[0]), routingAssetsKeys[0]) | |
8 | 8 | let dApp1TokenGet = getIntegerValue(addressFromStringValue(exchangers[0]), routingAssetsKeys[1]) | |
9 | 9 | let dApp2TokenPay = getIntegerValue(addressFromStringValue(exchangers[1]), routingAssetsKeys[2]) | |
10 | 10 | let dApp2TokenGet = getIntegerValue(addressFromStringValue(exchangers[1]), routingAssetsKeys[3]) | |
11 | 11 | let getFrom1Trade = fraction(dApp1TokenGet, pmtAmount, (pmtAmount + dApp1TokenPay)) | |
12 | 12 | let getFrom1TradeWithFee = fraction(getFrom1Trade, (commissionScaleDelimiter - commission), commissionScaleDelimiter) | |
13 | 13 | let getFrom2Trade = fraction(dApp2TokenGet, getFrom1TradeWithFee, (getFrom1TradeWithFee + dApp2TokenPay)) | |
14 | 14 | let getFrom2TradeWithFee = fraction(getFrom2Trade, (commissionScaleDelimiter - commission), commissionScaleDelimiter) | |
15 | - | if (true) | |
16 | - | then throw(toString(getFrom1TradeWithFee)) | |
17 | - | else if ((getFrom2TradeWithFee >= minAmountToReceive)) | |
18 | - | then true | |
19 | - | else false | |
15 | + | if ((getFrom2TradeWithFee >= minAmountToReceive)) | |
16 | + | then true | |
17 | + | else false | |
20 | 18 | } | |
21 | 19 | ||
22 | 20 | ||
23 | 21 | @Callable(i) | |
24 | 22 | func routingTrade (exchangers,exchangersType,args,routingAssetsKeys,receiveAssetId,minAmountToReceive) = { | |
25 | - | let $ | |
26 | - | let pmtAmount = $ | |
27 | - | let pmtAssetId = $ | |
23 | + | let $t019642038 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
24 | + | let pmtAmount = $t019642038._1 | |
25 | + | let pmtAssetId = $t019642038._2 | |
28 | 26 | if (!(checkPossibilty(pmtAmount, minAmountToReceive, exchangers, exchangersType, routingAssetsKeys))) | |
29 | 27 | then throw("Check transaction possibilty: declined") | |
30 | 28 | else { | |
31 | 29 | let routingSize = size(exchangers) | |
32 | 30 | func exchangeFold (accumulated,exchanger) = { | |
33 | - | let $ | |
34 | - | let exchangeCounter = $ | |
35 | - | let amountsWithFee = $ | |
36 | - | let assetsIdSend = $ | |
31 | + | let $t023282391 = accumulated | |
32 | + | let exchangeCounter = $t023282391._1 | |
33 | + | let amountsWithFee = $t023282391._2 | |
34 | + | let assetsIdSend = $t023282391._3 | |
37 | 35 | if ((exchangeCounter == 0)) | |
38 | 36 | then { | |
39 | 37 | let exchangerAddress = addressFromStringValue(exchanger) | |
40 | 38 | let inv = invoke(exchangerAddress, "exchange", [args[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)]) | |
41 | 39 | if ((inv == inv)) | |
42 | 40 | then match inv { | |
43 | 41 | case inv: (Int, ByteVector) => | |
44 | - | let $ | |
45 | - | let amountWithFee = $ | |
46 | - | let assetIdSend = $ | |
42 | + | let $t027262764 = inv | |
43 | + | let amountWithFee = $t027262764._1 | |
44 | + | let assetIdSend = $t027262764._2 | |
47 | 45 | $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend) | |
48 | 46 | case _ => | |
49 | 47 | throw("Incorrect invoke result: expected amountWithFee and assetsIdSend") | |
50 | 48 | } | |
51 | 49 | else throw("Strict value is not equal to itself.") | |
52 | 50 | } | |
53 | 51 | else if (if ((exchangeCounter > 0)) | |
54 | 52 | then (routingSize > exchangeCounter) | |
55 | 53 | else false) | |
56 | 54 | then { | |
57 | 55 | let exchangerAddress = addressFromStringValue(exchanger) | |
58 | - | let $ | |
59 | - | let pmtAssetIdRout = $ | |
60 | - | let pmtAmountRout = $ | |
56 | + | let $t031103176 = $Tuple2(assetsIdSend, amountsWithFee) | |
57 | + | let pmtAssetIdRout = $t031103176._1 | |
58 | + | let pmtAmountRout = $t031103176._2 | |
61 | 59 | let inv = invoke(exchangerAddress, "exchange", [args[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)]) | |
62 | 60 | if ((inv == inv)) | |
63 | 61 | then match inv { | |
64 | 62 | case inv: (Int, ByteVector) => | |
65 | - | let $ | |
66 | - | let amountWithFee = $ | |
67 | - | let assetIdSend = $ | |
63 | + | let $t034253463 = inv | |
64 | + | let amountWithFee = $t034253463._1 | |
65 | + | let assetIdSend = $t034253463._2 | |
68 | 66 | $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend) | |
69 | 67 | case _ => | |
70 | 68 | throw("Incorrect invoke result: expected amountWithFee and assetsIdSend") | |
71 | 69 | } | |
72 | 70 | else throw("Strict value is not equal to itself.") | |
73 | 71 | } | |
74 | 72 | else accumulated | |
75 | 73 | } | |
76 | 74 | ||
77 | - | let $ | |
78 | - | let $ | |
79 | - | let $ | |
80 | - | let $ | |
81 | - | if (($ | |
82 | - | then $ | |
75 | + | let $t037013802 = { | |
76 | + | let $list37533802 = exchangers | |
77 | + | let $size37533802 = size($list37533802) | |
78 | + | let $acc037533802 = $Tuple3(0, 0, base58'') | |
79 | + | if (($size37533802 == 0)) | |
80 | + | then $acc037533802 | |
83 | 81 | else { | |
84 | - | let $ | |
85 | - | if (($ | |
86 | - | then $ | |
82 | + | let $acc137533802 = exchangeFold($acc037533802, $list37533802[0]) | |
83 | + | if (($size37533802 == 1)) | |
84 | + | then $acc137533802 | |
87 | 85 | else { | |
88 | - | let $ | |
89 | - | if (($ | |
90 | - | then $ | |
86 | + | let $acc237533802 = exchangeFold($acc137533802, $list37533802[1]) | |
87 | + | if (($size37533802 == 2)) | |
88 | + | then $acc237533802 | |
91 | 89 | else { | |
92 | - | let $ | |
93 | - | if (($ | |
94 | - | then $ | |
90 | + | let $acc337533802 = exchangeFold($acc237533802, $list37533802[2]) | |
91 | + | if (($size37533802 == 3)) | |
92 | + | then $acc337533802 | |
95 | 93 | else { | |
96 | - | let $ | |
94 | + | let $acc437533802 = exchangeFold($acc337533802, $list37533802[3]) | |
97 | 95 | throw("List size exceed 3") | |
98 | 96 | } | |
99 | 97 | } | |
100 | 98 | } | |
101 | 99 | } | |
102 | 100 | } | |
103 | - | let exchangeCounter = $ | |
104 | - | let amountsWithFee = $ | |
105 | - | let assetsIdSend = $ | |
101 | + | let exchangeCounter = $t037013802._1 | |
102 | + | let amountsWithFee = $t037013802._2 | |
103 | + | let assetsIdSend = $t037013802._3 | |
106 | 104 | let amountToRecieve = assetBalance(this, receiveAssetId) | |
107 | 105 | if (if ((exchangeCounter == routingSize)) | |
108 | 106 | then (amountToRecieve >= minAmountToReceive) | |
109 | 107 | else false) | |
110 | 108 | then [ScriptTransfer(i.caller, amountToRecieve, receiveAssetId)] | |
111 | 109 | else throw("routing != routingSize or amountToRecieve < minAmountToReceive") | |
112 | 110 | } | |
113 | 111 | } | |
114 | 112 | ||
115 | 113 |
github/deemru/w8io/026f985 40.84 ms ◑