tx · 9afHXwHh2UxoJQFxqLuw6zqfYFiaKnxC7Q9DZj31CpK9

3MpMuGN8rW9EpPwzETAQz88Pe9TQhSwiriq:  -0.01000000 Waves

2023.07.19 12:27 [2672562] smart account 3MpMuGN8rW9EpPwzETAQz88Pe9TQhSwiriq > SELF 0.00000000 Waves

{ "type": 13, "id": "9afHXwHh2UxoJQFxqLuw6zqfYFiaKnxC7Q9DZj31CpK9", "fee": 1000000, "feeAssetId": null, "timestamp": 1689758900243, "version": 2, "chainId": 84, "sender": "3MpMuGN8rW9EpPwzETAQz88Pe9TQhSwiriq", "senderPublicKey": "57SkjQUEwC1ayCqLbXLuzBqifK6B6SR6rfxtGsbAo3zW", "proofs": [ "2Qx9FFi4xCi5Xbx2xFNGDiPUCr31f6RXTbCwDMPKYD3aayV7mKQYjsLmhDiMfYzBi7cSN7d9MNo8gEx2kVEnV6it" ], "script": "base64:BgIaCAISAwoBARIAEgMKAQgSAwoBARIDCgEIEgAVAAxjb250cmFjdEZpbGUCEG1ydF9zdGFraW5nLnJpZGUAA1NFUAICX18ABnNjYWxlOACAwtcvAQh0aHJvd0VycgEDbXNnCQACAQkArAICCQCsAgIFDGNvbnRyYWN0RmlsZQICOiAFA21zZwAKa2V5QXNzZXRJZAkAuQkCCQDMCAICAiVzCQDMCAICB2Fzc2V0SWQFA25pbAUDU0VQABNrZXlFbWlzc2lvblBlckJsb2NrCQC5CQIJAMwIAgICJXMJAMwIAgIQZW1pc3Npb25QZXJCbG9jawUDbmlsBQNTRVAADWtleVN0YXJ0QmxvY2sJALkJAgkAzAgCAgIlcwkAzAgCAgpzdGFydEJsb2NrBQNuaWwFA1NFUAAQa2V5VG90YWxMcEFtb3VudAkAuQkCCQDMCAICAiVzCQDMCAICDXRvdGFsTHBBbW91bnQFA25pbAUDU0VQABNrZXlUb3RhbEFzc2V0QW1vdW50CQC5CQIJAMwIAgICJXMJAMwIAgIQdG90YWxBc3NldEFtb3VudAUDbmlsBQNTRVABD2tleVVzZXJMcEF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AzAgCCQEMSW50ZWdlckVudHJ5AgkBD2tleVVzZXJMcEFtb3VudAEFC3VzZXJBZGRyZXNzBQ9uZXdVc2VyTHBBbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQIJARprZXlVc2VyVG90YWxBc3NldFdpdGhkcmF3bgEFC3VzZXJBZGRyZXNzBRpuZXdVc2VyVG90YWxBc3NldFdpdGhkcmF3bgkAzAgCCQEMSW50ZWdlckVudHJ5AgUNa2V5U3RhcnRCbG9jawUGaGVpZ2h0CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgUTd2l0aGRyYXdBc3NldEFtb3VudAUMYXNzZXRJZEJ5dGVzBQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BaQEVZ2V0VXNlckFzc2V0c1JFQURPTkxZAQt1c2VyQWRkcmVzcwQMdXNlckxwQW1vdW50CQEPZ2V0VXNlckxwQW1vdW50AQULdXNlckFkZHJlc3MEHHVzZXJBdmFpbGFibGVBc3NldFRvV2l0aGRyYXcJAGsDBQx1c2VyTHBBbW91bnQJAQ9nZXRDdXJyZW50UHJpY2UABQZzY2FsZTgJAJQKAgUDbmlsCQCVCgMFDHVzZXJMcEFtb3VudAUcdXNlckF2YWlsYWJsZUFzc2V0VG9XaXRoZHJhdwkBD2dldEN1cnJlbnRQcmljZQABaQEWZ2V0VG90YWxBc3NldHNSRUFET05MWQAJAJQKAgUDbmlsCQCVCgMFDXRvdGFsTHBBbW91bnQJAStnZXRUb3RhbEFzc2V0QW1vdW50V2l0aFByb2ZpdE9yTWF4QXZhaWxhYmxlAAkBD2dldEN1cnJlbnRQcmljZQAABHKXbA==", "height": 2672562, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6MqgmCdbvrGRDpGhqPsXLMXtpdFF6pEjrJrSbCVDvqxq Next: BrkV6ZnB28fo3AMKbuDLP5GHPgzyrbBBVsRxAjqjnbJw Diff:
OldNewDifferences
125125 func withdraw (Q) = {
126126 let l = toString(E.caller)
127127 let I = s(l)
128- let P = [if ((I >= Q))
128+ let P = [if ((Q > 0))
129+ then true
130+ else d("amount should be more than 0"), if ((I >= Q))
129131 then true
130132 else d((("cannot withdraw more than available (" + toString(I)) + ")"))]
131133 if ((P == P))
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 func d (e) = throw(((a + ": ") + e))
1111
1212
1313 let f = makeString(["%s", "assetId"], b)
1414
1515 let g = makeString(["%s", "emissionPerBlock"], b)
1616
1717 let h = makeString(["%s", "startBlock"], b)
1818
1919 let i = makeString(["%s", "totalLpAmount"], b)
2020
2121 let j = makeString(["%s", "totalAssetAmount"], b)
2222
2323 func k (l) = makeString(["%s%s", "userLpAmount", l], b)
2424
2525
2626 func m (l) = makeString(["%s%s", "totalAssetWithdrawn", l], b)
2727
2828
2929 func n (l) = makeString(["%s%s", "totalAssetStaked", l], b)
3030
3131
3232 let o = valueOrElse(getInteger(this, i), 0)
3333
3434 let p = valueOrElse(getInteger(this, j), 0)
3535
3636 let q = valueOrElse(getString(this, f), "WAVES")
3737
3838 let r = if ((q == "WAVES"))
3939 then unit
4040 else fromBase58String(q)
4141
4242 func s (l) = valueOrElse(getInteger(this, k(l)), 0)
4343
4444
4545 func t () = {
4646 let u = valueOrElse(getInteger(this, g), 0)
4747 let v = valueOrElse(getInteger(this, h), 0)
4848 let w = (height - v)
4949 max([0, (u * w)])
5050 }
5151
5252
5353 func x () = {
5454 let y = (p + t())
5555 let z = r
5656 if ($isInstanceOf(z, "Unit"))
5757 then {
5858 let A = z
5959 min([y, wavesBalance(this).available])
6060 }
6161 else if ($isInstanceOf(z, "ByteVector"))
6262 then {
6363 let B = z
6464 min([y, assetBalance(this, B)])
6565 }
6666 else throw("Match error")
6767 }
6868
6969
7070 func C () = if ((o != 0))
7171 then fraction(x(), c, o)
7272 else (1 * c)
7373
7474
7575 func D (E,l) = {
7676 let F = [if ((size(E.payments) == 1))
7777 then true
7878 else d("should include 1 payment"), if ((E.payments[0].assetId == r))
7979 then true
8080 else d(("payment should be in " + q)), if ((E.payments[0].amount > 0))
8181 then true
8282 else "payment amount should be greater than 0"]
8383 if ((F == F))
8484 then {
8585 let G = E.payments[0].amount
8686 let H = fraction(G, c, C())
8787 let I = s(l)
8888 let J = valueOrElse(getInteger(this, n(l)), 0)
8989 let K = (o + H)
9090 let L = (p + G)
9191 let M = (I + H)
9292 let N = (J + G)
9393 let O = if ((o == 0))
9494 then [IntegerEntry(h, height)]
9595 else nil
9696 ([IntegerEntry(i, K), IntegerEntry(j, L), IntegerEntry(k(l), M), IntegerEntry(n(l), N)] ++ O)
9797 }
9898 else throw("Strict value is not equal to itself.")
9999 }
100100
101101
102102 @Callable(E)
103103 func setEmissionPerBlock (u) = {
104104 let P = [if ((E.caller == this))
105105 then true
106106 else d("permission denied")]
107107 if ((P == P))
108108 then [IntegerEntry(j, x()), IntegerEntry(h, height), IntegerEntry(g, max([0, u]))]
109109 else throw("Strict value is not equal to itself.")
110110 }
111111
112112
113113
114114 @Callable(E)
115115 func stake () = D(E, toString(E.caller))
116116
117117
118118
119119 @Callable(E)
120120 func stakeFor (l) = D(E, l)
121121
122122
123123
124124 @Callable(E)
125125 func withdraw (Q) = {
126126 let l = toString(E.caller)
127127 let I = s(l)
128- let P = [if ((I >= Q))
128+ let P = [if ((Q > 0))
129+ then true
130+ else d("amount should be more than 0"), if ((I >= Q))
129131 then true
130132 else d((("cannot withdraw more than available (" + toString(I)) + ")"))]
131133 if ((P == P))
132134 then {
133135 let M = (I - Q)
134136 let R = fraction(Q, C(), c)
135137 let K = (o - Q)
136138 let L = fraction(K, C(), c)
137139 let S = valueOrElse(getInteger(this, m(l)), 0)
138140 let T = (S + R)
139141 [IntegerEntry(i, K), IntegerEntry(j, L), IntegerEntry(k(l), M), IntegerEntry(m(l), T), IntegerEntry(h, height), ScriptTransfer(E.caller, R, r)]
140142 }
141143 else throw("Strict value is not equal to itself.")
142144 }
143145
144146
145147
146148 @Callable(E)
147149 func getUserAssetsREADONLY (l) = {
148150 let I = s(l)
149151 let U = fraction(I, C(), c)
150152 $Tuple2(nil, $Tuple3(I, U, C()))
151153 }
152154
153155
154156
155157 @Callable(E)
156158 func getTotalAssetsREADONLY () = $Tuple2(nil, $Tuple3(o, x(), C()))
157159
158160

github/deemru/w8io/026f985 
40.77 ms