tx · 9VSJDAE3AHniSi75bSKhCVmtHkc9WfD5jg2kNLKT1KBf

3MpMuGN8rW9EpPwzETAQz88Pe9TQhSwiriq:  -0.01000000 Waves

2023.07.19 17:16 [2672850] smart account 3MpMuGN8rW9EpPwzETAQz88Pe9TQhSwiriq > SELF 0.00000000 Waves

{ "type": 13, "id": "9VSJDAE3AHniSi75bSKhCVmtHkc9WfD5jg2kNLKT1KBf", "fee": 1000000, "feeAssetId": null, "timestamp": 1689776256967, "version": 2, "chainId": 84, "sender": "3MpMuGN8rW9EpPwzETAQz88Pe9TQhSwiriq", "senderPublicKey": "57SkjQUEwC1ayCqLbXLuzBqifK6B6SR6rfxtGsbAo3zW", "proofs": [ "3dKGXXkJyYpt42MLsSvpKZgDuYHWagsiNkpda3M3j6ATJgCKrcyj3CLRmT3tq4zqdiVZN45NbG98T4eMdFurK6sa" ], "script": "base64:BgIaCAISAwoBARIAEgMKAQgSAwoBARIDCgEIEgAWAAxjb250cmFjdEZpbGUCEG1ydF9zdGFraW5nLnJpZGUAA1NFUAICX18ABnNjYWxlOACAwtcvABJBRERSRVNTX0JZVEVTX1NJWkUAGgEIdGhyb3dFcnIBA21zZwkAAgEJAKwCAgkArAICBQxjb250cmFjdEZpbGUCAjogBQNtc2cACmtleUFzc2V0SWQJALkJAgkAzAgCAgIlcwkAzAgCAgdhc3NldElkBQNuaWwFA1NFUAATa2V5RW1pc3Npb25QZXJCbG9jawkAuQkCCQDMCAICAiVzCQDMCAICEGVtaXNzaW9uUGVyQmxvY2sFA25pbAUDU0VQAA1rZXlTdGFydEJsb2NrCQC5CQIJAMwIAgICJXMJAMwIAgIKc3RhcnRCbG9jawUDbmlsBQNTRVAAEGtleVRvdGFsTHBBbW91bnQJALkJAgkAzAgCAgIlcwkAzAgCAg10b3RhbExwQW1vdW50BQNuaWwFA1NFUAATa2V5VG90YWxBc3NldEFtb3VudAkAuQkCCQDMCAICAiVzCQDMCAICEHRvdGFsQXNzZXRBbW91bnQFA25pbAUDU0V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AABBd1c2VyVG90YWxBc3NldFdpdGhkcmF3bgkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzCQEaa2V5VXNlclRvdGFsQXNzZXRXaXRoZHJhd24BBQt1c2VyQWRkcmVzcwAACQCUCgIFA25pbAkAlwoFBQx1c2VyTHBBbW91bnQFHHVzZXJBdmFpbGFibGVBc3NldFRvV2l0aGRyYXcJAQ9nZXRDdXJyZW50UHJpY2UABRV1c2VyVG90YWxTdGFrZWRBbW91bnQFF3VzZXJUb3RhbEFzc2V0V2l0aGRyYXduAWkBFmdldFRvdGFsQXNzZXRzUkVBRE9OTFkACQCUCgIFA25pbAkAlQoDBQ10b3RhbExwQW1vdW50CQErZ2V0VG90YWxBc3NldEFtb3VudFdpdGhQcm9maXRPck1heEF2YWlsYWJsZQAJAQ9nZXRDdXJyZW50UHJpY2UAAHZVUSA=", "height": 2672850, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BrkV6ZnB28fo3AMKbuDLP5GHPgzyrbBBVsRxAjqjnbJw Next: 8Fa8PH8xvgBTVuXa7AWViEpTjZ8rooSMzJf4SRfVELxi Diff:
OldNewDifferences
5454
5555 func y () = {
5656 let z = (q + u())
57- let A = s
58- if ($isInstanceOf(A, "Unit"))
59- then {
60- let B = A
61- min([z, wavesBalance(this).available])
62- }
63- else if ($isInstanceOf(A, "ByteVector"))
57+ let A = {
58+ let B = s
59+ if ($isInstanceOf(B, "Unit"))
6460 then {
65- let C = A
66- min([z, assetBalance(this, C)])
61+ let C = B
62+ min([z, wavesBalance(this).available])
6763 }
68- else throw("Match error")
64+ else if ($isInstanceOf(B, "ByteVector"))
65+ then {
66+ let D = B
67+ min([z, assetBalance(this, D)])
68+ }
69+ else throw("Match error")
70+ }
71+ if ((p == 0))
72+ then 0
73+ else A
6974 }
7075
7176
72-func D () = if ((p != 0))
77+func E () = if ((p != 0))
7378 then fraction(y(), c, p)
7479 else (1 * c)
7580
7681
77-func E (F,m) = {
78- let G = [if ((size(F.payments) == 1))
82+func F (G,m) = {
83+ let H = [if ((size(G.payments) == 1))
7984 then true
80- else e("should include 1 payment"), if ((F.payments[0].assetId == s))
85+ else e("should include 1 payment"), if ((G.payments[0].assetId == s))
8186 then true
82- else e(("payment should be in " + r)), if ((F.payments[0].amount > 0))
87+ else e(("payment should be in " + r)), if ((G.payments[0].amount > 0))
8388 then true
8489 else "payment amount should be greater than 0"]
85- if ((G == G))
90+ if ((H == H))
8691 then {
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))
92+ let I = G.payments[0].amount
93+ let J = fraction(I, c, E())
94+ let K = t(m)
95+ let L = valueOrElse(getInteger(this, o(m)), 0)
96+ let M = (p + J)
97+ let N = (q + I)
98+ let O = (K + J)
99+ let P = (L + I)
100+ let Q = if ((p == 0))
96101 then [IntegerEntry(i, height)]
97102 else nil
98- ([IntegerEntry(j, L), IntegerEntry(k, M), IntegerEntry(l(m), N), IntegerEntry(o(m), O)] ++ P)
103+ ([IntegerEntry(j, M), IntegerEntry(k, N), IntegerEntry(l(m), O), IntegerEntry(o(m), P)] ++ Q)
99104 }
100105 else throw("Strict value is not equal to itself.")
101106 }
102107
103108
104-@Callable(F)
109+@Callable(G)
105110 func setEmissionPerBlock (v) = {
106- let Q = [if ((F.caller == this))
111+ let R = [if ((G.caller == this))
107112 then true
108113 else e("permission denied")]
109- if ((Q == Q))
114+ if ((R == R))
110115 then [IntegerEntry(k, y()), IntegerEntry(i, height), IntegerEntry(h, max([0, v]))]
111116 else throw("Strict value is not equal to itself.")
112117 }
113118
114119
115120
116-@Callable(F)
117-func stake () = E(F, toString(F.caller))
121+@Callable(G)
122+func stake () = F(G, toString(G.caller))
118123
119124
120125
121-@Callable(F)
126+@Callable(G)
122127 func stakeFor (m) = {
123- let Q = [if ((size(fromBase58String(m)) == d))
128+ let R = [if ((size(fromBase58String(m)) == d))
124129 then true
125130 else e("address is not valid")]
126- if ((Q == Q))
127- then E(F, m)
131+ if ((R == R))
132+ then F(G, m)
128133 else throw("Strict value is not equal to itself.")
129134 }
130135
131136
132137
133-@Callable(F)
134-func withdraw (R) = {
135- let m = toString(F.caller)
136- let J = t(m)
137- let Q = [if ((R > 0))
138+@Callable(G)
139+func withdraw (S) = {
140+ let m = toString(G.caller)
141+ let K = t(m)
142+ let R = [if ((S > 0))
138143 then true
139- else e("amount should be more than 0"), if ((J >= R))
144+ else e("amount should be more than 0"), if ((K >= S))
140145 then true
141- else e((("cannot withdraw more than available (" + toString(J)) + ")"))]
142- if ((Q == Q))
146+ else e((("cannot withdraw more than available (" + toString(K)) + ")"))]
147+ if ((R == R))
143148 then {
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)]
149+ let O = (K - S)
150+ let T = fraction(S, E(), c)
151+ let M = (p - S)
152+ let N = fraction(M, E(), c)
153+ let U = valueOrElse(getInteger(this, n(m)), 0)
154+ let V = (U + T)
155+[IntegerEntry(j, M), IntegerEntry(k, N), IntegerEntry(l(m), O), IntegerEntry(n(m), V), IntegerEntry(i, height), ScriptTransfer(G.caller, T, s)]
151156 }
152157 else throw("Strict value is not equal to itself.")
153158 }
154159
155160
156161
157-@Callable(F)
162+@Callable(G)
158163 func getUserAssetsREADONLY (m) = {
159- let J = t(m)
160- let V = fraction(J, D(), c)
161- $Tuple2(nil, $Tuple3(J, V, D()))
164+ let K = t(m)
165+ let W = fraction(K, E(), c)
166+ let L = valueOrElse(getInteger(this, o(m)), 0)
167+ let U = valueOrElse(getInteger(this, n(m)), 0)
168+ $Tuple2(nil, $Tuple5(K, W, E(), L, U))
162169 }
163170
164171
165172
166-@Callable(F)
167-func getTotalAssetsREADONLY () = $Tuple2(nil, $Tuple3(p, y(), D()))
173+@Callable(G)
174+func getTotalAssetsREADONLY () = $Tuple2(nil, $Tuple3(p, y(), E()))
168175
169176
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
1010 let d = 26
1111
1212 func e (f) = throw(((a + ": ") + f))
1313
1414
1515 let g = makeString(["%s", "assetId"], b)
1616
1717 let h = makeString(["%s", "emissionPerBlock"], b)
1818
1919 let i = makeString(["%s", "startBlock"], b)
2020
2121 let j = makeString(["%s", "totalLpAmount"], b)
2222
2323 let k = makeString(["%s", "totalAssetAmount"], b)
2424
2525 func l (m) = makeString(["%s%s", "userLpAmount", m], b)
2626
2727
2828 func n (m) = makeString(["%s%s", "totalAssetWithdrawn", m], b)
2929
3030
3131 func o (m) = makeString(["%s%s", "totalAssetStaked", m], b)
3232
3333
3434 let p = valueOrElse(getInteger(this, j), 0)
3535
3636 let q = valueOrElse(getInteger(this, k), 0)
3737
3838 let r = valueOrElse(getString(this, g), "WAVES")
3939
4040 let s = if ((r == "WAVES"))
4141 then unit
4242 else fromBase58String(r)
4343
4444 func t (m) = valueOrElse(getInteger(this, l(m)), 0)
4545
4646
4747 func u () = {
4848 let v = valueOrElse(getInteger(this, h), 0)
4949 let w = valueOrElse(getInteger(this, i), 0)
5050 let x = (height - w)
5151 max([0, (v * x)])
5252 }
5353
5454
5555 func y () = {
5656 let z = (q + u())
57- let A = s
58- if ($isInstanceOf(A, "Unit"))
59- then {
60- let B = A
61- min([z, wavesBalance(this).available])
62- }
63- else if ($isInstanceOf(A, "ByteVector"))
57+ let A = {
58+ let B = s
59+ if ($isInstanceOf(B, "Unit"))
6460 then {
65- let C = A
66- min([z, assetBalance(this, C)])
61+ let C = B
62+ min([z, wavesBalance(this).available])
6763 }
68- else throw("Match error")
64+ else if ($isInstanceOf(B, "ByteVector"))
65+ then {
66+ let D = B
67+ min([z, assetBalance(this, D)])
68+ }
69+ else throw("Match error")
70+ }
71+ if ((p == 0))
72+ then 0
73+ else A
6974 }
7075
7176
72-func D () = if ((p != 0))
77+func E () = if ((p != 0))
7378 then fraction(y(), c, p)
7479 else (1 * c)
7580
7681
77-func E (F,m) = {
78- let G = [if ((size(F.payments) == 1))
82+func F (G,m) = {
83+ let H = [if ((size(G.payments) == 1))
7984 then true
80- else e("should include 1 payment"), if ((F.payments[0].assetId == s))
85+ else e("should include 1 payment"), if ((G.payments[0].assetId == s))
8186 then true
82- else e(("payment should be in " + r)), if ((F.payments[0].amount > 0))
87+ else e(("payment should be in " + r)), if ((G.payments[0].amount > 0))
8388 then true
8489 else "payment amount should be greater than 0"]
85- if ((G == G))
90+ if ((H == H))
8691 then {
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))
92+ let I = G.payments[0].amount
93+ let J = fraction(I, c, E())
94+ let K = t(m)
95+ let L = valueOrElse(getInteger(this, o(m)), 0)
96+ let M = (p + J)
97+ let N = (q + I)
98+ let O = (K + J)
99+ let P = (L + I)
100+ let Q = if ((p == 0))
96101 then [IntegerEntry(i, height)]
97102 else nil
98- ([IntegerEntry(j, L), IntegerEntry(k, M), IntegerEntry(l(m), N), IntegerEntry(o(m), O)] ++ P)
103+ ([IntegerEntry(j, M), IntegerEntry(k, N), IntegerEntry(l(m), O), IntegerEntry(o(m), P)] ++ Q)
99104 }
100105 else throw("Strict value is not equal to itself.")
101106 }
102107
103108
104-@Callable(F)
109+@Callable(G)
105110 func setEmissionPerBlock (v) = {
106- let Q = [if ((F.caller == this))
111+ let R = [if ((G.caller == this))
107112 then true
108113 else e("permission denied")]
109- if ((Q == Q))
114+ if ((R == R))
110115 then [IntegerEntry(k, y()), IntegerEntry(i, height), IntegerEntry(h, max([0, v]))]
111116 else throw("Strict value is not equal to itself.")
112117 }
113118
114119
115120
116-@Callable(F)
117-func stake () = E(F, toString(F.caller))
121+@Callable(G)
122+func stake () = F(G, toString(G.caller))
118123
119124
120125
121-@Callable(F)
126+@Callable(G)
122127 func stakeFor (m) = {
123- let Q = [if ((size(fromBase58String(m)) == d))
128+ let R = [if ((size(fromBase58String(m)) == d))
124129 then true
125130 else e("address is not valid")]
126- if ((Q == Q))
127- then E(F, m)
131+ if ((R == R))
132+ then F(G, m)
128133 else throw("Strict value is not equal to itself.")
129134 }
130135
131136
132137
133-@Callable(F)
134-func withdraw (R) = {
135- let m = toString(F.caller)
136- let J = t(m)
137- let Q = [if ((R > 0))
138+@Callable(G)
139+func withdraw (S) = {
140+ let m = toString(G.caller)
141+ let K = t(m)
142+ let R = [if ((S > 0))
138143 then true
139- else e("amount should be more than 0"), if ((J >= R))
144+ else e("amount should be more than 0"), if ((K >= S))
140145 then true
141- else e((("cannot withdraw more than available (" + toString(J)) + ")"))]
142- if ((Q == Q))
146+ else e((("cannot withdraw more than available (" + toString(K)) + ")"))]
147+ if ((R == R))
143148 then {
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)]
149+ let O = (K - S)
150+ let T = fraction(S, E(), c)
151+ let M = (p - S)
152+ let N = fraction(M, E(), c)
153+ let U = valueOrElse(getInteger(this, n(m)), 0)
154+ let V = (U + T)
155+[IntegerEntry(j, M), IntegerEntry(k, N), IntegerEntry(l(m), O), IntegerEntry(n(m), V), IntegerEntry(i, height), ScriptTransfer(G.caller, T, s)]
151156 }
152157 else throw("Strict value is not equal to itself.")
153158 }
154159
155160
156161
157-@Callable(F)
162+@Callable(G)
158163 func getUserAssetsREADONLY (m) = {
159- let J = t(m)
160- let V = fraction(J, D(), c)
161- $Tuple2(nil, $Tuple3(J, V, D()))
164+ let K = t(m)
165+ let W = fraction(K, E(), c)
166+ let L = valueOrElse(getInteger(this, o(m)), 0)
167+ let U = valueOrElse(getInteger(this, n(m)), 0)
168+ $Tuple2(nil, $Tuple5(K, W, E(), L, U))
162169 }
163170
164171
165172
166-@Callable(F)
167-func getTotalAssetsREADONLY () = $Tuple2(nil, $Tuple3(p, y(), D()))
173+@Callable(G)
174+func getTotalAssetsREADONLY () = $Tuple2(nil, $Tuple3(p, y(), E()))
168175
169176

github/deemru/w8io/026f985 
48.79 ms