tx · FY5V8rz5rLaMr94r5G68yKVrdwpwiE5sYjHMP9c1Jf6W 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL: -0.01000000 Waves 2021.09.09 23:56 [1696020] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves
{ "type": 13, "id": "FY5V8rz5rLaMr94r5G68yKVrdwpwiE5sYjHMP9c1Jf6W", "fee": 1000000, "feeAssetId": null, "timestamp": 1631220990606, "version": 2, "chainId": 84, "sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL", "senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx", "proofs": [ "WVRh5hdzV9joAsV132Zy2uVNN4kRi8BruYtvrckFcvcrpqrJC67xoyABWgGJLYesUTn8PnoRo3CDitkovTcjwpH" ], "script": "base64:AAIFAAAAAAAAA+EIAhIICgYYGBEYAgEaFQoCYTESD2NoZWNrUG9zc2liaWx0eRoPCgJhMhIJcG10QW1vdW50GhgKAmEzEhJtaW5BbW91bnRUb1JlY2VpdmUaEAoCYTQSCmV4Y2hhbmdlcnMaFAoCYTUSDmV4Y2hhbmdlcnNUeXBlGhcKAmE2EhFyb3V0aW5nQXNzZXRzS2V5cxoQCgJhNxIKY29tbWlzc2lvbhoeCgJhOBIYY29tbWlzc2lvblNjYWxlRGVsaW1pdGVyGhMKAmE5Eg1kQXBwMVRva2VuUGF5GhMKAmIxEg1kQXBwMVRva2VuR2V0GhMKAmIyEg1kQXBwMlRva2VuUGF5GhMKAmIzEg1kQXBwMlRva2VuR2V0GhMKAmI0Eg1nZXRGcm9tMVRyYWRlGhoKAmI1EhRnZXRGcm9tMVRyYWRlV2l0aEZlZRoTCgJiNhINZ2V0RnJvbTJUcmFkZRoaCgJiNxIUZ2V0RnJvbTJUcmFkZVdpdGhGZWUaBwoCYjgSAWkaCgoCYjkSBGFyZ3MaFAoCYzESDnJlY2VpdmVBc3NldElkGhEKAmM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ABkQAAAAIFAAAAAmU1AAAAAAAAAAACAwkAAAAAAAACBQAAAAJlNgAAAAAAAAAAAwUAAAACZjEEAAAAAmYyCQEAAAACYzUAAAACBQAAAAJmMQkAAZEAAAACBQAAAAJlNQAAAAAAAAAAAwkAAAIAAAABAgAAABJMaXN0IHNpemUgZXhjZWVkIDMEAAAAAmM5CAUAAAACZTQAAAACXzEEAAAAAmQxCAUAAAACZTQAAAACXzIEAAAAAmQyCAUAAAACZTQAAAACXzMEAAAAAmYzCQAD8AAAAAIFAAAABHRoaXMFAAAAAmMxAwMJAAAAAAAAAgUAAAACYzkFAAAAAmM0CQAAZwAAAAIFAAAAAmYzBQAAAAJhMwcJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAmI4AAAABmNhbGxlcgUAAAACZjMFAAAAAmMxBQAAAANuaWwJAAACAAAAAQIAAAA+cm91dGluZyAhPSByb3V0aW5nU2l6ZSBvciBhbW91bnRUb1JlY2lldmUgPCBtaW5BbW91bnRUb1JlY2VpdmUAAAAAO/ywIQ==", "height": 1696020, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8vLJDmwemBYi1bSduvX2PWf37yBFJShX9PyPb3tSvbar Next: CdZYon4JJbf1r9uhhso9PRSwSiUCNPGZ4aFQtib4u91i Diff:
Old | New | Differences | |
---|---|---|---|
12 | 12 | let n = fraction(m, (h - g), h) | |
13 | 13 | let o = fraction(l, n, (n + k)) | |
14 | 14 | let p = fraction(o, (h - g), h) | |
15 | - | if (true) | |
16 | - | then throw(toString(n)) | |
17 | - | else if ((p >= c)) | |
18 | - | then true | |
19 | - | else false | |
15 | + | if ((p >= c)) | |
16 | + | then true | |
17 | + | else false | |
20 | 18 | } | |
21 | 19 | ||
22 | 20 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a (b,c,d,e,f) = { | |
5 | 5 | let g = 3000 | |
6 | 6 | let h = 1000000 | |
7 | 7 | let i = getIntegerValue(addressFromStringValue(d[0]), f[0]) | |
8 | 8 | let j = getIntegerValue(addressFromStringValue(d[0]), f[1]) | |
9 | 9 | let k = getIntegerValue(addressFromStringValue(d[1]), f[2]) | |
10 | 10 | let l = getIntegerValue(addressFromStringValue(d[1]), f[3]) | |
11 | 11 | let m = fraction(j, b, (b + i)) | |
12 | 12 | let n = fraction(m, (h - g), h) | |
13 | 13 | let o = fraction(l, n, (n + k)) | |
14 | 14 | let p = fraction(o, (h - g), h) | |
15 | - | if (true) | |
16 | - | then throw(toString(n)) | |
17 | - | else if ((p >= c)) | |
18 | - | then true | |
19 | - | else false | |
15 | + | if ((p >= c)) | |
16 | + | then true | |
17 | + | else false | |
20 | 18 | } | |
21 | 19 | ||
22 | 20 | ||
23 | 21 | @Callable(q) | |
24 | 22 | func routingTrade (d,e,r,f,s,c) = { | |
25 | 23 | let t = $Tuple2(q.payments[0].amount, q.payments[0].assetId) | |
26 | 24 | let b = t._1 | |
27 | 25 | let u = t._2 | |
28 | 26 | if (!(a(b, c, d, e, f))) | |
29 | 27 | then throw("Check transaction possibilty: declined") | |
30 | 28 | else { | |
31 | 29 | let v = size(d) | |
32 | 30 | func w (x,y) = { | |
33 | 31 | let z = x | |
34 | 32 | let A = z._1 | |
35 | 33 | let B = z._2 | |
36 | 34 | let C = z._3 | |
37 | 35 | if ((A == 0)) | |
38 | 36 | then { | |
39 | 37 | let D = addressFromStringValue(y) | |
40 | 38 | let E = invoke(D, "exchange", [r[A]], [AttachedPayment(u, b)]) | |
41 | 39 | if ((E == E)) | |
42 | 40 | then { | |
43 | 41 | let F = E | |
44 | 42 | if ($isInstanceOf(F, "(Int, ByteVector)")) | |
45 | 43 | then { | |
46 | 44 | let E = F | |
47 | 45 | let G = E | |
48 | 46 | let H = G._1 | |
49 | 47 | let I = G._2 | |
50 | 48 | $Tuple3((A + 1), H, I) | |
51 | 49 | } | |
52 | 50 | else throw("Incorrect invoke result: expected amountWithFee and assetsIdSend") | |
53 | 51 | } | |
54 | 52 | else throw("Strict value is not equal to itself.") | |
55 | 53 | } | |
56 | 54 | else if (if ((A > 0)) | |
57 | 55 | then (v > A) | |
58 | 56 | else false) | |
59 | 57 | then { | |
60 | 58 | let D = addressFromStringValue(y) | |
61 | 59 | let J = $Tuple2(C, B) | |
62 | 60 | let K = J._1 | |
63 | 61 | let L = J._2 | |
64 | 62 | let E = invoke(D, "exchange", [r[A]], [AttachedPayment(K, L)]) | |
65 | 63 | if ((E == E)) | |
66 | 64 | then { | |
67 | 65 | let F = E | |
68 | 66 | if ($isInstanceOf(F, "(Int, ByteVector)")) | |
69 | 67 | then { | |
70 | 68 | let E = F | |
71 | 69 | let M = E | |
72 | 70 | let H = M._1 | |
73 | 71 | let I = M._2 | |
74 | 72 | $Tuple3((A + 1), H, I) | |
75 | 73 | } | |
76 | 74 | else throw("Incorrect invoke result: expected amountWithFee and assetsIdSend") | |
77 | 75 | } | |
78 | 76 | else throw("Strict value is not equal to itself.") | |
79 | 77 | } | |
80 | 78 | else x | |
81 | 79 | } | |
82 | 80 | ||
83 | 81 | let N = { | |
84 | 82 | let O = d | |
85 | 83 | let P = size(O) | |
86 | 84 | let Q = $Tuple3(0, 0, base58'') | |
87 | 85 | if ((P == 0)) | |
88 | 86 | then Q | |
89 | 87 | else { | |
90 | 88 | let R = w(Q, O[0]) | |
91 | 89 | if ((P == 1)) | |
92 | 90 | then R | |
93 | 91 | else { | |
94 | 92 | let S = w(R, O[1]) | |
95 | 93 | if ((P == 2)) | |
96 | 94 | then S | |
97 | 95 | else { | |
98 | 96 | let T = w(S, O[2]) | |
99 | 97 | if ((P == 3)) | |
100 | 98 | then T | |
101 | 99 | else { | |
102 | 100 | let U = w(T, O[3]) | |
103 | 101 | throw("List size exceed 3") | |
104 | 102 | } | |
105 | 103 | } | |
106 | 104 | } | |
107 | 105 | } | |
108 | 106 | } | |
109 | 107 | let A = N._1 | |
110 | 108 | let B = N._2 | |
111 | 109 | let C = N._3 | |
112 | 110 | let V = assetBalance(this, s) | |
113 | 111 | if (if ((A == v)) | |
114 | 112 | then (V >= c) | |
115 | 113 | else false) | |
116 | 114 | then [ScriptTransfer(q.caller, V, s)] | |
117 | 115 | else throw("routing != routingSize or amountToRecieve < minAmountToReceive") | |
118 | 116 | } | |
119 | 117 | } | |
120 | 118 | ||
121 | 119 |
github/deemru/w8io/026f985 24.81 ms ◑