From 252d8698fd93b0317a71698b4924bc4a60946a8f Mon Sep 17 00:00:00 2001 From: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> Date: Tue, 23 Dec 2025 20:44:42 +0100 Subject: [PATCH 1/3] chore: add mint button --- examples/CRISP/client/.env.example | 4 +- .../CRISP/client/src/components/Navbar.tsx | 11 +++ .../client/src/hooks/generic/useMintToken.tsx | 73 +++++++++++++++++++ examples/CRISP/client/src/utils/abi.ts | 6 ++ examples/CRISP/client/src/utils/constants.ts | 1 + examples/CRISP/server/src/cli/approve.rs | 2 +- 6 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 examples/CRISP/client/src/hooks/generic/useMintToken.tsx create mode 100644 examples/CRISP/client/src/utils/abi.ts create mode 100644 examples/CRISP/client/src/utils/constants.ts diff --git a/examples/CRISP/client/.env.example b/examples/CRISP/client/.env.example index a17f4aedbb..02234436a2 100644 --- a/examples/CRISP/client/.env.example +++ b/examples/CRISP/client/.env.example @@ -1,3 +1,5 @@ VITE_ENCLAVE_API=http://127.0.0.1:4000 -VITE_TWITTER_SERVERLESS_API= VITE_WALLETCONNECT_PROJECT_ID= +# A token with a public mint function. Also used as the fee token for Enclave. +# This is its default address in Hardhat node +VITE_CRISP_TOKEN="0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0" diff --git a/examples/CRISP/client/src/components/Navbar.tsx b/examples/CRISP/client/src/components/Navbar.tsx index 1c4d1d53ca..1ebcd20b11 100644 --- a/examples/CRISP/client/src/components/Navbar.tsx +++ b/examples/CRISP/client/src/components/Navbar.tsx @@ -9,6 +9,7 @@ import Logo from '@/assets/icons/logo.svg' import { Link } from 'react-router-dom' import NavMenu from '@/components/NavMenu' import { ConnectKitButton } from 'connectkit' +import useToken from '@/hooks/generic/useMintToken' const PAGES = [ { @@ -22,6 +23,8 @@ const PAGES = [ ] const Navbar: React.FC = () => { + const { mintTokens, isMinting } = useToken() + return (