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:BgIJCAISABIDCgEIDgAQYW1vdW50QXNzZXRJZEtleQINYW1vdW50QXNzZXRJZAAPcHJpY2VBc3NldElkS2V5AgxwcmljZUFzc2V0SWQACmZlZVJhdGVLZXkCB2ZlZVJhdGUBCmdldEFzc2V0SWQBDWFzc2V0SWRTdHJpbmcDCQAAAgUNYXNzZXRJZFN0cmluZwIFV0FWRVMFBHVuaXQJANkEAQUNYXNzZXRJZFN0cmluZwEPZ2V0QXNzZXRCYWxhbmNlAQdhc3NldElkBAckbWF0Y2gwBQdhc3NldElkAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAmlkBQckbWF0Y2gwCQDwBwIFBHRoaXMFAmlkCAkA7wcBBQR0aGlzCWF2YWlsYWJsZQATYW1vdW50QXNzZXRJZFN0cmluZwkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwUQYW1vdW50QXNzZXRJZEtleQANYW1vdW50QXNzZXRJZAkBCmdldEFzc2V0SWQBBRNhbW91bnRBc3NldElkU3RyaW5nABJwcmljZUFzc2V0SWRTdHJpbmcJARFAZXh0ck5hdGl2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CAAAFCWZlZUFtb3VudAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDBQdhZGRyZXNzBQpzZW5kQW1vdW50BQtzZW5kQXNzZXRJZAUDbmlsCQACAQIRYW1vdW50IGlzIHRvbyBsb3cJAJQKAgULc2VuZEFjdGlvbnMJAJYKBAUKc2VuZEFtb3VudAUJZmVlQW1vdW50BQtzZW5kQXNzZXRJZAUNdXNlclJlYWxQcmljZQkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgIBaQEEc3dhcAAJAQxzd2FwSW50ZXJuYWwCCAUBaQZjYWxsZXIFAWkBaQEHc3dhcEZvcgEHYWRkcmVzcwkBDHN3YXBJbnRlcm5hbAIJARFAZXh0ck5hdGl2ZSgxMDYyKQEFB2FkZHJlc3MFAWkAvtOQIQ==", "height": 3003212, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 84HimeExGbNgyFFNkU9A4yjPrvhocm7dgrGYy3yxz3vb Next: 8uyPT7s4kuon3CLduEBBzpLXB9X6G1GyWGN9Fq94bVjd Diff:
OldNewDifferences
2727
2828 let k = d(j)
2929
30-let l = f(k)
30+let l = getStringValue(this, b)
3131
32-let m = getStringValue(this, b)
32+let m = d(l)
3333
34-let n = d(m)
34+let n = 100000000
3535
36-let o = f(n)
36+let o = valueOrElse(getInteger(this, c), 200000)
3737
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
4743 }
4844
4945
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)
6561 }
6662
6763
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))
7066 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))
7268 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))
7771 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)]
8781 else throw("amount is too low")
88- $Tuple2(M, $Tuple4(x, E, L, F))
82+ $Tuple2(K, $Tuple4(v, C, J, D))
8983 }
9084 else throw("Strict value is not equal to itself.")
9185 }
9286
9387
94-@Callable(I)
95-func swap () = G(I.caller, I)
88+@Callable(G)
89+func swap () = E(G.caller, G)
9690
9791
9892
99-@Callable(I)
100-func swapFor (H) = G(addressFromStringValue(H), I)
93+@Callable(G)
94+func swapFor (F) = E(addressFromStringValue(F), G)
10195
10296
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
30-let l = f(k)
30+let l = getStringValue(this, b)
3131
32-let m = getStringValue(this, b)
32+let m = d(l)
3333
34-let n = d(m)
34+let n = 100000000
3535
36-let o = f(n)
36+let o = valueOrElse(getInteger(this, c), 200000)
3737
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
4743 }
4844
4945
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)
6561 }
6662
6763
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))
7066 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))
7268 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))
7771 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)]
8781 else throw("amount is too low")
88- $Tuple2(M, $Tuple4(x, E, L, F))
82+ $Tuple2(K, $Tuple4(v, C, J, D))
8983 }
9084 else throw("Strict value is not equal to itself.")
9185 }
9286
9387
94-@Callable(I)
95-func swap () = G(I.caller, I)
88+@Callable(G)
89+func swap () = E(G.caller, G)
9690
9791
9892
99-@Callable(I)
100-func swapFor (H) = G(addressFromStringValue(H), I)
93+@Callable(G)
94+func swapFor (F) = E(addressFromStringValue(F), G)
10195
10296

github/deemru/w8io/026f985 
31.15 ms