tx · 3p2Dw2wsrYh9aCkyDs5tdQixPXADneubkiwvzbQWhJWh 3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB: -0.01000000 Waves 2023.09.22 22:19 [2767007] smart account 3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB > SELF 0.00000000 Waves
{ "type": 13, "id": "3p2Dw2wsrYh9aCkyDs5tdQixPXADneubkiwvzbQWhJWh", "fee": 1000000, "feeAssetId": null, "timestamp": 1695410458924, "version": 2, "chainId": 84, "sender": "3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB", "senderPublicKey": "8M2WuphuhMvTZMcpBocfLqUvkcFJisjdcCZaaPHxpwmS", "proofs": [ "W89ovyvc7YbBJ8JPUfCWYYYfRbvoozvUbi98XvvBmFa93T9qyoPk4g3L4eQWWeUwS7MC8uXBy3oeZX3QLsxzTXz" ], "script": "base64:BgLRAggCEgASAwoBARIAEgAiBnVzZG5JZCIJdXNkbklkU3RyIghwdXp6bGVJZCILcHV6emxlSWRTdHIiBVNjYWxlIg10cnlHZXRJbnRlZ2VyIgNrZXkiByRtYXRjaDAiAWIiDHRyeUdldFN0cmluZyIBYSIQY2xhaW1BbGlhc1Jlc3VsdCIHYWRkcmVzcyIKYXNzZXRJZFN0ciIKYWRkcmVzc1N0ciIPY3VycmVudEludGVyZXN0IgxzdGFrZWRBbW91bnQiGGxhc3RDaGVja0ludGVyZXN0SW5TdGF0ZSIRbGFzdENoZWNrSW50ZXJlc3QiBnJld2FyZCILY2xhaW1SZXN1bHQiAWkiBmFtb3VudCIRdG90YWxTdGFrZWRBbW91bnQiCHBtdEFzc2V0IglwbXRBbW91bnQiDWludGVyZXN0RGVsdGEiAnR4IgZ2ZXJpZnkJAAFhASBvJKPKqzDcUimY6CxhWu5afyNNwi11u+mdqlTg0tAHwQABYgIsOFVyZkRWZDVHcmVlVXdtN3VQazdlWXoxZU12Mzc2a3pSNTJDNnNBTlBrd1MAAWMBIGEgR2q15TSU04z5reN5xPpwlT3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AKwCAgkArAICAhFnbG9iYWxfbGFzdENoZWNrXwUBYgIJX2ludGVyZXN0CQBkAgUBcAUBQQUDbmlsBQF3BQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAUIBAUMACQD0AwMIBQFCCWJvZHlCeXRlcwkAkQMCCAUBQgZwcm9vZnMAAAgFAUIPc2VuZGVyUHVibGljS2V5DyWp3A==", "height": 2767007, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4QFAe2oPYS4e4Z4KN2gWsbDFj4nLc9XwtAxxhqaHim9h Next: 7i3uFq7Zwa4QR3nt8AAYj4KQXAHRivDERUSHzUqSkjH2 Diff:
Old | New | Differences | |
---|---|---|---|
89 | 89 | else throw("not correct asset attached") | |
90 | 90 | if ((w == w)) | |
91 | 91 | then { | |
92 | - | let p = f((("global_lastCheck_" + | |
92 | + | let p = f((("global_lastCheck_" + b) + "_interest")) | |
93 | 93 | let x = f("global_staked") | |
94 | 94 | let A = if ((x > 0)) | |
95 | 95 | then fraction(w, e, x) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
5 | 5 | ||
6 | 6 | let b = "8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS" | |
7 | 7 | ||
8 | 8 | let c = base58'7Y96UTbBQ45cjWoHeFj2EhnjdgEt6iK2LnA4eTcfxdoD' | |
9 | 9 | ||
10 | 10 | let d = "7Y96UTbBQ45cjWoHeFj2EhnjdgEt6iK2LnA4eTcfxdoD" | |
11 | 11 | ||
12 | 12 | let e = 1000000000000 | |
13 | 13 | ||
14 | 14 | func f (g) = { | |
15 | 15 | let h = getInteger(this, g) | |
16 | 16 | if ($isInstanceOf(h, "Int")) | |
17 | 17 | then { | |
18 | 18 | let i = h | |
19 | 19 | i | |
20 | 20 | } | |
21 | 21 | else 0 | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func j (g) = { | |
26 | 26 | let h = getString(this, g) | |
27 | 27 | if ($isInstanceOf(h, "String")) | |
28 | 28 | then { | |
29 | 29 | let k = h | |
30 | 30 | k | |
31 | 31 | } | |
32 | 32 | else "" | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func l (m,n) = { | |
37 | 37 | let o = toString(m) | |
38 | 38 | let p = f((("global_lastCheck_" + n) + "_interest")) | |
39 | 39 | let q = f((o + "_staked")) | |
40 | 40 | let r = f((((o + "_lastCheck_") + n) + "_interest")) | |
41 | 41 | let s = if ((r == 0)) | |
42 | 42 | then 0 | |
43 | 43 | else r | |
44 | 44 | let t = fraction((p - s), q, e) | |
45 | 45 | [IntegerEntry((((o + "_lastCheck_") + n) + "_interest"), p), IntegerEntry((((o + "_") + n) + "_claimed"), (f((((o + "_") + n) + "_claimed")) + t)), ScriptTransfer(m, t, fromBase58String(n))] | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func u (m) = l(m, b) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | @Callable(v) | |
53 | 53 | func stake () = { | |
54 | 54 | let w = v.payments[0].amount | |
55 | 55 | let o = toString(v.caller) | |
56 | 56 | let n = toBase58String(a) | |
57 | 57 | let x = f("global_staked") | |
58 | 58 | if ((v.payments[0].assetId != c)) | |
59 | 59 | then throw("wrong asset attached") | |
60 | 60 | else (u(v.caller) ++ [IntegerEntry("global_staked", (x + w)), IntegerEntry((o + "_staked"), (f((o + "_staked")) + w))]) | |
61 | 61 | } | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | ||
65 | 65 | @Callable(v) | |
66 | 66 | func unStake (w) = { | |
67 | 67 | let o = toString(v.caller) | |
68 | 68 | let q = f((o + "_staked")) | |
69 | 69 | if ((w > q)) | |
70 | 70 | then throw("you don't have tokens available") | |
71 | 71 | else (u(v.caller) ++ [IntegerEntry((o + "_staked"), (q - w)), IntegerEntry("global_staked", (f("global_staked") - w)), ScriptTransfer(v.caller, w, c)]) | |
72 | 72 | } | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | ||
76 | 76 | @Callable(v) | |
77 | 77 | func claimReward () = u(v.caller) | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | ||
81 | 81 | @Callable(v) | |
82 | 82 | func topUpReward () = { | |
83 | 83 | let y = value(v.payments[0].assetId) | |
84 | 84 | let z = v.payments[0].amount | |
85 | 85 | let w = if ((y == a)) | |
86 | 86 | then 0 | |
87 | 87 | else if ((y == c)) | |
88 | 88 | then z | |
89 | 89 | else throw("not correct asset attached") | |
90 | 90 | if ((w == w)) | |
91 | 91 | then { | |
92 | - | let p = f((("global_lastCheck_" + | |
92 | + | let p = f((("global_lastCheck_" + b) + "_interest")) | |
93 | 93 | let x = f("global_staked") | |
94 | 94 | let A = if ((x > 0)) | |
95 | 95 | then fraction(w, e, x) | |
96 | 96 | else 0 | |
97 | 97 | if ((y != a)) | |
98 | 98 | then $Tuple2([IntegerEntry((("global_" + b) + "_earnings"), (f((("global_" + b) + "_earnings")) + w)), IntegerEntry((("global_lastCheck_" + b) + "_interest"), (p + A))], w) | |
99 | 99 | else nil | |
100 | 100 | } | |
101 | 101 | else throw("Strict value is not equal to itself.") | |
102 | 102 | } | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | @Verifier(B) | |
106 | 106 | func C () = sigVerify(B.bodyBytes, B.proofs[0], B.senderPublicKey) | |
107 | 107 |
github/deemru/w8io/026f985 24.57 ms ◑