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