tx · 2TXNUoCatBrgcHKhwMQcQstCekjbmLRbzv2i4wygavVN
3N61RYWc9QuqKUwLvowpZZLpgUnqpQSFwLq: -0.01000000 Waves
2024.03.04 14:44 [3003221] smart account 3N61RYWc9QuqKUwLvowpZZLpgUnqpQSFwLq > SELF 0.00000000 Waves
{
"type": 13,
"id": "2TXNUoCatBrgcHKhwMQcQstCekjbmLRbzv2i4wygavVN",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1709552664285,
"version": 2,
"chainId": 84,
"sender": "3N61RYWc9QuqKUwLvowpZZLpgUnqpQSFwLq",
"senderPublicKey": "HdwFH8HPYu3HG27yK6bszu1CdR4uik4HgzyTimeSfcYf",
"proofs": [
"2Ht2LbUff4N4cParJ3doDTykLnYnG7g2rKr5HfnSTjFD1jduZZ9NBPMaXUFaVGDSvs3Ds2UAJ5KDJChR6kPYe7Bo"
],
"script": "base64:BgIOCAISABIDCgEBEgMKAQgPABBhbW91bnRBc3NldElkS2V5Ag1hbW91bnRBc3NldElkAA9wcmljZUFzc2V0SWRLZXkCDHByaWNlQXNzZXRJZAAKZmVlUmF0ZUtleQIHZmVlUmF0ZQEKZ2V0QXNzZXRJZAENYXNzZXRJZFN0cmluZwMJAAACBQ1hc3NldElkU3RyaW5nAgVXQVZFUwUEdW5pdAkA2QQBBQ1hc3NldElkU3RyaW5nAQ9nZXRBc3NldEJhbGFuY2UBB2Fzc2V0SWQEByRtYXRjaDAFB2Fzc2V0SWQDCQABAgUHJG1hdGNoMAIKQnl0ZVZlY3RvcgQCaWQFByRtYXRjaDAJAPAHAgUEdGhpcwUCaWQICQDvBwEFBHRoaXMJYXZhaWxhYmxlABNhbW91bnRBc3NldElkU3RyaW5nCQERQGV4dHJOYXRpdmUoMTA1MykCBQR0aGlzBRBhbW91bnRBc3NldElkS2V5AA1hbW91bnRBc3NldElkCQEKZ2V0QXNzZXRJZAEFE2Ftb3VudEFzc2V0SWRTdHJpbmcAEnByaWNlQXNzZXRJZFN0cmluZwkBEUB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ERQGV4dHJOYXRpdmUoMTA2MikBBQdhZGRyZXNzBQFpAKqErUs=",
"height": 3003221,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 7KgSYbDidQ1pC6WWZLTPHFsv2oYMaLdLx6BcXrkuVCGN
Next: AUT1JaVsQcktijNetUsnNgs9p94j3aQHep5BLzF3mtAF
Diff:
Old | New | | Differences |
---|
35 | 35 | | |
---|
36 | 36 | | let o = valueOrElse(getInteger(this, c), 200000) |
---|
37 | 37 | | |
---|
38 | | - | func p (q,r,s) = { |
---|
39 | | - | let t = (r + s) |
---|
40 | | - | let u = fraction(q, r, t) |
---|
41 | | - | let v = (q - u) |
---|
42 | | - | v |
---|
| 38 | + | func p () = fraction(f(k), n, f(m)) |
---|
| 39 | + | |
---|
| 40 | + | |
---|
| 41 | + | func q (r,s,t) = { |
---|
| 42 | + | let u = (s + t) |
---|
| 43 | + | let v = fraction(r, s, u) |
---|
| 44 | + | let w = (r - v) |
---|
| 45 | + | w |
---|
43 | 46 | | } |
---|
44 | 47 | | |
---|
45 | 48 | | |
---|
46 | | - | func w (x,s) = { |
---|
47 | | - | let y = if ((x == k)) |
---|
| 49 | + | func x (y,t) = { |
---|
| 50 | + | let z = if ((y == k)) |
---|
48 | 51 | | then $Tuple2(m, k) |
---|
49 | 52 | | else $Tuple2(k, m) |
---|
50 | | - | let z = y._1 |
---|
51 | | - | let A = y._2 |
---|
52 | | - | let q = f(z) |
---|
53 | | - | let r = (f(A) - s) |
---|
54 | | - | let B = p(q, r, s) |
---|
55 | | - | let C = fraction(B, o, n) |
---|
56 | | - | let v = (B - C) |
---|
57 | | - | let D = if ((x == k)) |
---|
58 | | - | then fraction(v, n, s) |
---|
59 | | - | else fraction(s, n, v) |
---|
60 | | - | $Tuple4(v, C, z, D) |
---|
| 53 | + | let A = z._1 |
---|
| 54 | + | let B = z._2 |
---|
| 55 | + | let r = f(A) |
---|
| 56 | + | let s = (f(B) - t) |
---|
| 57 | + | let C = q(r, s, t) |
---|
| 58 | + | let D = fraction(C, o, n) |
---|
| 59 | + | let w = (C - D) |
---|
| 60 | + | let E = if ((y == k)) |
---|
| 61 | + | then fraction(w, n, t) |
---|
| 62 | + | else fraction(t, n, w) |
---|
| 63 | + | $Tuple4(w, D, A, E) |
---|
61 | 64 | | } |
---|
62 | 65 | | |
---|
63 | 66 | | |
---|
64 | | - | func E (F,G) = { |
---|
65 | | - | let H = [if ((size(G.payments) > 0)) |
---|
| 67 | + | func F (G,H) = { |
---|
| 68 | + | let I = [if ((size(H.payments) > 0)) |
---|
66 | 69 | | then true |
---|
67 | | - | else throw("should be with 1 payment"), if (containsElement([k, m], G.payments[0].assetId)) |
---|
| 70 | + | else throw("should be with 1 payment"), if (containsElement([k, m], H.payments[0].assetId)) |
---|
68 | 71 | | then true |
---|
69 | 72 | | else throw(makeString(["payment assetId should be", j, "or", l], " "))] |
---|
70 | | - | if ((H == H)) |
---|
| 73 | + | if ((I == I)) |
---|
71 | 74 | | then { |
---|
72 | | - | let x = G.payments[0].assetId |
---|
73 | | - | let s = G.payments[0].amount |
---|
74 | | - | let I = w(x, s) |
---|
75 | | - | let v = I._1 |
---|
76 | | - | let C = I._2 |
---|
77 | | - | let J = I._3 |
---|
78 | | - | let D = I._4 |
---|
79 | | - | let K = if ((C > 0)) |
---|
80 | | - | then [ScriptTransfer(F, v, J)] |
---|
| 75 | + | let y = H.payments[0].assetId |
---|
| 76 | + | let t = H.payments[0].amount |
---|
| 77 | + | let J = x(y, t) |
---|
| 78 | + | let w = J._1 |
---|
| 79 | + | let D = J._2 |
---|
| 80 | + | let K = J._3 |
---|
| 81 | + | let E = J._4 |
---|
| 82 | + | let L = if ((D > 0)) |
---|
| 83 | + | then [ScriptTransfer(G, w, K)] |
---|
81 | 84 | | else throw("amount is too low") |
---|
82 | | - | $Tuple2(K, $Tuple4(v, C, J, D)) |
---|
| 85 | + | $Tuple2(L, $Tuple4(w, D, K, E)) |
---|
83 | 86 | | } |
---|
84 | 87 | | else throw("Strict value is not equal to itself.") |
---|
85 | 88 | | } |
---|
86 | 89 | | |
---|
87 | 90 | | |
---|
88 | | - | @Callable(G) |
---|
89 | | - | func swap () = E(G.caller, G) |
---|
| 91 | + | @Callable(H) |
---|
| 92 | + | func swap () = F(H.caller, H) |
---|
90 | 93 | | |
---|
91 | 94 | | |
---|
92 | 95 | | |
---|
93 | | - | @Callable(G) |
---|
94 | | - | func swapNoLess (L) = { |
---|
95 | | - | let M = E(G.caller, G) |
---|
96 | | - | let K = M._1 |
---|
97 | | - | let N = M._2 |
---|
98 | | - | let O = N |
---|
99 | | - | let v = O._1 |
---|
100 | | - | let C = O._2 |
---|
101 | | - | let J = O._3 |
---|
102 | | - | let D = O._4 |
---|
103 | | - | if ((L > v)) |
---|
104 | | - | then throw(makeString(["Price slipped. minAmount: ", toString(L), " swapAmount: ", toString(v)], "")) |
---|
105 | | - | else $Tuple2(K, N) |
---|
| 96 | + | @Callable(H) |
---|
| 97 | + | func swapNoLess (M) = { |
---|
| 98 | + | let N = F(H.caller, H) |
---|
| 99 | + | let L = N._1 |
---|
| 100 | + | let O = N._2 |
---|
| 101 | + | let P = O |
---|
| 102 | + | let w = P._1 |
---|
| 103 | + | let D = P._2 |
---|
| 104 | + | let K = P._3 |
---|
| 105 | + | let E = P._4 |
---|
| 106 | + | if ((M > w)) |
---|
| 107 | + | then throw(makeString(["Price slipped. minAmount: ", toString(M), " swapAmount: ", toString(w)], "")) |
---|
| 108 | + | else $Tuple2(L, O) |
---|
106 | 109 | | } |
---|
107 | 110 | | |
---|
108 | 111 | | |
---|
109 | 112 | | |
---|
110 | | - | @Callable(G) |
---|
111 | | - | func swapFor (F) = E(addressFromStringValue(F), G) |
---|
| 113 | + | @Callable(H) |
---|
| 114 | + | func swapFor (G) = F(addressFromStringValue(G), H) |
---|
112 | 115 | | |
---|
113 | 116 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = "amountAssetId" |
---|
5 | 5 | | |
---|
6 | 6 | | let b = "priceAssetId" |
---|
7 | 7 | | |
---|
8 | 8 | | let c = "feeRate" |
---|
9 | 9 | | |
---|
10 | 10 | | func d (e) = if ((e == "WAVES")) |
---|
11 | 11 | | then unit |
---|
12 | 12 | | else fromBase58String(e) |
---|
13 | 13 | | |
---|
14 | 14 | | |
---|
15 | 15 | | func f (g) = { |
---|
16 | 16 | | let h = g |
---|
17 | 17 | | if ($isInstanceOf(h, "ByteVector")) |
---|
18 | 18 | | then { |
---|
19 | 19 | | let i = h |
---|
20 | 20 | | assetBalance(this, i) |
---|
21 | 21 | | } |
---|
22 | 22 | | else wavesBalance(this).available |
---|
23 | 23 | | } |
---|
24 | 24 | | |
---|
25 | 25 | | |
---|
26 | 26 | | let j = getStringValue(this, a) |
---|
27 | 27 | | |
---|
28 | 28 | | let k = d(j) |
---|
29 | 29 | | |
---|
30 | 30 | | let l = getStringValue(this, b) |
---|
31 | 31 | | |
---|
32 | 32 | | let m = d(l) |
---|
33 | 33 | | |
---|
34 | 34 | | let n = 100000000 |
---|
35 | 35 | | |
---|
36 | 36 | | let o = valueOrElse(getInteger(this, c), 200000) |
---|
37 | 37 | | |
---|
38 | | - | func p (q,r,s) = { |
---|
39 | | - | let t = (r + s) |
---|
40 | | - | let u = fraction(q, r, t) |
---|
41 | | - | let v = (q - u) |
---|
42 | | - | v |
---|
| 38 | + | func p () = fraction(f(k), n, f(m)) |
---|
| 39 | + | |
---|
| 40 | + | |
---|
| 41 | + | func q (r,s,t) = { |
---|
| 42 | + | let u = (s + t) |
---|
| 43 | + | let v = fraction(r, s, u) |
---|
| 44 | + | let w = (r - v) |
---|
| 45 | + | w |
---|
43 | 46 | | } |
---|
44 | 47 | | |
---|
45 | 48 | | |
---|
46 | | - | func w (x,s) = { |
---|
47 | | - | let y = if ((x == k)) |
---|
| 49 | + | func x (y,t) = { |
---|
| 50 | + | let z = if ((y == k)) |
---|
48 | 51 | | then $Tuple2(m, k) |
---|
49 | 52 | | else $Tuple2(k, m) |
---|
50 | | - | let z = y._1 |
---|
51 | | - | let A = y._2 |
---|
52 | | - | let q = f(z) |
---|
53 | | - | let r = (f(A) - s) |
---|
54 | | - | let B = p(q, r, s) |
---|
55 | | - | let C = fraction(B, o, n) |
---|
56 | | - | let v = (B - C) |
---|
57 | | - | let D = if ((x == k)) |
---|
58 | | - | then fraction(v, n, s) |
---|
59 | | - | else fraction(s, n, v) |
---|
60 | | - | $Tuple4(v, C, z, D) |
---|
| 53 | + | let A = z._1 |
---|
| 54 | + | let B = z._2 |
---|
| 55 | + | let r = f(A) |
---|
| 56 | + | let s = (f(B) - t) |
---|
| 57 | + | let C = q(r, s, t) |
---|
| 58 | + | let D = fraction(C, o, n) |
---|
| 59 | + | let w = (C - D) |
---|
| 60 | + | let E = if ((y == k)) |
---|
| 61 | + | then fraction(w, n, t) |
---|
| 62 | + | else fraction(t, n, w) |
---|
| 63 | + | $Tuple4(w, D, A, E) |
---|
61 | 64 | | } |
---|
62 | 65 | | |
---|
63 | 66 | | |
---|
64 | | - | func E (F,G) = { |
---|
65 | | - | let H = [if ((size(G.payments) > 0)) |
---|
| 67 | + | func F (G,H) = { |
---|
| 68 | + | let I = [if ((size(H.payments) > 0)) |
---|
66 | 69 | | then true |
---|
67 | | - | else throw("should be with 1 payment"), if (containsElement([k, m], G.payments[0].assetId)) |
---|
| 70 | + | else throw("should be with 1 payment"), if (containsElement([k, m], H.payments[0].assetId)) |
---|
68 | 71 | | then true |
---|
69 | 72 | | else throw(makeString(["payment assetId should be", j, "or", l], " "))] |
---|
70 | | - | if ((H == H)) |
---|
| 73 | + | if ((I == I)) |
---|
71 | 74 | | then { |
---|
72 | | - | let x = G.payments[0].assetId |
---|
73 | | - | let s = G.payments[0].amount |
---|
74 | | - | let I = w(x, s) |
---|
75 | | - | let v = I._1 |
---|
76 | | - | let C = I._2 |
---|
77 | | - | let J = I._3 |
---|
78 | | - | let D = I._4 |
---|
79 | | - | let K = if ((C > 0)) |
---|
80 | | - | then [ScriptTransfer(F, v, J)] |
---|
| 75 | + | let y = H.payments[0].assetId |
---|
| 76 | + | let t = H.payments[0].amount |
---|
| 77 | + | let J = x(y, t) |
---|
| 78 | + | let w = J._1 |
---|
| 79 | + | let D = J._2 |
---|
| 80 | + | let K = J._3 |
---|
| 81 | + | let E = J._4 |
---|
| 82 | + | let L = if ((D > 0)) |
---|
| 83 | + | then [ScriptTransfer(G, w, K)] |
---|
81 | 84 | | else throw("amount is too low") |
---|
82 | | - | $Tuple2(K, $Tuple4(v, C, J, D)) |
---|
| 85 | + | $Tuple2(L, $Tuple4(w, D, K, E)) |
---|
83 | 86 | | } |
---|
84 | 87 | | else throw("Strict value is not equal to itself.") |
---|
85 | 88 | | } |
---|
86 | 89 | | |
---|
87 | 90 | | |
---|
88 | | - | @Callable(G) |
---|
89 | | - | func swap () = E(G.caller, G) |
---|
| 91 | + | @Callable(H) |
---|
| 92 | + | func swap () = F(H.caller, H) |
---|
90 | 93 | | |
---|
91 | 94 | | |
---|
92 | 95 | | |
---|
93 | | - | @Callable(G) |
---|
94 | | - | func swapNoLess (L) = { |
---|
95 | | - | let M = E(G.caller, G) |
---|
96 | | - | let K = M._1 |
---|
97 | | - | let N = M._2 |
---|
98 | | - | let O = N |
---|
99 | | - | let v = O._1 |
---|
100 | | - | let C = O._2 |
---|
101 | | - | let J = O._3 |
---|
102 | | - | let D = O._4 |
---|
103 | | - | if ((L > v)) |
---|
104 | | - | then throw(makeString(["Price slipped. minAmount: ", toString(L), " swapAmount: ", toString(v)], "")) |
---|
105 | | - | else $Tuple2(K, N) |
---|
| 96 | + | @Callable(H) |
---|
| 97 | + | func swapNoLess (M) = { |
---|
| 98 | + | let N = F(H.caller, H) |
---|
| 99 | + | let L = N._1 |
---|
| 100 | + | let O = N._2 |
---|
| 101 | + | let P = O |
---|
| 102 | + | let w = P._1 |
---|
| 103 | + | let D = P._2 |
---|
| 104 | + | let K = P._3 |
---|
| 105 | + | let E = P._4 |
---|
| 106 | + | if ((M > w)) |
---|
| 107 | + | then throw(makeString(["Price slipped. minAmount: ", toString(M), " swapAmount: ", toString(w)], "")) |
---|
| 108 | + | else $Tuple2(L, O) |
---|
106 | 109 | | } |
---|
107 | 110 | | |
---|
108 | 111 | | |
---|
109 | 112 | | |
---|
110 | | - | @Callable(G) |
---|
111 | | - | func swapFor (F) = E(addressFromStringValue(F), G) |
---|
| 113 | + | @Callable(H) |
---|
| 114 | + | func swapFor (G) = F(addressFromStringValue(G), H) |
---|
112 | 115 | | |
---|
113 | 116 | | |
---|