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:BgIOCAISABIDCgEBEgMKAQgPABBhbW91bnRBc3NldElkS2V5Ag1hbW91bnRBc3NldElkAA9wcmljZUFzc2V0SWRLZXkCDHByaWNlQXNzZXRJZAAKZmVlUmF0ZUtleQIHZmVlUmF0ZQEKZ2V0QXNzZXRJZAENYXNzZXRJZFN0cmluZwMJAAACBQ1hc3NldElkU3RyaW5nAgVXQVZFUwUEdW5pdAkA2QQBBQ1hc3NldElkU3RyaW5nAQ9nZXRBc3NldEJhbGFuY2UBB2Fzc2V0SWQEByRtYXRjaDAFB2Fzc2V0SWQDCQABAgUHJG1hdGNoMAIKQnl0ZVZlY3RvcgQCaWQFByRtYXRjaDAJAPAHAgUEdGhpcwUCaWQICQDvBwEFBHRoaXMJYXZhaWxhYmxlABNhbW91bnRBc3NldElkU3RyaW5nCQERQGV4dHJOYXRpdmUoMTA1MykCBQR0aGlzBRBhbW91bnRBc3NldElkS2V5AA1hbW91bnRBc3NldElkCQEKZ2V0QXNzZXRJZAEFE2Ftb3VudEFzc2V0SWRTdHJpbmcAEnByaWNlQXNzZXRJZFN0cmluZwkBEUBleHRyTmF0a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YXRpdmUoMTA2MikBBQdhZGRyZXNzBQFpAKqErUs=", "height": 3003221, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7KgSYbDidQ1pC6WWZLTPHFsv2oYMaLdLx6BcXrkuVCGN Next: AUT1JaVsQcktijNetUsnNgs9p94j3aQHep5BLzF3mtAF Diff:
OldNewDifferences
3535
3636 let o = valueOrElse(getInteger(this, c), 200000)
3737
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
4346 }
4447
4548
46-func w (x,s) = {
47- let y = if ((x == k))
49+func x (y,t) = {
50+ let z = if ((y == k))
4851 then $Tuple2(m, k)
4952 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)
6164 }
6265
6366
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))
6669 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))
6871 then true
6972 else throw(makeString(["payment assetId should be", j, "or", l], " "))]
70- if ((H == H))
73+ if ((I == I))
7174 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)]
8184 else throw("amount is too low")
82- $Tuple2(K, $Tuple4(v, C, J, D))
85+ $Tuple2(L, $Tuple4(w, D, K, E))
8386 }
8487 else throw("Strict value is not equal to itself.")
8588 }
8689
8790
88-@Callable(G)
89-func swap () = E(G.caller, G)
91+@Callable(H)
92+func swap () = F(H.caller, H)
9093
9194
9295
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)
106109 }
107110
108111
109112
110-@Callable(G)
111-func swapFor (F) = E(addressFromStringValue(F), G)
113+@Callable(H)
114+func swapFor (G) = F(addressFromStringValue(G), H)
112115
113116
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "amountAssetId"
55
66 let b = "priceAssetId"
77
88 let c = "feeRate"
99
1010 func d (e) = if ((e == "WAVES"))
1111 then unit
1212 else fromBase58String(e)
1313
1414
1515 func f (g) = {
1616 let h = g
1717 if ($isInstanceOf(h, "ByteVector"))
1818 then {
1919 let i = h
2020 assetBalance(this, i)
2121 }
2222 else wavesBalance(this).available
2323 }
2424
2525
2626 let j = getStringValue(this, a)
2727
2828 let k = d(j)
2929
3030 let l = getStringValue(this, b)
3131
3232 let m = d(l)
3333
3434 let n = 100000000
3535
3636 let o = valueOrElse(getInteger(this, c), 200000)
3737
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
4346 }
4447
4548
46-func w (x,s) = {
47- let y = if ((x == k))
49+func x (y,t) = {
50+ let z = if ((y == k))
4851 then $Tuple2(m, k)
4952 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)
6164 }
6265
6366
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))
6669 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))
6871 then true
6972 else throw(makeString(["payment assetId should be", j, "or", l], " "))]
70- if ((H == H))
73+ if ((I == I))
7174 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)]
8184 else throw("amount is too low")
82- $Tuple2(K, $Tuple4(v, C, J, D))
85+ $Tuple2(L, $Tuple4(w, D, K, E))
8386 }
8487 else throw("Strict value is not equal to itself.")
8588 }
8689
8790
88-@Callable(G)
89-func swap () = E(G.caller, G)
91+@Callable(H)
92+func swap () = F(H.caller, H)
9093
9194
9295
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)
106109 }
107110
108111
109112
110-@Callable(G)
111-func swapFor (F) = E(addressFromStringValue(F), G)
113+@Callable(H)
114+func swapFor (G) = F(addressFromStringValue(G), H)
112115
113116

github/deemru/w8io/169f3d6 
35.49 ms