tx · 5m2j4DtUzd7CnkYncT4jzLbPQsUuyawKEo4AHFNqH8Tp
3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL: -0.01000000 Waves
2021.08.08 17:55 [1649517] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves
{
"type": 13,
"id": "5m2j4DtUzd7CnkYncT4jzLbPQsUuyawKEo4AHFNqH8Tp",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1628434552491,
"version": 2,
"chainId": 84,
"sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL",
"senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx",
"proofs": [
"4x43N7Kjb2ZY2ZPpfqKveqbjeJcsmYuqeyhJstn8sptVkY6b8xgLkxCd19YiLDtNFyQnnSMYBkNBqZLHLRq2o98H"
],
"script": "base64:AAIFAAAAAAAAAb4IAhIGCgQYERIBGgcKAmExEgFpGhAKAmEyEgpleGNoYW5nZXJzGgoKAmEzEgRhcmdzGg4KAmE0Eghhc3NldFBheRoYCgJhNRISbWluQW1vdW50VG9SZWNlaXZlGg8KAmE2EgkkdDA2MjQ2OTkaDwoCYTcSCXBtdEFtb3VudBoQCgJhOBIKcG10QXNzZXRJZBoRCgJhORILcm91dGluZ1NpemUaEgoCYjESDGV4Y2hhbmdlRm9sZBoRCgJiMhILYWNjdW11bGF0ZWQaDwoCYjMSCWV4Y2hhbmdlchoNCgJiNBIHcm91dGluZxoTCgJiNRINJGxpc3QxMjQyMTI3OBoTCgJiNhINJHNpemUxMjQyMTI3OBoTCgJiNxINJGFjYzAxMjQyMTI3OBoTCgJiOBINJGFjYzExMjQyMTI3OBoTCgJiORINJGFjYzIxMjQyMTI3OBoTCgJjMRINJGFjYzMxMjQyMTI3OBoTCgJjMhINJGFjYzQxMjQyMTI3OBoTCgJjMxINJGFjYzUxMjQyMTI3OBoTCgJjNBINJGFjYzYxMjQyMTI3OBo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AAAAAAAAAEAwkAAAAAAAACBQAAAAJiNgAAAAAAAAAABQUAAAACYzMEAAAAAmM0CQEAAAACYjEAAAACBQAAAAJjMwkAAZEAAAACBQAAAAJiNQAAAAAAAAAABQkAAAIAAAABAgAAABJMaXN0IHNpemUgZXhjZWVkIDUDCQAAAAAAAAIFAAAAAmI0BQAAAAJhOQQAAAACYzUJAAPwAAAAAgUAAAAEdGhpcwkAAZEAAAACBQAAAAJhNAkAAGUAAAACBQAAAAJhOQAAAAAAAAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAACYTEAAAAGY2FsbGVyBQAAAAJjNQkAAZEAAAACBQAAAAJhNAkAAGUAAAACBQAAAAJhOQAAAAAAAAAAAQUAAAADbmlsBQAAAANuaWwAAAAAWcNAsg==",
"height": 1649517,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 9qfZffjHD5FhBymKMF7B1z4QBE3YqBPTD8G7G4goTiL9
Next: 5558uDCnSLXMA7tDemRi3hd1NMzyNzNxVRLV8N9ehtXi
Diff:
Old | New | | Differences |
---|
10 | 10 | | let pmtAssetId = $t0624699._2 |
---|
11 | 11 | | let routingSize = size(exchangers) |
---|
12 | 12 | | func exchangeFold (accumulated,exchanger) = if ((routingSize > accumulated)) |
---|
13 | | - | then { |
---|
14 | | - | let exchangerAddress = addressFromStringValue(exchanger) |
---|
15 | | - | let inv = invoke(exchangerAddress, "exchange", [1], [AttachedPayment(pmtAssetId, pmtAmount)]) |
---|
16 | | - | if ((inv == inv)) |
---|
17 | | - | then (accumulated + 1) |
---|
18 | | - | else throw("Strict value is not equal to itself.") |
---|
19 | | - | } |
---|
| 13 | + | then (accumulated + 1) |
---|
20 | 14 | | else accumulated |
---|
21 | 15 | | |
---|
22 | 16 | | let routing = { |
---|
23 | | - | let $list12221258 = exchangers |
---|
24 | | - | let $size12221258 = size($list12221258) |
---|
25 | | - | let $acc012221258 = 0 |
---|
26 | | - | if (($size12221258 == 0)) |
---|
27 | | - | then $acc012221258 |
---|
| 17 | + | let $list12421278 = exchangers |
---|
| 18 | + | let $size12421278 = size($list12421278) |
---|
| 19 | + | let $acc012421278 = 0 |
---|
| 20 | + | if (($size12421278 == 0)) |
---|
| 21 | + | then $acc012421278 |
---|
28 | 22 | | else { |
---|
29 | | - | let $acc112221258 = exchangeFold($acc012221258, $list12221258[0]) |
---|
30 | | - | if (($size12221258 == 1)) |
---|
31 | | - | then $acc112221258 |
---|
| 23 | + | let $acc112421278 = exchangeFold($acc012421278, $list12421278[0]) |
---|
| 24 | + | if (($size12421278 == 1)) |
---|
| 25 | + | then $acc112421278 |
---|
32 | 26 | | else { |
---|
33 | | - | let $acc212221258 = exchangeFold($acc112221258, $list12221258[1]) |
---|
34 | | - | if (($size12221258 == 2)) |
---|
35 | | - | then $acc212221258 |
---|
| 27 | + | let $acc212421278 = exchangeFold($acc112421278, $list12421278[1]) |
---|
| 28 | + | if (($size12421278 == 2)) |
---|
| 29 | + | then $acc212421278 |
---|
36 | 30 | | else { |
---|
37 | | - | let $acc312221258 = exchangeFold($acc212221258, $list12221258[2]) |
---|
38 | | - | if (($size12221258 == 3)) |
---|
39 | | - | then $acc312221258 |
---|
| 31 | + | let $acc312421278 = exchangeFold($acc212421278, $list12421278[2]) |
---|
| 32 | + | if (($size12421278 == 3)) |
---|
| 33 | + | then $acc312421278 |
---|
40 | 34 | | else { |
---|
41 | | - | let $acc412221258 = exchangeFold($acc312221258, $list12221258[3]) |
---|
42 | | - | if (($size12221258 == 4)) |
---|
43 | | - | then $acc412221258 |
---|
| 35 | + | let $acc412421278 = exchangeFold($acc312421278, $list12421278[3]) |
---|
| 36 | + | if (($size12421278 == 4)) |
---|
| 37 | + | then $acc412421278 |
---|
44 | 38 | | else { |
---|
45 | | - | let $acc512221258 = exchangeFold($acc412221258, $list12221258[4]) |
---|
46 | | - | if (($size12221258 == 5)) |
---|
47 | | - | then $acc512221258 |
---|
| 39 | + | let $acc512421278 = exchangeFold($acc412421278, $list12421278[4]) |
---|
| 40 | + | if (($size12421278 == 5)) |
---|
| 41 | + | then $acc512421278 |
---|
48 | 42 | | else { |
---|
49 | | - | let $acc612221258 = exchangeFold($acc512221258, $list12221258[5]) |
---|
| 43 | + | let $acc612421278 = exchangeFold($acc512421278, $list12421278[5]) |
---|
50 | 44 | | throw("List size exceed 5") |
---|
51 | 45 | | } |
---|
52 | 46 | | } |
---|
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 | | func exchangeFold (accumulated,exchanger) = if ((routingSize > accumulated)) |
---|
13 | | - | then { |
---|
14 | | - | let exchangerAddress = addressFromStringValue(exchanger) |
---|
15 | | - | let inv = invoke(exchangerAddress, "exchange", [1], [AttachedPayment(pmtAssetId, pmtAmount)]) |
---|
16 | | - | if ((inv == inv)) |
---|
17 | | - | then (accumulated + 1) |
---|
18 | | - | else throw("Strict value is not equal to itself.") |
---|
19 | | - | } |
---|
| 13 | + | then (accumulated + 1) |
---|
20 | 14 | | else accumulated |
---|
21 | 15 | | |
---|
22 | 16 | | let routing = { |
---|
23 | | - | let $list12221258 = exchangers |
---|
24 | | - | let $size12221258 = size($list12221258) |
---|
25 | | - | let $acc012221258 = 0 |
---|
26 | | - | if (($size12221258 == 0)) |
---|
27 | | - | then $acc012221258 |
---|
| 17 | + | let $list12421278 = exchangers |
---|
| 18 | + | let $size12421278 = size($list12421278) |
---|
| 19 | + | let $acc012421278 = 0 |
---|
| 20 | + | if (($size12421278 == 0)) |
---|
| 21 | + | then $acc012421278 |
---|
28 | 22 | | else { |
---|
29 | | - | let $acc112221258 = exchangeFold($acc012221258, $list12221258[0]) |
---|
30 | | - | if (($size12221258 == 1)) |
---|
31 | | - | then $acc112221258 |
---|
| 23 | + | let $acc112421278 = exchangeFold($acc012421278, $list12421278[0]) |
---|
| 24 | + | if (($size12421278 == 1)) |
---|
| 25 | + | then $acc112421278 |
---|
32 | 26 | | else { |
---|
33 | | - | let $acc212221258 = exchangeFold($acc112221258, $list12221258[1]) |
---|
34 | | - | if (($size12221258 == 2)) |
---|
35 | | - | then $acc212221258 |
---|
| 27 | + | let $acc212421278 = exchangeFold($acc112421278, $list12421278[1]) |
---|
| 28 | + | if (($size12421278 == 2)) |
---|
| 29 | + | then $acc212421278 |
---|
36 | 30 | | else { |
---|
37 | | - | let $acc312221258 = exchangeFold($acc212221258, $list12221258[2]) |
---|
38 | | - | if (($size12221258 == 3)) |
---|
39 | | - | then $acc312221258 |
---|
| 31 | + | let $acc312421278 = exchangeFold($acc212421278, $list12421278[2]) |
---|
| 32 | + | if (($size12421278 == 3)) |
---|
| 33 | + | then $acc312421278 |
---|
40 | 34 | | else { |
---|
41 | | - | let $acc412221258 = exchangeFold($acc312221258, $list12221258[3]) |
---|
42 | | - | if (($size12221258 == 4)) |
---|
43 | | - | then $acc412221258 |
---|
| 35 | + | let $acc412421278 = exchangeFold($acc312421278, $list12421278[3]) |
---|
| 36 | + | if (($size12421278 == 4)) |
---|
| 37 | + | then $acc412421278 |
---|
44 | 38 | | else { |
---|
45 | | - | let $acc512221258 = exchangeFold($acc412221258, $list12221258[4]) |
---|
46 | | - | if (($size12221258 == 5)) |
---|
47 | | - | then $acc512221258 |
---|
| 39 | + | let $acc512421278 = exchangeFold($acc412421278, $list12421278[4]) |
---|
| 40 | + | if (($size12421278 == 5)) |
---|
| 41 | + | then $acc512421278 |
---|
48 | 42 | | else { |
---|
49 | | - | let $acc612221258 = exchangeFold($acc512221258, $list12221258[5]) |
---|
| 43 | + | let $acc612421278 = exchangeFold($acc512421278, $list12421278[5]) |
---|
50 | 44 | | throw("List size exceed 5") |
---|
51 | 45 | | } |
---|
52 | 46 | | } |
---|
53 | 47 | | } |
---|
54 | 48 | | } |
---|
55 | 49 | | } |
---|
56 | 50 | | } |
---|
57 | 51 | | } |
---|
58 | 52 | | if ((routing == routingSize)) |
---|
59 | 53 | | then { |
---|
60 | 54 | | let ammountToRecieve = assetBalance(this, assetPay[(routingSize - 1)]) |
---|
61 | 55 | | [ScriptTransfer(i.caller, ammountToRecieve, assetPay[(routingSize - 1)])] |
---|
62 | 56 | | } |
---|
63 | 57 | | else nil |
---|
64 | 58 | | } |
---|
65 | 59 | | |
---|
66 | 60 | | |
---|