tx · GZpte7Lf3J7JELzS9cexNLeiR6jQLrti7GtArmS3y4yW
3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL: -0.01000000 Waves
2021.08.08 17:42 [1649502] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves
{
"type": 13,
"id": "GZpte7Lf3J7JELzS9cexNLeiR6jQLrti7GtArmS3y4yW",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1628433774873,
"version": 2,
"chainId": 84,
"sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL",
"senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx",
"proofs": [
"2dNJn17hgFy1qb2xRj6aHjJhduQWy2vCjkdHDWsmbfAvJ2RCqiXPM68xSjG4rAFM7fZurKBrpVbE64V1vPt8i6hG"
],
"script": "base64:AAIFAAAAAAAAAeEIAhIGCgQYERIBGgcKAmExEgFpGhAKAmEyEgpleGNoYW5nZXJzGgoKAmEzEgRhcmdzGg4KAmE0Eghhc3NldFBheRoYCgJhNRISbWluQW1vdW50VG9SZWNlaXZlGg8KAmE2EgkkdDA2MjQ2OTkaDwoCYTcSCXBtdEFtb3VudBoQCgJhOBIKcG10QXNzZXRJZBoRCgJhORILcm91dGluZ1NpemUaEgoCYjESDGV4Y2hhbmdlRm9sZBoRCgJiMhILYWNjdW11bGF0ZWQaDwoCYjMSCWV4Y2hhbmdlchoWCgJiNBIQZXhjaGFuZ2VyQWRkcmVzcxoJCgJiNRIDaW52Gg0KAmI2Egdyb3V0aW5nGhMKAmI3Eg0kbGlzdDEyMDExMjM3GhMKAmI4Eg0kc2l6ZTEyMDExMjM3GhMKAmI5Eg0kYWNjMDEyMDExMjM3GhMKAmMxEg0kYWNjMTEyMDExMjM3GhMKAmMyEg0kYWNjMjEyMDExMjM3GhMKAmMzEg0kYWNjMzEyMDExMjM3GhMKAmM0Eg0kYWNjNDEyMDExMjM3GhMKAm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ACYjcAAAAAAAAAAAADCQAAAAAAAAIFAAAAAmI4AAAAAAAAAAABBQAAAAJjMQQAAAACYzIJAQAAAAJiMQAAAAIFAAAAAmMxCQABkQAAAAIFAAAAAmI3AAAAAAAAAAABAwkAAAAAAAACBQAAAAJiOAAAAAAAAAAAAgUAAAACYzIEAAAAAmMzCQEAAAACYjEAAAACBQAAAAJjMgkAAZEAAAACBQAAAAJiNwAAAAAAAAAAAgMJAAAAAAAAAgUAAAACYjgAAAAAAAAAAAMFAAAAAmMzBAAAAAJjNAkBAAAAAmIxAAAAAgUAAAACYzMJAAGRAAAAAgUAAAACYjcAAAAAAAAAAAMDCQAAAAAAAAIFAAAAAmI4AAAAAAAAAAAEBQAAAAJjNAQAAAACYzUJAQAAAAJiMQAAAAIFAAAAAmM0CQABkQAAAAIFAAAAAmI3AAAAAAAAAAAEAwkAAAAAAAACBQAAAAJiOAAAAAAAAAAABQUAAAACYzUEAAAAAmM2CQEAAAACYjEAAAACBQAAAAJjNQkAAZEAAAACBQAAAAJiNwAAAAAAAAAABQkAAAIAAAABAgAAABJMaXN0IHNpemUgZXhjZWVkIDUDCQAAAAAAAAIFAAAAAmI2BQAAAAJhOQQAAAACYzcJAAPwAAAAAgUAAAAEdGhpcwkAAZEAAAACBQAAAAJhNAD//////////wkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAACYTEAAAAGY2FsbGVyBQAAAAJjNwkAAZEAAAACBQAAAAJhNAD//////////wUAAAADbmlsBQAAAANuaWwAAAAAbqGUXg==",
"height": 1649502,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 3GAwaJcqYE9AZNyssAeh9NaRkoLsSHAfuUqdepJ6YB6K
Next: DoAtrZSU4xbGizNegdmeYh1yGbnTrEkMukqJqKgsQnkb
Diff:
Old | New | | Differences |
---|
10 | 10 | | let pmtAssetId = $t0624699._2 |
---|
11 | 11 | | let routingSize = size(exchangers) |
---|
12 | 12 | | if (true) |
---|
13 | | - | then throw(toBase58String(assetPay[-1])) |
---|
| 13 | + | then throw(toBase58String(assetPay[(routingSize - 1)])) |
---|
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 $list11901226 = exchangers |
---|
27 | | - | let $size11901226 = size($list11901226) |
---|
28 | | - | let $acc011901226 = 0 |
---|
29 | | - | if (($size11901226 == 0)) |
---|
30 | | - | then $acc011901226 |
---|
| 26 | + | let $list12011237 = exchangers |
---|
| 27 | + | let $size12011237 = size($list12011237) |
---|
| 28 | + | let $acc012011237 = 0 |
---|
| 29 | + | if (($size12011237 == 0)) |
---|
| 30 | + | then $acc012011237 |
---|
31 | 31 | | else { |
---|
32 | | - | let $acc111901226 = exchangeFold($acc011901226, $list11901226[0]) |
---|
33 | | - | if (($size11901226 == 1)) |
---|
34 | | - | then $acc111901226 |
---|
| 32 | + | let $acc112011237 = exchangeFold($acc012011237, $list12011237[0]) |
---|
| 33 | + | if (($size12011237 == 1)) |
---|
| 34 | + | then $acc112011237 |
---|
35 | 35 | | else { |
---|
36 | | - | let $acc211901226 = exchangeFold($acc111901226, $list11901226[1]) |
---|
37 | | - | if (($size11901226 == 2)) |
---|
38 | | - | then $acc211901226 |
---|
| 36 | + | let $acc212011237 = exchangeFold($acc112011237, $list12011237[1]) |
---|
| 37 | + | if (($size12011237 == 2)) |
---|
| 38 | + | then $acc212011237 |
---|
39 | 39 | | else { |
---|
40 | | - | let $acc311901226 = exchangeFold($acc211901226, $list11901226[2]) |
---|
41 | | - | if (($size11901226 == 3)) |
---|
42 | | - | then $acc311901226 |
---|
| 40 | + | let $acc312011237 = exchangeFold($acc212011237, $list12011237[2]) |
---|
| 41 | + | if (($size12011237 == 3)) |
---|
| 42 | + | then $acc312011237 |
---|
43 | 43 | | else { |
---|
44 | | - | let $acc411901226 = exchangeFold($acc311901226, $list11901226[3]) |
---|
45 | | - | if (($size11901226 == 4)) |
---|
46 | | - | then $acc411901226 |
---|
| 44 | + | let $acc412011237 = exchangeFold($acc312011237, $list12011237[3]) |
---|
| 45 | + | if (($size12011237 == 4)) |
---|
| 46 | + | then $acc412011237 |
---|
47 | 47 | | else { |
---|
48 | | - | let $acc511901226 = exchangeFold($acc411901226, $list11901226[4]) |
---|
49 | | - | if (($size11901226 == 5)) |
---|
50 | | - | then $acc511901226 |
---|
| 48 | + | let $acc512011237 = exchangeFold($acc412011237, $list12011237[4]) |
---|
| 49 | + | if (($size12011237 == 5)) |
---|
| 50 | + | then $acc512011237 |
---|
51 | 51 | | else { |
---|
52 | | - | let $acc611901226 = exchangeFold($acc511901226, $list11901226[5]) |
---|
| 52 | + | let $acc612011237 = exchangeFold($acc512011237, $list12011237[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(toBase58String(assetPay[-1])) |
---|
| 13 | + | then throw(toBase58String(assetPay[(routingSize - 1)])) |
---|
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 $list11901226 = exchangers |
---|
27 | | - | let $size11901226 = size($list11901226) |
---|
28 | | - | let $acc011901226 = 0 |
---|
29 | | - | if (($size11901226 == 0)) |
---|
30 | | - | then $acc011901226 |
---|
| 26 | + | let $list12011237 = exchangers |
---|
| 27 | + | let $size12011237 = size($list12011237) |
---|
| 28 | + | let $acc012011237 = 0 |
---|
| 29 | + | if (($size12011237 == 0)) |
---|
| 30 | + | then $acc012011237 |
---|
31 | 31 | | else { |
---|
32 | | - | let $acc111901226 = exchangeFold($acc011901226, $list11901226[0]) |
---|
33 | | - | if (($size11901226 == 1)) |
---|
34 | | - | then $acc111901226 |
---|
| 32 | + | let $acc112011237 = exchangeFold($acc012011237, $list12011237[0]) |
---|
| 33 | + | if (($size12011237 == 1)) |
---|
| 34 | + | then $acc112011237 |
---|
35 | 35 | | else { |
---|
36 | | - | let $acc211901226 = exchangeFold($acc111901226, $list11901226[1]) |
---|
37 | | - | if (($size11901226 == 2)) |
---|
38 | | - | then $acc211901226 |
---|
| 36 | + | let $acc212011237 = exchangeFold($acc112011237, $list12011237[1]) |
---|
| 37 | + | if (($size12011237 == 2)) |
---|
| 38 | + | then $acc212011237 |
---|
39 | 39 | | else { |
---|
40 | | - | let $acc311901226 = exchangeFold($acc211901226, $list11901226[2]) |
---|
41 | | - | if (($size11901226 == 3)) |
---|
42 | | - | then $acc311901226 |
---|
| 40 | + | let $acc312011237 = exchangeFold($acc212011237, $list12011237[2]) |
---|
| 41 | + | if (($size12011237 == 3)) |
---|
| 42 | + | then $acc312011237 |
---|
43 | 43 | | else { |
---|
44 | | - | let $acc411901226 = exchangeFold($acc311901226, $list11901226[3]) |
---|
45 | | - | if (($size11901226 == 4)) |
---|
46 | | - | then $acc411901226 |
---|
| 44 | + | let $acc412011237 = exchangeFold($acc312011237, $list12011237[3]) |
---|
| 45 | + | if (($size12011237 == 4)) |
---|
| 46 | + | then $acc412011237 |
---|
47 | 47 | | else { |
---|
48 | | - | let $acc511901226 = exchangeFold($acc411901226, $list11901226[4]) |
---|
49 | | - | if (($size11901226 == 5)) |
---|
50 | | - | then $acc511901226 |
---|
| 48 | + | let $acc512011237 = exchangeFold($acc412011237, $list12011237[4]) |
---|
| 49 | + | if (($size12011237 == 5)) |
---|
| 50 | + | then $acc512011237 |
---|
51 | 51 | | else { |
---|
52 | | - | let $acc611901226 = exchangeFold($acc511901226, $list11901226[5]) |
---|
| 52 | + | let $acc612011237 = exchangeFold($acc512011237, $list12011237[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 | | |
---|