tx · 9PBbhfajL5RmsDGZeAkpzCQKnexVLNy3wfDmeKtM7Gfm 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL: -0.01000000 Waves 2021.08.15 13:35 [1659357] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves
{ "type": 13, "id": "9PBbhfajL5RmsDGZeAkpzCQKnexVLNy3wfDmeKtM7Gfm", "fee": 1000000, "feeAssetId": null, "timestamp": 1629023735113, "version": 2, "chainId": 84, "sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL", "senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx", "proofs": [ "5MP9d9jgk9hYZTWQyjDT9uZUe3HEUkkN7LBUrWM3DkQKyQyus6MG5Y3MDPcYAg2pZPL4toNBpyqbYaTLnsEMkfEe" ], "script": "base64:AAIFAAAAAAAAAf0IAhIHCgUYERICARoHCgJhMRIBaRoQCgJhMhIKZXhjaGFuZ2VycxoKCgJhMxIEYXJncxoRCgJhNBILYXNzZXRzVG9QYXkaFQoCYTUSD2Fzc2V0VG9Vc2VyU2VuZBoYCgJhNhISbWluQW1vdW50VG9SZWNlaXZlGhEKAmE3Egtyb3V0aW5nU2l6ZRoSCgJhOBIMZXhjaGFuZ2VGb2xkGhEKAmE5EgthY2N1bXVsYXRlZBoPCgJiMRIJZXhjaGFuZ2VyGhYKAmIyEhBleGNoYW5nZXJBZGRyZXNzGhAKAmIzEgokdDA5NzMxMDQ3Gg8KAmI0EglwbXRBbW91bnQaEAoCYjUSCnBtdEFzc2V0SWQaCQoCYjYSA2ludhoNCgJiNxIHcm91dGluZxoTCgJiOBINJGxpc3QxNzk2MTgzMhoTCgJiORINJHNpemUxNzk2MTgzMhoTCgJjMRINJGFjYzAxNzk2MTgzMhoTCgJjMhINJGFjYzExNzk2MTgzMhoTCgJjMxINJGFjYzIxNzk2MTgzMhoTCgJjNBINJGFjYzMxNzk2MTgzM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AAAAAAEAwkAAAAAAAACBQAAAAJiOQAAAAAAAAAABQUAAAACYzYEAAAAAmM3CQEAAAACYTgAAAACBQAAAAJjNgkAAZEAAAACBQAAAAJiOAAAAAAAAAAABQkAAAIAAAABAgAAABJMaXN0IHNpemUgZXhjZWVkIDUDCQAAAAAAAAIFAAAAAmI3BQAAAAJhNwMGCQAAAgAAAAECAAAAATEEAAAAAmM4CQAD8AAAAAIFAAAABHRoaXMFAAAAAmE1CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAJhMQAAAAZjYWxsZXIFAAAAAmM4BQAAAAJhNQUAAAADbmlsBQAAAANuaWwAAAAAcNqzEA==", "height": 1659357, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AvuZwm1y1KSTjuX7DCuzXLk9B1a7RL6QBsyJwos9UjyA Next: G6N6qMWympRgLtpxzywXhkhHsSCcGWDGjGwAeeh8bxr3 Full:
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 if (true) | |
11 | 11 | then throw("1") | |
12 | 12 | else { | |
13 | 13 | let exchangerAddress = addressFromStringValue(exchanger) | |
14 | 14 | let $t09731047 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
15 | 15 | let pmtAmount = $t09731047._1 | |
16 | 16 | let pmtAssetId = $t09731047._2 | |
17 | 17 | if ((assetsToPay[0] != pmtAssetId)) | |
18 | 18 | then throw("Incorrect payment and assetsToPay array") | |
19 | 19 | else { | |
20 | 20 | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, pmtAmount)]) | |
21 | 21 | if ((inv == inv)) | |
22 | 22 | then (accumulated + 1) | |
23 | 23 | else throw("Strict value is not equal to itself.") | |
24 | 24 | } | |
25 | 25 | } | |
26 | 26 | else if (if ((accumulated > 0)) | |
27 | 27 | then (routingSize > accumulated) | |
28 | 28 | else false) | |
29 | 29 | then { | |
30 | 30 | let exchangerAddress = addressFromStringValue(exchanger) | |
31 | 31 | let pmtAssetId = assetsToPay[accumulated] | |
32 | 32 | let pmtAmount = assetBalance(this, pmtAssetId) | |
33 | 33 | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, pmtAmount)]) | |
34 | 34 | if ((inv == inv)) | |
35 | 35 | then (accumulated + 1) | |
36 | 36 | else throw("Strict value is not equal to itself.") | |
37 | 37 | } | |
38 | 38 | else accumulated | |
39 | 39 | ||
40 | 40 | let routing = { | |
41 | 41 | let $list17961832 = exchangers | |
42 | 42 | let $size17961832 = size($list17961832) | |
43 | 43 | let $acc017961832 = 0 | |
44 | 44 | if (($size17961832 == 0)) | |
45 | 45 | then $acc017961832 | |
46 | 46 | else { | |
47 | 47 | let $acc117961832 = exchangeFold($acc017961832, $list17961832[0]) | |
48 | 48 | if (($size17961832 == 1)) | |
49 | 49 | then $acc117961832 | |
50 | 50 | else { | |
51 | 51 | let $acc217961832 = exchangeFold($acc117961832, $list17961832[1]) | |
52 | 52 | if (($size17961832 == 2)) | |
53 | 53 | then $acc217961832 | |
54 | 54 | else { | |
55 | 55 | let $acc317961832 = exchangeFold($acc217961832, $list17961832[2]) | |
56 | 56 | if (($size17961832 == 3)) | |
57 | 57 | then $acc317961832 | |
58 | 58 | else { | |
59 | 59 | let $acc417961832 = exchangeFold($acc317961832, $list17961832[3]) | |
60 | 60 | if (($size17961832 == 4)) | |
61 | 61 | then $acc417961832 | |
62 | 62 | else { | |
63 | 63 | let $acc517961832 = exchangeFold($acc417961832, $list17961832[4]) | |
64 | 64 | if (($size17961832 == 5)) | |
65 | 65 | then $acc517961832 | |
66 | 66 | else { | |
67 | 67 | let $acc617961832 = exchangeFold($acc517961832, $list17961832[5]) | |
68 | 68 | throw("List size exceed 5") | |
69 | 69 | } | |
70 | 70 | } | |
71 | 71 | } | |
72 | 72 | } | |
73 | 73 | } | |
74 | 74 | } | |
75 | 75 | } | |
76 | 76 | if ((routing == routingSize)) | |
77 | 77 | then if (true) | |
78 | 78 | then throw("1") | |
79 | 79 | else { | |
80 | 80 | let ammountToRecieve = assetBalance(this, assetToUserSend) | |
81 | 81 | [ScriptTransfer(i.caller, ammountToRecieve, assetToUserSend)] | |
82 | 82 | } | |
83 | 83 | else nil | |
84 | 84 | } | |
85 | 85 | ||
86 | 86 |
github/deemru/w8io/026f985 23.54 ms ◑