tx · HX2qcsRGvSQgnaxXsFFtksiF2352Mj4QzarSYFrTa4XA 3MsU428UzSefm85q7jvBsRV66Du7E72xEkL: -0.01000000 Waves 2022.06.10 10:59 [2090021] smart account 3MsU428UzSefm85q7jvBsRV66Du7E72xEkL > SELF 0.00000000 Waves
{ "type": 13, "id": "HX2qcsRGvSQgnaxXsFFtksiF2352Mj4QzarSYFrTa4XA", "fee": 1000000, "feeAssetId": null, "timestamp": 1654848021166, "version": 2, "chainId": 84, "sender": "3MsU428UzSefm85q7jvBsRV66Du7E72xEkL", "senderPublicKey": "58FFoU7LCj1DKboVntQXuE3KQDpf92NouXncN5b4vY8U", "proofs": [ "AsPqetPFPoDZ6g7NdZNzVXtCq6Bg8wneerZtG2xrGpaUNQDihAxDmUTw5gnyerrL4yXT4f4WuqTnYX7QXy74wPa" ], "script": "base64:AAIFAAAAAAAAAAsIAhIAEgMKAQESAAAAAAgAAAAACkRJU0NMQUlNRVICAAAAGnB1enpsZSBzdGFraW5nIHNjLiB0eXZtIDopAAAAAAVzY2FsZQAAAAAABfXhAAAAAAAIcHV6emxlSWQBAAAAIC03E4HTJDddn+FvdtPRD5PvLCz03YmtXEpW6HzJAXIbAAAAAAxlYXJuZWRBc3NldHMJAARMAAAAAgEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQFAAAAA25pbAAAAAASZWFybmVkQXNzZXRzQW1vdW50CQABkAAAAAEFAAAADGVhcm5lZEFzc2V0cwEAAAANdHJ5R2V0SW50ZWdlcgAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAAAQAAAB1jYWxjdWxhdGVDdXJyZW50QXNzZXRJbnRlcmVzdAAAAAIAAAAHYXNzZXRJZAAAAAphc3NldElkU3RyBAAAAAt0b3RhbFN0YWtl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JhbF9wdXp6bGVTdGFrZWQFAAAABmFtb3VudAUAAAADbmlsAAAAAWkBAAAABWNsYWltAAAAAAkBAAAAC2NsYWltUmVzdWx0AAAAAQgFAAAAAWkAAAAGY2FsbGVyAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXnmnFq1", "height": 2090021, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6eC7XpinLjD7ZWisd4M5TyHy41mSk9PgvHEUDHHc5UMq Next: none Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = " | |
4 | + | let a = "puzzle staking sc. tyvm :)" | |
5 | 5 | ||
6 | 6 | let b = 100000000 | |
7 | 7 | ||
97 | 97 | ||
98 | 98 | ||
99 | 99 | @Callable(H) | |
100 | - | func unstake ( | |
100 | + | func unstake (K) = { | |
101 | 101 | let u = toString(H.caller) | |
102 | - | let | |
103 | - | if (( | |
102 | + | let L = f((u + "_puzzleStaked")) | |
103 | + | if ((K > L)) | |
104 | 104 | then throw("you don't have PUZZLE available") | |
105 | - | else (s(H.caller) ++ [IntegerEntry((u + "_puzzleStaked"), ( | |
105 | + | else (s(H.caller) ++ [IntegerEntry((u + "_puzzleStaked"), (L - K)), IntegerEntry("global_puzzleStaked", (f("global_puzzleStaked") - K))]) | |
106 | 106 | } | |
107 | 107 | ||
108 | 108 | ||
111 | 111 | func claim () = s(H.caller) | |
112 | 112 | ||
113 | 113 | ||
114 | - | @Verifier( | |
115 | - | func | |
114 | + | @Verifier(M) | |
115 | + | func N () = sigVerify(M.bodyBytes, M.proofs[0], M.senderPublicKey) | |
116 | 116 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = " | |
4 | + | let a = "puzzle staking sc. tyvm :)" | |
5 | 5 | ||
6 | 6 | let b = 100000000 | |
7 | 7 | ||
8 | 8 | let c = base58'43W4FcqA1rEpSmUGHoGiXvpSLfhadws9LS5j3SJsKxxS' | |
9 | 9 | ||
10 | 10 | let d = [base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh'] | |
11 | 11 | ||
12 | 12 | let e = size(d) | |
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 = f("global_puzzleStaked") | |
27 | 27 | let n = f((("global_lastCheck_" + l) + "_earnings")) | |
28 | 28 | let o = max([n, assetBalance(this, k)]) | |
29 | 29 | let p = (o - n) | |
30 | 30 | let q = if ((m == 0)) | |
31 | 31 | then 0 | |
32 | 32 | else fraction(p, b, m) | |
33 | 33 | let r = f((("global_lastCheck_" + l) + "_interest")) | |
34 | 34 | (r + q) | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func s (t) = { | |
39 | 39 | let u = toString(t) | |
40 | 40 | let v = f((u + "_puzzleStaked")) | |
41 | 41 | func w (x,k) = { | |
42 | 42 | let l = toBase58String(k) | |
43 | 43 | let y = j(k, l) | |
44 | 44 | let o = max([f((("global_lastCheck_" + l) + "_earnings")), assetBalance(this, k)]) | |
45 | 45 | let z = fraction(v, (y - f((((u + "_lastCheck_") + l) + "_interest"))), b) | |
46 | 46 | if ((z == 0)) | |
47 | 47 | then x | |
48 | 48 | else (x ++ [IntegerEntry((("global_lastCheck_" + l) + "_earnings"), (o - z)), IntegerEntry((("global_lastCheck_" + l) + "_interest"), y), IntegerEntry((((u + "_lastCheck_") + l) + "_interest"), y), ScriptTransfer(t, z, k)]) | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | let A = d | |
52 | 52 | let B = size(A) | |
53 | 53 | let C = nil | |
54 | 54 | func D (E,F) = if ((F >= B)) | |
55 | 55 | then E | |
56 | 56 | else w(E, A[F]) | |
57 | 57 | ||
58 | 58 | func G (E,F) = if ((F >= B)) | |
59 | 59 | then E | |
60 | 60 | else throw("List size exceeds 17") | |
61 | 61 | ||
62 | 62 | G(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(C, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17) | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | @Callable(H) | |
67 | 67 | func stake () = { | |
68 | 68 | let u = toString(H.caller) | |
69 | 69 | let I = H.payments[0] | |
70 | 70 | if ((value(I.assetId) != c)) | |
71 | 71 | then throw("wrong asset attached") | |
72 | 72 | else { | |
73 | 73 | func w (x,k) = { | |
74 | 74 | let l = toBase58String(k) | |
75 | 75 | let y = j(k, l) | |
76 | 76 | (x ++ [IntegerEntry((("global_lastCheck_" + l) + "_earnings"), assetBalance(this, k)), IntegerEntry((("global_lastCheck_" + l) + "_interest"), y), IntegerEntry((((u + "_lastCheck_") + l) + "_interest"), y)]) | |
77 | 77 | } | |
78 | 78 | ||
79 | 79 | let J = { | |
80 | 80 | let A = d | |
81 | 81 | let B = size(A) | |
82 | 82 | let C = nil | |
83 | 83 | func D (E,F) = if ((F >= B)) | |
84 | 84 | then E | |
85 | 85 | else w(E, A[F]) | |
86 | 86 | ||
87 | 87 | func G (E,F) = if ((F >= B)) | |
88 | 88 | then E | |
89 | 89 | else throw("List size exceeds 17") | |
90 | 90 | ||
91 | 91 | G(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(C, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17) | |
92 | 92 | } | |
93 | 93 | (J ++ [IntegerEntry((u + "_puzzleStaked"), (f((u + "_puzzleStaked")) + I.amount)), IntegerEntry("global_puzzleStaked", (f("global_puzzleStaked") + I.amount))]) | |
94 | 94 | } | |
95 | 95 | } | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | ||
99 | 99 | @Callable(H) | |
100 | - | func unstake ( | |
100 | + | func unstake (K) = { | |
101 | 101 | let u = toString(H.caller) | |
102 | - | let | |
103 | - | if (( | |
102 | + | let L = f((u + "_puzzleStaked")) | |
103 | + | if ((K > L)) | |
104 | 104 | then throw("you don't have PUZZLE available") | |
105 | - | else (s(H.caller) ++ [IntegerEntry((u + "_puzzleStaked"), ( | |
105 | + | else (s(H.caller) ++ [IntegerEntry((u + "_puzzleStaked"), (L - K)), IntegerEntry("global_puzzleStaked", (f("global_puzzleStaked") - K))]) | |
106 | 106 | } | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | ||
110 | 110 | @Callable(H) | |
111 | 111 | func claim () = s(H.caller) | |
112 | 112 | ||
113 | 113 | ||
114 | - | @Verifier( | |
115 | - | func | |
114 | + | @Verifier(M) | |
115 | + | func N () = sigVerify(M.bodyBytes, M.proofs[0], M.senderPublicKey) | |
116 | 116 |
github/deemru/w8io/169f3d6 39.89 ms ◑