tx · DSdMaVasgRi8PCoaaq2ri7xwsWEjn81ztJjfdxVez3gY 3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB: -0.01000000 Waves 2023.09.22 21:04 [2766923] smart account 3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB > SELF 0.00000000 Waves
{ "type": 13, "id": "DSdMaVasgRi8PCoaaq2ri7xwsWEjn81ztJjfdxVez3gY", "fee": 1000000, "feeAssetId": null, "timestamp": 1695405918858, "version": 2, "chainId": 84, "sender": "3NDFcJ3K5esyuknc2ngNcw59e8SJXtfgaHB", "senderPublicKey": "8M2WuphuhMvTZMcpBocfLqUvkcFJisjdcCZaaPHxpwmS", "proofs": [ "2XmZWg4FBbnKTo5XxYzYnKJkQi2hSDC7WZcNGbtH4EorQuMPh3nN39qDkNsUKfKA9nvVE4vum8YUr6qkUjta83n7" ], "script": "base64:BgLAAggCEgASAwoBARIAEgAiBnVzZG5JZCIJdXNkbklkU3RyIghwdXp6bGVJZCILcHV6emxlSWRTdHIiBVNjYWxlIg10cnlHZXRJbnRlZ2VyIgNrZXkiByRtYXRjaDAiAWIiEGNsYWltQWxpYXNSZXN1bHQiB2FkZHJlc3MiCmFzc2V0SWRTdHIiCmFkZHJlc3NTdHIiD2N1cnJlbnRJbnRlcmVzdCIMc3Rha2VkQW1vdW50IhhsYXN0Q2hlY2tJbnRlcmVzdEluU3RhdGUiEWxhc3RDaGVja0ludGVyZXN0IgZyZXdhcmQiC2NsYWltUmVzdWx0IgFpIgZhbW91bnQiEXRvdGFsU3Rha2VkQW1vdW50IghwbXRBc3NldCIJcG10QW1vdW50Ig1pbnRlcmVzdERlbHRhIgJ0eCIGdmVyaWZ5CAABYQEgbySjyqsw3FIpmOgsYVruWn8jTcItdbvpnapU4NLQB8EAAWICLDhVcmZEVmQ1R3JlZVV3bTd1UGs3ZVl6MWVNdjM3Nmt6UjUyQzZzQU5Qa3dTAAFjASBhIEdqteU0lNOM+a3jecT6cJU92ajDMxppPdJKJ6I3Y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WwFAXUJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAXoBAUEACQD0AwMIBQF6CWJvZHlCeXRlcwkAkQMCCAUBegZwcm9vZnMAAAgFAXoPc2VuZGVyUHVibGljS2V56Ta5Sg==", "height": 2766923, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FNpyEmdbhsfxaghg8FrLSBSruzAQmXWSDukqbmmNSKGw Next: 7KoKHebjbi7Sr441at7eCZRdJPqn2yJ9jhpet6wR4TNm Diff:
Old | New | Differences | |
---|---|---|---|
83 | 83 | let y = if ((v > 0)) | |
84 | 84 | then fraction(u, e, v) | |
85 | 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 | |
86 | + | $Tuple2([IntegerEntry((("global_" + d) + "_earnings"), (f((("global_" + d) + "_earnings")) + u)), IntegerEntry((("global_lastCheck_" + d) + "_interest"), (n + y))], u) | |
89 | 87 | } | |
90 | 88 | else throw("Strict value is not equal to itself.") | |
91 | 89 | } |
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 (k,l) = { | |
26 | 26 | let m = toString(k) | |
27 | 27 | let n = f((("global_lastCheck_" + l) + "_interest")) | |
28 | 28 | let o = f((m + "_staked")) | |
29 | 29 | let p = f((((m + "_lastCheck_") + l) + "_interest")) | |
30 | 30 | let q = if ((p == 0)) | |
31 | 31 | then 0 | |
32 | 32 | else p | |
33 | 33 | let r = fraction((n - q), o, e) | |
34 | 34 | [IntegerEntry((((m + "_lastCheck_") + l) + "_interest"), n), IntegerEntry((((m + "_") + l) + "_claimed"), (f((((m + "_") + l) + "_claimed")) + r)), ScriptTransfer(k, r, fromBase58String(l))] | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func s (k) = (j(k, b) ++ j(k, d)) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | @Callable(t) | |
42 | 42 | func stake () = { | |
43 | 43 | let u = t.payments[0].amount | |
44 | 44 | let m = toString(t.caller) | |
45 | 45 | let l = toBase58String(a) | |
46 | 46 | let v = f("global_staked") | |
47 | 47 | if ((t.payments[0].assetId != c)) | |
48 | 48 | then throw("wrong asset attached") | |
49 | 49 | else (s(t.caller) ++ [IntegerEntry("global_staked", (v + u)), IntegerEntry((m + "_staked"), (f((m + "_staked")) + u))]) | |
50 | 50 | } | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | ||
54 | 54 | @Callable(t) | |
55 | 55 | func unStake (u) = { | |
56 | 56 | let m = toString(t.caller) | |
57 | 57 | let o = f((m + "_staked")) | |
58 | 58 | if ((u > o)) | |
59 | 59 | then throw("you don't have tokens available") | |
60 | 60 | else (s(t.caller) ++ [IntegerEntry((m + "_staked"), (o - u)), IntegerEntry("global_staked", (f("global_staked") - u)), ScriptTransfer(t.caller, u, c)]) | |
61 | 61 | } | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | ||
65 | 65 | @Callable(t) | |
66 | 66 | func claimReward () = s(t.caller) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | ||
70 | 70 | @Callable(t) | |
71 | 71 | func topUpReward () = { | |
72 | 72 | let w = value(t.payments[0].assetId) | |
73 | 73 | let x = t.payments[0].amount | |
74 | 74 | let u = if ((w == a)) | |
75 | 75 | then 0 | |
76 | 76 | else if ((w == c)) | |
77 | 77 | then x | |
78 | 78 | else throw("not correct asset attached") | |
79 | 79 | if ((u == u)) | |
80 | 80 | then { | |
81 | 81 | let n = f((("global_lastCheck_" + d) + "_interest")) | |
82 | 82 | let v = f("global_staked") | |
83 | 83 | let y = if ((v > 0)) | |
84 | 84 | then fraction(u, e, v) | |
85 | 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 | |
86 | + | $Tuple2([IntegerEntry((("global_" + d) + "_earnings"), (f((("global_" + d) + "_earnings")) + u)), IntegerEntry((("global_lastCheck_" + d) + "_interest"), (n + y))], u) | |
89 | 87 | } | |
90 | 88 | else throw("Strict value is not equal to itself.") | |
91 | 89 | } | |
92 | 90 | ||
93 | 91 | ||
94 | 92 | @Verifier(z) | |
95 | 93 | func A () = sigVerify(z.bodyBytes, z.proofs[0], z.senderPublicKey) | |
96 | 94 |
github/deemru/w8io/169f3d6 39.24 ms ◑