tx · GPCRaLfmCssrDvqhoPNDt8ZoDeLkwsc1cHsezzwTr7on

3N1WbxZTdjLm3L8faJGiCTRk3kfaAofzd16:  -1.20000000 Waves

2022.11.15 17:42 [2318372] smart account 3N1WbxZTdjLm3L8faJGiCTRk3kfaAofzd16 > SELF 0.00000000 Waves

{ "type": 13, "id": "GPCRaLfmCssrDvqhoPNDt8ZoDeLkwsc1cHsezzwTr7on", "fee": 120000000, "feeAssetId": null, "timestamp": 1668523398822, "version": 2, "chainId": 84, "sender": "3N1WbxZTdjLm3L8faJGiCTRk3kfaAofzd16", "senderPublicKey": "BrpLGAiTnNa5QohVytFPYdF7oZR7Gk1UZfA7c9Uxs9Fw", "proofs": [ "2oWpuxuDRHi3HvxVpSvCYNb4AkDqTJJo2G2gpkFX2ndZ7pLZ4bFiNLTzHYd28oAWBQswckAZqPGd5wUd6iHfqV9k" ], "script": "base64:AAIFAAAAAAAAAAkIAhIDCgEIEgAAAAAEAQAAABNrZXlNYW5hZ2VyUHVibGljS2V5AAAAAAkABCIAAAABAgAAABBtYW5hZ2VyUHVibGljS2V5AQAAABZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAAAAAQAAAAHJG1hdGNoMAkBAAAAE2tleU1hbmFnZXJQdWJsaWNLZXkAAAAAAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAXMFAAAAByRtYXRjaDAJAAJZAAAAAQUAAAABcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAUAAAAEdW5pdAkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgEAAAALbXVzdE1hbmFnZXIAAAABAAAAAWkEAAAAAnBkCQAAAgAAAAECAAAAEXBlcm1pc3Npb24gZGVuaWVkBAAAAAckbWF0Y2gwCQEAAAAWbWFuYWdlclB1YmxpY0tleU9yVW5pdAAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAnBrBQAAAAckbWF0Y2gwA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QAAAAR0aGlzAAAAB3JlZ3VsYXIDCQEAAAACIT0AAAACCAUAAAABaQAAAAZjYWxsZXIFAAAAC21haW5BZGRyZXNzCQAAAgAAAAECAAAAKU9ubHkgbWFpbiBjb250cmFjdCBjYW4gaW52b2tlIHRoaXMgbWV0aG9kCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAC21haW5BZGRyZXNzBQAAAA5yZWd1bGFyQmFsYW5jZQUAAAAEdW5pdAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXlZx2US", "height": 2318372, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ChFNu4pTY1Sa3K8cLSjnwRy8FYHgvHYxXjciEh1gSypr Next: DJ9cpmfJMhr7wuqx68UUgZJSW81YzvqeMDNJemQWu4Ya Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = 1000000000000000000
5-
6-let b = ((60 * 60) * 24)
7-
8-let c = 100000000
9-
10-let d = "k_lastCompoundTime"
11-
12-let e = "k_periodFinish"
13-
14-let f = "k_lastRate"
15-
16-let g = "k_growthRate"
17-
18-let h = "k_balance"
19-
20-let i = "k_leaseId"
21-
22-let j = "k_initialized"
23-
24-let k = "k_adminPublicKey"
25-
26-let l = "k_adminAddress"
27-
28-let m = "k_minerAddress"
29-
30-let n = "k_sWavesAssetId"
31-
32-func o (p,q) = fraction(p, c, q, HALFEVEN)
4+func a () = getString("managerPublicKey")
335
346
35-func r (p,q) = fraction(p, q, c, HALFEVEN)
36-
37-
38-func s (p,q) = fraction(p, a, q, HALFEVEN)
39-
40-
41-func t (p,q) = fraction(p, q, a, HALFEVEN)
42-
43-
44-func u (p) = if ((p > 0))
45- then p
46- else -(p)
47-
48-
49-func v (p,q) = if ((p > q))
50- then q
51- else p
52-
53-
54-func w (x,y) = ((x + "_") + y)
55-
56-
57-func z () = addressFromString(getStringValue(this, l))
58-
59-
60-func A () = fromBase58String(getStringValue(this, k))
61-
62-
63-func B () = valueOrErrorMessage(addressFromString(getStringValue(this, m)), "Invalid miner address is not set")
64-
65-
66-func C () = fromBase58String(getStringValue(this, n))
67-
68-
69-func D () = valueOrElse(getBoolean(this, j), false)
70-
71-
72-func E (F) = valueOrErrorMessage(getInteger(this, F), ("No value for " + F))
73-
74-
75-func G (F) = valueOrElse(getInteger(this, F), 0)
76-
77-
78-func H () = G(d)
79-
80-
81-func I () = G(g)
82-
83-
84-func J () = G(h)
85-
86-
87-func K () = E(f)
88-
89-
90-func L () = G(e)
91-
92-
93-func M () = {
94- let N = getString(this, k)
95- if ($isInstanceOf(N, "String"))
7+func b () = {
8+ let c = a()
9+ if ($isInstanceOf(c, "String"))
9610 then {
97- let O = N
98- fromBase58String(O)
11+ let d = c
12+ fromBase58String(d)
9913 }
100- else if ($isInstanceOf(N, "Unit"))
14+ else if ($isInstanceOf(c, "Unit"))
10115 then unit
10216 else throw("Match error")
10317 }
10418
10519
106-func P (Q) = {
107- let R = throw("permission denied")
108- let N = M()
109- if ($isInstanceOf(N, "ByteVector"))
20+func e (f) = {
21+ let g = throw("permission denied")
22+ let c = b()
23+ if ($isInstanceOf(c, "ByteVector"))
11024 then {
111- let S = N
112- if ((Q.callerPublicKey == S))
25+ let h = c
26+ if ((f.callerPublicKey == h))
11327 then true
114- else R
28+ else g
11529 }
116- else if ($isInstanceOf(N, "Unit"))
117- then if ((Q.caller == this))
30+ else if ($isInstanceOf(c, "Unit"))
31+ then if ((f.caller == this))
11832 then true
119- else R
33+ else g
12034 else throw("Match error")
12135 }
12236
12337
124-func T () = (lastBlock.timestamp / 1000)
125-
126-
127-func U () = v(T(), L())
128-
129-
130-func V () = {
131- let N = getBinary(i)
132- if ($isInstanceOf(N, "ByteVector"))
38+func i () = {
39+ let c = getBoolean("inited")
40+ if ($isInstanceOf(c, "Boolean"))
13341 then {
134- let W = N
135-[LeaseCancel(W), DeleteEntry(i)]
42+ let j = c
43+ if ((j == false))
44+ then true
45+ else throw("Already inited")
13646 }
137- else if ($isInstanceOf(N, "Unit"))
138- then nil
47+ else if ($isInstanceOf(c, "Unit"))
48+ then false
13949 else throw("Match error")
14050 }
14151
14252
143-func X (Y) = [IntegerEntry(h, Y)]
144-
145-
146-func Z (aa,ab) = [IntegerEntry(d, aa), IntegerEntry(e, ab)]
147-
148-
149-func ac (ad,ae) = [IntegerEntry(f, ad), IntegerEntry(g, ae)]
150-
151-
152-func af (Y) = if ((Y > 0))
153- then {
154- let ag = Lease(B(), Y)
155- let ah = calculateLeaseId(ag)
156-[ag, BinaryEntry(i, ah)]
157- }
158- else nil
159-
160-
161-func ai (Y) = if ((Y == 0))
162- then nil
163- else {
164- let aj = (J() + Y)
165- ((V() ++ af(aj)) ++ X(aj))
166- }
167-
168-
169-func ak (Y) = [Reissue(C(), Y, true)]
170-
171-
172-func al (Y) = [Burn(C(), Y)]
173-
174-
175-func am (an,Y) = [ScriptTransfer(an, Y, C())]
176-
177-
178-func ao (an,Y) = [ScriptTransfer(an, Y, unit)]
179-
180-
181-func ap () = {
182- let N = assetInfo(C())
183- if ($isInstanceOf(N, "Asset"))
184- then {
185- let aq = N
186- aq.quantity
187- }
188- else throw("Can't find asset")
189- }
190-
191-
192-func ar () = wavesBalance(B()).regular
193-
194-
195-func as () = {
196- let at = invoke(B(), "withdraw", nil, nil)
197- if ((at == at))
198- then at
199- else throw("Strict value is not equal to itself.")
200- }
201-
202-
203-func au () = (K() + (I() * U()))
204-
205-
206-@Callable(Q)
207-func init (av) = {
208- let aw = P(Q)
209- if ((aw == aw))
210- then if (D())
211- then throw("Already initialized")
212- else {
213- let ax = Issue("sWaves", "", 0, 8, true, unit, 0)
214- let ay = calculateAssetId(ax)
215-[BooleanEntry(j, true), StringEntry(n, toBase58String(ay)), StringEntry(m, av), IntegerEntry(f, a), ax]
216- }
53+@Callable(f)
54+func init (k) = {
55+ let l = [e(f), i()]
56+ if ((l == l))
57+ then [BooleanEntry("inited", true), StringEntry("mainAddress", k)]
21758 else throw("Strict value is not equal to itself.")
21859 }
21960
22061
22162
222-@Callable(Q)
223-func compound () = if ((size(Q.payments) != 0))
224- then throw("No payments allowed")
225- else {
226- let az = ar()
227- if ((az == az))
228- then if (((1 * c) > az))
229- then nil
230- else {
231- let aA = as()
232- if ((aA == aA))
233- then {
234- let aB = au()
235- let aC = T()
236- let aD = if ((aC > L()))
237- then (s(az, c) / b)
238- else {
239- let aE = (L() - aC)
240- let aF = (I() * aE)
241- (s((az + aF), c) / b)
242- }
243- ((ai(az) ++ ac(aB, aD)) ++ Z(aC, (aC + b)))
244- }
245- else throw("Strict value is not equal to itself.")
246- }
247- else throw("Strict value is not equal to itself.")
248- }
249-
250-
251-
252-@Callable(Q)
253-func stake () = {
254- let aG = invoke(this, "compound", nil, nil)
255- if ((aG == aG))
256- then {
257- let aH = Q.payments[0]
258- if ((aH.assetId != unit))
259- then throw("Only WAVES supported")
260- else if ((size(Q.payments) != 1))
261- then throw("Wrong payments amount")
262- else {
263- let aI = au()
264- let aJ = s(aH.amount, aI)
265- ((ai(aH.amount) ++ ak(aJ)) ++ am(Q.caller, aJ))
266- }
267- }
268- else throw("Strict value is not equal to itself.")
63+@Callable(f)
64+func withdraw () = {
65+ let k = Address(fromBase58String(getStringValue("mainAddress")))
66+ let m = wavesBalance(this).regular
67+ if ((f.caller != k))
68+ then throw("Only main contract can invoke this method")
69+ else [ScriptTransfer(k, m, unit)]
26970 }
27071
27172
272-
273-@Callable(Q)
274-func unstake () = {
275- let aG = invoke(this, "compound", nil, nil)
276- if ((aG == aG))
277- then {
278- let aH = Q.payments[0]
279- if ((aH.assetId != C()))
280- then throw("Only sWAVES supported")
281- else if ((size(Q.payments) != 1))
282- then throw("Wrong payments amount")
283- else {
284- let aI = au()
285- let aK = t(aH.amount, aI)
286- ((ai(-(aK)) ++ al(aH.amount)) ++ ao(Q.caller, aK))
287- }
288- }
289- else throw("Strict value is not equal to itself.")
290- }
291-
292-
293-@Verifier(aL)
294-func aM () = sigVerify(aL.bodyBytes, aL.proofs[0], aL.senderPublicKey)
73+@Verifier(n)
74+func o () = sigVerify(n.bodyBytes, n.proofs[0], n.senderPublicKey)
29575

github/deemru/w8io/026f985 
37.80 ms