tx · 7vd7uAYCni4sqmubcULm1FaF8rUdHedG693J7CQrEu1R 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL: -0.01000000 Waves 2021.08.18 11:54 [1663563] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves
{ "type": 13, "id": "7vd7uAYCni4sqmubcULm1FaF8rUdHedG693J7CQrEu1R", "fee": 1000000, "feeAssetId": null, "timestamp": 1629276915749, "version": 2, "chainId": 84, "sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL", "senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx", "proofs": [ "3XbqpXhxYWKLqb3Z9bZtPMETaU2V7wWpjh72RitDwz7R4BMAwkt3iiPPTToymvGFDAEFvnjJYfFzfkGirVVDTMNb" ], "script": "base64:AAIFAAAAAAAAAfwIAhIHCgUYERICARoHCgJhMRIBaRoQCgJhMhIKZXhjaGFuZ2VycxoKCgJhMxIEYXJncxoRCgJhNBILYXNzZXRzVG9QYXkaFQoCYTUSD2Fzc2V0VG9Vc2VyU2VuZBoYCgJhNhISbWluQW1vdW50VG9SZWNlaXZlGhEKAmE3Egtyb3V0aW5nU2l6ZRoSCgJhOBIMZXhjaGFuZ2VGb2xkGhEKAmE5EgthY2N1bXVsYXRlZBoPCgJiMRIJZXhjaGFuZ2VyGhYKAmIyEhBleGNoYW5nZXJBZGRyZXNzGhAKAmIzEgokdDA5MzIxMDA2Gg8KAmI0EglwbXRBbW91bnQaEAoCYjUSCnBtdEFzc2V0SWQaCQoCYjYSA2ludhoNCgJiNxIHcm91dGluZxoTCgJiOBINJGxpc3QxNzU1MTc5MRoTCgJiORINJHNpemUxNzU1MTc5MRoTCgJjMRINJGFjYzAxNzU1MTc5MRoTCgJjMhINJGFjYzExNzU1MTc5MRoTCgJjMxINJGFjYzIxNzU1MTc5MRoTCgJjNBINJGFjYzMxNzU1MTc5MRoTCgJjNRINJGFjY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AAAJjNwkBAAAAAmE4AAAAAgUAAAACYzYJAAGRAAAAAgUAAAACYjgAAAAAAAAAAAUJAAACAAAAAQIAAAASTGlzdCBzaXplIGV4Y2VlZCA1BAAAAAJjOAkAA/AAAAACBQAAAAR0aGlzBQAAAAJhNQMDCQAAAAAAAAIFAAAAAmI3BQAAAAJhNwkAAGcAAAACBQAAAAJjOAUAAAACYTYHCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAJhMQAAAAZjYWxsZXIFAAAAAmM4BQAAAAJhNQUAAAADbmlsCQAAAgAAAAECAAAAPnJvdXRpbmcgIT0gcm91dGluZ1NpemUgb3IgYW1vdW50VG9SZWNpZXZlIDwgbWluQW1vdW50VG9SZWNlaXZlAAAAAGazX1w=", "height": 1663563, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 56fSfBoxrmwNmy3ibacNyMP5KRwLQMVgPVKfcZw4ykur Next: 7PBgbC1b53QzfyYZWAt9xrKrmbfxW54qmCay3kqZKRER Diff:
Old | New | Differences | |
---|---|---|---|
71 | 71 | } | |
72 | 72 | } | |
73 | 73 | } | |
74 | - | | |
75 | - | | |
76 | - | | |
77 | - | ||
78 | - | | |
79 | - | else | |
74 | + | let z = assetBalance(this, e) | |
75 | + | if (if ((p == g)) | |
76 | + | then (z >= f) | |
77 | + | else false) | |
78 | + | then [ScriptTransfer(a.caller, z, e)] | |
79 | + | else throw("routing != routingSize or amountToRecieve < minAmountToReceive") | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 |
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(a) | |
7 | 7 | func routingTrade (b,c,d,e,f) = { | |
8 | 8 | let g = size(b) | |
9 | 9 | func h (i,j) = if ((i == 0)) | |
10 | 10 | then { | |
11 | 11 | let k = addressFromStringValue(j) | |
12 | 12 | let l = $Tuple2(a.payments[0].amount, a.payments[0].assetId) | |
13 | 13 | let m = l._1 | |
14 | 14 | let n = l._2 | |
15 | 15 | if ((d[0] != n)) | |
16 | 16 | then throw("Incorrect payment and assetsToPay array") | |
17 | 17 | else { | |
18 | 18 | let o = invoke(k, "exchange", [c[i]], [AttachedPayment(n, m)]) | |
19 | 19 | if ((o == o)) | |
20 | 20 | then (i + 1) | |
21 | 21 | else throw("Strict value is not equal to itself.") | |
22 | 22 | } | |
23 | 23 | } | |
24 | 24 | else if (if ((i > 0)) | |
25 | 25 | then (g > i) | |
26 | 26 | else false) | |
27 | 27 | then { | |
28 | 28 | let k = addressFromStringValue(j) | |
29 | 29 | let n = d[i] | |
30 | 30 | let m = assetBalance(this, n) | |
31 | 31 | let o = invoke(k, "exchange", [c[i]], [AttachedPayment(n, m)]) | |
32 | 32 | if ((o == o)) | |
33 | 33 | then (i + 1) | |
34 | 34 | else throw("Strict value is not equal to itself.") | |
35 | 35 | } | |
36 | 36 | else i | |
37 | 37 | ||
38 | 38 | let p = { | |
39 | 39 | let q = b | |
40 | 40 | let r = size(q) | |
41 | 41 | let s = 0 | |
42 | 42 | if ((r == 0)) | |
43 | 43 | then s | |
44 | 44 | else { | |
45 | 45 | let t = h(s, q[0]) | |
46 | 46 | if ((r == 1)) | |
47 | 47 | then t | |
48 | 48 | else { | |
49 | 49 | let u = h(t, q[1]) | |
50 | 50 | if ((r == 2)) | |
51 | 51 | then u | |
52 | 52 | else { | |
53 | 53 | let v = h(u, q[2]) | |
54 | 54 | if ((r == 3)) | |
55 | 55 | then v | |
56 | 56 | else { | |
57 | 57 | let w = h(v, q[3]) | |
58 | 58 | if ((r == 4)) | |
59 | 59 | then w | |
60 | 60 | else { | |
61 | 61 | let x = h(w, q[4]) | |
62 | 62 | if ((r == 5)) | |
63 | 63 | then x | |
64 | 64 | else { | |
65 | 65 | let y = h(x, q[5]) | |
66 | 66 | throw("List size exceed 5") | |
67 | 67 | } | |
68 | 68 | } | |
69 | 69 | } | |
70 | 70 | } | |
71 | 71 | } | |
72 | 72 | } | |
73 | 73 | } | |
74 | - | | |
75 | - | | |
76 | - | | |
77 | - | ||
78 | - | | |
79 | - | else | |
74 | + | let z = assetBalance(this, e) | |
75 | + | if (if ((p == g)) | |
76 | + | then (z >= f) | |
77 | + | else false) | |
78 | + | then [ScriptTransfer(a.caller, z, e)] | |
79 | + | else throw("routing != routingSize or amountToRecieve < minAmountToReceive") | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 |
github/deemru/w8io/026f985 30.57 ms ◑