|
| 1 | +"use client"; |
| 2 | + |
| 3 | +import type { ReactNode } from "react"; |
| 4 | +import { useDateFormatter } from "react-aria"; |
| 5 | + |
| 6 | +import { useChangelog } from "../../hooks/use-changelog"; |
| 7 | +import { Link } from "../Link"; |
| 8 | +import { ModalDialog } from "../ModalDialog"; |
| 9 | + |
| 10 | +export const Changelog = () => { |
| 11 | + const { isOpen, toggleOpen } = useChangelog(); |
| 12 | + |
| 13 | + return ( |
| 14 | + <ModalDialog title="Changelog" isOpen={isOpen} onOpenChange={toggleOpen}> |
| 15 | + <ul className="flex max-w-prose flex-col divide-y divide-neutral-600/50"> |
| 16 | + {messages.map(({ id, message }) => ( |
| 17 | + <li key={id}>{message}</li> |
| 18 | + ))} |
| 19 | + </ul> |
| 20 | + </ModalDialog> |
| 21 | + ); |
| 22 | +}; |
| 23 | + |
| 24 | +type ChangelogMessageProps = { |
| 25 | + date: Date; |
| 26 | + children: ReactNode | ReactNode[]; |
| 27 | +}; |
| 28 | + |
| 29 | +export const ChangelogMessage = ({ date, children }: ChangelogMessageProps) => { |
| 30 | + const dateFormatter = useDateFormatter({ |
| 31 | + year: "numeric", |
| 32 | + month: "short", |
| 33 | + day: "numeric", |
| 34 | + }); |
| 35 | + |
| 36 | + return ( |
| 37 | + <section className="py-8"> |
| 38 | + <h2 className="text-sm uppercase text-pythpurple-400"> |
| 39 | + {dateFormatter.format(date)} |
| 40 | + </h2> |
| 41 | + {children} |
| 42 | + </section> |
| 43 | + ); |
| 44 | +}; |
| 45 | + |
| 46 | +type ChangelogSectionProps = { |
| 47 | + title: ReactNode; |
| 48 | + children: ReactNode | ReactNode[]; |
| 49 | +}; |
| 50 | + |
| 51 | +export const ChangelogSection = ({ |
| 52 | + title, |
| 53 | + children, |
| 54 | +}: ChangelogSectionProps) => ( |
| 55 | + <section className="mt-4"> |
| 56 | + <h3 className="text-lg font-semibold text-white">{title}</h3> |
| 57 | + <div className="flex flex-col gap-2 pl-2 text-sm opacity-70"> |
| 58 | + {children} |
| 59 | + </div> |
| 60 | + </section> |
| 61 | +); |
| 62 | + |
| 63 | +export const messages = [ |
| 64 | + { |
| 65 | + id: 1, |
| 66 | + message: ( |
| 67 | + <ChangelogMessage date={new Date("2024-10-10")}> |
| 68 | + <ChangelogSection title="Milestones"> |
| 69 | + <div> |
| 70 | + <p> |
| 71 | + We are pleased to announce the following Oracle Integrity Staking |
| 72 | + milestones: |
| 73 | + </p> |
| 74 | + <ul className="list-disc pl-8"> |
| 75 | + <li>143M PYTH staked and securing DeFi.</li> |
| 76 | + <li>9.6K unique stakers participating.</li> |
| 77 | + <li>237K in PYTH programmatically distributed.</li> |
| 78 | + </ul> |
| 79 | + </div> |
| 80 | + <p>We’re thrilled to see so many community participants.</p> |
| 81 | + </ChangelogSection> |
| 82 | + <ChangelogSection title="New Features to the Staking Frontend"> |
| 83 | + <ul className="list-disc pl-4"> |
| 84 | + <li> |
| 85 | + New sort filter for publishers list. Publishers with self-stake |
| 86 | + are displayed first by default. You can sort by publisher details, |
| 87 | + pool composition, and more. |
| 88 | + </li> |
| 89 | + <li> |
| 90 | + Publishers interested in de-anonymizing themselves can have their |
| 91 | + names displayed in the publisher list. |
| 92 | + </li> |
| 93 | + <li>New OIS live stats added to navigation bar.</li> |
| 94 | + <li> |
| 95 | + New dialogue added under “Help” where you can view current program |
| 96 | + parameters. |
| 97 | + </li> |
| 98 | + <li> |
| 99 | + Option to remove PYTH from the smart contract program for parties |
| 100 | + with restricted access to the staking frontend. |
| 101 | + </li> |
| 102 | + <li> |
| 103 | + Full access to Pyth Governance for certain restricted |
| 104 | + jurisdictions. |
| 105 | + </li> |
| 106 | + <li>APYs are now shown as net of delegation fees.</li> |
| 107 | + <li> |
| 108 | + Updates to educational materials (all Guides and FAQs) for clarity |
| 109 | + and readability. |
| 110 | + </li> |
| 111 | + <li> |
| 112 | + New Oracle Integrity Staking{" "} |
| 113 | + <Link |
| 114 | + href="https://forum.pyth.network/c/oracle-integrity-staking-ois-discussion/8" |
| 115 | + className="underline" |
| 116 | + target="_blank" |
| 117 | + > |
| 118 | + discussion catalogue |
| 119 | + </Link>{" "} |
| 120 | + opened in Pyth DAO forum. Let the community know your thoughts and |
| 121 | + feedback! |
| 122 | + </li> |
| 123 | + </ul> |
| 124 | + </ChangelogSection> |
| 125 | + <ChangelogSection title="Security"> |
| 126 | + <p> |
| 127 | + The Pyth contributors take security extremely seriously. The |
| 128 | + contract code is{" "} |
| 129 | + <Link |
| 130 | + href="https://github.com/pyth-network/governance/tree/main/staking/programs/staking" |
| 131 | + className="underline" |
| 132 | + target="_blank" |
| 133 | + > |
| 134 | + open source |
| 135 | + </Link>{" "} |
| 136 | + and the upgrade authority is governed by the Pyth DAO. The official{" "} |
| 137 | + <Link |
| 138 | + href="https://github.com/pyth-network/audit-reports/blob/main/2024_09_11/pyth_cip_final_report.pdf" |
| 139 | + className="underline" |
| 140 | + target="_blank" |
| 141 | + > |
| 142 | + audit report |
| 143 | + </Link>{" "} |
| 144 | + is publicly accessible. All on-chain contract codes are verified |
| 145 | + using{" "} |
| 146 | + <Link |
| 147 | + href="https://github.com/Ellipsis-Labs/solana-verifiable-build/" |
| 148 | + className="underline" |
| 149 | + target="_blank" |
| 150 | + > |
| 151 | + Solana verifiable build |
| 152 | + </Link>{" "} |
| 153 | + and the Pyth DAO governs the upgrade authority. |
| 154 | + </p> |
| 155 | + </ChangelogSection> |
| 156 | + <ChangelogSection title="Best Practices"> |
| 157 | + <p> |
| 158 | + Please remember that publishers have priority for programmatic |
| 159 | + rewards distributions. By protocol design, if a pool’s stake cap is |
| 160 | + exceeded, the programmatic reward rate for other stakers |
| 161 | + participating in that pool will be lower than the Pyth DAO-set |
| 162 | + maximum reward rate. |
| 163 | + </p> |
| 164 | + </ChangelogSection> |
| 165 | + <ChangelogSection title="Acknowledgements"> |
| 166 | + <p> |
| 167 | + The Pyth contributors are glad to see so many network participants |
| 168 | + getting involved with Oracle Integrity Staking to help secure the |
| 169 | + oracle and protect the wider DeFi industry. OIS wouldn’t be possible |
| 170 | + without you! |
| 171 | + </p> |
| 172 | + </ChangelogSection> |
| 173 | + <ChangelogSection title="Feedback"> |
| 174 | + <p> |
| 175 | + Please reach out in the official{" "} |
| 176 | + <Link |
| 177 | + href="https://discord.com/invite/PythNetwork" |
| 178 | + className="underline" |
| 179 | + target="_blank" |
| 180 | + > |
| 181 | + Pyth Discord |
| 182 | + </Link>{" "} |
| 183 | + or the{" "} |
| 184 | + <Link |
| 185 | + href="https://forum.pyth.network" |
| 186 | + className="underline" |
| 187 | + target="_blank" |
| 188 | + > |
| 189 | + Pyth DAO Forum |
| 190 | + </Link>{" "} |
| 191 | + to share your questions, ideas, or feedback. We want to hear what |
| 192 | + you think. |
| 193 | + </p> |
| 194 | + </ChangelogSection> |
| 195 | + </ChangelogMessage> |
| 196 | + ), |
| 197 | + }, |
| 198 | +]; |
0 commit comments