tx · HAVhLiHNz5Dw3jvHxJTuKxnhewxqwVyVjzijAx9oaQNa
3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL: -0.01000000 Waves
2021.08.08 18:27 [1649548] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves
{
"type": 13,
"id": "HAVhLiHNz5Dw3jvHxJTuKxnhewxqwVyVjzijAx9oaQNa",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1628436450110,
"version": 2,
"chainId": 84,
"sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL",
"senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx",
"proofs": [
"61G9ZQGPFwdFpxgPY3eeMYeKivzqpKGz4D26hsWHic6pWJeuyWqtuifeCw4x8yGemQpg28kaFyL9uqdhaRYy74yP"
],
"script": "base64:AAIFAAAAAAAAAeEIAhIGCgQYERIBGgcKAmExEgFpGhAKAmEyEgpleGNoYW5nZXJzGgoKAmEzEgRhcmdzGg4KAmE0Eghhc3NldFBheRoYCgJhNRISbWluQW1vdW50VG9SZWNlaXZlGg8KAmE2EgkkdDA2MjQ2OTkaDwoCYTcSCXBtdEFtb3VudBoQCgJhOBIKcG10QXNzZXRJZBoRCgJhORILcm91dGluZ1NpemUaEgoCYjESDGV4Y2hhbmdlRm9sZBoRCgJiMhILYWNjdW11bGF0ZWQaDwoCYjMSCWV4Y2hhbmdlchoWCgJiNBIQZXhjaGFuZ2VyQWRkcmVzcxoJCgJiNRIDaW52Gg0KAmI2Egdyb3V0aW5nGhMKAmI3Eg0kbGlzdDEyNTYxMjkyGhMKAmI4Eg0kc2l6ZTEyNTYxMjkyGhMKAmI5Eg0kYWNjMDEyNTYxMjkyGhMKAmMxEg0kYWNjMTEyNTYxMjkyGhMKAmMyEg0kYWNjMjEyNTYxMjkyGhMKAmMzEg0kYWNjMzEyNTYxMjkyGhMKAmM0Eg0kYWNjNDEyNTYx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YzIJAQAAAAJiMQAAAAIFAAAAAmMxCQABkQAAAAIFAAAAAmI3AAAAAAAAAAABAwkAAAAAAAACBQAAAAJiOAAAAAAAAAAAAgUAAAACYzIEAAAAAmMzCQEAAAACYjEAAAACBQAAAAJjMgkAAZEAAAACBQAAAAJiNwAAAAAAAAAAAgMJAAAAAAAAAgUAAAACYjgAAAAAAAAAAAMFAAAAAmMzBAAAAAJjNAkBAAAAAmIxAAAAAgUAAAACYzMJAAGRAAAAAgUAAAACYjcAAAAAAAAAAAMDCQAAAAAAAAIFAAAAAmI4AAAAAAAAAAAEBQAAAAJjNAQAAAACYzUJAQAAAAJiMQAAAAIFAAAAAmM0CQABkQAAAAIFAAAAAmI3AAAAAAAAAAAEAwkAAAAAAAACBQAAAAJiOAAAAAAAAAAABQUAAAACYzUEAAAAAmM2CQEAAAACYjEAAAACBQAAAAJjNQkAAZEAAAACBQAAAAJiNwAAAAAAAAAABQkAAAIAAAABAgAAABJMaXN0IHNpemUgZXhjZWVkIDUDCQAAAAAAAAIFAAAAAmI2BQAAAAJhOQQAAAACYzcJAAPwAAAAAgUAAAAEdGhpcwkAAZEAAAACBQAAAAJhNAkAAGUAAAACBQAAAAJhOQAAAAAAAAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAACYTEAAAAGY2FsbGVyBQAAAAJjNwkAAZEAAAACBQAAAAJhNAkAAGUAAAACBQAAAAJhOQAAAAAAAAAAAQUAAAADbmlsBQAAAANuaWwAAAAAWIEIIw==",
"height": 1649548,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 7Uu3Mxv2sBHuWMnNjR6ZKqnmXT8nyCmoXEmckk6YTeMC
Next: 4GDMStkpoG8EayGWsycCyVSvsFS1njJ6HS9zBQ4YzESs
Diff:
Old | New | | Differences |
---|
12 | 12 | | func exchangeFold (accumulated,exchanger) = if ((routingSize > accumulated)) |
---|
13 | 13 | | then { |
---|
14 | 14 | | let exchangerAddress = addressFromStringValue(exchanger) |
---|
15 | | - | if (true) |
---|
16 | | - | then throw(toString(exchangerAddress)) |
---|
17 | | - | else { |
---|
18 | | - | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, pmtAmount)]) |
---|
19 | | - | if ((inv == inv)) |
---|
20 | | - | then (accumulated + 1) |
---|
21 | | - | else throw("Strict value is not equal to itself.") |
---|
22 | | - | } |
---|
| 15 | + | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, pmtAmount)]) |
---|
| 16 | + | if ((inv == inv)) |
---|
| 17 | + | then (accumulated + 1) |
---|
| 18 | + | else throw("Strict value is not equal to itself.") |
---|
23 | 19 | | } |
---|
24 | 20 | | else accumulated |
---|
25 | 21 | | |
---|
26 | 22 | | let routing = { |
---|
27 | | - | let $list12541290 = exchangers |
---|
28 | | - | let $size12541290 = size($list12541290) |
---|
29 | | - | let $acc012541290 = 0 |
---|
30 | | - | if (($size12541290 == 0)) |
---|
31 | | - | then $acc012541290 |
---|
| 23 | + | let $list12561292 = exchangers |
---|
| 24 | + | let $size12561292 = size($list12561292) |
---|
| 25 | + | let $acc012561292 = 0 |
---|
| 26 | + | if (($size12561292 == 0)) |
---|
| 27 | + | then $acc012561292 |
---|
32 | 28 | | else { |
---|
33 | | - | let $acc112541290 = exchangeFold($acc012541290, $list12541290[0]) |
---|
34 | | - | if (($size12541290 == 1)) |
---|
35 | | - | then $acc112541290 |
---|
| 29 | + | let $acc112561292 = exchangeFold($acc012561292, $list12561292[0]) |
---|
| 30 | + | if (($size12561292 == 1)) |
---|
| 31 | + | then $acc112561292 |
---|
36 | 32 | | else { |
---|
37 | | - | let $acc212541290 = exchangeFold($acc112541290, $list12541290[1]) |
---|
38 | | - | if (($size12541290 == 2)) |
---|
39 | | - | then $acc212541290 |
---|
| 33 | + | let $acc212561292 = exchangeFold($acc112561292, $list12561292[1]) |
---|
| 34 | + | if (($size12561292 == 2)) |
---|
| 35 | + | then $acc212561292 |
---|
40 | 36 | | else { |
---|
41 | | - | let $acc312541290 = exchangeFold($acc212541290, $list12541290[2]) |
---|
42 | | - | if (($size12541290 == 3)) |
---|
43 | | - | then $acc312541290 |
---|
| 37 | + | let $acc312561292 = exchangeFold($acc212561292, $list12561292[2]) |
---|
| 38 | + | if (($size12561292 == 3)) |
---|
| 39 | + | then $acc312561292 |
---|
44 | 40 | | else { |
---|
45 | | - | let $acc412541290 = exchangeFold($acc312541290, $list12541290[3]) |
---|
46 | | - | if (($size12541290 == 4)) |
---|
47 | | - | then $acc412541290 |
---|
| 41 | + | let $acc412561292 = exchangeFold($acc312561292, $list12561292[3]) |
---|
| 42 | + | if (($size12561292 == 4)) |
---|
| 43 | + | then $acc412561292 |
---|
48 | 44 | | else { |
---|
49 | | - | let $acc512541290 = exchangeFold($acc412541290, $list12541290[4]) |
---|
50 | | - | if (($size12541290 == 5)) |
---|
51 | | - | then $acc512541290 |
---|
| 45 | + | let $acc512561292 = exchangeFold($acc412561292, $list12561292[4]) |
---|
| 46 | + | if (($size12561292 == 5)) |
---|
| 47 | + | then $acc512561292 |
---|
52 | 48 | | else { |
---|
53 | | - | let $acc612541290 = exchangeFold($acc512541290, $list12541290[5]) |
---|
| 49 | + | let $acc612561292 = exchangeFold($acc512561292, $list12561292[5]) |
---|
54 | 50 | | throw("List size exceed 5") |
---|
55 | 51 | | } |
---|
56 | 52 | | } |
---|
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 | 13 | | then { |
---|
14 | 14 | | let exchangerAddress = addressFromStringValue(exchanger) |
---|
15 | | - | if (true) |
---|
16 | | - | then throw(toString(exchangerAddress)) |
---|
17 | | - | else { |
---|
18 | | - | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, pmtAmount)]) |
---|
19 | | - | if ((inv == inv)) |
---|
20 | | - | then (accumulated + 1) |
---|
21 | | - | else throw("Strict value is not equal to itself.") |
---|
22 | | - | } |
---|
| 15 | + | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, pmtAmount)]) |
---|
| 16 | + | if ((inv == inv)) |
---|
| 17 | + | then (accumulated + 1) |
---|
| 18 | + | else throw("Strict value is not equal to itself.") |
---|
23 | 19 | | } |
---|
24 | 20 | | else accumulated |
---|
25 | 21 | | |
---|
26 | 22 | | let routing = { |
---|
27 | | - | let $list12541290 = exchangers |
---|
28 | | - | let $size12541290 = size($list12541290) |
---|
29 | | - | let $acc012541290 = 0 |
---|
30 | | - | if (($size12541290 == 0)) |
---|
31 | | - | then $acc012541290 |
---|
| 23 | + | let $list12561292 = exchangers |
---|
| 24 | + | let $size12561292 = size($list12561292) |
---|
| 25 | + | let $acc012561292 = 0 |
---|
| 26 | + | if (($size12561292 == 0)) |
---|
| 27 | + | then $acc012561292 |
---|
32 | 28 | | else { |
---|
33 | | - | let $acc112541290 = exchangeFold($acc012541290, $list12541290[0]) |
---|
34 | | - | if (($size12541290 == 1)) |
---|
35 | | - | then $acc112541290 |
---|
| 29 | + | let $acc112561292 = exchangeFold($acc012561292, $list12561292[0]) |
---|
| 30 | + | if (($size12561292 == 1)) |
---|
| 31 | + | then $acc112561292 |
---|
36 | 32 | | else { |
---|
37 | | - | let $acc212541290 = exchangeFold($acc112541290, $list12541290[1]) |
---|
38 | | - | if (($size12541290 == 2)) |
---|
39 | | - | then $acc212541290 |
---|
| 33 | + | let $acc212561292 = exchangeFold($acc112561292, $list12561292[1]) |
---|
| 34 | + | if (($size12561292 == 2)) |
---|
| 35 | + | then $acc212561292 |
---|
40 | 36 | | else { |
---|
41 | | - | let $acc312541290 = exchangeFold($acc212541290, $list12541290[2]) |
---|
42 | | - | if (($size12541290 == 3)) |
---|
43 | | - | then $acc312541290 |
---|
| 37 | + | let $acc312561292 = exchangeFold($acc212561292, $list12561292[2]) |
---|
| 38 | + | if (($size12561292 == 3)) |
---|
| 39 | + | then $acc312561292 |
---|
44 | 40 | | else { |
---|
45 | | - | let $acc412541290 = exchangeFold($acc312541290, $list12541290[3]) |
---|
46 | | - | if (($size12541290 == 4)) |
---|
47 | | - | then $acc412541290 |
---|
| 41 | + | let $acc412561292 = exchangeFold($acc312561292, $list12561292[3]) |
---|
| 42 | + | if (($size12561292 == 4)) |
---|
| 43 | + | then $acc412561292 |
---|
48 | 44 | | else { |
---|
49 | | - | let $acc512541290 = exchangeFold($acc412541290, $list12541290[4]) |
---|
50 | | - | if (($size12541290 == 5)) |
---|
51 | | - | then $acc512541290 |
---|
| 45 | + | let $acc512561292 = exchangeFold($acc412561292, $list12561292[4]) |
---|
| 46 | + | if (($size12561292 == 5)) |
---|
| 47 | + | then $acc512561292 |
---|
52 | 48 | | else { |
---|
53 | | - | let $acc612541290 = exchangeFold($acc512541290, $list12541290[5]) |
---|
| 49 | + | let $acc612561292 = exchangeFold($acc512561292, $list12561292[5]) |
---|
54 | 50 | | throw("List size exceed 5") |
---|
55 | 51 | | } |
---|
56 | 52 | | } |
---|
57 | 53 | | } |
---|
58 | 54 | | } |
---|
59 | 55 | | } |
---|
60 | 56 | | } |
---|
61 | 57 | | } |
---|
62 | 58 | | if ((routing == routingSize)) |
---|
63 | 59 | | then { |
---|
64 | 60 | | let ammountToRecieve = assetBalance(this, assetPay[(routingSize - 1)]) |
---|
65 | 61 | | [ScriptTransfer(i.caller, ammountToRecieve, assetPay[(routingSize - 1)])] |
---|
66 | 62 | | } |
---|
67 | 63 | | else nil |
---|
68 | 64 | | } |
---|
69 | 65 | | |
---|
70 | 66 | | |
---|