tx · 6nxtdQchehT4fEjJLP4yLT9i4ahXB2sqXQKjKbSGoWQX 3N8yxw7oNyi2XqSPcsshR4F27Epq9u2uuEf: -0.01000000 Waves 2023.09.25 15:38 [2770948] smart account 3N8yxw7oNyi2XqSPcsshR4F27Epq9u2uuEf > SELF 0.00000000 Waves
{ "type": 13, "id": "6nxtdQchehT4fEjJLP4yLT9i4ahXB2sqXQKjKbSGoWQX", "fee": 1000000, "feeAssetId": null, "timestamp": 1695645555764, "version": 2, "chainId": 84, "sender": "3N8yxw7oNyi2XqSPcsshR4F27Epq9u2uuEf", "senderPublicKey": "9mPGJ2QMz7yrJpQgNijB5pwFSNCkJHEJ9p3XFyoGsrmY", "proofs": [ "d8E3RA4JJV8t9CAsgF2Q1ENzC3f4oBpn9ReJj6gujTSSezF3t3rjiJQ4Z86LUF2UQujDB18VZPS355mcfPRCHSh" ], "script": "base64:BgINCAISABIDCgEBEgASAAkABnVzZG5JZAEgbySjyqsw3FIpmOgsYVruWn8jTcItdbvpnapU4NLQB8EACXVzZG5JZFN0cgIsOFVyZkRWZDVHcmVlVXdtN3VQazdlWXoxZU12Mzc2a3pSNTJDNnNBTlBrd1MACHB1enpsZUlkASBhIEdqteU0lNOM+a3jecT6cJU92ajDMxppPdJKJ6I3YAALcHV6emxlSWRTdHICLDdZOTZVVGJCUTQ1Y2pXb0hlRmoyRWhuamRnRXQ2aUsyTG5BNGVUY2Z4ZG9EAAVTY2FsZQCAoJSljR0BDXRyeUdldEludGVnZXIBA2tleQQHJG1hdGNoMAkAmggCBQR0aGlzBQNrZXkDCQABAgUHJG1hdGNoMAIDSW50BAFiBQckbWF0Y2gwBQFiAAABDHRyeUdldFN0cmluZwEDa2V5BAckbWF0Y2gwCQCdCAIFBHRoaXMFA2tleQMJAAECBQckbWF0Y2gwAgZTdHJpbmcEAWEFByRtYXRjaDAFAWECAAEQY2xhaW1BbGlhc1Jlc3VsdAIHYWRkcmVzcwphc3NldElkU3RyBAphZGRyZXNzU3RyCQClCA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VyZXN0RGVsdGEFA25pbAUGYW1vdW50BQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5zPf1VQ==", "height": 2770948, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 6hYaqk9NjopMq9CfeQezn9z9kmHc4rxqGYN4tA2xTtqU 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 (g) = { | |
26 | + | let h = getString(this, g) | |
27 | + | if ($isInstanceOf(h, "String")) | |
28 | + | then { | |
29 | + | let k = h | |
30 | + | k | |
31 | + | } | |
32 | + | else "" | |
33 | + | } | |
34 | + | ||
35 | + | ||
36 | + | func l (m,n) = { | |
37 | + | let o = toString(m) | |
38 | + | let p = f((("global_lastCheck_" + n) + "_interest")) | |
39 | + | let q = f((o + "_staked")) | |
40 | + | let r = f((((o + "_lastCheck_") + n) + "_interest")) | |
41 | + | let s = if ((r == 0)) | |
42 | + | then 0 | |
43 | + | else r | |
44 | + | let t = fraction((p - s), q, e) | |
45 | + | [IntegerEntry((((o + "_lastCheck_") + n) + "_interest"), p), IntegerEntry((((o + "_") + n) + "_claimed"), (f((((o + "_") + n) + "_claimed")) + t)), ScriptTransfer(m, t, fromBase58String(n))] | |
46 | + | } | |
47 | + | ||
48 | + | ||
49 | + | func u (m) = (l(m, b) ++ l(m, d)) | |
50 | + | ||
51 | + | ||
52 | + | @Callable(v) | |
53 | + | func stake () = { | |
54 | + | let w = v.payments[0].amount | |
55 | + | let o = toString(v.caller) | |
56 | + | let n = toBase58String(a) | |
57 | + | let x = f("global_staked") | |
58 | + | if ((v.payments[0].assetId != c)) | |
59 | + | then throw("wrong asset attached") | |
60 | + | else (u(v.caller) ++ [IntegerEntry("global_staked", (x + w)), IntegerEntry((o + "_staked"), (f((o + "_staked")) + w))]) | |
61 | + | } | |
62 | + | ||
63 | + | ||
64 | + | ||
65 | + | @Callable(v) | |
66 | + | func unStake (w) = { | |
67 | + | let o = toString(v.caller) | |
68 | + | let q = f((o + "_staked")) | |
69 | + | if ((w > q)) | |
70 | + | then throw("you don't have tokens available") | |
71 | + | else (u(v.caller) ++ [IntegerEntry((o + "_staked"), (q - w)), IntegerEntry("global_staked", (f("global_staked") - w)), ScriptTransfer(v.caller, w, c)]) | |
72 | + | } | |
73 | + | ||
74 | + | ||
75 | + | ||
76 | + | @Callable(v) | |
77 | + | func claimReward () = u(v.caller) | |
78 | + | ||
79 | + | ||
80 | + | ||
81 | + | @Callable(v) | |
82 | + | func topUpReward () = { | |
83 | + | let y = value(v.payments[0].assetId) | |
84 | + | let z = v.payments[0].amount | |
85 | + | let w = if ((y == c)) | |
86 | + | then 0 | |
87 | + | else if ((y == a)) | |
88 | + | then z | |
89 | + | else throw("not correct asset attached") | |
90 | + | if ((w == w)) | |
91 | + | then { | |
92 | + | let p = f((("global_lastCheck_" + b) + "_interest")) | |
93 | + | let x = f("global_staked") | |
94 | + | let A = if ((x > 0)) | |
95 | + | then fraction(w, e, x) | |
96 | + | else 0 | |
97 | + | if ((y != c)) | |
98 | + | then $Tuple2([IntegerEntry((("global_" + b) + "_earnings"), (f((("global_" + b) + "_earnings")) + w)), IntegerEntry((("global_lastCheck_" + b) + "_interest"), (p + A))], w) | |
99 | + | else nil | |
100 | + | } | |
101 | + | else throw("Strict value is not equal to itself.") | |
102 | + | } | |
103 | + | ||
104 | + | ||
105 | + | @Verifier(B) | |
106 | + | func C () = sigVerify(B.bodyBytes, B.proofs[0], B.senderPublicKey) | |
107 | + |
github/deemru/w8io/026f985 18.36 ms ◑