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