tx · GuWtKs3nYMdz2tUqzSF3Xmi9nZzLLUmXVtpq8jcdRpEn

3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h:  -0.05000000 Waves

2023.03.29 14:45 [2511188] smart account 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h > SELF 0.00000000 Waves

{ "type": 13, "id": "GuWtKs3nYMdz2tUqzSF3Xmi9nZzLLUmXVtpq8jcdRpEn", "fee": 5000000, "feeAssetId": null, "timestamp": 1680090396813, "version": 2, "chainId": 84, "sender": "3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h", "senderPublicKey": "3z8Q6Zu3KppVmn6fJJvrLc1Wo3krVHSvfaNcerm82md2", "proofs": [ "5Jxs8ZaNV1bQLe1AT1emJc6UKoacfQrVYqLRr58W5TGXF2e6oL84kMdaGjNFjofvnhJ5fK6u9VBH9kTdYwa3Cqs3" ], "script": "base64:BgIJCAISAwoBARIAFAAMY29udHJhY3RGaWxlAglyZWJhbGFuY2UAD2tleXNUYXJnZXRSYXRpbwIPJXNfX3RhcmdldFJhdGlvABRrZXlBZGRpdGlvbmFsQmFsYW5jZQIaJXNfX2FkZGl0aW9uYWxXYXZlc0JhbGFuY2UAGmtleVNXYXZlc0FkZGl0aW9uYWxCYWxhbmNlAhElc19fc1dhdmVzQmFsYW5jZQAQa2V5U1dhdmVzQXNzZXRJZAIRJXNfX3NXYXZlc0Fzc2V0SWQAD2tleVByb3h5QWRkcmVzcwIQJXNfX3Byb3h5QWRkcmVzcwANa2V5TWluQmFsYW5jZQITJXNfX21pbldhdmVzQmFsYW5jZQARa2V5RmFjdG9yeUFkZHJlc3MCCyVzX19mYWN0b3J5AAZNVUxUMTIAgKCUpY0dARBnZXRJbnRlZ2VyT3JaZXJvAQppbnRlZ2VyS2V5BAckbWF0Y2gwCQCaCAIFBHRoaXMFCmludGVnZXJLZXkDCQABAgUHJG1hdGNoMAIDSW50BAN2YWwFByRtYXRjaDAFA3ZhbAAAARBnZXRTdHJpbmdP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bGFuY2UJAJYDAQkAzAgCAAAJAMwIAgkAZQIJAGQCBRBhdmFpbGFibGVCYWxhbmNlBRFhZGRpdGlvbmFsQmFsYW5jZQkBDWdldE1pbkJhbGFuY2UABQNuaWwEF3RhcmdldEFkZGl0aW9uYWxCYWxhbmNlCQBrAwULdGFyZ2V0UmF0aW8FDHdob2xlQmFsYW5jZQBkBARkaWZmCQBlAgURYWRkaXRpb25hbEJhbGFuY2UFF3RhcmdldEFkZGl0aW9uYWxCYWxhbmNlAwkAAAIFBGRpZmYAAAUDbmlsAwkAZgIAAAUEZGlmZgQPc2VuZFdhdmVzQW1vdW50CQEBLQEFBGRpZmYJAQdkZXBvc2l0AQUPc2VuZFdhdmVzQW1vdW50BA5nZXRXYXZlc0Ftb3VudAUEZGlmZgkBCHdpdGhkcmF3AQUOZ2V0V2F2ZXNBbW91bnQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4CAWkBDnJlYmFsYW5jZVJhdGlvAQt0YXJnZXRSYXRpbwkBEXJlYmFsYW5jZUludGVybmFsAQULdGFyZ2V0UmF0aW8BaQEJcmViYWxhbmNlAAkBEXJlYmFsYW5jZUludGVybmFsAQkBDmdldFRhcmdldFJhdGlvAABOjxUe", "height": 2511188, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9B5o6xrQxZesRAhzUguYrZiAsQDiEBE8rwd8j9ahfLaN Next: AMUwG36YQv66tpSkTNkVUyUeaCsDCK5rdczmaWj9tJvc Diff:
OldNewDifferences
1515
1616 let g = "%s__minWavesBalance"
1717
18-let h = 1000000000000
18+let h = "%s__factory"
1919
20-func i (j) = {
21- let k = getInteger(this, j)
22- if ($isInstanceOf(k, "Int"))
20+let i = 1000000000000
21+
22+func j (k) = {
23+ let l = getInteger(this, k)
24+ if ($isInstanceOf(l, "Int"))
2325 then {
24- let l = k
25- l
26+ let m = l
27+ m
2628 }
2729 else 0
2830 }
2931
3032
31-func m (n) = {
32- let k = getString(this, n)
33- if ($isInstanceOf(k, "String"))
33+func n (o) = {
34+ let l = getString(this, o)
35+ if ($isInstanceOf(l, "String"))
3436 then {
35- let o = k
36- o
37+ let p = l
38+ p
3739 }
38- else throw((("[" + n) + "] is empty"))
40+ else throw((("[" + o) + "] is empty"))
3941 }
4042
4143
42-func p () = {
43- let k = getInteger(b)
44- if ($isInstanceOf(k, "Int"))
44+func q () = {
45+ let l = getInteger(b)
46+ if ($isInstanceOf(l, "Int"))
4547 then {
46- let q = k
47- min([100, max([0, q])])
48+ let r = l
49+ min([100, max([0, r])])
4850 }
4951 else 0
5052 }
5153
5254
53-func r () = {
54- let k = getInteger(g)
55- if ($isInstanceOf(k, "Int"))
55+func s () = {
56+ let l = getInteger(g)
57+ if ($isInstanceOf(l, "Int"))
5658 then {
57- let s = k
58- max([0, s])
59+ let t = l
60+ max([0, t])
5961 }
6062 else 0
6163 }
6264
6365
64-func t () = {
65- let u = addressFromStringValue(m(f))
66- let v = invoke(u, "getRate", nil, nil)
67- if ((v == v))
66+func u () = {
67+ let v = addressFromStringValue(n(f))
68+ let w = invoke(v, "getRate", nil, nil)
69+ if ((w == w))
6870 then {
69- let k = v
70- if ($isInstanceOf(k, "String"))
71+ let l = w
72+ if ($isInstanceOf(l, "String"))
7173 then {
72- let o = k
73- parseIntValue(o)
74+ let p = l
75+ parseIntValue(p)
7476 }
7577 else throw("Rate is zero (0)")
7678 }
7880 }
7981
8082
81-func w () = addressFromStringValue(m(f))
83+func x () = addressFromStringValue(n(f))
8284
8385
84-func x () = fromBase58String(m(e))
86+func y () = fromBase58String(n(e))
8587
8688
87-func y (z) = {
88- let u = w()
89- let A = i(c)
90- if ((A == A))
89+func z () = {
90+ let A = addressFromStringValue(valueOrElse(getString(h), ""))
91+ let B = toString(this)
92+ $Tuple2(invoke(A, "", [B, "WAVES"], nil), B)
93+ }
94+
95+
96+func C (D) = {
97+ let v = x()
98+ let E = j(c)
99+ if ((E == E))
91100 then {
92- let B = i(d)
93- if ((B == B))
94- then if ((z > 0))
101+ let F = j(d)
102+ if ((F == F))
103+ then if ((D > 0))
95104 then {
96- let C = invoke(u, "deposit", nil, [AttachedPayment(unit, z)])
97- if ((C == C))
105+ let G = invoke(v, "deposit", nil, [AttachedPayment(unit, D)])
106+ if ((G == G))
98107 then {
99- let k = C
100- if ($isInstanceOf(k, "Int"))
108+ let l = G
109+ if ($isInstanceOf(l, "Int"))
101110 then {
102- let D = k
103- let E = (A + z)
104- let F = (B + D)
105-[IntegerEntry(c, E), IntegerEntry(d, F)]
111+ let H = l
112+ let I = (E + D)
113+ let J = (F + H)
114+[IntegerEntry(c, I), IntegerEntry(d, J)]
106115 }
107116 else nil
108117 }
115124 }
116125
117126
118-func G (z) = {
119- let u = w()
120- let A = i(c)
121- if ((A == A))
127+func K (D) = {
128+ let v = x()
129+ let E = j(c)
130+ if ((E == E))
122131 then {
123- let B = i(d)
124- if ((B == B))
132+ let F = j(d)
133+ if ((F == F))
125134 then {
126- let H = t()
127- if ((H == H))
135+ let L = u()
136+ if ((L == L))
128137 then {
129- let I = fraction(h, z, H)
130- if ((I > 0))
138+ let M = fraction(i, D, L)
139+ if ((M > 0))
131140 then {
132- let J = invoke(u, "withdraw", nil, [AttachedPayment(x(), I)])
133- if ((J == J))
141+ let N = invoke(v, "withdraw", nil, [AttachedPayment(y(), M)])
142+ if ((N == N))
134143 then {
135- let k = J
136- if ($isInstanceOf(k, "Int"))
144+ let l = N
145+ if ($isInstanceOf(l, "Int"))
137146 then {
138- let K = k
139- let E = (A - K)
140- let F = (B - I)
141-[IntegerEntry(c, E), IntegerEntry(d, F)]
147+ let O = l
148+ let I = (E - O)
149+ let J = (F - M)
150+[IntegerEntry(c, I), IntegerEntry(d, J)]
142151 }
143152 else nil
144153 }
154163 }
155164
156165
157-func L (M) = {
158- let N = wavesBalance(this).regular
159- if ((N == N))
166+func P (Q) = {
167+ let R = wavesBalance(this).available
168+ if ((R == R))
160169 then {
161- let O = i(c)
162- if ((O == O))
170+ let S = j(c)
171+ if ((S == S))
163172 then {
164- let P = max([0, ((N + O) - r())])
165- let Q = fraction(M, P, 100)
166- let R = (O - Q)
167- if ((R == 0))
173+ let T = max([0, ((R + S) - s())])
174+ let U = fraction(Q, T, 100)
175+ let V = (S - U)
176+ if ((V == 0))
168177 then nil
169- else if ((0 > R))
178+ else if ((0 > V))
170179 then {
171- let S = -(R)
172- y(S)
180+ let W = -(V)
181+ C(W)
173182 }
174183 else {
175- let T = R
176- G(T)
184+ let X = V
185+ K(X)
177186 }
178187 }
179188 else throw("Strict value is not equal to itself.")
182191 }
183192
184193
185-@Callable(s)
186-func rebalanceRatio (M) = L(M)
194+@Callable(t)
195+func rebalanceRatio (Q) = P(Q)
187196
188197
189198
190-@Callable(s)
191-func rebalance () = L(p())
199+@Callable(t)
200+func rebalance () = P(q())
192201
193202
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "rebalance"
55
66 let b = "%s__targetRatio"
77
88 let c = "%s__additionalWavesBalance"
99
1010 let d = "%s__sWavesBalance"
1111
1212 let e = "%s__sWavesAssetId"
1313
1414 let f = "%s__proxyAddress"
1515
1616 let g = "%s__minWavesBalance"
1717
18-let h = 1000000000000
18+let h = "%s__factory"
1919
20-func i (j) = {
21- let k = getInteger(this, j)
22- if ($isInstanceOf(k, "Int"))
20+let i = 1000000000000
21+
22+func j (k) = {
23+ let l = getInteger(this, k)
24+ if ($isInstanceOf(l, "Int"))
2325 then {
24- let l = k
25- l
26+ let m = l
27+ m
2628 }
2729 else 0
2830 }
2931
3032
31-func m (n) = {
32- let k = getString(this, n)
33- if ($isInstanceOf(k, "String"))
33+func n (o) = {
34+ let l = getString(this, o)
35+ if ($isInstanceOf(l, "String"))
3436 then {
35- let o = k
36- o
37+ let p = l
38+ p
3739 }
38- else throw((("[" + n) + "] is empty"))
40+ else throw((("[" + o) + "] is empty"))
3941 }
4042
4143
42-func p () = {
43- let k = getInteger(b)
44- if ($isInstanceOf(k, "Int"))
44+func q () = {
45+ let l = getInteger(b)
46+ if ($isInstanceOf(l, "Int"))
4547 then {
46- let q = k
47- min([100, max([0, q])])
48+ let r = l
49+ min([100, max([0, r])])
4850 }
4951 else 0
5052 }
5153
5254
53-func r () = {
54- let k = getInteger(g)
55- if ($isInstanceOf(k, "Int"))
55+func s () = {
56+ let l = getInteger(g)
57+ if ($isInstanceOf(l, "Int"))
5658 then {
57- let s = k
58- max([0, s])
59+ let t = l
60+ max([0, t])
5961 }
6062 else 0
6163 }
6264
6365
64-func t () = {
65- let u = addressFromStringValue(m(f))
66- let v = invoke(u, "getRate", nil, nil)
67- if ((v == v))
66+func u () = {
67+ let v = addressFromStringValue(n(f))
68+ let w = invoke(v, "getRate", nil, nil)
69+ if ((w == w))
6870 then {
69- let k = v
70- if ($isInstanceOf(k, "String"))
71+ let l = w
72+ if ($isInstanceOf(l, "String"))
7173 then {
72- let o = k
73- parseIntValue(o)
74+ let p = l
75+ parseIntValue(p)
7476 }
7577 else throw("Rate is zero (0)")
7678 }
7779 else throw("Strict value is not equal to itself.")
7880 }
7981
8082
81-func w () = addressFromStringValue(m(f))
83+func x () = addressFromStringValue(n(f))
8284
8385
84-func x () = fromBase58String(m(e))
86+func y () = fromBase58String(n(e))
8587
8688
87-func y (z) = {
88- let u = w()
89- let A = i(c)
90- if ((A == A))
89+func z () = {
90+ let A = addressFromStringValue(valueOrElse(getString(h), ""))
91+ let B = toString(this)
92+ $Tuple2(invoke(A, "", [B, "WAVES"], nil), B)
93+ }
94+
95+
96+func C (D) = {
97+ let v = x()
98+ let E = j(c)
99+ if ((E == E))
91100 then {
92- let B = i(d)
93- if ((B == B))
94- then if ((z > 0))
101+ let F = j(d)
102+ if ((F == F))
103+ then if ((D > 0))
95104 then {
96- let C = invoke(u, "deposit", nil, [AttachedPayment(unit, z)])
97- if ((C == C))
105+ let G = invoke(v, "deposit", nil, [AttachedPayment(unit, D)])
106+ if ((G == G))
98107 then {
99- let k = C
100- if ($isInstanceOf(k, "Int"))
108+ let l = G
109+ if ($isInstanceOf(l, "Int"))
101110 then {
102- let D = k
103- let E = (A + z)
104- let F = (B + D)
105-[IntegerEntry(c, E), IntegerEntry(d, F)]
111+ let H = l
112+ let I = (E + D)
113+ let J = (F + H)
114+[IntegerEntry(c, I), IntegerEntry(d, J)]
106115 }
107116 else nil
108117 }
109118 else throw("Strict value is not equal to itself.")
110119 }
111120 else nil
112121 else throw("Strict value is not equal to itself.")
113122 }
114123 else throw("Strict value is not equal to itself.")
115124 }
116125
117126
118-func G (z) = {
119- let u = w()
120- let A = i(c)
121- if ((A == A))
127+func K (D) = {
128+ let v = x()
129+ let E = j(c)
130+ if ((E == E))
122131 then {
123- let B = i(d)
124- if ((B == B))
132+ let F = j(d)
133+ if ((F == F))
125134 then {
126- let H = t()
127- if ((H == H))
135+ let L = u()
136+ if ((L == L))
128137 then {
129- let I = fraction(h, z, H)
130- if ((I > 0))
138+ let M = fraction(i, D, L)
139+ if ((M > 0))
131140 then {
132- let J = invoke(u, "withdraw", nil, [AttachedPayment(x(), I)])
133- if ((J == J))
141+ let N = invoke(v, "withdraw", nil, [AttachedPayment(y(), M)])
142+ if ((N == N))
134143 then {
135- let k = J
136- if ($isInstanceOf(k, "Int"))
144+ let l = N
145+ if ($isInstanceOf(l, "Int"))
137146 then {
138- let K = k
139- let E = (A - K)
140- let F = (B - I)
141-[IntegerEntry(c, E), IntegerEntry(d, F)]
147+ let O = l
148+ let I = (E - O)
149+ let J = (F - M)
150+[IntegerEntry(c, I), IntegerEntry(d, J)]
142151 }
143152 else nil
144153 }
145154 else throw("Strict value is not equal to itself.")
146155 }
147156 else nil
148157 }
149158 else throw("Strict value is not equal to itself.")
150159 }
151160 else throw("Strict value is not equal to itself.")
152161 }
153162 else throw("Strict value is not equal to itself.")
154163 }
155164
156165
157-func L (M) = {
158- let N = wavesBalance(this).regular
159- if ((N == N))
166+func P (Q) = {
167+ let R = wavesBalance(this).available
168+ if ((R == R))
160169 then {
161- let O = i(c)
162- if ((O == O))
170+ let S = j(c)
171+ if ((S == S))
163172 then {
164- let P = max([0, ((N + O) - r())])
165- let Q = fraction(M, P, 100)
166- let R = (O - Q)
167- if ((R == 0))
173+ let T = max([0, ((R + S) - s())])
174+ let U = fraction(Q, T, 100)
175+ let V = (S - U)
176+ if ((V == 0))
168177 then nil
169- else if ((0 > R))
178+ else if ((0 > V))
170179 then {
171- let S = -(R)
172- y(S)
180+ let W = -(V)
181+ C(W)
173182 }
174183 else {
175- let T = R
176- G(T)
184+ let X = V
185+ K(X)
177186 }
178187 }
179188 else throw("Strict value is not equal to itself.")
180189 }
181190 else throw("Strict value is not equal to itself.")
182191 }
183192
184193
185-@Callable(s)
186-func rebalanceRatio (M) = L(M)
194+@Callable(t)
195+func rebalanceRatio (Q) = P(Q)
187196
188197
189198
190-@Callable(s)
191-func rebalance () = L(p())
199+@Callable(t)
200+func rebalance () = P(q())
192201
193202

github/deemru/w8io/026f985 
72.44 ms