tx · HxiTscvZdKWKreKhF6oqun29jxg41dEuXaCdSWavho5o 3MpQMfcqygL5TqY51peDk3tD4YC35ZtLHDR: -0.00400000 Waves 2024.04.28 22:50 [3083150] smart account 3MpQMfcqygL5TqY51peDk3tD4YC35ZtLHDR > SELF 0.00000000 Waves
{ "type": 13, "id": "HxiTscvZdKWKreKhF6oqun29jxg41dEuXaCdSWavho5o", "fee": 400000, "feeAssetId": null, "timestamp": 1714333855532, "version": 1, "sender": "3MpQMfcqygL5TqY51peDk3tD4YC35ZtLHDR", "senderPublicKey": "6gZhJH4ky42qJRCmfh8c56C2eeKTB5MRzEKsSZToBtYT", "proofs": [ "4Fs6dQSeH4iR1pmcwfvxhG9QcNTJ2jhZEq3CPPa1UK3srY79s5iHnTFhXHbvSNNidzHrK3nMLW6M8YdMvCu36M5n" ], "script": "base64:BgINCAISABIDCgEIEgASAAkABnVzZG5JZAEgD/IcEqzkxDya7EYaqyWosOy6BytGzG2IcvC14pJJAbQACXVzZG5JZFN0cgIsMjVGRXFFalJrcUs2eUNraVQ3THo2U0FZejdnVUZDdHhmQ0NobnJWRkQ1QVQACHB1enpsZUlkASBUIP2ahsY3H5qgvXhIyN9J/Le53Mzn5csGOcF0H4nk2wAFU2NhbGUAgKCUpY0dAQ10cnlHZXRJbnRlZ2VyAQNrZXkEByRtYXRjaDAJAJoIAgUEdGhpcwUDa2V5AwkAAQIFByRtYXRjaDACA0ludAQBYgUHJG1hdGNoMAUBYgAAAQx0cnlHZXRTdHJpbmcBA2tleQQHJG1hdGNoMAkAnQgCBQR0aGlzBQNrZXkDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAFhBQckbWF0Y2gwBQFhAgABEGNsYWltQWxpYXNSZXN1bHQCB2FkZHJlc3MKYXNzZXRJZFN0cgQKYWRkcmVzc1N0cgkApQgBBQdhZGRyZXNzBA9jdXJyZW50SW50ZXJlc3QJAQ10cnlHZXRJbnRlZ2VyAQkArAICCQCsAgICEWdsb2JhbF9sYXN0Q2hlY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cgIJX2Vhcm5pbmdzCQBkAgkBDXRyeUdldEludGVnZXIBCQCsAgIJAKwCAgIHZ2xvYmFsXwUKYXNzZXRJZFN0cgIJX2Vhcm5pbmdzBQZhbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgkArAICAhFnbG9iYWxfbGFzdENoZWNrXwUKYXNzZXRJZFN0cgIJX2ludGVyZXN0CQBkAgUPY3VycmVudEludGVyZXN0BQ1pbnRlcmVzdERlbHRhBQNuaWwBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5UPw7/w==", "chainId": 84, "height": 3083150, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 92votuufkWPrPiLdRsmxfSoyeQ2pDX8GxRemzA5mM2sH Next: none Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | let b = "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT" | |
7 | 7 | ||
8 | - | let c = base58' | |
8 | + | let c = base58'6fQRaL3L25nGqevXT8kxwjBS28fkBErrJ69JYcj7qKgW' | |
9 | 9 | ||
10 | 10 | let d = 1000000000000 | |
11 | 11 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
5 | 5 | ||
6 | 6 | let b = "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT" | |
7 | 7 | ||
8 | - | let c = base58' | |
8 | + | let c = base58'6fQRaL3L25nGqevXT8kxwjBS28fkBErrJ69JYcj7qKgW' | |
9 | 9 | ||
10 | 10 | let d = 1000000000000 | |
11 | 11 | ||
12 | 12 | func e (f) = { | |
13 | 13 | let g = getInteger(this, f) | |
14 | 14 | if ($isInstanceOf(g, "Int")) | |
15 | 15 | then { | |
16 | 16 | let h = g | |
17 | 17 | h | |
18 | 18 | } | |
19 | 19 | else 0 | |
20 | 20 | } | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func i (f) = { | |
24 | 24 | let g = getString(this, f) | |
25 | 25 | if ($isInstanceOf(g, "String")) | |
26 | 26 | then { | |
27 | 27 | let j = g | |
28 | 28 | j | |
29 | 29 | } | |
30 | 30 | else "" | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func k (l,m) = { | |
35 | 35 | let n = toString(l) | |
36 | 36 | let o = e((("global_lastCheck_" + m) + "_interest")) | |
37 | 37 | let p = e((((n + "_lastCheck_") + m) + "_interest")) | |
38 | 38 | let q = if ((m == b)) | |
39 | 39 | then e((n + "_staked")) | |
40 | 40 | else e((((n + "_") + m) + "_staked")) | |
41 | 41 | let r = if ((p > 0)) | |
42 | 42 | then fraction((o - p), q, d) | |
43 | 43 | else 0 | |
44 | 44 | [IntegerEntry((((n + "_lastCheck_") + m) + "_interest"), o), IntegerEntry((((n + "_") + m) + "_claimed"), (e((((n + "_") + m) + "_claimed")) + r)), ScriptTransfer(l, r, a)] | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func s (l) = k(l, b) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func t (u) = { | |
52 | 52 | let g = getString(Address(base58'3N9yxp4gyTCsEtPUzE7CFLnae4YwqRgwUkW'), (("art_" + toBase58String(u)) + "_type")) | |
53 | 53 | if ($isInstanceOf(g, "String")) | |
54 | 54 | then { | |
55 | 55 | let v = g | |
56 | 56 | 5 | |
57 | 57 | } | |
58 | 58 | else if ((getString(Address(base58'3N7CE8qNvnNNzk1pCxFJ4S8LA4sTyWakczC'), (("nft_" + toBase58String(u)) + "_issuer")) == "3N7G3XELPvHrkSrTLzbWQwAxPLcEUhNnsht")) | |
59 | 59 | then 1 | |
60 | 60 | else 0 | |
61 | 61 | } | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | @Callable(w) | |
65 | 65 | func stake () = { | |
66 | 66 | let n = toString(w.caller) | |
67 | 67 | let x = if ((w.payments[0].amount == 1)) | |
68 | 68 | then value(w.payments[0].assetId) | |
69 | 69 | else throw("please attach NFT") | |
70 | 70 | let m = toBase58String(a) | |
71 | 71 | let o = e((("global_lastCheck_" + m) + "_interest")) | |
72 | 72 | let y = e("global_staked") | |
73 | 73 | let z = fraction(10000, t(x), 5) | |
74 | 74 | let A = if ((z == 10000)) | |
75 | 75 | then "Eagle NFT" | |
76 | 76 | else "Ania NFT" | |
77 | 77 | if ((z == 0)) | |
78 | 78 | then throw("not valid NFT attached") | |
79 | 79 | else (s(w.caller) ++ [IntegerEntry("global_staked", (y + z)), IntegerEntry((n + "_staked"), (e((n + "_staked")) + z)), StringEntry((toBase58String(x) + "_owner"), n), IntegerEntry(((("address_" + toString(w.caller)) + "_nft_") + toBase58String(x)), lastBlock.timestamp), StringEntry((toBase58String(x) + "_name"), A)]) | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | ||
84 | 84 | @Callable(w) | |
85 | 85 | func unStake (B) = { | |
86 | 86 | let z = fraction(10000, t(fromBase58String(B)), 5) | |
87 | 87 | let n = toString(w.caller) | |
88 | 88 | let q = e((n + "_staked")) | |
89 | 89 | let C = i((B + "_owner")) | |
90 | 90 | if ((n != C)) | |
91 | 91 | then throw("you don't have NFT available") | |
92 | 92 | else (s(w.caller) ++ [IntegerEntry((n + "_staked"), (q - z)), IntegerEntry("global_staked", (e("global_staked") - z)), ScriptTransfer(w.caller, 1, fromBase58String(B)), DeleteEntry((B + "_owner")), DeleteEntry(((("address_" + toString(w.caller)) + "_nft_") + B))]) | |
93 | 93 | } | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | ||
97 | 97 | @Callable(w) | |
98 | 98 | func claimReward () = s(w.caller) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | ||
102 | 102 | @Callable(w) | |
103 | 103 | func topUpReward () = { | |
104 | 104 | let D = w.payments[0].amount | |
105 | 105 | let m = b | |
106 | 106 | let o = e((("global_lastCheck_" + m) + "_interest")) | |
107 | 107 | let y = e("global_staked") | |
108 | 108 | let E = if ((y > 0)) | |
109 | 109 | then fraction(D, d, y) | |
110 | 110 | else 0 | |
111 | 111 | let F = e("global_lastCheck_ultra_interest") | |
112 | 112 | let G = e("global_ultra_staked") | |
113 | 113 | let H = if ((y > 0)) | |
114 | 114 | then fraction(D, d, y) | |
115 | 115 | else 0 | |
116 | 116 | if ((w.payments[0].assetId != a)) | |
117 | 117 | then throw("wrong asset attached") | |
118 | 118 | else [IntegerEntry((("global_" + m) + "_earnings"), (e((("global_" + m) + "_earnings")) + D)), IntegerEntry((("global_lastCheck_" + m) + "_interest"), (o + E))] | |
119 | 119 | } | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | @Verifier(I) | |
123 | 123 | func J () = sigVerify(I.bodyBytes, I.proofs[0], I.senderPublicKey) | |
124 | 124 |
github/deemru/w8io/169f3d6 53.07 ms ◑