tx · 7KoKHebjbi7Sr441at7eCZRdJPqn2yJ9jhpet6wR4TNm

3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB:  -0.01000000 Waves

2023.09.22 21:26 [2766947] smart account 3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB > SELF 0.00000000 Waves

{ "type": 13, "id": "7KoKHebjbi7Sr441at7eCZRdJPqn2yJ9jhpet6wR4TNm", "fee": 1000000, "feeAssetId": null, "timestamp": 1695407237690, "version": 2, "chainId": 84, "sender": "3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB", "senderPublicKey": "8M2WuphuhMvTZMcpBocfLqUvkcFJisjdcCZaaPHxpwmS", "proofs": [ "3LREdLbPow6VCe5dCDJjn8bMAVmzaMfdggiGMCT1nhSQhB6PHhtB1ASGknMnG8JgooShnUY5bmec2WbLkqJEypUQ" ], "script": "base64:BgLRAggCEgASAwoBARIAEgAiBnVzZG5JZCIJdXNkbklkU3RyIghwdXp6bGVJZCILcHV6emxlSWRTdHIiBVNjYWxlIg10cnlHZXRJbnRlZ2VyIgNrZXkiByRtYXRjaDAiAWIiDHRyeUdldFN0cmluZyIBYSIQY2xhaW1BbGlhc1Jlc3VsdCIHYWRkcmVzcyIKYXNzZXRJZFN0ciIKYWRkcmVzc1N0ciIPY3VycmVudEludGVyZXN0IgxzdGFrZWRBbW91bnQiGGxhc3RDaGVja0ludGVyZXN0SW5TdGF0ZSIRbGFzdENoZWNrSW50ZXJlc3QiBnJld2FyZCILY2xhaW1SZXN1bHQiAWkiBmFtb3VudCIRdG90YWxTdGFrZWRBbW91bnQiCHBtdEFzc2V0IglwbXRBbW91bnQiDWludGVyZXN0RGVsdGEiAnR4IgZ2ZXJpZnkJAAFhASBvJKPKqzDcUimY6CxhWu5afyNNwi11u+mdqlTg0tAHwQABYgIsOFVyZkRWZDVHcmVlVXdtN3VQazdlWXoxZU12Mzc2a3pSNTJDNnNBTlBrd1MAAWMBIGEgR2q15TSU04z5reN5xPpwlT3Zq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bmdzBQF3CQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIJAKwCAgIRZ2xvYmFsX2xhc3RDaGVja18FAWQCCV9pbnRlcmVzdAkAZAIFAXAFAUEFA25pbAUBdwUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQFCAQFDAAkA9AMDCAUBQglib2R5Qnl0ZXMJAJEDAggFAUIGcHJvb2ZzAAAIBQFCD3NlbmRlclB1YmxpY0tlebItLCE=", "height": 2766947, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DSdMaVasgRi8PCoaaq2ri7xwsWEjn81ztJjfdxVez3gY Next: 4QFAe2oPYS4e4Z4KN2gWsbDFj4nLc9XwtAxxhqaHim9h Diff:
OldNewDifferences
2222 }
2323
2424
25-func j (k,l) = {
26- let m = toString(k)
27- let n = f((("global_lastCheck_" + l) + "_interest"))
28- let o = f((m + "_staked"))
29- let p = f((((m + "_lastCheck_") + l) + "_interest"))
30- let q = if ((p == 0))
31- then 0
32- else p
33- let r = fraction((n - q), o, e)
34-[IntegerEntry((((m + "_lastCheck_") + l) + "_interest"), n), IntegerEntry((((m + "_") + l) + "_claimed"), (f((((m + "_") + l) + "_claimed")) + r)), ScriptTransfer(k, r, fromBase58String(l))]
25+func j (g) = {
26+ let h = getString(this, g)
27+ if ($isInstanceOf(h, "String"))
28+ then {
29+ let k = h
30+ k
31+ }
32+ else ""
3533 }
3634
3735
38-func s (k) = (j(k, b) ++ j(k, d))
36+func l (m,n) = {
37+ let o = toString(m)
38+ let p = f((("global_lastCheck_" + n) + "_interest"))
39+ let q = f((o + "_staked"))
40+ let r = f((((o + "_lastCheck_") + n) + "_interest"))
41+ let s = if ((r == 0))
42+ then 0
43+ else r
44+ let t = fraction((p - s), q, e)
45+[IntegerEntry((((o + "_lastCheck_") + n) + "_interest"), p), IntegerEntry((((o + "_") + n) + "_claimed"), (f((((o + "_") + n) + "_claimed")) + t)), ScriptTransfer(m, t, fromBase58String(n))]
46+ }
3947
4048
41-@Callable(t)
49+func u (m) = (l(m, b) ++ l(m, d))
50+
51+
52+@Callable(v)
4253 func stake () = {
43- let u = t.payments[0].amount
44- let m = toString(t.caller)
45- let l = toBase58String(a)
46- let v = f("global_staked")
47- if ((t.payments[0].assetId != c))
54+ let w = v.payments[0].amount
55+ let o = toString(v.caller)
56+ let n = toBase58String(a)
57+ let x = f("global_staked")
58+ if ((v.payments[0].assetId != c))
4859 then throw("wrong asset attached")
49- else (s(t.caller) ++ [IntegerEntry("global_staked", (v + u)), IntegerEntry((m + "_staked"), (f((m + "_staked")) + u))])
60+ else (u(v.caller) ++ [IntegerEntry("global_staked", (x + w)), IntegerEntry((o + "_staked"), (f((o + "_staked")) + w))])
5061 }
5162
5263
5364
54-@Callable(t)
55-func unStake (u) = {
56- let m = toString(t.caller)
57- let o = f((m + "_staked"))
58- if ((u > o))
65+@Callable(v)
66+func unStake (w) = {
67+ let o = toString(v.caller)
68+ let q = f((o + "_staked"))
69+ if ((w > q))
5970 then throw("you don't have tokens available")
60- else (s(t.caller) ++ [IntegerEntry((m + "_staked"), (o - u)), IntegerEntry("global_staked", (f("global_staked") - u)), ScriptTransfer(t.caller, u, c)])
71+ else (u(v.caller) ++ [IntegerEntry((o + "_staked"), (q - w)), IntegerEntry("global_staked", (f("global_staked") - w)), ScriptTransfer(v.caller, w, c)])
6172 }
6273
6374
6475
65-@Callable(t)
66-func claimReward () = s(t.caller)
76+@Callable(v)
77+func claimReward () = u(v.caller)
6778
6879
6980
70-@Callable(t)
81+@Callable(v)
7182 func topUpReward () = {
72- let w = value(t.payments[0].assetId)
73- let x = t.payments[0].amount
74- let u = if ((w == a))
83+ let y = value(v.payments[0].assetId)
84+ let z = v.payments[0].amount
85+ let w = if ((y == a))
7586 then 0
76- else if ((w == c))
77- then x
87+ else if ((y == c))
88+ then z
7889 else throw("not correct asset attached")
79- if ((u == u))
90+ if ((w == w))
8091 then {
81- let n = f((("global_lastCheck_" + d) + "_interest"))
82- let v = f("global_staked")
83- let y = if ((v > 0))
84- then fraction(u, e, v)
92+ let p = f((("global_lastCheck_" + d) + "_interest"))
93+ let x = f("global_staked")
94+ let A = if ((x > 0))
95+ then fraction(w, e, x)
8596 else 0
86- $Tuple2([IntegerEntry((("global_" + d) + "_earnings"), (f((("global_" + d) + "_earnings")) + u)), IntegerEntry((("global_lastCheck_" + d) + "_interest"), (n + y))], u)
97+ if ((y != a))
98+ then $Tuple2([IntegerEntry((("global_" + d) + "_earnings"), (f((("global_" + d) + "_earnings")) + w)), IntegerEntry((("global_lastCheck_" + d) + "_interest"), (p + A))], w)
99+ else nil
87100 }
88101 else throw("Strict value is not equal to itself.")
89102 }
90103
91104
92-@Verifier(z)
93-func A () = sigVerify(z.bodyBytes, z.proofs[0], z.senderPublicKey)
105+@Verifier(B)
106+func C () = sigVerify(B.bodyBytes, B.proofs[0], B.senderPublicKey)
94107
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS'
55
66 let b = "8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS"
77
88 let c = base58'7Y96UTbBQ45cjWoHeFj2EhnjdgEt6iK2LnA4eTcfxdoD'
99
1010 let d = "7Y96UTbBQ45cjWoHeFj2EhnjdgEt6iK2LnA4eTcfxdoD"
1111
1212 let e = 1000000000000
1313
1414 func f (g) = {
1515 let h = getInteger(this, g)
1616 if ($isInstanceOf(h, "Int"))
1717 then {
1818 let i = h
1919 i
2020 }
2121 else 0
2222 }
2323
2424
25-func j (k,l) = {
26- let m = toString(k)
27- let n = f((("global_lastCheck_" + l) + "_interest"))
28- let o = f((m + "_staked"))
29- let p = f((((m + "_lastCheck_") + l) + "_interest"))
30- let q = if ((p == 0))
31- then 0
32- else p
33- let r = fraction((n - q), o, e)
34-[IntegerEntry((((m + "_lastCheck_") + l) + "_interest"), n), IntegerEntry((((m + "_") + l) + "_claimed"), (f((((m + "_") + l) + "_claimed")) + r)), ScriptTransfer(k, r, fromBase58String(l))]
25+func j (g) = {
26+ let h = getString(this, g)
27+ if ($isInstanceOf(h, "String"))
28+ then {
29+ let k = h
30+ k
31+ }
32+ else ""
3533 }
3634
3735
38-func s (k) = (j(k, b) ++ j(k, d))
36+func l (m,n) = {
37+ let o = toString(m)
38+ let p = f((("global_lastCheck_" + n) + "_interest"))
39+ let q = f((o + "_staked"))
40+ let r = f((((o + "_lastCheck_") + n) + "_interest"))
41+ let s = if ((r == 0))
42+ then 0
43+ else r
44+ let t = fraction((p - s), q, e)
45+[IntegerEntry((((o + "_lastCheck_") + n) + "_interest"), p), IntegerEntry((((o + "_") + n) + "_claimed"), (f((((o + "_") + n) + "_claimed")) + t)), ScriptTransfer(m, t, fromBase58String(n))]
46+ }
3947
4048
41-@Callable(t)
49+func u (m) = (l(m, b) ++ l(m, d))
50+
51+
52+@Callable(v)
4253 func stake () = {
43- let u = t.payments[0].amount
44- let m = toString(t.caller)
45- let l = toBase58String(a)
46- let v = f("global_staked")
47- if ((t.payments[0].assetId != c))
54+ let w = v.payments[0].amount
55+ let o = toString(v.caller)
56+ let n = toBase58String(a)
57+ let x = f("global_staked")
58+ if ((v.payments[0].assetId != c))
4859 then throw("wrong asset attached")
49- else (s(t.caller) ++ [IntegerEntry("global_staked", (v + u)), IntegerEntry((m + "_staked"), (f((m + "_staked")) + u))])
60+ else (u(v.caller) ++ [IntegerEntry("global_staked", (x + w)), IntegerEntry((o + "_staked"), (f((o + "_staked")) + w))])
5061 }
5162
5263
5364
54-@Callable(t)
55-func unStake (u) = {
56- let m = toString(t.caller)
57- let o = f((m + "_staked"))
58- if ((u > o))
65+@Callable(v)
66+func unStake (w) = {
67+ let o = toString(v.caller)
68+ let q = f((o + "_staked"))
69+ if ((w > q))
5970 then throw("you don't have tokens available")
60- else (s(t.caller) ++ [IntegerEntry((m + "_staked"), (o - u)), IntegerEntry("global_staked", (f("global_staked") - u)), ScriptTransfer(t.caller, u, c)])
71+ else (u(v.caller) ++ [IntegerEntry((o + "_staked"), (q - w)), IntegerEntry("global_staked", (f("global_staked") - w)), ScriptTransfer(v.caller, w, c)])
6172 }
6273
6374
6475
65-@Callable(t)
66-func claimReward () = s(t.caller)
76+@Callable(v)
77+func claimReward () = u(v.caller)
6778
6879
6980
70-@Callable(t)
81+@Callable(v)
7182 func topUpReward () = {
72- let w = value(t.payments[0].assetId)
73- let x = t.payments[0].amount
74- let u = if ((w == a))
83+ let y = value(v.payments[0].assetId)
84+ let z = v.payments[0].amount
85+ let w = if ((y == a))
7586 then 0
76- else if ((w == c))
77- then x
87+ else if ((y == c))
88+ then z
7889 else throw("not correct asset attached")
79- if ((u == u))
90+ if ((w == w))
8091 then {
81- let n = f((("global_lastCheck_" + d) + "_interest"))
82- let v = f("global_staked")
83- let y = if ((v > 0))
84- then fraction(u, e, v)
92+ let p = f((("global_lastCheck_" + d) + "_interest"))
93+ let x = f("global_staked")
94+ let A = if ((x > 0))
95+ then fraction(w, e, x)
8596 else 0
86- $Tuple2([IntegerEntry((("global_" + d) + "_earnings"), (f((("global_" + d) + "_earnings")) + u)), IntegerEntry((("global_lastCheck_" + d) + "_interest"), (n + y))], u)
97+ if ((y != a))
98+ then $Tuple2([IntegerEntry((("global_" + d) + "_earnings"), (f((("global_" + d) + "_earnings")) + w)), IntegerEntry((("global_lastCheck_" + d) + "_interest"), (p + A))], w)
99+ else nil
87100 }
88101 else throw("Strict value is not equal to itself.")
89102 }
90103
91104
92-@Verifier(z)
93-func A () = sigVerify(z.bodyBytes, z.proofs[0], z.senderPublicKey)
105+@Verifier(B)
106+func C () = sigVerify(B.bodyBytes, B.proofs[0], B.senderPublicKey)
94107

github/deemru/w8io/026f985 
36.02 ms