tx · CQfUzppQx18V1ZvAZZGZJFWtFVQh65jpniwwoqhDNgGh 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL: -0.01000000 Waves 2021.08.15 13:38 [1659362] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves
{ "type": 13, "id": "CQfUzppQx18V1ZvAZZGZJFWtFVQh65jpniwwoqhDNgGh", "fee": 1000000, "feeAssetId": null, "timestamp": 1629023933698, "version": 2, "chainId": 84, "sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL", "senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx", "proofs": [ "5mfS6jTtMSinhzXUWzhrXMdPhV64XzxmH6FThEd5avUHmz9tyuN1SwXJKiheEqafEzDdCymRFamrh6yiSaJ4zZVy" ], "script": "base64:AAIFAAAAAAAAAf0IAhIHCgUYERICARoHCgJhMRIBaRoQCgJhMhIKZXhjaGFuZ2VycxoKCgJhMxIEYXJncxoRCgJhNBILYXNzZXRzVG9QYXkaFQoCYTUSD2Fzc2V0VG9Vc2VyU2VuZBoYCgJhNhISbWluQW1vdW50VG9SZWNlaXZlGhEKAmE3Egtyb3V0aW5nU2l6ZRoSCgJhOBIMZXhjaGFuZ2VGb2xkGhEKAmE5EgthY2N1bXVsYXRlZBoPCgJiMRIJZXhjaGFuZ2VyGhYKAmIyEhBleGNoYW5nZXJBZGRyZXNzGhAKAmIzEgokdDA5MzIxMDA2Gg8KAmI0EglwbXRBbW91bnQaEAoCYjUSCnBtdEFzc2V0SWQaCQoCYjYSA2ludhoNCgJiNxIHcm91dGluZxoTCgJiOBINJGxpc3QxNzU1MTc5MRoTCgJiORINJHNpemUxNzU1MTc5MRoTCgJjMRINJGFjYzAxNzU1MTc5MRoTCgJjMhINJGFjYzExNzU1MTc5MRoTCgJjMxINJGFjYzIxNzU1MTc5MRoTCgJjNBINJGFjYzMxNzU1MTc5MRoTCgJjNRINJG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QAAAAJjNgQAAAACYzcJAQAAAAJhOAAAAAIFAAAAAmM2CQABkQAAAAIFAAAAAmI4AAAAAAAAAAAFCQAAAgAAAAECAAAAEkxpc3Qgc2l6ZSBleGNlZWQgNQMJAAAAAAAAAgUAAAACYjcFAAAAAmE3AwYJAAACAAAAAQIAAAABMQQAAAACYzgJAAPwAAAAAgUAAAAEdGhpcwUAAAACYTUJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAmExAAAABmNhbGxlcgUAAAACYzgFAAAAAmE1BQAAAANuaWwFAAAAA25pbAAAAABv2CMP", "height": 1659362, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8DJxVc5323yCZgvFKWrnBybmMb23Cr8fVDR7A2ZBiprq Next: 56fSfBoxrmwNmy3ibacNyMP5KRwLQMVgPVKfcZw4ykur Diff:
Old | New | Differences | |
---|---|---|---|
6 | 6 | @Callable(i) | |
7 | 7 | func routingTrade (exchangers,args,assetsToPay,assetToUserSend,minAmountToReceive) = { | |
8 | 8 | let routingSize = size(exchangers) | |
9 | - | if (true) | |
10 | - | then throw(toString(routingSize)) | |
11 | - | else { | |
12 | - | func exchangeFold (accumulated,exchanger) = if ((accumulated == 0)) | |
13 | - | then { | |
14 | - | let exchangerAddress = addressFromStringValue(exchanger) | |
15 | - | let $t09841058 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
16 | - | let pmtAmount = $t09841058._1 | |
17 | - | let pmtAssetId = $t09841058._2 | |
18 | - | if ((assetsToPay[0] != pmtAssetId)) | |
19 | - | then throw("Incorrect payment and assetsToPay array") | |
20 | - | else { | |
21 | - | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, pmtAmount)]) | |
22 | - | if ((inv == inv)) | |
23 | - | then (accumulated + 1) | |
24 | - | else throw("Strict value is not equal to itself.") | |
25 | - | } | |
9 | + | func exchangeFold (accumulated,exchanger) = if ((accumulated == 0)) | |
10 | + | then { | |
11 | + | let exchangerAddress = addressFromStringValue(exchanger) | |
12 | + | let $t09321006 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
13 | + | let pmtAmount = $t09321006._1 | |
14 | + | let pmtAssetId = $t09321006._2 | |
15 | + | if ((assetsToPay[0] != pmtAssetId)) | |
16 | + | then throw("Incorrect payment and assetsToPay array") | |
17 | + | else { | |
18 | + | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, pmtAmount)]) | |
19 | + | if ((inv == inv)) | |
20 | + | then (accumulated + 1) | |
21 | + | else throw("Strict value is not equal to itself.") | |
26 | 22 | } | |
27 | - | else if (if ((accumulated > 0)) | |
28 | - | then (routingSize > accumulated) | |
29 | - | else false) | |
30 | - | then { | |
31 | - | let exchangerAddress = addressFromStringValue(exchanger) | |
32 | - | let pmtAssetId = assetsToPay[accumulated] | |
33 | - | let pmtAmount = assetBalance(this, pmtAssetId) | |
34 | - | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, pmtAmount)]) | |
35 | - | if ((inv == inv)) | |
36 | - | then (accumulated + 1) | |
37 | - | else throw("Strict value is not equal to itself.") | |
38 | - | } | |
39 | - | else accumulated | |
23 | + | } | |
24 | + | else if (if ((accumulated > 0)) | |
25 | + | then (routingSize > accumulated) | |
26 | + | else false) | |
27 | + | then { | |
28 | + | let exchangerAddress = addressFromStringValue(exchanger) | |
29 | + | let pmtAssetId = assetsToPay[accumulated] | |
30 | + | let pmtAmount = assetBalance(this, pmtAssetId) | |
31 | + | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, pmtAmount)]) | |
32 | + | if ((inv == inv)) | |
33 | + | then (accumulated + 1) | |
34 | + | else throw("Strict value is not equal to itself.") | |
35 | + | } | |
36 | + | else accumulated | |
40 | 37 | ||
41 | - | let routing = { | |
42 | - | let $list18071843 = exchangers | |
43 | - | let $size18071843 = size($list18071843) | |
44 | - | let $acc018071843 = 0 | |
45 | - | if (($size18071843 == 0)) | |
46 | - | then $acc018071843 | |
38 | + | let routing = { | |
39 | + | let $list17551791 = exchangers | |
40 | + | let $size17551791 = size($list17551791) | |
41 | + | let $acc017551791 = 0 | |
42 | + | if (($size17551791 == 0)) | |
43 | + | then $acc017551791 | |
44 | + | else { | |
45 | + | let $acc117551791 = exchangeFold($acc017551791, $list17551791[0]) | |
46 | + | if (($size17551791 == 1)) | |
47 | + | then $acc117551791 | |
47 | 48 | else { | |
48 | - | let $ | |
49 | - | if (($ | |
50 | - | then $ | |
49 | + | let $acc217551791 = exchangeFold($acc117551791, $list17551791[1]) | |
50 | + | if (($size17551791 == 2)) | |
51 | + | then $acc217551791 | |
51 | 52 | else { | |
52 | - | let $ | |
53 | - | if (($ | |
54 | - | then $ | |
53 | + | let $acc317551791 = exchangeFold($acc217551791, $list17551791[2]) | |
54 | + | if (($size17551791 == 3)) | |
55 | + | then $acc317551791 | |
55 | 56 | else { | |
56 | - | let $ | |
57 | - | if (($ | |
58 | - | then $ | |
57 | + | let $acc417551791 = exchangeFold($acc317551791, $list17551791[3]) | |
58 | + | if (($size17551791 == 4)) | |
59 | + | then $acc417551791 | |
59 | 60 | else { | |
60 | - | let $ | |
61 | - | if (($ | |
62 | - | then $ | |
61 | + | let $acc517551791 = exchangeFold($acc417551791, $list17551791[4]) | |
62 | + | if (($size17551791 == 5)) | |
63 | + | then $acc517551791 | |
63 | 64 | else { | |
64 | - | let $acc518071843 = exchangeFold($acc418071843, $list18071843[4]) | |
65 | - | if (($size18071843 == 5)) | |
66 | - | then $acc518071843 | |
67 | - | else { | |
68 | - | let $acc618071843 = exchangeFold($acc518071843, $list18071843[5]) | |
69 | - | throw("List size exceed 5") | |
70 | - | } | |
65 | + | let $acc617551791 = exchangeFold($acc517551791, $list17551791[5]) | |
66 | + | throw("List size exceed 5") | |
71 | 67 | } | |
72 | 68 | } | |
73 | 69 | } | |
74 | 70 | } | |
75 | 71 | } | |
76 | 72 | } | |
77 | - | if ((routing == routingSize)) | |
78 | - | then if (true) | |
79 | - | then throw("1") | |
80 | - | else { | |
81 | - | let ammountToRecieve = assetBalance(this, assetToUserSend) | |
73 | + | } | |
74 | + | if ((routing == routingSize)) | |
75 | + | then if (true) | |
76 | + | then throw("1") | |
77 | + | else { | |
78 | + | let ammountToRecieve = assetBalance(this, assetToUserSend) | |
82 | 79 | [ScriptTransfer(i.caller, ammountToRecieve, assetToUserSend)] | |
83 | - | } | |
84 | - | else nil | |
85 | - | } | |
80 | + | } | |
81 | + | else nil | |
86 | 82 | } | |
87 | 83 | ||
88 | 84 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func routingTrade (exchangers,args,assetsToPay,assetToUserSend,minAmountToReceive) = { | |
8 | 8 | let routingSize = size(exchangers) | |
9 | - | if (true) | |
10 | - | then throw(toString(routingSize)) | |
11 | - | else { | |
12 | - | func exchangeFold (accumulated,exchanger) = if ((accumulated == 0)) | |
13 | - | then { | |
14 | - | let exchangerAddress = addressFromStringValue(exchanger) | |
15 | - | let $t09841058 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
16 | - | let pmtAmount = $t09841058._1 | |
17 | - | let pmtAssetId = $t09841058._2 | |
18 | - | if ((assetsToPay[0] != pmtAssetId)) | |
19 | - | then throw("Incorrect payment and assetsToPay array") | |
20 | - | else { | |
21 | - | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, pmtAmount)]) | |
22 | - | if ((inv == inv)) | |
23 | - | then (accumulated + 1) | |
24 | - | else throw("Strict value is not equal to itself.") | |
25 | - | } | |
9 | + | func exchangeFold (accumulated,exchanger) = if ((accumulated == 0)) | |
10 | + | then { | |
11 | + | let exchangerAddress = addressFromStringValue(exchanger) | |
12 | + | let $t09321006 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
13 | + | let pmtAmount = $t09321006._1 | |
14 | + | let pmtAssetId = $t09321006._2 | |
15 | + | if ((assetsToPay[0] != pmtAssetId)) | |
16 | + | then throw("Incorrect payment and assetsToPay array") | |
17 | + | else { | |
18 | + | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, pmtAmount)]) | |
19 | + | if ((inv == inv)) | |
20 | + | then (accumulated + 1) | |
21 | + | else throw("Strict value is not equal to itself.") | |
26 | 22 | } | |
27 | - | else if (if ((accumulated > 0)) | |
28 | - | then (routingSize > accumulated) | |
29 | - | else false) | |
30 | - | then { | |
31 | - | let exchangerAddress = addressFromStringValue(exchanger) | |
32 | - | let pmtAssetId = assetsToPay[accumulated] | |
33 | - | let pmtAmount = assetBalance(this, pmtAssetId) | |
34 | - | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, pmtAmount)]) | |
35 | - | if ((inv == inv)) | |
36 | - | then (accumulated + 1) | |
37 | - | else throw("Strict value is not equal to itself.") | |
38 | - | } | |
39 | - | else accumulated | |
23 | + | } | |
24 | + | else if (if ((accumulated > 0)) | |
25 | + | then (routingSize > accumulated) | |
26 | + | else false) | |
27 | + | then { | |
28 | + | let exchangerAddress = addressFromStringValue(exchanger) | |
29 | + | let pmtAssetId = assetsToPay[accumulated] | |
30 | + | let pmtAmount = assetBalance(this, pmtAssetId) | |
31 | + | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, pmtAmount)]) | |
32 | + | if ((inv == inv)) | |
33 | + | then (accumulated + 1) | |
34 | + | else throw("Strict value is not equal to itself.") | |
35 | + | } | |
36 | + | else accumulated | |
40 | 37 | ||
41 | - | let routing = { | |
42 | - | let $list18071843 = exchangers | |
43 | - | let $size18071843 = size($list18071843) | |
44 | - | let $acc018071843 = 0 | |
45 | - | if (($size18071843 == 0)) | |
46 | - | then $acc018071843 | |
38 | + | let routing = { | |
39 | + | let $list17551791 = exchangers | |
40 | + | let $size17551791 = size($list17551791) | |
41 | + | let $acc017551791 = 0 | |
42 | + | if (($size17551791 == 0)) | |
43 | + | then $acc017551791 | |
44 | + | else { | |
45 | + | let $acc117551791 = exchangeFold($acc017551791, $list17551791[0]) | |
46 | + | if (($size17551791 == 1)) | |
47 | + | then $acc117551791 | |
47 | 48 | else { | |
48 | - | let $ | |
49 | - | if (($ | |
50 | - | then $ | |
49 | + | let $acc217551791 = exchangeFold($acc117551791, $list17551791[1]) | |
50 | + | if (($size17551791 == 2)) | |
51 | + | then $acc217551791 | |
51 | 52 | else { | |
52 | - | let $ | |
53 | - | if (($ | |
54 | - | then $ | |
53 | + | let $acc317551791 = exchangeFold($acc217551791, $list17551791[2]) | |
54 | + | if (($size17551791 == 3)) | |
55 | + | then $acc317551791 | |
55 | 56 | else { | |
56 | - | let $ | |
57 | - | if (($ | |
58 | - | then $ | |
57 | + | let $acc417551791 = exchangeFold($acc317551791, $list17551791[3]) | |
58 | + | if (($size17551791 == 4)) | |
59 | + | then $acc417551791 | |
59 | 60 | else { | |
60 | - | let $ | |
61 | - | if (($ | |
62 | - | then $ | |
61 | + | let $acc517551791 = exchangeFold($acc417551791, $list17551791[4]) | |
62 | + | if (($size17551791 == 5)) | |
63 | + | then $acc517551791 | |
63 | 64 | else { | |
64 | - | let $acc518071843 = exchangeFold($acc418071843, $list18071843[4]) | |
65 | - | if (($size18071843 == 5)) | |
66 | - | then $acc518071843 | |
67 | - | else { | |
68 | - | let $acc618071843 = exchangeFold($acc518071843, $list18071843[5]) | |
69 | - | throw("List size exceed 5") | |
70 | - | } | |
65 | + | let $acc617551791 = exchangeFold($acc517551791, $list17551791[5]) | |
66 | + | throw("List size exceed 5") | |
71 | 67 | } | |
72 | 68 | } | |
73 | 69 | } | |
74 | 70 | } | |
75 | 71 | } | |
76 | 72 | } | |
77 | - | if ((routing == routingSize)) | |
78 | - | then if (true) | |
79 | - | then throw("1") | |
80 | - | else { | |
81 | - | let ammountToRecieve = assetBalance(this, assetToUserSend) | |
73 | + | } | |
74 | + | if ((routing == routingSize)) | |
75 | + | then if (true) | |
76 | + | then throw("1") | |
77 | + | else { | |
78 | + | let ammountToRecieve = assetBalance(this, assetToUserSend) | |
82 | 79 | [ScriptTransfer(i.caller, ammountToRecieve, assetToUserSend)] | |
83 | - | } | |
84 | - | else nil | |
85 | - | } | |
80 | + | } | |
81 | + | else nil | |
86 | 82 | } | |
87 | 83 | ||
88 | 84 |
github/deemru/w8io/026f985 45.71 ms ◑