tx · BrkV6ZnB28fo3AMKbuDLP5GHPgzyrbBBVsRxAjqjnbJw

3MpMuGN8rW9EpPwzETAQz88Pe9TQhSwiriq:  -0.01000000 Waves

2023.07.19 12:33 [2672569] smart account 3MpMuGN8rW9EpPwzETAQz88Pe9TQhSwiriq > SELF 0.00000000 Waves

{ "type": 13, "id": "BrkV6ZnB28fo3AMKbuDLP5GHPgzyrbBBVsRxAjqjnbJw", "fee": 1000000, "feeAssetId": null, "timestamp": 1689759240288, "version": 2, "chainId": 84, "sender": "3MpMuGN8rW9EpPwzETAQz88Pe9TQhSwiriq", "senderPublicKey": "57SkjQUEwC1ayCqLbXLuzBqifK6B6SR6rfxtGsbAo3zW", "proofs": [ "5UoiXpLcGrQBKDT5vtdDkQgo3crmvpiNXZxAJw5ELx2xomJhiX6zGRTPpAq2m7m6aXrq1ykxmAwcxQeXgrpGLaiD" ], "script": "base64:BgIaCAISAwoBARIAEgMKAQgSAwoBARIDCgEIEgAWAAxjb250cmFjdEZpbGUCEG1ydF9zdGFraW5nLnJpZGUAA1NFUAICX18ABnNjYWxlOACAwtcvABJBRERSRVNTX0JZVEVTX1NJWkUAGgEIdGhyb3dFcnIBA21zZwkAAgEJAKwCAgkArAICBQxjb250cmFjdEZpbGUCAjogBQNtc2cACmtleUFzc2V0SWQJALkJAgkAzAgCAgIlcwkAzAgCAgdhc3NldElkBQNuaWwFA1NFUAATa2V5RW1pc3Npb25QZXJCbG9jawkAuQkCCQDMCAICAiVzCQDMCAICEGVtaXNzaW9uUGVyQmxvY2sFA25pbAUDU0VQAA1rZXlTdGFydEJsb2NrCQC5CQIJAMwIAgICJXMJAMwIAgIKc3RhcnRCbG9jawUDbmlsBQNTRVAAEGtleVRvdGFsTHBBbW91bnQJALkJAgkAzAgCAgIlcwkAzAgCAg10b3RhbExwQW1vdW50BQNuaWwFA1NFUAATa2V5VG90YWxBc3NldEFtb3VudAkAuQkCCQDMCAICAiVzCQDMCAICEHRvdGFsQXNzZXRBbW91bnQFA25p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3RhbEFzc2V0QW1vdW50V2l0aFByb2ZpdE9yTWF4QXZhaWxhYmxlAAkBD2dldEN1cnJlbnRQcmljZQAAYFOd7g==", "height": 2672569, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9afHXwHh2UxoJQFxqLuw6zqfYFiaKnxC7Q9DZj31CpK9 Next: 9VSJDAE3AHniSi75bSKhCVmtHkc9WfD5jg2kNLKT1KBf Diff:
OldNewDifferences
77
88 let c = 100000000
99
10-func d (e) = throw(((a + ": ") + e))
10+let d = 26
11+
12+func e (f) = throw(((a + ": ") + f))
1113
1214
13-let f = makeString(["%s", "assetId"], b)
15+let g = makeString(["%s", "assetId"], b)
1416
15-let g = makeString(["%s", "emissionPerBlock"], b)
17+let h = makeString(["%s", "emissionPerBlock"], b)
1618
17-let h = makeString(["%s", "startBlock"], b)
19+let i = makeString(["%s", "startBlock"], b)
1820
19-let i = makeString(["%s", "totalLpAmount"], b)
21+let j = makeString(["%s", "totalLpAmount"], b)
2022
21-let j = makeString(["%s", "totalAssetAmount"], b)
23+let k = makeString(["%s", "totalAssetAmount"], b)
2224
23-func k (l) = makeString(["%s%s", "userLpAmount", l], b)
25+func l (m) = makeString(["%s%s", "userLpAmount", m], b)
2426
2527
26-func m (l) = makeString(["%s%s", "totalAssetWithdrawn", l], b)
28+func n (m) = makeString(["%s%s", "totalAssetWithdrawn", m], b)
2729
2830
29-func n (l) = makeString(["%s%s", "totalAssetStaked", l], b)
31+func o (m) = makeString(["%s%s", "totalAssetStaked", m], b)
3032
31-
32-let o = valueOrElse(getInteger(this, i), 0)
3333
3434 let p = valueOrElse(getInteger(this, j), 0)
3535
36-let q = valueOrElse(getString(this, f), "WAVES")
36+let q = valueOrElse(getInteger(this, k), 0)
3737
38-let r = if ((q == "WAVES"))
38+let r = valueOrElse(getString(this, g), "WAVES")
39+
40+let s = if ((r == "WAVES"))
3941 then unit
40- else fromBase58String(q)
42+ else fromBase58String(r)
4143
42-func s (l) = valueOrElse(getInteger(this, k(l)), 0)
44+func t (m) = valueOrElse(getInteger(this, l(m)), 0)
4345
4446
45-func t () = {
46- let u = valueOrElse(getInteger(this, g), 0)
47+func u () = {
4748 let v = valueOrElse(getInteger(this, h), 0)
48- let w = (height - v)
49- max([0, (u * w)])
49+ let w = valueOrElse(getInteger(this, i), 0)
50+ let x = (height - w)
51+ max([0, (v * x)])
5052 }
5153
5254
53-func x () = {
54- let y = (p + t())
55- let z = r
56- if ($isInstanceOf(z, "Unit"))
55+func y () = {
56+ let z = (q + u())
57+ let A = s
58+ if ($isInstanceOf(A, "Unit"))
5759 then {
58- let A = z
59- min([y, wavesBalance(this).available])
60+ let B = A
61+ min([z, wavesBalance(this).available])
6062 }
61- else if ($isInstanceOf(z, "ByteVector"))
63+ else if ($isInstanceOf(A, "ByteVector"))
6264 then {
63- let B = z
64- min([y, assetBalance(this, B)])
65+ let C = A
66+ min([z, assetBalance(this, C)])
6567 }
6668 else throw("Match error")
6769 }
6870
6971
70-func C () = if ((o != 0))
71- then fraction(x(), c, o)
72+func D () = if ((p != 0))
73+ then fraction(y(), c, p)
7274 else (1 * c)
7375
7476
75-func D (E,l) = {
76- let F = [if ((size(E.payments) == 1))
77+func E (F,m) = {
78+ let G = [if ((size(F.payments) == 1))
7779 then true
78- else d("should include 1 payment"), if ((E.payments[0].assetId == r))
80+ else e("should include 1 payment"), if ((F.payments[0].assetId == s))
7981 then true
80- else d(("payment should be in " + q)), if ((E.payments[0].amount > 0))
82+ else e(("payment should be in " + r)), if ((F.payments[0].amount > 0))
8183 then true
8284 else "payment amount should be greater than 0"]
83- if ((F == F))
85+ if ((G == G))
8486 then {
85- let G = E.payments[0].amount
86- let H = fraction(G, c, C())
87- let I = s(l)
88- let J = valueOrElse(getInteger(this, n(l)), 0)
89- let K = (o + H)
90- let L = (p + G)
91- let M = (I + H)
92- let N = (J + G)
93- let O = if ((o == 0))
94- then [IntegerEntry(h, height)]
87+ let H = F.payments[0].amount
88+ let I = fraction(H, c, D())
89+ let J = t(m)
90+ let K = valueOrElse(getInteger(this, o(m)), 0)
91+ let L = (p + I)
92+ let M = (q + H)
93+ let N = (J + I)
94+ let O = (K + H)
95+ let P = if ((p == 0))
96+ then [IntegerEntry(i, height)]
9597 else nil
96- ([IntegerEntry(i, K), IntegerEntry(j, L), IntegerEntry(k(l), M), IntegerEntry(n(l), N)] ++ O)
98+ ([IntegerEntry(j, L), IntegerEntry(k, M), IntegerEntry(l(m), N), IntegerEntry(o(m), O)] ++ P)
9799 }
98100 else throw("Strict value is not equal to itself.")
99101 }
100102
101103
102-@Callable(E)
103-func setEmissionPerBlock (u) = {
104- let P = [if ((E.caller == this))
104+@Callable(F)
105+func setEmissionPerBlock (v) = {
106+ let Q = [if ((F.caller == this))
105107 then true
106- else d("permission denied")]
107- if ((P == P))
108- then [IntegerEntry(j, x()), IntegerEntry(h, height), IntegerEntry(g, max([0, u]))]
108+ else e("permission denied")]
109+ if ((Q == Q))
110+ then [IntegerEntry(k, y()), IntegerEntry(i, height), IntegerEntry(h, max([0, v]))]
109111 else throw("Strict value is not equal to itself.")
110112 }
111113
112114
113115
114-@Callable(E)
115-func stake () = D(E, toString(E.caller))
116+@Callable(F)
117+func stake () = E(F, toString(F.caller))
116118
117119
118120
119-@Callable(E)
120-func stakeFor (l) = D(E, l)
121+@Callable(F)
122+func stakeFor (m) = {
123+ let Q = [if ((size(fromBase58String(m)) == d))
124+ then true
125+ else e("address is not valid")]
126+ if ((Q == Q))
127+ then E(F, m)
128+ else throw("Strict value is not equal to itself.")
129+ }
121130
122131
123132
124-@Callable(E)
125-func withdraw (Q) = {
126- let l = toString(E.caller)
127- let I = s(l)
128- let P = [if ((Q > 0))
133+@Callable(F)
134+func withdraw (R) = {
135+ let m = toString(F.caller)
136+ let J = t(m)
137+ let Q = [if ((R > 0))
129138 then true
130- else d("amount should be more than 0"), if ((I >= Q))
139+ else e("amount should be more than 0"), if ((J >= R))
131140 then true
132- else d((("cannot withdraw more than available (" + toString(I)) + ")"))]
133- if ((P == P))
141+ else e((("cannot withdraw more than available (" + toString(J)) + ")"))]
142+ if ((Q == Q))
134143 then {
135- let M = (I - Q)
136- let R = fraction(Q, C(), c)
137- let K = (o - Q)
138- let L = fraction(K, C(), c)
139- let S = valueOrElse(getInteger(this, m(l)), 0)
140- let T = (S + R)
141-[IntegerEntry(i, K), IntegerEntry(j, L), IntegerEntry(k(l), M), IntegerEntry(m(l), T), IntegerEntry(h, height), ScriptTransfer(E.caller, R, r)]
144+ let N = (J - R)
145+ let S = fraction(R, D(), c)
146+ let L = (p - R)
147+ let M = fraction(L, D(), c)
148+ let T = valueOrElse(getInteger(this, n(m)), 0)
149+ let U = (T + S)
150+[IntegerEntry(j, L), IntegerEntry(k, M), IntegerEntry(l(m), N), IntegerEntry(n(m), U), IntegerEntry(i, height), ScriptTransfer(F.caller, S, s)]
142151 }
143152 else throw("Strict value is not equal to itself.")
144153 }
145154
146155
147156
148-@Callable(E)
149-func getUserAssetsREADONLY (l) = {
150- let I = s(l)
151- let U = fraction(I, C(), c)
152- $Tuple2(nil, $Tuple3(I, U, C()))
157+@Callable(F)
158+func getUserAssetsREADONLY (m) = {
159+ let J = t(m)
160+ let V = fraction(J, D(), c)
161+ $Tuple2(nil, $Tuple3(J, V, D()))
153162 }
154163
155164
156165
157-@Callable(E)
158-func getTotalAssetsREADONLY () = $Tuple2(nil, $Tuple3(o, x(), C()))
166+@Callable(F)
167+func getTotalAssetsREADONLY () = $Tuple2(nil, $Tuple3(p, y(), D()))
159168
160169
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "mrt_staking.ride"
55
66 let b = "__"
77
88 let c = 100000000
99
10-func d (e) = throw(((a + ": ") + e))
10+let d = 26
11+
12+func e (f) = throw(((a + ": ") + f))
1113
1214
13-let f = makeString(["%s", "assetId"], b)
15+let g = makeString(["%s", "assetId"], b)
1416
15-let g = makeString(["%s", "emissionPerBlock"], b)
17+let h = makeString(["%s", "emissionPerBlock"], b)
1618
17-let h = makeString(["%s", "startBlock"], b)
19+let i = makeString(["%s", "startBlock"], b)
1820
19-let i = makeString(["%s", "totalLpAmount"], b)
21+let j = makeString(["%s", "totalLpAmount"], b)
2022
21-let j = makeString(["%s", "totalAssetAmount"], b)
23+let k = makeString(["%s", "totalAssetAmount"], b)
2224
23-func k (l) = makeString(["%s%s", "userLpAmount", l], b)
25+func l (m) = makeString(["%s%s", "userLpAmount", m], b)
2426
2527
26-func m (l) = makeString(["%s%s", "totalAssetWithdrawn", l], b)
28+func n (m) = makeString(["%s%s", "totalAssetWithdrawn", m], b)
2729
2830
29-func n (l) = makeString(["%s%s", "totalAssetStaked", l], b)
31+func o (m) = makeString(["%s%s", "totalAssetStaked", m], b)
3032
31-
32-let o = valueOrElse(getInteger(this, i), 0)
3333
3434 let p = valueOrElse(getInteger(this, j), 0)
3535
36-let q = valueOrElse(getString(this, f), "WAVES")
36+let q = valueOrElse(getInteger(this, k), 0)
3737
38-let r = if ((q == "WAVES"))
38+let r = valueOrElse(getString(this, g), "WAVES")
39+
40+let s = if ((r == "WAVES"))
3941 then unit
40- else fromBase58String(q)
42+ else fromBase58String(r)
4143
42-func s (l) = valueOrElse(getInteger(this, k(l)), 0)
44+func t (m) = valueOrElse(getInteger(this, l(m)), 0)
4345
4446
45-func t () = {
46- let u = valueOrElse(getInteger(this, g), 0)
47+func u () = {
4748 let v = valueOrElse(getInteger(this, h), 0)
48- let w = (height - v)
49- max([0, (u * w)])
49+ let w = valueOrElse(getInteger(this, i), 0)
50+ let x = (height - w)
51+ max([0, (v * x)])
5052 }
5153
5254
53-func x () = {
54- let y = (p + t())
55- let z = r
56- if ($isInstanceOf(z, "Unit"))
55+func y () = {
56+ let z = (q + u())
57+ let A = s
58+ if ($isInstanceOf(A, "Unit"))
5759 then {
58- let A = z
59- min([y, wavesBalance(this).available])
60+ let B = A
61+ min([z, wavesBalance(this).available])
6062 }
61- else if ($isInstanceOf(z, "ByteVector"))
63+ else if ($isInstanceOf(A, "ByteVector"))
6264 then {
63- let B = z
64- min([y, assetBalance(this, B)])
65+ let C = A
66+ min([z, assetBalance(this, C)])
6567 }
6668 else throw("Match error")
6769 }
6870
6971
70-func C () = if ((o != 0))
71- then fraction(x(), c, o)
72+func D () = if ((p != 0))
73+ then fraction(y(), c, p)
7274 else (1 * c)
7375
7476
75-func D (E,l) = {
76- let F = [if ((size(E.payments) == 1))
77+func E (F,m) = {
78+ let G = [if ((size(F.payments) == 1))
7779 then true
78- else d("should include 1 payment"), if ((E.payments[0].assetId == r))
80+ else e("should include 1 payment"), if ((F.payments[0].assetId == s))
7981 then true
80- else d(("payment should be in " + q)), if ((E.payments[0].amount > 0))
82+ else e(("payment should be in " + r)), if ((F.payments[0].amount > 0))
8183 then true
8284 else "payment amount should be greater than 0"]
83- if ((F == F))
85+ if ((G == G))
8486 then {
85- let G = E.payments[0].amount
86- let H = fraction(G, c, C())
87- let I = s(l)
88- let J = valueOrElse(getInteger(this, n(l)), 0)
89- let K = (o + H)
90- let L = (p + G)
91- let M = (I + H)
92- let N = (J + G)
93- let O = if ((o == 0))
94- then [IntegerEntry(h, height)]
87+ let H = F.payments[0].amount
88+ let I = fraction(H, c, D())
89+ let J = t(m)
90+ let K = valueOrElse(getInteger(this, o(m)), 0)
91+ let L = (p + I)
92+ let M = (q + H)
93+ let N = (J + I)
94+ let O = (K + H)
95+ let P = if ((p == 0))
96+ then [IntegerEntry(i, height)]
9597 else nil
96- ([IntegerEntry(i, K), IntegerEntry(j, L), IntegerEntry(k(l), M), IntegerEntry(n(l), N)] ++ O)
98+ ([IntegerEntry(j, L), IntegerEntry(k, M), IntegerEntry(l(m), N), IntegerEntry(o(m), O)] ++ P)
9799 }
98100 else throw("Strict value is not equal to itself.")
99101 }
100102
101103
102-@Callable(E)
103-func setEmissionPerBlock (u) = {
104- let P = [if ((E.caller == this))
104+@Callable(F)
105+func setEmissionPerBlock (v) = {
106+ let Q = [if ((F.caller == this))
105107 then true
106- else d("permission denied")]
107- if ((P == P))
108- then [IntegerEntry(j, x()), IntegerEntry(h, height), IntegerEntry(g, max([0, u]))]
108+ else e("permission denied")]
109+ if ((Q == Q))
110+ then [IntegerEntry(k, y()), IntegerEntry(i, height), IntegerEntry(h, max([0, v]))]
109111 else throw("Strict value is not equal to itself.")
110112 }
111113
112114
113115
114-@Callable(E)
115-func stake () = D(E, toString(E.caller))
116+@Callable(F)
117+func stake () = E(F, toString(F.caller))
116118
117119
118120
119-@Callable(E)
120-func stakeFor (l) = D(E, l)
121+@Callable(F)
122+func stakeFor (m) = {
123+ let Q = [if ((size(fromBase58String(m)) == d))
124+ then true
125+ else e("address is not valid")]
126+ if ((Q == Q))
127+ then E(F, m)
128+ else throw("Strict value is not equal to itself.")
129+ }
121130
122131
123132
124-@Callable(E)
125-func withdraw (Q) = {
126- let l = toString(E.caller)
127- let I = s(l)
128- let P = [if ((Q > 0))
133+@Callable(F)
134+func withdraw (R) = {
135+ let m = toString(F.caller)
136+ let J = t(m)
137+ let Q = [if ((R > 0))
129138 then true
130- else d("amount should be more than 0"), if ((I >= Q))
139+ else e("amount should be more than 0"), if ((J >= R))
131140 then true
132- else d((("cannot withdraw more than available (" + toString(I)) + ")"))]
133- if ((P == P))
141+ else e((("cannot withdraw more than available (" + toString(J)) + ")"))]
142+ if ((Q == Q))
134143 then {
135- let M = (I - Q)
136- let R = fraction(Q, C(), c)
137- let K = (o - Q)
138- let L = fraction(K, C(), c)
139- let S = valueOrElse(getInteger(this, m(l)), 0)
140- let T = (S + R)
141-[IntegerEntry(i, K), IntegerEntry(j, L), IntegerEntry(k(l), M), IntegerEntry(m(l), T), IntegerEntry(h, height), ScriptTransfer(E.caller, R, r)]
144+ let N = (J - R)
145+ let S = fraction(R, D(), c)
146+ let L = (p - R)
147+ let M = fraction(L, D(), c)
148+ let T = valueOrElse(getInteger(this, n(m)), 0)
149+ let U = (T + S)
150+[IntegerEntry(j, L), IntegerEntry(k, M), IntegerEntry(l(m), N), IntegerEntry(n(m), U), IntegerEntry(i, height), ScriptTransfer(F.caller, S, s)]
142151 }
143152 else throw("Strict value is not equal to itself.")
144153 }
145154
146155
147156
148-@Callable(E)
149-func getUserAssetsREADONLY (l) = {
150- let I = s(l)
151- let U = fraction(I, C(), c)
152- $Tuple2(nil, $Tuple3(I, U, C()))
157+@Callable(F)
158+func getUserAssetsREADONLY (m) = {
159+ let J = t(m)
160+ let V = fraction(J, D(), c)
161+ $Tuple2(nil, $Tuple3(J, V, D()))
153162 }
154163
155164
156165
157-@Callable(E)
158-func getTotalAssetsREADONLY () = $Tuple2(nil, $Tuple3(o, x(), C()))
166+@Callable(F)
167+func getTotalAssetsREADONLY () = $Tuple2(nil, $Tuple3(p, y(), D()))
159168
160169

github/deemru/w8io/169f3d6 
59.46 ms