tx · 45CNgQ5pyFHg5RY2xRwFQCCfDx32otwFyqcKtoirfWKP
3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL: -0.01000000 Waves
2021.08.08 18:59 [1649581] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves
{
"type": 13,
"id": "45CNgQ5pyFHg5RY2xRwFQCCfDx32otwFyqcKtoirfWKP",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1628438402667,
"version": 2,
"chainId": 84,
"sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL",
"senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx",
"proofs": [
"4BF2FLDh68txN4craNb2jLyxyuPHH5VJ2fMfeNpJLKCB7tYUxjEcPVkEp7DpPpmMhFmhQqeMHPSSnkXJggHRsVXz"
],
"script": "base64:AAIFAAAAAAAAAeEIAhIGCgQYERIBGgcKAmExEgFpGhAKAmEyEgpleGNoYW5nZXJzGgoKAmEzEgRhcmdzGg4KAmE0Eghhc3NldFBheRoYCgJhNRISbWluQW1vdW50VG9SZWNlaXZlGg8KAmE2EgkkdDA2MjQ2OTkaDwoCYTcSCXBtdEFtb3VudBoQCgJhOBIKcG10QXNzZXRJZBoRCgJhORILcm91dGluZ1NpemUaEgoCYjESDGV4Y2hhbmdlRm9sZBoRCgJiMhILYWNjdW11bGF0ZWQaDwoCYjMSCWV4Y2hhbmdlchoWCgJiNBIQZXhjaGFuZ2VyQWRkcmVzcxoJCgJiNRIDaW52Gg0KAmI2Egdyb3V0aW5nGhMKAmI3Eg0kbGlzdDEyNDYxMjgyGhMKAmI4Eg0kc2l6ZTEyNDYxMjgyGhMKAmI5Eg0kYWNjMDEyNDYxMjgyGhMKAmMxEg0kYWNjMTEyNDYxMjgyGhMKAmMyEg0kYWNjMjEyNDYxMjgyGhMKAmMzEg0kYWNjMzEyNDYxMjgyGhMKAmM0Eg0kYWNjNDEyNDYx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AJjMgkBAAAAAmIxAAAAAgUAAAACYzEJAAGRAAAAAgUAAAACYjcAAAAAAAAAAAEDCQAAAAAAAAIFAAAAAmI4AAAAAAAAAAACBQAAAAJjMgQAAAACYzMJAQAAAAJiMQAAAAIFAAAAAmMyCQABkQAAAAIFAAAAAmI3AAAAAAAAAAACAwkAAAAAAAACBQAAAAJiOAAAAAAAAAAAAwUAAAACYzMEAAAAAmM0CQEAAAACYjEAAAACBQAAAAJjMwkAAZEAAAACBQAAAAJiNwAAAAAAAAAAAwMJAAAAAAAAAgUAAAACYjgAAAAAAAAAAAQFAAAAAmM0BAAAAAJjNQkBAAAAAmIxAAAAAgUAAAACYzQJAAGRAAAAAgUAAAACYjcAAAAAAAAAAAQDCQAAAAAAAAIFAAAAAmI4AAAAAAAAAAAFBQAAAAJjNQQAAAACYzYJAQAAAAJiMQAAAAIFAAAAAmM1CQABkQAAAAIFAAAAAmI3AAAAAAAAAAAFCQAAAgAAAAECAAAAEkxpc3Qgc2l6ZSBleGNlZWQgNQMJAAAAAAAAAgUAAAACYjYFAAAAAmE5BAAAAAJjNwkAA/AAAAACBQAAAAR0aGlzCQABkQAAAAIFAAAAAmE0CQAAZQAAAAIFAAAAAmE5AAAAAAAAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAJhMQAAAAZjYWxsZXIFAAAAAmM3CQABkQAAAAIFAAAAAmE0CQAAZQAAAAIFAAAAAmE5AAAAAAAAAAABBQAAAANuaWwFAAAAA25pbAAAAAAJIk5A",
"height": 1649581,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 8kKJUoAf8dmfUvFrpsRsZBx7spq5Ar4qagEkhb1KdneE
Next: 7J7K9EBfMs6XNaeLgQ4GKWzNwgKhxtGrYHemJ1Fojs8z
Diff:
Old | New | | Differences |
---|
12 | 12 | | func exchangeFold (accumulated,exchanger) = if ((routingSize > accumulated)) |
---|
13 | 13 | | then { |
---|
14 | 14 | | let exchangerAddress = addressFromStringValue(exchanger) |
---|
15 | | - | let a = match pmtAssetId { |
---|
16 | | - | case t: ByteVector => |
---|
17 | | - | value(fromBase58String(toBase58String(t))) |
---|
18 | | - | case u: Unit => |
---|
19 | | - | u |
---|
20 | | - | case _ => |
---|
21 | | - | throw("Match error") |
---|
22 | | - | } |
---|
23 | | - | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(a, 100000)]) |
---|
| 15 | + | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, 100000)]) |
---|
24 | 16 | | if ((inv == inv)) |
---|
25 | 17 | | then (accumulated + 1) |
---|
26 | 18 | | else throw("Strict value is not equal to itself.") |
---|
|
28 | 20 | | else accumulated |
---|
29 | 21 | | |
---|
30 | 22 | | let routing = { |
---|
31 | | - | let $list14121448 = exchangers |
---|
32 | | - | let $size14121448 = size($list14121448) |
---|
33 | | - | let $acc014121448 = 0 |
---|
34 | | - | if (($size14121448 == 0)) |
---|
35 | | - | then $acc014121448 |
---|
| 23 | + | let $list12461282 = exchangers |
---|
| 24 | + | let $size12461282 = size($list12461282) |
---|
| 25 | + | let $acc012461282 = 0 |
---|
| 26 | + | if (($size12461282 == 0)) |
---|
| 27 | + | then $acc012461282 |
---|
36 | 28 | | else { |
---|
37 | | - | let $acc114121448 = exchangeFold($acc014121448, $list14121448[0]) |
---|
38 | | - | if (($size14121448 == 1)) |
---|
39 | | - | then $acc114121448 |
---|
| 29 | + | let $acc112461282 = exchangeFold($acc012461282, $list12461282[0]) |
---|
| 30 | + | if (($size12461282 == 1)) |
---|
| 31 | + | then $acc112461282 |
---|
40 | 32 | | else { |
---|
41 | | - | let $acc214121448 = exchangeFold($acc114121448, $list14121448[1]) |
---|
42 | | - | if (($size14121448 == 2)) |
---|
43 | | - | then $acc214121448 |
---|
| 33 | + | let $acc212461282 = exchangeFold($acc112461282, $list12461282[1]) |
---|
| 34 | + | if (($size12461282 == 2)) |
---|
| 35 | + | then $acc212461282 |
---|
44 | 36 | | else { |
---|
45 | | - | let $acc314121448 = exchangeFold($acc214121448, $list14121448[2]) |
---|
46 | | - | if (($size14121448 == 3)) |
---|
47 | | - | then $acc314121448 |
---|
| 37 | + | let $acc312461282 = exchangeFold($acc212461282, $list12461282[2]) |
---|
| 38 | + | if (($size12461282 == 3)) |
---|
| 39 | + | then $acc312461282 |
---|
48 | 40 | | else { |
---|
49 | | - | let $acc414121448 = exchangeFold($acc314121448, $list14121448[3]) |
---|
50 | | - | if (($size14121448 == 4)) |
---|
51 | | - | then $acc414121448 |
---|
| 41 | + | let $acc412461282 = exchangeFold($acc312461282, $list12461282[3]) |
---|
| 42 | + | if (($size12461282 == 4)) |
---|
| 43 | + | then $acc412461282 |
---|
52 | 44 | | else { |
---|
53 | | - | let $acc514121448 = exchangeFold($acc414121448, $list14121448[4]) |
---|
54 | | - | if (($size14121448 == 5)) |
---|
55 | | - | then $acc514121448 |
---|
| 45 | + | let $acc512461282 = exchangeFold($acc412461282, $list12461282[4]) |
---|
| 46 | + | if (($size12461282 == 5)) |
---|
| 47 | + | then $acc512461282 |
---|
56 | 48 | | else { |
---|
57 | | - | let $acc614121448 = exchangeFold($acc514121448, $list14121448[5]) |
---|
| 49 | + | let $acc612461282 = exchangeFold($acc512461282, $list12461282[5]) |
---|
58 | 50 | | throw("List size exceed 5") |
---|
59 | 51 | | } |
---|
60 | 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 | | - | let a = match pmtAssetId { |
---|
16 | | - | case t: ByteVector => |
---|
17 | | - | value(fromBase58String(toBase58String(t))) |
---|
18 | | - | case u: Unit => |
---|
19 | | - | u |
---|
20 | | - | case _ => |
---|
21 | | - | throw("Match error") |
---|
22 | | - | } |
---|
23 | | - | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(a, 100000)]) |
---|
| 15 | + | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(pmtAssetId, 100000)]) |
---|
24 | 16 | | if ((inv == inv)) |
---|
25 | 17 | | then (accumulated + 1) |
---|
26 | 18 | | else throw("Strict value is not equal to itself.") |
---|
27 | 19 | | } |
---|
28 | 20 | | else accumulated |
---|
29 | 21 | | |
---|
30 | 22 | | let routing = { |
---|
31 | | - | let $list14121448 = exchangers |
---|
32 | | - | let $size14121448 = size($list14121448) |
---|
33 | | - | let $acc014121448 = 0 |
---|
34 | | - | if (($size14121448 == 0)) |
---|
35 | | - | then $acc014121448 |
---|
| 23 | + | let $list12461282 = exchangers |
---|
| 24 | + | let $size12461282 = size($list12461282) |
---|
| 25 | + | let $acc012461282 = 0 |
---|
| 26 | + | if (($size12461282 == 0)) |
---|
| 27 | + | then $acc012461282 |
---|
36 | 28 | | else { |
---|
37 | | - | let $acc114121448 = exchangeFold($acc014121448, $list14121448[0]) |
---|
38 | | - | if (($size14121448 == 1)) |
---|
39 | | - | then $acc114121448 |
---|
| 29 | + | let $acc112461282 = exchangeFold($acc012461282, $list12461282[0]) |
---|
| 30 | + | if (($size12461282 == 1)) |
---|
| 31 | + | then $acc112461282 |
---|
40 | 32 | | else { |
---|
41 | | - | let $acc214121448 = exchangeFold($acc114121448, $list14121448[1]) |
---|
42 | | - | if (($size14121448 == 2)) |
---|
43 | | - | then $acc214121448 |
---|
| 33 | + | let $acc212461282 = exchangeFold($acc112461282, $list12461282[1]) |
---|
| 34 | + | if (($size12461282 == 2)) |
---|
| 35 | + | then $acc212461282 |
---|
44 | 36 | | else { |
---|
45 | | - | let $acc314121448 = exchangeFold($acc214121448, $list14121448[2]) |
---|
46 | | - | if (($size14121448 == 3)) |
---|
47 | | - | then $acc314121448 |
---|
| 37 | + | let $acc312461282 = exchangeFold($acc212461282, $list12461282[2]) |
---|
| 38 | + | if (($size12461282 == 3)) |
---|
| 39 | + | then $acc312461282 |
---|
48 | 40 | | else { |
---|
49 | | - | let $acc414121448 = exchangeFold($acc314121448, $list14121448[3]) |
---|
50 | | - | if (($size14121448 == 4)) |
---|
51 | | - | then $acc414121448 |
---|
| 41 | + | let $acc412461282 = exchangeFold($acc312461282, $list12461282[3]) |
---|
| 42 | + | if (($size12461282 == 4)) |
---|
| 43 | + | then $acc412461282 |
---|
52 | 44 | | else { |
---|
53 | | - | let $acc514121448 = exchangeFold($acc414121448, $list14121448[4]) |
---|
54 | | - | if (($size14121448 == 5)) |
---|
55 | | - | then $acc514121448 |
---|
| 45 | + | let $acc512461282 = exchangeFold($acc412461282, $list12461282[4]) |
---|
| 46 | + | if (($size12461282 == 5)) |
---|
| 47 | + | then $acc512461282 |
---|
56 | 48 | | else { |
---|
57 | | - | let $acc614121448 = exchangeFold($acc514121448, $list14121448[5]) |
---|
| 49 | + | let $acc612461282 = exchangeFold($acc512461282, $list12461282[5]) |
---|
58 | 50 | | throw("List size exceed 5") |
---|
59 | 51 | | } |
---|
60 | 52 | | } |
---|
61 | 53 | | } |
---|
62 | 54 | | } |
---|
63 | 55 | | } |
---|
64 | 56 | | } |
---|
65 | 57 | | } |
---|
66 | 58 | | if ((routing == routingSize)) |
---|
67 | 59 | | then { |
---|
68 | 60 | | let ammountToRecieve = assetBalance(this, assetPay[(routingSize - 1)]) |
---|
69 | 61 | | [ScriptTransfer(i.caller, ammountToRecieve, assetPay[(routingSize - 1)])] |
---|
70 | 62 | | } |
---|
71 | 63 | | else nil |
---|
72 | 64 | | } |
---|
73 | 65 | | |
---|
74 | 66 | | |
---|