tx · B46PFEmiRqG5JyfYHtk1FYKyMWdMGteAsZTFdcGgXTL1
3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL: -0.01000000 Waves
2021.08.08 17:44 [1649505] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves
{
"type": 13,
"id": "B46PFEmiRqG5JyfYHtk1FYKyMWdMGteAsZTFdcGgXTL1",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1628433902937,
"version": 2,
"chainId": 84,
"sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL",
"senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx",
"proofs": [
"5yP9NGZK7n8WLxFtonRAFqwmrCtdpjMfLGMKDb75NyGBybg2krPLg6ky7S4giz4nWWjnzdrEpRvLMQ2nFuZXxCj5"
],
"script": "base64:AAIFAAAAAAAAAeEIAhIGCgQYERIBGgcKAmExEgFpGhAKAmEyEgpleGNoYW5nZXJzGgoKAmEzEgRhcmdzGg4KAmE0Eghhc3NldFBheRoYCgJhNRISbWluQW1vdW50VG9SZWNlaXZlGg8KAmE2EgkkdDA2MjQ2OTkaDwoCYTcSCXBtdEFtb3VudBoQCgJhOBIKcG10QXNzZXRJZBoRCgJhORILcm91dGluZ1NpemUaEgoCYjESDGV4Y2hhbmdlRm9sZBoRCgJiMhILYWNjdW11bGF0ZWQaDwoCYjMSCWV4Y2hhbmdlchoWCgJiNBIQZXhjaGFuZ2VyQWRkcmVzcxoJCgJiNRIDaW52Gg0KAmI2Egdyb3V0aW5nGhMKAmI3Eg0kbGlzdDExODYxMjIyGhMKAmI4Eg0kc2l6ZTExODYxMjIyGhMKAmI5Eg0kYWNjMDExODYxMjIyGhMKAmMxEg0kYWNjMTExODYxMjIyGhMKAmMyEg0kYWNjMjExODYxMjIyGhMKAmMzEg0kYWNjMzExODYxMjIyGhMKAmM0Eg0kYWNjNDExODYxMjIyGhMKAmM1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AwkAAAAAAAACBQAAAAJiOAAAAAAAAAAAAQUAAAACYzEEAAAAAmMyCQEAAAACYjEAAAACBQAAAAJjMQkAAZEAAAACBQAAAAJiNwAAAAAAAAAAAQMJAAAAAAAAAgUAAAACYjgAAAAAAAAAAAIFAAAAAmMyBAAAAAJjMwkBAAAAAmIxAAAAAgUAAAACYzIJAAGRAAAAAgUAAAACYjcAAAAAAAAAAAIDCQAAAAAAAAIFAAAAAmI4AAAAAAAAAAADBQAAAAJjMwQAAAACYzQJAQAAAAJiMQAAAAIFAAAAAmMzCQABkQAAAAIFAAAAAmI3AAAAAAAAAAADAwkAAAAAAAACBQAAAAJiOAAAAAAAAAAABAUAAAACYzQEAAAAAmM1CQEAAAACYjEAAAACBQAAAAJjNAkAAZEAAAACBQAAAAJiNwAAAAAAAAAABAMJAAAAAAAAAgUAAAACYjgAAAAAAAAAAAUFAAAAAmM1BAAAAAJjNgkBAAAAAmIxAAAAAgUAAAACYzUJAAGRAAAAAgUAAAACYjcAAAAAAAAAAAUJAAACAAAAAQIAAAASTGlzdCBzaXplIGV4Y2VlZCA1AwkAAAAAAAACBQAAAAJiNgUAAAACYTkEAAAAAmM3CQAD8AAAAAIFAAAABHRoaXMJAAGRAAAAAgUAAAACYTQA//////////8JAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAmExAAAABmNhbGxlcgUAAAACYzcJAAGRAAAAAgUAAAACYTQA//////////8FAAAAA25pbAUAAAADbmlsAAAAAAlsu3k=",
"height": 1649505,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: D5DKt4bpA8aSKJzBwRL4m9p2bgzGUnzaiJKwvx5oKjxn
Next: 3wMVk55Ay64Mz4Kq9mxwRASYdfbEcF9cnrLjYBeibKD5
Diff:
Old | New | | Differences |
---|
10 | 10 | | let pmtAssetId = $t0624699._2 |
---|
11 | 11 | | let routingSize = size(exchangers) |
---|
12 | 12 | | if (true) |
---|
13 | | - | then throw(exchangers[routingSize]) |
---|
| 13 | + | then throw(exchangers[(routingSize - 2)]) |
---|
14 | 14 | | else { |
---|
15 | 15 | | func exchangeFold (accumulated,exchanger) = if ((routingSize > accumulated)) |
---|
16 | 16 | | then { |
---|
|
23 | 23 | | else accumulated |
---|
24 | 24 | | |
---|
25 | 25 | | let routing = { |
---|
26 | | - | let $list11841220 = exchangers |
---|
27 | | - | let $size11841220 = size($list11841220) |
---|
28 | | - | let $acc011841220 = 0 |
---|
29 | | - | if (($size11841220 == 0)) |
---|
30 | | - | then $acc011841220 |
---|
| 26 | + | let $list11861222 = exchangers |
---|
| 27 | + | let $size11861222 = size($list11861222) |
---|
| 28 | + | let $acc011861222 = 0 |
---|
| 29 | + | if (($size11861222 == 0)) |
---|
| 30 | + | then $acc011861222 |
---|
31 | 31 | | else { |
---|
32 | | - | let $acc111841220 = exchangeFold($acc011841220, $list11841220[0]) |
---|
33 | | - | if (($size11841220 == 1)) |
---|
34 | | - | then $acc111841220 |
---|
| 32 | + | let $acc111861222 = exchangeFold($acc011861222, $list11861222[0]) |
---|
| 33 | + | if (($size11861222 == 1)) |
---|
| 34 | + | then $acc111861222 |
---|
35 | 35 | | else { |
---|
36 | | - | let $acc211841220 = exchangeFold($acc111841220, $list11841220[1]) |
---|
37 | | - | if (($size11841220 == 2)) |
---|
38 | | - | then $acc211841220 |
---|
| 36 | + | let $acc211861222 = exchangeFold($acc111861222, $list11861222[1]) |
---|
| 37 | + | if (($size11861222 == 2)) |
---|
| 38 | + | then $acc211861222 |
---|
39 | 39 | | else { |
---|
40 | | - | let $acc311841220 = exchangeFold($acc211841220, $list11841220[2]) |
---|
41 | | - | if (($size11841220 == 3)) |
---|
42 | | - | then $acc311841220 |
---|
| 40 | + | let $acc311861222 = exchangeFold($acc211861222, $list11861222[2]) |
---|
| 41 | + | if (($size11861222 == 3)) |
---|
| 42 | + | then $acc311861222 |
---|
43 | 43 | | else { |
---|
44 | | - | let $acc411841220 = exchangeFold($acc311841220, $list11841220[3]) |
---|
45 | | - | if (($size11841220 == 4)) |
---|
46 | | - | then $acc411841220 |
---|
| 44 | + | let $acc411861222 = exchangeFold($acc311861222, $list11861222[3]) |
---|
| 45 | + | if (($size11861222 == 4)) |
---|
| 46 | + | then $acc411861222 |
---|
47 | 47 | | else { |
---|
48 | | - | let $acc511841220 = exchangeFold($acc411841220, $list11841220[4]) |
---|
49 | | - | if (($size11841220 == 5)) |
---|
50 | | - | then $acc511841220 |
---|
| 48 | + | let $acc511861222 = exchangeFold($acc411861222, $list11861222[4]) |
---|
| 49 | + | if (($size11861222 == 5)) |
---|
| 50 | + | then $acc511861222 |
---|
51 | 51 | | else { |
---|
52 | | - | let $acc611841220 = exchangeFold($acc511841220, $list11841220[5]) |
---|
| 52 | + | let $acc611861222 = exchangeFold($acc511861222, $list11861222[5]) |
---|
53 | 53 | | throw("List size exceed 5") |
---|
54 | 54 | | } |
---|
55 | 55 | | } |
---|
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,assetPay,minAmountToReceive) = { |
---|
8 | 8 | | let $t0624699 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) |
---|
9 | 9 | | let pmtAmount = $t0624699._1 |
---|
10 | 10 | | let pmtAssetId = $t0624699._2 |
---|
11 | 11 | | let routingSize = size(exchangers) |
---|
12 | 12 | | if (true) |
---|
13 | | - | then throw(exchangers[routingSize]) |
---|
| 13 | + | then throw(exchangers[(routingSize - 2)]) |
---|
14 | 14 | | else { |
---|
15 | 15 | | func exchangeFold (accumulated,exchanger) = if ((routingSize > accumulated)) |
---|
16 | 16 | | then { |
---|
17 | 17 | | let exchangerAddress = addressFromStringValue(exchanger) |
---|
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 | | else accumulated |
---|
24 | 24 | | |
---|
25 | 25 | | let routing = { |
---|
26 | | - | let $list11841220 = exchangers |
---|
27 | | - | let $size11841220 = size($list11841220) |
---|
28 | | - | let $acc011841220 = 0 |
---|
29 | | - | if (($size11841220 == 0)) |
---|
30 | | - | then $acc011841220 |
---|
| 26 | + | let $list11861222 = exchangers |
---|
| 27 | + | let $size11861222 = size($list11861222) |
---|
| 28 | + | let $acc011861222 = 0 |
---|
| 29 | + | if (($size11861222 == 0)) |
---|
| 30 | + | then $acc011861222 |
---|
31 | 31 | | else { |
---|
32 | | - | let $acc111841220 = exchangeFold($acc011841220, $list11841220[0]) |
---|
33 | | - | if (($size11841220 == 1)) |
---|
34 | | - | then $acc111841220 |
---|
| 32 | + | let $acc111861222 = exchangeFold($acc011861222, $list11861222[0]) |
---|
| 33 | + | if (($size11861222 == 1)) |
---|
| 34 | + | then $acc111861222 |
---|
35 | 35 | | else { |
---|
36 | | - | let $acc211841220 = exchangeFold($acc111841220, $list11841220[1]) |
---|
37 | | - | if (($size11841220 == 2)) |
---|
38 | | - | then $acc211841220 |
---|
| 36 | + | let $acc211861222 = exchangeFold($acc111861222, $list11861222[1]) |
---|
| 37 | + | if (($size11861222 == 2)) |
---|
| 38 | + | then $acc211861222 |
---|
39 | 39 | | else { |
---|
40 | | - | let $acc311841220 = exchangeFold($acc211841220, $list11841220[2]) |
---|
41 | | - | if (($size11841220 == 3)) |
---|
42 | | - | then $acc311841220 |
---|
| 40 | + | let $acc311861222 = exchangeFold($acc211861222, $list11861222[2]) |
---|
| 41 | + | if (($size11861222 == 3)) |
---|
| 42 | + | then $acc311861222 |
---|
43 | 43 | | else { |
---|
44 | | - | let $acc411841220 = exchangeFold($acc311841220, $list11841220[3]) |
---|
45 | | - | if (($size11841220 == 4)) |
---|
46 | | - | then $acc411841220 |
---|
| 44 | + | let $acc411861222 = exchangeFold($acc311861222, $list11861222[3]) |
---|
| 45 | + | if (($size11861222 == 4)) |
---|
| 46 | + | then $acc411861222 |
---|
47 | 47 | | else { |
---|
48 | | - | let $acc511841220 = exchangeFold($acc411841220, $list11841220[4]) |
---|
49 | | - | if (($size11841220 == 5)) |
---|
50 | | - | then $acc511841220 |
---|
| 48 | + | let $acc511861222 = exchangeFold($acc411861222, $list11861222[4]) |
---|
| 49 | + | if (($size11861222 == 5)) |
---|
| 50 | + | then $acc511861222 |
---|
51 | 51 | | else { |
---|
52 | | - | let $acc611841220 = exchangeFold($acc511841220, $list11841220[5]) |
---|
| 52 | + | let $acc611861222 = exchangeFold($acc511861222, $list11861222[5]) |
---|
53 | 53 | | throw("List size exceed 5") |
---|
54 | 54 | | } |
---|
55 | 55 | | } |
---|
56 | 56 | | } |
---|
57 | 57 | | } |
---|
58 | 58 | | } |
---|
59 | 59 | | } |
---|
60 | 60 | | } |
---|
61 | 61 | | if ((routing == routingSize)) |
---|
62 | 62 | | then { |
---|
63 | 63 | | let ammountToRecieve = assetBalance(this, assetPay[-1]) |
---|
64 | 64 | | [ScriptTransfer(i.caller, ammountToRecieve, assetPay[-1])] |
---|
65 | 65 | | } |
---|
66 | 66 | | else nil |
---|
67 | 67 | | } |
---|
68 | 68 | | } |
---|
69 | 69 | | |
---|
70 | 70 | | |
---|