tx · 4CuLC9CLa76mqGzE5JGsAFmXKDGJf9Xr6ThwyGB3G6V5

3MwLW8P5yh5T2xML9QqFuVxkVkm9RXqnzXh:  -0.00900000 Waves

2022.12.01 22:21 [2341679] smart account 3MwLW8P5yh5T2xML9QqFuVxkVkm9RXqnzXh > SELF 0.00000000 Waves

{ "type": 13, "id": "4CuLC9CLa76mqGzE5JGsAFmXKDGJf9Xr6ThwyGB3G6V5", "fee": 900000, "feeAssetId": null, "timestamp": 1669922581119, "version": 2, "chainId": 84, "sender": "3MwLW8P5yh5T2xML9QqFuVxkVkm9RXqnzXh", "senderPublicKey": "HscGVyJG5M3NMHWKfQbucCBsFLGPi8VmTxTAmcBbaWTa", "proofs": [ "2yPrkrnBkyuKMBgLVRSDMLX1XAxW3M1dzqDPHeA49249Nfnsd1GRhAiMeirvx8XXr2WdokACTDJqLaDV7jgbFpw2" ], "script": "base64:BgITCAISAwoBCBIDCgEIEgASAwoBARMABlNjYWxlNgDAhD0ABlNjYWxlOACAwtcvAAdTY2FsZTE2CQBoAgUGU2NhbGU4BQZTY2FsZTgACnZhbGlkYXRvcnMJAMwIAgIjM05BbXFHanhSQlJQb1JIWlVVcXZoaU5TNmF4bkdwaW5MSEMFA25pbAAHYXNzZXRJZAIsSEhtYUZRcFVvYndLeHpqejRFQ2FCUHRvRjY5a3VqS3dVMmNvemFVelRzZ3YAC3B1enpsZVBvb2xzCQDMCAICIzNONlN0SmRnbVRmQVJzUk5uOVh0NXJEWUVzM3ByNEtHeTF2BQNuaWwBCmdldEJhbGFuY2UBB2Fzc2V0SWQEByRtYXRjaDAFB2Fzc2V0SWQDCQABAgUHJG1hdGNoMAIEVW5pdAQBeAUHJG1hdGNoMAgJAO8HAQUEdGhpcwlhdmFpbGFibGUJAPAHAgUEdGhpcwkBBXZhbHVlAQUHYXNzZXRJZAEJdHJ5R2V0SW50AgdhZGRyZXNzA2tleQQHJG1hdGNoMAkAmggCBQdhZGRyZXNzBQNrZXkDCQABAgUHJG1hdGN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mVudFBvb2wCAAkAAgECFFBvb2wgbm90IGluaXRpYWxpemVkCQDOCAIJAQtzdGFrZVJlc3VsdAIFBHVzZXIFBmFtb3VudAkBDHN1cHBseVJlc3VsdAEFC2N1cnJlbnRQb29sAWkBB3Vuc3Rha2UBBmFtb3VudAQEdXNlcgkApQgBCAUBaQZjYWxsZXIEC2N1cnJlbnRQb29sCQEJdHJ5R2V0U3RyAgUEdGhpcwILY3VycmVudFBvb2wEAnR4CQEWd2l0aGRyYXdGcm9tUHV6emxlUG9vbAIFC2N1cnJlbnRQb29sBQZhbW91bnQDCQAAAgUCdHgFAnR4CQDOCAIJAQ11bnN0YWtlUmVzdWx0AgUEdXNlcgUGYW1vdW50CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgUGYW1vdW50CQDZBAEFB2Fzc2V0SWQFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXlkpqDV", "height": 2341679, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ALUPCoxYdG6XSME6xfy1pfkNe8T9vpxsPtZUjpVU1rwz Next: ChtSv1AseKpKtu36yP5ZvmQnnUXbfv1EekzVwjGGh36e Diff:
OldNewDifferences
100100 func D (E) = {
101101 let A = j(this, "global_staked")
102102 let C = y()
103-[IntegerEntry("global_staked", (A + E)), IntegerEntry("global_lastCheckSRate", C), IntegerEntry("global_lastCheckSRateHeight", height)]
103+[IntegerEntry("global_staked", (A + E)), IntegerEntry("global_lastCheckSRate", C)]
104104 }
105105
106106
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = 1000000
55
66 let b = 100000000
77
88 let c = (b * b)
99
1010 let d = ["3NAmqGjxRBRPoRHZUUqvhiNS6axnGpinLHC"]
1111
1212 let e = "HHmaFQpUobwKxzjz4ECaBPtoF69kujKwU2cozaUzTsgv"
1313
1414 let f = ["3N6StJdgmTfARsRNn9Xt5rDYEs3pr4KGy1v"]
1515
1616 func g (e) = {
1717 let h = e
1818 if ($isInstanceOf(h, "Unit"))
1919 then {
2020 let i = h
2121 wavesBalance(this).available
2222 }
2323 else assetBalance(this, value(e))
2424 }
2525
2626
2727 func j (k,l) = {
2828 let h = getInteger(k, l)
2929 if ($isInstanceOf(h, "Int"))
3030 then {
3131 let m = h
3232 m
3333 }
3434 else 0
3535 }
3636
3737
3838 func n (k,l) = {
3939 let h = getString(k, l)
4040 if ($isInstanceOf(h, "String"))
4141 then {
4242 let m = h
4343 m
4444 }
4545 else ""
4646 }
4747
4848
4949 func o (e) = {
5050 let h = e
5151 if ($isInstanceOf(h, "ByteVector"))
5252 then {
5353 let m = h
5454 toBase58String(m)
5555 }
5656 else "WAVES"
5757 }
5858
5959
6060 func p (q) = {
6161 let r = assetBalance(Address(fromBase58String(q)), fromBase58String(e))
6262 r
6363 }
6464
6565
6666 func s () = {
6767 let t = n(this, "currentPool")
6868 if ((t == ""))
6969 then throw(("Cannot find pool with id " + t))
7070 else p(t)
7171 }
7272
7373
7474 func u (q,v) = {
7575 let w = Address(fromBase58String(q))
7676 let x = if ((v > 0))
7777 then invoke(w, "withdraw", [e, v], nil)
7878 else ""
7979 if ((x == x))
8080 then x
8181 else throw("Strict value is not equal to itself.")
8282 }
8383
8484
8585 func y () = {
8686 let z = j(this, "global_lastCheckSRate")
8787 let A = j(this, "global_staked")
8888 let B = fraction(A, z, b)
8989 if ((B == 0))
9090 then b
9191 else {
9292 let C = fraction(z, s(), B)
9393 if ((b > C))
9494 then b
9595 else C
9696 }
9797 }
9898
9999
100100 func D (E) = {
101101 let A = j(this, "global_staked")
102102 let C = y()
103-[IntegerEntry("global_staked", (A + E)), IntegerEntry("global_lastCheckSRate", C), IntegerEntry("global_lastCheckSRateHeight", height)]
103+[IntegerEntry("global_staked", (A + E)), IntegerEntry("global_lastCheckSRate", C)]
104104 }
105105
106106
107107 func F (q) = if ((indexOf(f, q) == unit))
108108 then throw(("Unknown poolId " + q))
109109 else {
110110 let G = fromBase58String(e)
111111 let r = g(G)
112112 let H = invoke(Address(fromBase58String(q)), "supply", nil, [AttachedPayment(G, r)])
113113 if ((H == H))
114114 then [StringEntry("currentPool", q)]
115115 else throw("Strict value is not equal to itself.")
116116 }
117117
118118
119119 func I () = {
120120 let t = n(this, "currentPool")
121121 if ((t == ""))
122122 then throw(("Cannot find pool with id " + t))
123123 else {
124124 let v = p(t)
125125 let J = u(t, v)
126126 if ((J == J))
127127 then J
128128 else throw("Strict value is not equal to itself.")
129129 }
130130 }
131131
132132
133133 func K (L,v) = {
134134 let M = fraction(v, b, y())
135135 (D(M) ++ [IntegerEntry((L + "_staked"), (j(this, (L + "_staked")) + M))])
136136 }
137137
138138
139139 func N (L,v) = {
140140 let M = fraction(v, b, y())
141141 let O = j(this, (L + "_staked"))
142142 let P = if ((M > O))
143143 then O
144144 else M
145145 (D(-(M)) ++ [IntegerEntry((L + "_staked"), (O - P))])
146146 }
147147
148148
149149 @Callable(Q)
150150 func init (q) = {
151151 let t = n(this, "currentPool")
152152 if ((indexOf(d, toString(Q.caller)) == unit))
153153 then throw("Access denied")
154154 else if ((t == ""))
155155 then [StringEntry("currentPool", q)]
156156 else nil
157157 }
158158
159159
160160
161161 @Callable(Q)
162162 func rebalance (q) = {
163163 let t = n(this, "currentPool")
164164 if ((indexOf(d, toString(Q.caller)) == unit))
165165 then throw("Access denied")
166166 else if ((t == q))
167167 then throw(("Already supplied to" + t))
168168 else {
169169 let x = I()
170170 if ((x == x))
171171 then (F(q) ++ D(0))
172172 else throw("Strict value is not equal to itself.")
173173 }
174174 }
175175
176176
177177
178178 @Callable(Q)
179179 func stake () = {
180180 let L = toString(Q.caller)
181181 let v = Q.payments[0].amount
182182 let t = n(this, "currentPool")
183183 if (if ((0 >= v))
184184 then true
185185 else (Q.payments[0].assetId != fromBase58String(e)))
186186 then throw("invalid token attached")
187187 else if ((t == ""))
188188 then throw("Pool not initialized")
189189 else (K(L, v) ++ F(t))
190190 }
191191
192192
193193
194194 @Callable(Q)
195195 func unstake (v) = {
196196 let L = toString(Q.caller)
197197 let t = n(this, "currentPool")
198198 let J = u(t, v)
199199 if ((J == J))
200200 then (N(L, v) ++ [ScriptTransfer(Q.caller, v, fromBase58String(e))])
201201 else throw("Strict value is not equal to itself.")
202202 }
203203
204204
205205 @Verifier(J)
206206 func R () = sigVerify(J.bodyBytes, J.proofs[0], J.senderPublicKey)
207207

github/deemru/w8io/026f985 
40.35 ms