tx · 5pGjXFkyxGep1K38YdPhbKvjEhUDAdXR9fsdUUPwg2hz
3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL: -0.01000000 Waves
2021.08.08 18:47 [1649570] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves
{
"type": 13,
"id": "5pGjXFkyxGep1K38YdPhbKvjEhUDAdXR9fsdUUPwg2hz",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1628437645193,
"version": 2,
"chainId": 84,
"sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL",
"senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx",
"proofs": [
"2x9VzGnr2RrQqWyzcn8Zku2EH5jkywUThmKTyJAsqNkRr5aJYsYbtfJczqivtBt9WcjezJ1eFevuCvnUxQhfbAFh"
],
"script": "base64:AAIFAAAAAAAAAeEIAhIGCgQYERIBGgcKAmExEgFpGhAKAmEyEgpleGNoYW5nZXJzGgoKAmEzEgRhcmdzGg4KAmE0Eghhc3NldFBheRoYCgJhNRISbWluQW1vdW50VG9SZWNlaXZlGg8KAmE2EgkkdDA2MjQ2OTkaDwoCYTcSCXBtdEFtb3VudBoQCgJhOBIKcG10QXNzZXRJZBoRCgJhORILcm91dGluZ1NpemUaEgoCYjESDGV4Y2hhbmdlRm9sZBoRCgJiMhILYWNjdW11bGF0ZWQaDwoCYjMSCWV4Y2hhbmdlchoWCgJiNBIQZXhjaGFuZ2VyQWRkcmVzcxoJCgJiNRIDaW52Gg0KAmI2Egdyb3V0aW5nGhMKAmI3Eg0kbGlzdDEyNDcxMjgzGhMKAmI4Eg0kc2l6ZTEyNDcxMjgzGhMKAmI5Eg0kYWNjMDEyNDcxMjgzGhMKAmMxEg0kYWNjMTEyNDcxMjgzGhMKAmMyEg0kYWNjMjEyNDcxMjgzGhMKAmMzEg0kYWNjMzEyNDcxMjgzGhMKAmM0Eg0kYWNjNDEyNDc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AAAAAmMyCQEAAAACYjEAAAACBQAAAAJjMQkAAZEAAAACBQAAAAJiNwAAAAAAAAAAAQMJAAAAAAAAAgUAAAACYjgAAAAAAAAAAAIFAAAAAmMyBAAAAAJjMwkBAAAAAmIxAAAAAgUAAAACYzIJAAGRAAAAAgUAAAACYjcAAAAAAAAAAAIDCQAAAAAAAAIFAAAAAmI4AAAAAAAAAAADBQAAAAJjMwQAAAACYzQJAQAAAAJiMQAAAAIFAAAAAmMzCQABkQAAAAIFAAAAAmI3AAAAAAAAAAADAwkAAAAAAAACBQAAAAJiOAAAAAAAAAAABAUAAAACYzQEAAAAAmM1CQEAAAACYjEAAAACBQAAAAJjNAkAAZEAAAACBQAAAAJiNwAAAAAAAAAABAMJAAAAAAAAAgUAAAACYjgAAAAAAAAAAAUFAAAAAmM1BAAAAAJjNgkBAAAAAmIxAAAAAgUAAAACYzUJAAGRAAAAAgUAAAACYjcAAAAAAAAAAAUJAAACAAAAAQIAAAASTGlzdCBzaXplIGV4Y2VlZCA1AwkAAAAAAAACBQAAAAJiNgUAAAACYTkEAAAAAmM3CQAD8AAAAAIFAAAABHRoaXMJAAGRAAAAAgUAAAACYTQJAABlAAAAAgUAAAACYTkAAAAAAAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAmExAAAABmNhbGxlcgUAAAACYzcJAAGRAAAAAgUAAAACYTQJAABlAAAAAgUAAAACYTkAAAAAAAAAAAEFAAAAA25pbAUAAAADbmlsAAAAAF4srVg=",
"height": 1649570,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 2LrwAquKhX25BAf2g2GnxJ4V62K3dYta23wQrD8BBM1m
Next: 9HbGXYy6qCuQohGBSwGiCJnLMwTkEp1trcLNwoTWcsnz
Diff:
Old | New | | Differences |
---|
12 | 12 | | func exchangeFold (accumulated,exchanger) = if ((routingSize > accumulated)) |
---|
13 | 13 | | then { |
---|
14 | 14 | | let exchangerAddress = addressFromStringValue(exchanger) |
---|
15 | | - | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(base58'Zq2voms8GifXDmRFEboVJPZatB25KWkCdPQchwVu1nk', 100000)]) |
---|
| 15 | + | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(unit, 100000)]) |
---|
16 | 16 | | if ((inv == inv)) |
---|
17 | 17 | | then (accumulated + 1) |
---|
18 | 18 | | else throw("Strict value is not equal to itself.") |
---|
|
20 | 20 | | else accumulated |
---|
21 | 21 | | |
---|
22 | 22 | | let routing = { |
---|
23 | | - | let $list12951331 = exchangers |
---|
24 | | - | let $size12951331 = size($list12951331) |
---|
25 | | - | let $acc012951331 = 0 |
---|
26 | | - | if (($size12951331 == 0)) |
---|
27 | | - | then $acc012951331 |
---|
| 23 | + | let $list12471283 = exchangers |
---|
| 24 | + | let $size12471283 = size($list12471283) |
---|
| 25 | + | let $acc012471283 = 0 |
---|
| 26 | + | if (($size12471283 == 0)) |
---|
| 27 | + | then $acc012471283 |
---|
28 | 28 | | else { |
---|
29 | | - | let $acc112951331 = exchangeFold($acc012951331, $list12951331[0]) |
---|
30 | | - | if (($size12951331 == 1)) |
---|
31 | | - | then $acc112951331 |
---|
| 29 | + | let $acc112471283 = exchangeFold($acc012471283, $list12471283[0]) |
---|
| 30 | + | if (($size12471283 == 1)) |
---|
| 31 | + | then $acc112471283 |
---|
32 | 32 | | else { |
---|
33 | | - | let $acc212951331 = exchangeFold($acc112951331, $list12951331[1]) |
---|
34 | | - | if (($size12951331 == 2)) |
---|
35 | | - | then $acc212951331 |
---|
| 33 | + | let $acc212471283 = exchangeFold($acc112471283, $list12471283[1]) |
---|
| 34 | + | if (($size12471283 == 2)) |
---|
| 35 | + | then $acc212471283 |
---|
36 | 36 | | else { |
---|
37 | | - | let $acc312951331 = exchangeFold($acc212951331, $list12951331[2]) |
---|
38 | | - | if (($size12951331 == 3)) |
---|
39 | | - | then $acc312951331 |
---|
| 37 | + | let $acc312471283 = exchangeFold($acc212471283, $list12471283[2]) |
---|
| 38 | + | if (($size12471283 == 3)) |
---|
| 39 | + | then $acc312471283 |
---|
40 | 40 | | else { |
---|
41 | | - | let $acc412951331 = exchangeFold($acc312951331, $list12951331[3]) |
---|
42 | | - | if (($size12951331 == 4)) |
---|
43 | | - | then $acc412951331 |
---|
| 41 | + | let $acc412471283 = exchangeFold($acc312471283, $list12471283[3]) |
---|
| 42 | + | if (($size12471283 == 4)) |
---|
| 43 | + | then $acc412471283 |
---|
44 | 44 | | else { |
---|
45 | | - | let $acc512951331 = exchangeFold($acc412951331, $list12951331[4]) |
---|
46 | | - | if (($size12951331 == 5)) |
---|
47 | | - | then $acc512951331 |
---|
| 45 | + | let $acc512471283 = exchangeFold($acc412471283, $list12471283[4]) |
---|
| 46 | + | if (($size12471283 == 5)) |
---|
| 47 | + | then $acc512471283 |
---|
48 | 48 | | else { |
---|
49 | | - | let $acc612951331 = exchangeFold($acc512951331, $list12951331[5]) |
---|
| 49 | + | let $acc612471283 = exchangeFold($acc512471283, $list12471283[5]) |
---|
50 | 50 | | throw("List size exceed 5") |
---|
51 | 51 | | } |
---|
52 | 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 inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(base58'Zq2voms8GifXDmRFEboVJPZatB25KWkCdPQchwVu1nk', 100000)]) |
---|
| 15 | + | let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(unit, 100000)]) |
---|
16 | 16 | | if ((inv == inv)) |
---|
17 | 17 | | then (accumulated + 1) |
---|
18 | 18 | | else throw("Strict value is not equal to itself.") |
---|
19 | 19 | | } |
---|
20 | 20 | | else accumulated |
---|
21 | 21 | | |
---|
22 | 22 | | let routing = { |
---|
23 | | - | let $list12951331 = exchangers |
---|
24 | | - | let $size12951331 = size($list12951331) |
---|
25 | | - | let $acc012951331 = 0 |
---|
26 | | - | if (($size12951331 == 0)) |
---|
27 | | - | then $acc012951331 |
---|
| 23 | + | let $list12471283 = exchangers |
---|
| 24 | + | let $size12471283 = size($list12471283) |
---|
| 25 | + | let $acc012471283 = 0 |
---|
| 26 | + | if (($size12471283 == 0)) |
---|
| 27 | + | then $acc012471283 |
---|
28 | 28 | | else { |
---|
29 | | - | let $acc112951331 = exchangeFold($acc012951331, $list12951331[0]) |
---|
30 | | - | if (($size12951331 == 1)) |
---|
31 | | - | then $acc112951331 |
---|
| 29 | + | let $acc112471283 = exchangeFold($acc012471283, $list12471283[0]) |
---|
| 30 | + | if (($size12471283 == 1)) |
---|
| 31 | + | then $acc112471283 |
---|
32 | 32 | | else { |
---|
33 | | - | let $acc212951331 = exchangeFold($acc112951331, $list12951331[1]) |
---|
34 | | - | if (($size12951331 == 2)) |
---|
35 | | - | then $acc212951331 |
---|
| 33 | + | let $acc212471283 = exchangeFold($acc112471283, $list12471283[1]) |
---|
| 34 | + | if (($size12471283 == 2)) |
---|
| 35 | + | then $acc212471283 |
---|
36 | 36 | | else { |
---|
37 | | - | let $acc312951331 = exchangeFold($acc212951331, $list12951331[2]) |
---|
38 | | - | if (($size12951331 == 3)) |
---|
39 | | - | then $acc312951331 |
---|
| 37 | + | let $acc312471283 = exchangeFold($acc212471283, $list12471283[2]) |
---|
| 38 | + | if (($size12471283 == 3)) |
---|
| 39 | + | then $acc312471283 |
---|
40 | 40 | | else { |
---|
41 | | - | let $acc412951331 = exchangeFold($acc312951331, $list12951331[3]) |
---|
42 | | - | if (($size12951331 == 4)) |
---|
43 | | - | then $acc412951331 |
---|
| 41 | + | let $acc412471283 = exchangeFold($acc312471283, $list12471283[3]) |
---|
| 42 | + | if (($size12471283 == 4)) |
---|
| 43 | + | then $acc412471283 |
---|
44 | 44 | | else { |
---|
45 | | - | let $acc512951331 = exchangeFold($acc412951331, $list12951331[4]) |
---|
46 | | - | if (($size12951331 == 5)) |
---|
47 | | - | then $acc512951331 |
---|
| 45 | + | let $acc512471283 = exchangeFold($acc412471283, $list12471283[4]) |
---|
| 46 | + | if (($size12471283 == 5)) |
---|
| 47 | + | then $acc512471283 |
---|
48 | 48 | | else { |
---|
49 | | - | let $acc612951331 = exchangeFold($acc512951331, $list12951331[5]) |
---|
| 49 | + | let $acc612471283 = exchangeFold($acc512471283, $list12471283[5]) |
---|
50 | 50 | | throw("List size exceed 5") |
---|
51 | 51 | | } |
---|
52 | 52 | | } |
---|
53 | 53 | | } |
---|
54 | 54 | | } |
---|
55 | 55 | | } |
---|
56 | 56 | | } |
---|
57 | 57 | | } |
---|
58 | 58 | | if ((routing == routingSize)) |
---|
59 | 59 | | then { |
---|
60 | 60 | | let ammountToRecieve = assetBalance(this, assetPay[(routingSize - 1)]) |
---|
61 | 61 | | [ScriptTransfer(i.caller, ammountToRecieve, assetPay[(routingSize - 1)])] |
---|
62 | 62 | | } |
---|
63 | 63 | | else nil |
---|
64 | 64 | | } |
---|
65 | 65 | | |
---|
66 | 66 | | |
---|