From e9830a47119a86ee9e1ea0e07e3fcfad4cc8ce93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20S=C3=A1nchez?= Date: Wed, 22 Jan 2025 12:05:39 +0100 Subject: [PATCH 1/6] Challange 1 tweaks --- packages/nextjs/data/challenges/1.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/nextjs/data/challenges/1.md b/packages/nextjs/data/challenges/1.md index 601e4ec..666138e 100644 --- a/packages/nextjs/data/challenges/1.md +++ b/packages/nextjs/data/challenges/1.md @@ -10,14 +10,12 @@ Try to complete as many challenges as possible and get all the flags back from t ## Player Progress -Check your progress by visiting `/profile/{YourRegisteredAddress}`. - -You may also connect your registered Ethereum address to this website and view your progress by clicking on "My Flags". +Check your progress by connecting your Ethereum Wallet with the address you are using to play the game and click on "My Flags" on the top of the page. ## Hints - You can use the [/debug](/debug) page or [ABI Ninja](https://abi.ninja/) to interact with the contract -- We recommend beginners use this [Scaffold ETH extension](https://github.com/buidlguidl/ctf.buidlguidl.com/tree/ctf-extension) that contains everything you need to play the game and test your solutions locally. Advanced players may use any means necessary to progress. +- We recommend beginners use this [Scaffold ETH CTF extension](https://github.com/buidlguidl/ctf.buidlguidl.com/tree/extension) that contains everything you need to play the game and test your solutions locally. Advanced players may use any means necessary to progress. - After Challenge #1, you may complete the other challenges in any order. ## FAQs From 1440e24c3eda09acdb53d7665d8402e345f74181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20S=C3=A1nchez?= Date: Wed, 22 Jan 2025 13:21:19 +0100 Subject: [PATCH 2/6] Metadata for FAQ / Stats / User profile --- packages/nextjs/app/faqs/page.tsx | 6 ++++++ packages/nextjs/app/profile/[address]/page.tsx | 10 ++++++++++ packages/nextjs/app/stats/page.tsx | 6 ++++++ 3 files changed, 22 insertions(+) diff --git a/packages/nextjs/app/faqs/page.tsx b/packages/nextjs/app/faqs/page.tsx index 4b6c32d..bfed206 100644 --- a/packages/nextjs/app/faqs/page.tsx +++ b/packages/nextjs/app/faqs/page.tsx @@ -1,4 +1,5 @@ import Link from "next/link"; +import { getMetadata } from "~~/utils/scaffold-eth/getMetadata"; // ToDo: // - Review the existing FAQs @@ -51,6 +52,11 @@ const faqs = [ }, ]; +export const metadata = getMetadata({ + title: "FAQ", + description: "Check out the FAQ for the BuidlGuidl CTF", +}); + export default function FaqsPage() { return (
diff --git a/packages/nextjs/app/profile/[address]/page.tsx b/packages/nextjs/app/profile/[address]/page.tsx index 531382a..0865779 100644 --- a/packages/nextjs/app/profile/[address]/page.tsx +++ b/packages/nextjs/app/profile/[address]/page.tsx @@ -1,6 +1,7 @@ import Image from "next/image"; import { UserData } from "~~/components/UserData"; import { getChallenges } from "~~/utils/getChallenges"; +import { getMetadata } from "~~/utils/scaffold-eth/getMetadata"; interface ProfilePageProps { params: { @@ -8,6 +9,15 @@ interface ProfilePageProps { }; } +export async function generateMetadata({ params }: ProfilePageProps) { + const { address } = params; + const displayAddress = address?.slice(0, 4) + "..." + address?.slice(-4); + return getMetadata({ + title: `${displayAddress} Profile`, + description: `Check out ${address} progress in the BuidlGuidl CTF`, + }); +} + export default async function ProfilePage({ params }: ProfilePageProps) { const { address } = params; const challenges = await getChallenges(); diff --git a/packages/nextjs/app/stats/page.tsx b/packages/nextjs/app/stats/page.tsx index 62b022a..a9f5a6c 100644 --- a/packages/nextjs/app/stats/page.tsx +++ b/packages/nextjs/app/stats/page.tsx @@ -2,10 +2,16 @@ import { useQuery } from "@tanstack/react-query"; import type { NextPage } from "next"; +import { getMetadata } from "~~/utils/scaffold-eth/getMetadata"; const thStyles = "whitespace-nowrap px-3 py-3.5"; const tdStyles = "whitespace-nowrap px-3 py-4"; +export const metadata = getMetadata({ + title: "Stats", + description: "Check out the stats for the BuidlGuidl CTF", +}); + const Stats: NextPage = () => { const { isPending, From 54048fdc9404e3c59b534334475e9725eccfba59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20S=C3=A1nchez?= Date: Wed, 22 Jan 2025 13:29:50 +0100 Subject: [PATCH 3/6] FAQ tweaks --- packages/nextjs/app/faqs/page.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/nextjs/app/faqs/page.tsx b/packages/nextjs/app/faqs/page.tsx index bfed206..6f36526 100644 --- a/packages/nextjs/app/faqs/page.tsx +++ b/packages/nextjs/app/faqs/page.tsx @@ -1,9 +1,5 @@ -import Link from "next/link"; import { getMetadata } from "~~/utils/scaffold-eth/getMetadata"; -// ToDo: -// - Review the existing FAQs -// - Talk about the deployed network (Optimism?) / real ETH const faqs = [ { id: 1, @@ -17,7 +13,7 @@ const faqs = [ question: "How should I complete the challenges?", answer: "Advanced players may use any means necessary to progress through the challenges. We recommend that beginners use this Scaffold ETH extension that contains everything you need to play the game and test your solutions locally:", - link: "https://github.com/buidlguidl/ctf-devcon", + link: "https://github.com/buidlguidl/ctf.buidlguidl.com/tree/extension", }, { id: 3, @@ -29,7 +25,7 @@ const faqs = [ id: 4, question: "What chain/network is this game on?", answer: - "The challenges are deployed on Optimism mainnet. You will need to use real ETH on Optimism in order to complete the challenges.", + "The challenges are deployed on Optimism mainnet. You will need to use real ETH on Optimism in order to complete the challenges. But you can always play locally!", }, { id: 5, @@ -71,9 +67,9 @@ export default function FaqsPage() {
{faq.answer}{" "} {faq.link && ( - + {faq.link} - + )}
From 20190bad8982a9f545cb1007ccaec6ff1482bd05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20S=C3=A1nchez?= Date: Wed, 22 Jan 2025 13:30:33 +0100 Subject: [PATCH 4/6] Move metadata out of client component in Stats page --- packages/nextjs/app/stats/layout.tsx | 10 ++++++++++ packages/nextjs/app/stats/page.tsx | 6 ------ 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 packages/nextjs/app/stats/layout.tsx diff --git a/packages/nextjs/app/stats/layout.tsx b/packages/nextjs/app/stats/layout.tsx new file mode 100644 index 0000000..ee56ae1 --- /dev/null +++ b/packages/nextjs/app/stats/layout.tsx @@ -0,0 +1,10 @@ +import { getMetadata } from "~~/utils/scaffold-eth/getMetadata"; + +export const metadata = getMetadata({ + title: "Stats", + description: "Check out the stats for the BuidlGuidl CTF", +}); + +export default function StatsLayout({ children }: { children: React.ReactNode }) { + return children; +} diff --git a/packages/nextjs/app/stats/page.tsx b/packages/nextjs/app/stats/page.tsx index a9f5a6c..62b022a 100644 --- a/packages/nextjs/app/stats/page.tsx +++ b/packages/nextjs/app/stats/page.tsx @@ -2,16 +2,10 @@ import { useQuery } from "@tanstack/react-query"; import type { NextPage } from "next"; -import { getMetadata } from "~~/utils/scaffold-eth/getMetadata"; const thStyles = "whitespace-nowrap px-3 py-3.5"; const tdStyles = "whitespace-nowrap px-3 py-4"; -export const metadata = getMetadata({ - title: "Stats", - description: "Check out the stats for the BuidlGuidl CTF", -}); - const Stats: NextPage = () => { const { isPending, From b4d91f05d74d563ac70a851bbc7245c52a024ac8 Mon Sep 17 00:00:00 2001 From: pabl0cks Date: Thu, 23 Jan 2025 00:27:54 +0100 Subject: [PATCH 5/6] Adjust metadata --- packages/nextjs/app/faqs/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nextjs/app/faqs/page.tsx b/packages/nextjs/app/faqs/page.tsx index 6f36526..741cd56 100644 --- a/packages/nextjs/app/faqs/page.tsx +++ b/packages/nextjs/app/faqs/page.tsx @@ -49,8 +49,8 @@ const faqs = [ ]; export const metadata = getMetadata({ - title: "FAQ", - description: "Check out the FAQ for the BuidlGuidl CTF", + title: "FAQs", + description: "Check out the FAQs for the BuidlGuidl CTF", }); export default function FaqsPage() { From a991e472920d6df4cbb338a7e279b98ddae3c898 Mon Sep 17 00:00:00 2001 From: pabl0cks Date: Thu, 23 Jan 2025 00:29:55 +0100 Subject: [PATCH 6/6] Grammar fix --- packages/nextjs/data/challenges/1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nextjs/data/challenges/1.md b/packages/nextjs/data/challenges/1.md index 666138e..15422cf 100644 --- a/packages/nextjs/data/challenges/1.md +++ b/packages/nextjs/data/challenges/1.md @@ -10,7 +10,7 @@ Try to complete as many challenges as possible and get all the flags back from t ## Player Progress -Check your progress by connecting your Ethereum Wallet with the address you are using to play the game and click on "My Flags" on the top of the page. +Check your progress by connecting your Ethereum Wallet with the address you are using to play the game and click on "My Flags" at the top of the page. ## Hints