tx · 2ccnzSoF6bt7Di5ShBHK6bxh661XC27nWXZeyC1GFgdh 3MweQGUGGmQd8iV1CdEjRSvcW8asP9khepg: -0.01000000 Waves 2022.04.27 00:28 [2025986] smart account 3MweQGUGGmQd8iV1CdEjRSvcW8asP9khepg > SELF 0.00000000 Waves
{ "type": 13, "id": "2ccnzSoF6bt7Di5ShBHK6bxh661XC27nWXZeyC1GFgdh", "fee": 1000000, "feeAssetId": null, "timestamp": 1651008506889, "version": 2, "chainId": 84, "sender": "3MweQGUGGmQd8iV1CdEjRSvcW8asP9khepg", "senderPublicKey": "5uu2gJEDT6GJGwY9ET4ZCSgVRPbH9NnWAnF9iSyc2mTH", "proofs": [ "4rtoohmDTvc6RuuE5JHY6wNURgUkEnamdUvYgNQEz6kznukoJMjUNGyZCD7wV6s37tTRMxAMgx5GbofULDrpuLCq" ], "script": "base64:AAIFAAAAAAAAABIIAhIDCgEIEgASAwoBARIAEgAAAAAIAAAAAAlvcmFjbGVLZXkCAAAACW9yYWNsZUtleQAAAAAFU2NhbGUAAAAAAAAPQkABAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAEAAAAMdHJ5R2V0U3RyaW5nAAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAAAAAAGb3JhY2xlCQEAAAAMdHJ5R2V0U3RyaW5nAAAAAQUAAAAJb3JhY2xlS2V5AAAAAAlvcmFjbGVGZWUJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQUAAAAGb3JhY2xlAAAAAA1TY29uZXhBc3NldElkCQACWQAAA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 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = "oracleKey" | |
5 | + | ||
6 | + | let b = 1000000 | |
7 | + | ||
8 | + | func c (d) = { | |
9 | + | let e = getInteger(this, d) | |
10 | + | if ($isInstanceOf(e, "Int")) | |
11 | + | then { | |
12 | + | let f = e | |
13 | + | f | |
14 | + | } | |
15 | + | else 0 | |
16 | + | } | |
17 | + | ||
18 | + | ||
19 | + | func g (d) = { | |
20 | + | let e = getString(this, d) | |
21 | + | if ($isInstanceOf(e, "String")) | |
22 | + | then { | |
23 | + | let h = e | |
24 | + | h | |
25 | + | } | |
26 | + | else "" | |
27 | + | } | |
28 | + | ||
29 | + | ||
30 | + | let i = g(a) | |
31 | + | ||
32 | + | let j = value(addressFromString(i)) | |
33 | + | ||
34 | + | let k = fromBase58String(getStringValue(j, "SconexAssetId")) | |
35 | + | ||
36 | + | func l (m) = { | |
37 | + | let n = toString(m) | |
38 | + | let o = c("global_lastCheck_SCONEX_interest") | |
39 | + | let p = c((n + "_lastCheck_SCONEX_interest")) | |
40 | + | let q = c((n + "_SCONEX_staked")) | |
41 | + | let r = if ((p > 0)) | |
42 | + | then fraction((o - p), q, b) | |
43 | + | else 0 | |
44 | + | [IntegerEntry((n + "_lastCheck_SCONEX_interest"), o), IntegerEntry((n + "_SCONEX_claimed"), (c((n + "_SCONEX_claimed")) + r)), ScriptTransfer(m, r, k)] | |
45 | + | } | |
46 | + | ||
47 | + | ||
48 | + | @Callable(s) | |
49 | + | func initDapp (t) = if ((s.caller != this)) | |
50 | + | then throw("You cannot do this action") | |
51 | + | else if ((i != "")) | |
52 | + | then throw("oracle already set, you can't override!") | |
53 | + | else [StringEntry(a, t)] | |
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | @Callable(s) | |
58 | + | func stake () = { | |
59 | + | let u = s.payments[0].amount | |
60 | + | let n = toString(s.caller) | |
61 | + | let v = c("global_staked") | |
62 | + | if ((s.payments[0].assetId != k)) | |
63 | + | then throw("wrong asset attached") | |
64 | + | else (l(s.caller) ++ [IntegerEntry("global_staked", (v + u)), IntegerEntry((n + "_SCONEX_staked"), (c((n + "_SCONEX_staked")) + u))]) | |
65 | + | } | |
66 | + | ||
67 | + | ||
68 | + | ||
69 | + | @Callable(s) | |
70 | + | func unStake (u) = { | |
71 | + | let n = toString(s.caller) | |
72 | + | let q = c((n + "_SCONEX_staked")) | |
73 | + | if ((u > q)) | |
74 | + | then throw("you don't have tokens available") | |
75 | + | else (l(s.caller) ++ [IntegerEntry((n + "_SCONEX_staked"), (q - u)), IntegerEntry("global_staked", (c("global_staked") - u)), ScriptTransfer(s.caller, u, k)]) | |
76 | + | } | |
77 | + | ||
78 | + | ||
79 | + | ||
80 | + | @Callable(s) | |
81 | + | func claimReward () = l(s.caller) | |
82 | + | ||
83 | + | ||
84 | + | ||
85 | + | @Callable(s) | |
86 | + | func topUpReward () = { | |
87 | + | let u = fraction(s.payments[0].amount, 9, 10) | |
88 | + | let o = c("global_lastCheck_SCONEX_interest") | |
89 | + | let v = c("global_staked") | |
90 | + | let w = if ((v > 0)) | |
91 | + | then fraction(u, b, v) | |
92 | + | else 0 | |
93 | + | if ((s.payments[0].assetId != k)) | |
94 | + | then throw("wrong asset attached") | |
95 | + | else [IntegerEntry("global_SCONEX_earnings", (c("global_SCONEX_earnings") + u)), IntegerEntry("global_lastCheck_SCONEX_interest", (o + w))] | |
96 | + | } | |
97 | + | ||
98 | + | ||
99 | + | @Verifier(x) | |
100 | + | func y () = sigVerify(x.bodyBytes, x.proofs[0], x.senderPublicKey) | |
101 | + |
github/deemru/w8io/169f3d6 17.61 ms ◑