tx · FNpyEmdbhsfxaghg8FrLSBSruzAQmXWSDukqbmmNSKGw 3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB: -0.01000000 Waves 2023.09.22 20:57 [2766916] smart account 3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB > SELF 0.00000000 Waves
{ "type": 13, "id": "FNpyEmdbhsfxaghg8FrLSBSruzAQmXWSDukqbmmNSKGw", "fee": 1000000, "feeAssetId": null, "timestamp": 1695405471665, "version": 2, "chainId": 84, "sender": "3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB", "senderPublicKey": "8M2WuphuhMvTZMcpBocfLqUvkcFJisjdcCZaaPHxpwmS", "proofs": [ "5QG99bivN4YHtn4JM6AbaKz3Z1tUipm1acYn5Cf7byo7ZzY4dedJPfZxAopQ5BhaFV4YfvtsfhH1m9RgfqJUBTuy" ], "script": "base64:BgLAAggCEgASAwoBARIAEgAiBnVzZG5JZCIJdXNkbklkU3RyIghwdXp6bGVJZCILcHV6emxlSWRTdHIiBVNjYWxlIg10cnlHZXRJbnRlZ2VyIgNrZXkiByRtYXRjaDAiAWIiEGNsYWltQWxpYXNSZXN1bHQiB2FkZHJlc3MiCmFzc2V0SWRTdHIiCmFkZHJlc3NTdHIiD2N1cnJlbnRJbnRlcmVzdCIMc3Rha2VkQW1vdW50IhhsYXN0Q2hlY2tJbnRlcmVzdEluU3RhdGUiEWxhc3RDaGVja0ludGVyZXN0IgZyZXdhcmQiC2NsYWltUmVzdWx0IgFpIgZhbW91bnQiEXRvdGFsU3Rha2VkQW1vdW50IghwbXRBc3NldCIJcG10QW1vdW50Ig1pbnRlcmVzdERlbHRhIgJ0eCIGdmVyaWZ5CAABYQEgbySjyqsw3FIpmOgsYVruWn8jTcItdbvpnapU4NLQB8EAAWICLDhVcmZEVmQ1R3JlZVV3bTd1UGs3ZVl6MWVNdjM3Nmt6UjUyQzZzQU5Qa3dTAAFjASBhIEdqteU0lNOM+a3jecT6cJU92ajDMxppPdJKJ6I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UBbgUBeQUDbmlsBQF1BQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAXoBAUEACQD0AwMIBQF6CWJvZHlCeXRlcwkAkQMCCAUBegZwcm9vZnMAAAgFAXoPc2VuZGVyUHVibGljS2V5iwz78Q==", "height": 2766916, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: DSdMaVasgRi8PCoaaq2ri7xwsWEjn81ztJjfdxVez3gY Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
5 | + | ||
6 | + | let b = "8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS" | |
7 | + | ||
8 | + | let c = base58'7Y96UTbBQ45cjWoHeFj2EhnjdgEt6iK2LnA4eTcfxdoD' | |
9 | + | ||
10 | + | let d = "7Y96UTbBQ45cjWoHeFj2EhnjdgEt6iK2LnA4eTcfxdoD" | |
11 | + | ||
12 | + | let e = 1000000000000 | |
13 | + | ||
14 | + | func f (g) = { | |
15 | + | let h = getInteger(this, g) | |
16 | + | if ($isInstanceOf(h, "Int")) | |
17 | + | then { | |
18 | + | let i = h | |
19 | + | i | |
20 | + | } | |
21 | + | else 0 | |
22 | + | } | |
23 | + | ||
24 | + | ||
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))] | |
35 | + | } | |
36 | + | ||
37 | + | ||
38 | + | func s (k) = (j(k, b) ++ j(k, d)) | |
39 | + | ||
40 | + | ||
41 | + | @Callable(t) | |
42 | + | 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)) | |
48 | + | then throw("wrong asset attached") | |
49 | + | else (s(t.caller) ++ [IntegerEntry("global_staked", (v + u)), IntegerEntry((m + "_staked"), (f((m + "_staked")) + u))]) | |
50 | + | } | |
51 | + | ||
52 | + | ||
53 | + | ||
54 | + | @Callable(t) | |
55 | + | func unStake (u) = { | |
56 | + | let m = toString(t.caller) | |
57 | + | let o = f((m + "_staked")) | |
58 | + | if ((u > o)) | |
59 | + | 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)]) | |
61 | + | } | |
62 | + | ||
63 | + | ||
64 | + | ||
65 | + | @Callable(t) | |
66 | + | func claimReward () = s(t.caller) | |
67 | + | ||
68 | + | ||
69 | + | ||
70 | + | @Callable(t) | |
71 | + | func topUpReward () = { | |
72 | + | let w = value(t.payments[0].assetId) | |
73 | + | let x = t.payments[0].amount | |
74 | + | let u = if ((w == a)) | |
75 | + | then 0 | |
76 | + | else if ((w == c)) | |
77 | + | then x | |
78 | + | else throw("not correct asset attached") | |
79 | + | if ((u == u)) | |
80 | + | 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) | |
85 | + | else 0 | |
86 | + | if ((w != a)) | |
87 | + | then $Tuple2([IntegerEntry((("global_" + d) + "_earnings"), (f((("global_" + d) + "_earnings")) + u)), IntegerEntry((("global_lastCheck_" + d) + "_interest"), (n + y))], u) | |
88 | + | else nil | |
89 | + | } | |
90 | + | else throw("Strict value is not equal to itself.") | |
91 | + | } | |
92 | + | ||
93 | + | ||
94 | + | @Verifier(z) | |
95 | + | func A () = sigVerify(z.bodyBytes, z.proofs[0], z.senderPublicKey) | |
96 | + |
github/deemru/w8io/026f985 17.11 ms ◑