tx · 7PBgbC1b53QzfyYZWAt9xrKrmbfxW54qmCay3kqZKRER 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL: -0.01000000 Waves 2021.08.18 12:45 [1663614] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves
{ "type": 13, "id": "7PBgbC1b53QzfyYZWAt9xrKrmbfxW54qmCay3kqZKRER", "fee": 1000000, "feeAssetId": null, "timestamp": 1629279941542, "version": 2, "chainId": 84, "sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL", "senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx", "proofs": [ "3HjF1erDiiYVYnfKun8ujM4FBACNnLpYYNmQAvYDBenqgudQCootuTyQXbcyuYb1736o8pCUqtevsU89KfAiJq2s" ], "script": "base64:AAIFAAAAAAAAAfwIAhIHCgUYERICARoHCgJhMRIBaRoQCgJhMhIKZXhjaGFuZ2VycxoKCgJhMxIEYXJncxoRCgJhNBILYXNzZXRzVG9QYXkaFQoCYTUSD2Fzc2V0VG9Vc2VyU2VuZBoYCgJhNhISbWluQW1vdW50VG9SZWNlaXZlGhEKAmE3Egtyb3V0aW5nU2l6ZRoSCgJhOBIMZXhjaGFuZ2VGb2xkGhEKAmE5EgthY2N1bXVsYXRlZBoPCgJiMRIJZXhjaGFuZ2VyGhYKAmIyEhBleGNoYW5nZXJBZGRyZXNzGhAKAmIzEgokdDA5ODAxMDU0Gg8KAmI0EglwbXRBbW91bnQaEAoCYjUSCnBtdEFzc2V0SWQaCQoCYjYSA2ludhoNCgJiNxIHcm91dGluZxoTCgJiOBINJGxpc3QxODAzMTgzORoTCgJiORINJHNpemUxODAzMTgzORoTCgJjMRINJGFjYzAxODAzMTgzORoTCgJjMhINJGFjYzExODAzMTgzORoTCgJjMxINJGFjYzIxODAzMTgzORoTCgJjNBINJGFjYzMxODAzMTgzORoTCgJjNRINJGFjYzQxODAzMTgzORoTC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AAgUAAAACYzYJAAGRAAAAAgUAAAACYjgAAAAAAAAAAAUJAAACAAAAAQIAAAASTGlzdCBzaXplIGV4Y2VlZCA1BAAAAAJjOAkAA/AAAAACBQAAAAR0aGlzBQAAAAJhNQMDCQAAAAAAAAIFAAAAAmI3BQAAAAJhNwkAAGcAAAACBQAAAAJjOAUAAAACYTYHCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAJhMQAAAAZjYWxsZXIFAAAAAmM4BQAAAAJhNQUAAAADbmlsCQAAAgAAAAECAAAAPnJvdXRpbmcgIT0gcm91dGluZ1NpemUgb3IgYW1vdW50VG9SZWNpZXZlIDwgbWluQW1vdW50VG9SZWNlaXZlAAAAAIiu9XI=", "height": 1663614, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7vd7uAYCni4sqmubcULm1FaF8rUdHedG693J7CQrEu1R Next: H6NAZNDdryr85MZdYetmrYRfHGyL2AQYJr9CPTm5HBMN Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | func exchangeFold (accumulated,exchanger) = if ((accumulated == 0)) | |
10 | 10 | then { | |
11 | 11 | let exchangerAddress = addressFromStringValue(exchanger) | |
12 | - | let $ | |
13 | - | let pmtAmount = $ | |
14 | - | let pmtAssetId = $ | |
12 | + | let $t09801054 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
13 | + | let pmtAmount = $t09801054._1 | |
14 | + | let pmtAssetId = $t09801054._2 | |
15 | 15 | if ((assetsToPay[0] != pmtAssetId)) | |
16 | 16 | then throw("Incorrect payment and assetsToPay array") | |
17 | 17 | else { | |
36 | 36 | else accumulated | |
37 | 37 | ||
38 | 38 | let routing = { | |
39 | - | let $ | |
40 | - | let $ | |
41 | - | let $ | |
42 | - | if (($ | |
43 | - | then $ | |
39 | + | let $list18031839 = exchangers | |
40 | + | let $size18031839 = size($list18031839) | |
41 | + | let $acc018031839 = 0 | |
42 | + | if (($size18031839 == 0)) | |
43 | + | then $acc018031839 | |
44 | 44 | else { | |
45 | - | let $ | |
46 | - | if (($ | |
47 | - | then $ | |
45 | + | let $acc118031839 = exchangeFold($acc018031839, $list18031839[0]) | |
46 | + | if (($size18031839 == 1)) | |
47 | + | then $acc118031839 | |
48 | 48 | else { | |
49 | - | let $ | |
50 | - | if (($ | |
51 | - | then $ | |
49 | + | let $acc218031839 = exchangeFold($acc118031839, $list18031839[1]) | |
50 | + | if (($size18031839 == 2)) | |
51 | + | then $acc218031839 | |
52 | 52 | else { | |
53 | - | let $ | |
54 | - | if (($ | |
55 | - | then $ | |
53 | + | let $acc318031839 = exchangeFold($acc218031839, $list18031839[2]) | |
54 | + | if (($size18031839 == 3)) | |
55 | + | then $acc318031839 | |
56 | 56 | else { | |
57 | - | let $ | |
58 | - | if (($ | |
59 | - | then $ | |
57 | + | let $acc418031839 = exchangeFold($acc318031839, $list18031839[3]) | |
58 | + | if (($size18031839 == 4)) | |
59 | + | then $acc418031839 | |
60 | 60 | else { | |
61 | - | let $ | |
62 | - | if (($ | |
63 | - | then $ | |
61 | + | let $acc518031839 = exchangeFold($acc418031839, $list18031839[4]) | |
62 | + | if (($size18031839 == 5)) | |
63 | + | then $acc518031839 | |
64 | 64 | else { | |
65 | - | let $ | |
65 | + | let $acc618031839 = exchangeFold($acc518031839, $list18031839[5]) | |
66 | 66 | throw("List size exceed 5") | |
67 | 67 | } | |
68 | 68 | } |
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 | 9 | func exchangeFold (accumulated,exchanger) = if ((accumulated == 0)) | |
10 | 10 | then { | |
11 | 11 | let exchangerAddress = addressFromStringValue(exchanger) | |
12 | - | let $ | |
13 | - | let pmtAmount = $ | |
14 | - | let pmtAssetId = $ | |
12 | + | let $t09801054 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
13 | + | let pmtAmount = $t09801054._1 | |
14 | + | let pmtAssetId = $t09801054._2 | |
15 | 15 | if ((assetsToPay[0] != pmtAssetId)) | |
16 | 16 | then throw("Incorrect payment and assetsToPay array") | |
17 | 17 | else { | |
18 | 18 | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, pmtAmount)]) | |
19 | 19 | if ((inv == inv)) | |
20 | 20 | then (accumulated + 1) | |
21 | 21 | else throw("Strict value is not equal to itself.") | |
22 | 22 | } | |
23 | 23 | } | |
24 | 24 | else if (if ((accumulated > 0)) | |
25 | 25 | then (routingSize > accumulated) | |
26 | 26 | else false) | |
27 | 27 | then { | |
28 | 28 | let exchangerAddress = addressFromStringValue(exchanger) | |
29 | 29 | let pmtAssetId = assetsToPay[accumulated] | |
30 | 30 | let pmtAmount = assetBalance(this, pmtAssetId) | |
31 | 31 | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, pmtAmount)]) | |
32 | 32 | if ((inv == inv)) | |
33 | 33 | then (accumulated + 1) | |
34 | 34 | else throw("Strict value is not equal to itself.") | |
35 | 35 | } | |
36 | 36 | else accumulated | |
37 | 37 | ||
38 | 38 | let routing = { | |
39 | - | let $ | |
40 | - | let $ | |
41 | - | let $ | |
42 | - | if (($ | |
43 | - | then $ | |
39 | + | let $list18031839 = exchangers | |
40 | + | let $size18031839 = size($list18031839) | |
41 | + | let $acc018031839 = 0 | |
42 | + | if (($size18031839 == 0)) | |
43 | + | then $acc018031839 | |
44 | 44 | else { | |
45 | - | let $ | |
46 | - | if (($ | |
47 | - | then $ | |
45 | + | let $acc118031839 = exchangeFold($acc018031839, $list18031839[0]) | |
46 | + | if (($size18031839 == 1)) | |
47 | + | then $acc118031839 | |
48 | 48 | else { | |
49 | - | let $ | |
50 | - | if (($ | |
51 | - | then $ | |
49 | + | let $acc218031839 = exchangeFold($acc118031839, $list18031839[1]) | |
50 | + | if (($size18031839 == 2)) | |
51 | + | then $acc218031839 | |
52 | 52 | else { | |
53 | - | let $ | |
54 | - | if (($ | |
55 | - | then $ | |
53 | + | let $acc318031839 = exchangeFold($acc218031839, $list18031839[2]) | |
54 | + | if (($size18031839 == 3)) | |
55 | + | then $acc318031839 | |
56 | 56 | else { | |
57 | - | let $ | |
58 | - | if (($ | |
59 | - | then $ | |
57 | + | let $acc418031839 = exchangeFold($acc318031839, $list18031839[3]) | |
58 | + | if (($size18031839 == 4)) | |
59 | + | then $acc418031839 | |
60 | 60 | else { | |
61 | - | let $ | |
62 | - | if (($ | |
63 | - | then $ | |
61 | + | let $acc518031839 = exchangeFold($acc418031839, $list18031839[4]) | |
62 | + | if (($size18031839 == 5)) | |
63 | + | then $acc518031839 | |
64 | 64 | else { | |
65 | - | let $ | |
65 | + | let $acc618031839 = exchangeFold($acc518031839, $list18031839[5]) | |
66 | 66 | throw("List size exceed 5") | |
67 | 67 | } | |
68 | 68 | } | |
69 | 69 | } | |
70 | 70 | } | |
71 | 71 | } | |
72 | 72 | } | |
73 | 73 | } | |
74 | 74 | let amountToRecieve = assetBalance(this, assetToUserSend) | |
75 | 75 | if (if ((routing == routingSize)) | |
76 | 76 | then (amountToRecieve >= minAmountToReceive) | |
77 | 77 | else false) | |
78 | 78 | then [ScriptTransfer(i.caller, amountToRecieve, assetToUserSend)] | |
79 | 79 | else throw("routing != routingSize or amountToRecieve < minAmountToReceive") | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 |
github/deemru/w8io/026f985 36.12 ms ◑