tx · 33HXGRTLEydx9ES2EZ4HPKc3u7QdfMKTFKGnGxDSqMfc
3N61RYWc9QuqKUwLvowpZZLpgUnqpQSFwLq: -0.01000000 Waves
2024.03.04 14:32 [3003212] smart account 3N61RYWc9QuqKUwLvowpZZLpgUnqpQSFwLq > SELF 0.00000000 Waves
{
"type": 13,
"id": "33HXGRTLEydx9ES2EZ4HPKc3u7QdfMKTFKGnGxDSqMfc",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1709551978491,
"version": 2,
"chainId": 84,
"sender": "3N61RYWc9QuqKUwLvowpZZLpgUnqpQSFwLq",
"senderPublicKey": "HdwFH8HPYu3HG27yK6bszu1CdR4uik4HgzyTimeSfcYf",
"proofs": [
"3ZcVK22RZKQe8fZ4rMuHB187ys7AZJ27Ei3VrxdgGthmQaBeHp2f1Ccaop2Bkngcy5uGAtJ5iBaMxTzJsP6jHCyE"
],
"script": "base64:BgIJCAISABIDCgEIDgAQYW1vdW50QXNzZXRJZEtleQINYW1vdW50QXNzZXRJZAAPcHJpY2VBc3NldElkS2V5AgxwcmljZUFzc2V0SWQACmZlZVJhdGVLZXkCB2ZlZVJhdGUBCmdldEFzc2V0SWQBDWFzc2V0SWRTdHJpbmcDCQAAAgUNYXNzZXRJZFN0cmluZwIFV0FWRVMFBHVuaXQJANkEAQUNYXNzZXRJZFN0cmluZwEPZ2V0QXNzZXRCYWxhbmNlAQdhc3NldElkBAckbWF0Y2gwBQdhc3NldElkAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAmlkBQckbWF0Y2gwCQDwBwIFBHRoaXMFAmlkCAkA7wcBBQR0aGlzCWF2YWlsYWJsZQATYW1vdW50QXNzZXRJZFN0cmluZwkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwUQYW1vdW50QXNzZXRJZEtleQANYW1vdW50QXNzZXRJZAkBCmdldEFzc2V0SWQBBRNhbW91bnRBc3NldElkU3RyaW5nABJwcmljZUFzc2V0SWRTdHJpbmcJARFAZXh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9ucwMJAGcCAAAFCWZlZUFtb3VudAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDBQdhZGRyZXNzBQpzZW5kQW1vdW50BQtzZW5kQXNzZXRJZAUDbmlsCQACAQIRYW1vdW50IGlzIHRvbyBsb3cJAJQKAgULc2VuZEFjdGlvbnMJAJYKBAUKc2VuZEFtb3VudAUJZmVlQW1vdW50BQtzZW5kQXNzZXRJZAUNdXNlclJlYWxQcmljZQkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgIBaQEEc3dhcAAJAQxzd2FwSW50ZXJuYWwCCAUBaQZjYWxsZXIFAWkBaQEHc3dhcEZvcgEHYWRkcmVzcwkBDHN3YXBJbnRlcm5hbAIJARFAZXh0ck5hdGl2ZSgxMDYyKQEFB2FkZHJlc3MFAWkAvtOQIQ==",
"height": 3003212,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 84HimeExGbNgyFFNkU9A4yjPrvhocm7dgrGYy3yxz3vb
Next: 8uyPT7s4kuon3CLduEBBzpLXB9X6G1GyWGN9Fq94bVjd
Diff:
Old | New | | Differences |
---|
27 | 27 | | |
---|
28 | 28 | | let k = d(j) |
---|
29 | 29 | | |
---|
30 | | - | let l = f(k) |
---|
| 30 | + | let l = getStringValue(this, b) |
---|
31 | 31 | | |
---|
32 | | - | let m = getStringValue(this, b) |
---|
| 32 | + | let m = d(l) |
---|
33 | 33 | | |
---|
34 | | - | let n = d(m) |
---|
| 34 | + | let n = 100000000 |
---|
35 | 35 | | |
---|
36 | | - | let o = f(n) |
---|
| 36 | + | let o = valueOrElse(getInteger(this, c), 200000) |
---|
37 | 37 | | |
---|
38 | | - | let p = 100000000 |
---|
39 | | - | |
---|
40 | | - | let q = valueOrElse(getInteger(this, c), 1000000) |
---|
41 | | - | |
---|
42 | | - | func r (s,t,u) = { |
---|
43 | | - | let v = (t + u) |
---|
44 | | - | let w = fraction(s, t, v) |
---|
45 | | - | let x = (s - w) |
---|
46 | | - | x |
---|
| 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 |
---|
47 | 43 | | } |
---|
48 | 44 | | |
---|
49 | 45 | | |
---|
50 | | - | func y (z,u) = { |
---|
51 | | - | let A = if ((z == k)) |
---|
52 | | - | then $Tuple2(n, k) |
---|
53 | | - | else $Tuple2(k, n) |
---|
54 | | - | let B = A._1 |
---|
55 | | - | let C = A._2 |
---|
56 | | - | let s = f(B) |
---|
57 | | - | let t = (f(C) - u) |
---|
58 | | - | let D = r(s, t, u) |
---|
59 | | - | let E = fraction(D, q, p) |
---|
60 | | - | let x = (D - E) |
---|
61 | | - | let F = if ((z == k)) |
---|
62 | | - | then fraction(x, p, u) |
---|
63 | | - | else fraction(u, p, x) |
---|
64 | | - | $Tuple4(x, E, B, F) |
---|
| 46 | + | func w (x,s) = { |
---|
| 47 | + | let y = if ((x == k)) |
---|
| 48 | + | then $Tuple2(m, k) |
---|
| 49 | + | 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) |
---|
65 | 61 | | } |
---|
66 | 62 | | |
---|
67 | 63 | | |
---|
68 | | - | func G (H,I) = { |
---|
69 | | - | let J = [if ((size(I.payments) > 0)) |
---|
| 64 | + | func E (F,G) = { |
---|
| 65 | + | let H = [if ((size(G.payments) > 0)) |
---|
70 | 66 | | then true |
---|
71 | | - | else throw("should be with 1 payment"), if (if ((I.payments[0].assetId == k)) |
---|
| 67 | + | else throw("should be with 1 payment"), if (containsElement([k, m], G.payments[0].assetId)) |
---|
72 | 68 | | then true |
---|
73 | | - | else (I.payments[0].assetId == n)) |
---|
74 | | - | then true |
---|
75 | | - | else throw(makeString(["payment assetId should be (", j, ") or (", m, ")"], " "))] |
---|
76 | | - | if ((J == J)) |
---|
| 69 | + | else throw(makeString(["payment assetId should be (", j, ") or (", l, ")"], " "))] |
---|
| 70 | + | if ((H == H)) |
---|
77 | 71 | | then { |
---|
78 | | - | let z = I.payments[0].assetId |
---|
79 | | - | let u = I.payments[0].amount |
---|
80 | | - | let K = y(z, u) |
---|
81 | | - | let x = K._1 |
---|
82 | | - | let E = K._2 |
---|
83 | | - | let L = K._3 |
---|
84 | | - | let F = K._4 |
---|
85 | | - | let M = if ((E != 0)) |
---|
86 | | - | then [ScriptTransfer(H, x, L)] |
---|
| 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 ((0 >= C)) |
---|
| 80 | + | then [ScriptTransfer(F, v, J)] |
---|
87 | 81 | | else throw("amount is too low") |
---|
88 | | - | $Tuple2(M, $Tuple4(x, E, L, F)) |
---|
| 82 | + | $Tuple2(K, $Tuple4(v, C, J, D)) |
---|
89 | 83 | | } |
---|
90 | 84 | | else throw("Strict value is not equal to itself.") |
---|
91 | 85 | | } |
---|
92 | 86 | | |
---|
93 | 87 | | |
---|
94 | | - | @Callable(I) |
---|
95 | | - | func swap () = G(I.caller, I) |
---|
| 88 | + | @Callable(G) |
---|
| 89 | + | func swap () = E(G.caller, G) |
---|
96 | 90 | | |
---|
97 | 91 | | |
---|
98 | 92 | | |
---|
99 | | - | @Callable(I) |
---|
100 | | - | func swapFor (H) = G(addressFromStringValue(H), I) |
---|
| 93 | + | @Callable(G) |
---|
| 94 | + | func swapFor (F) = E(addressFromStringValue(F), G) |
---|
101 | 95 | | |
---|
102 | 96 | | |
---|
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 | | - | let l = f(k) |
---|
| 30 | + | let l = getStringValue(this, b) |
---|
31 | 31 | | |
---|
32 | | - | let m = getStringValue(this, b) |
---|
| 32 | + | let m = d(l) |
---|
33 | 33 | | |
---|
34 | | - | let n = d(m) |
---|
| 34 | + | let n = 100000000 |
---|
35 | 35 | | |
---|
36 | | - | let o = f(n) |
---|
| 36 | + | let o = valueOrElse(getInteger(this, c), 200000) |
---|
37 | 37 | | |
---|
38 | | - | let p = 100000000 |
---|
39 | | - | |
---|
40 | | - | let q = valueOrElse(getInteger(this, c), 1000000) |
---|
41 | | - | |
---|
42 | | - | func r (s,t,u) = { |
---|
43 | | - | let v = (t + u) |
---|
44 | | - | let w = fraction(s, t, v) |
---|
45 | | - | let x = (s - w) |
---|
46 | | - | x |
---|
| 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 |
---|
47 | 43 | | } |
---|
48 | 44 | | |
---|
49 | 45 | | |
---|
50 | | - | func y (z,u) = { |
---|
51 | | - | let A = if ((z == k)) |
---|
52 | | - | then $Tuple2(n, k) |
---|
53 | | - | else $Tuple2(k, n) |
---|
54 | | - | let B = A._1 |
---|
55 | | - | let C = A._2 |
---|
56 | | - | let s = f(B) |
---|
57 | | - | let t = (f(C) - u) |
---|
58 | | - | let D = r(s, t, u) |
---|
59 | | - | let E = fraction(D, q, p) |
---|
60 | | - | let x = (D - E) |
---|
61 | | - | let F = if ((z == k)) |
---|
62 | | - | then fraction(x, p, u) |
---|
63 | | - | else fraction(u, p, x) |
---|
64 | | - | $Tuple4(x, E, B, F) |
---|
| 46 | + | func w (x,s) = { |
---|
| 47 | + | let y = if ((x == k)) |
---|
| 48 | + | then $Tuple2(m, k) |
---|
| 49 | + | 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) |
---|
65 | 61 | | } |
---|
66 | 62 | | |
---|
67 | 63 | | |
---|
68 | | - | func G (H,I) = { |
---|
69 | | - | let J = [if ((size(I.payments) > 0)) |
---|
| 64 | + | func E (F,G) = { |
---|
| 65 | + | let H = [if ((size(G.payments) > 0)) |
---|
70 | 66 | | then true |
---|
71 | | - | else throw("should be with 1 payment"), if (if ((I.payments[0].assetId == k)) |
---|
| 67 | + | else throw("should be with 1 payment"), if (containsElement([k, m], G.payments[0].assetId)) |
---|
72 | 68 | | then true |
---|
73 | | - | else (I.payments[0].assetId == n)) |
---|
74 | | - | then true |
---|
75 | | - | else throw(makeString(["payment assetId should be (", j, ") or (", m, ")"], " "))] |
---|
76 | | - | if ((J == J)) |
---|
| 69 | + | else throw(makeString(["payment assetId should be (", j, ") or (", l, ")"], " "))] |
---|
| 70 | + | if ((H == H)) |
---|
77 | 71 | | then { |
---|
78 | | - | let z = I.payments[0].assetId |
---|
79 | | - | let u = I.payments[0].amount |
---|
80 | | - | let K = y(z, u) |
---|
81 | | - | let x = K._1 |
---|
82 | | - | let E = K._2 |
---|
83 | | - | let L = K._3 |
---|
84 | | - | let F = K._4 |
---|
85 | | - | let M = if ((E != 0)) |
---|
86 | | - | then [ScriptTransfer(H, x, L)] |
---|
| 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 ((0 >= C)) |
---|
| 80 | + | then [ScriptTransfer(F, v, J)] |
---|
87 | 81 | | else throw("amount is too low") |
---|
88 | | - | $Tuple2(M, $Tuple4(x, E, L, F)) |
---|
| 82 | + | $Tuple2(K, $Tuple4(v, C, J, D)) |
---|
89 | 83 | | } |
---|
90 | 84 | | else throw("Strict value is not equal to itself.") |
---|
91 | 85 | | } |
---|
92 | 86 | | |
---|
93 | 87 | | |
---|
94 | | - | @Callable(I) |
---|
95 | | - | func swap () = G(I.caller, I) |
---|
| 88 | + | @Callable(G) |
---|
| 89 | + | func swap () = E(G.caller, G) |
---|
96 | 90 | | |
---|
97 | 91 | | |
---|
98 | 92 | | |
---|
99 | | - | @Callable(I) |
---|
100 | | - | func swapFor (H) = G(addressFromStringValue(H), I) |
---|
| 93 | + | @Callable(G) |
---|
| 94 | + | func swapFor (F) = E(addressFromStringValue(F), G) |
---|
101 | 95 | | |
---|
102 | 96 | | |
---|