From becbfdf5e5559ea0ee24aa4e064e6995a6f13aac Mon Sep 17 00:00:00 2001 From: Oluwagbemiga Date: Mon, 8 Dec 2025 00:22:26 +0100 Subject: [PATCH 1/9] Implement new home page layout with wallet connection, contract interaction, and feature highlights for ChainReCovenant. Enhance user experience with dynamic agreement stats and improved design elements. --- frontend/app/page.tsx | 253 ++++++++++++++++++++++++++++++++---------- 1 file changed, 197 insertions(+), 56 deletions(-) diff --git a/frontend/app/page.tsx b/frontend/app/page.tsx index 295f8fd..ac3a6fd 100644 --- a/frontend/app/page.tsx +++ b/frontend/app/page.tsx @@ -1,65 +1,206 @@ -import Image from "next/image"; +'use client'; + +import { useAppKit } from '@reown/appkit/react'; +import { useAccount, useReadContract } from 'wagmi'; +import { CONTRACT_ADDRESSES } from '@/config/contracts'; +import { CHAINRECOVENANT_ABI } from '@/config/abi'; +import Link from 'next/link'; export default function Home() { + const { open } = useAppKit(); + const { address, isConnected } = useAccount(); + + // Read total agreements from contract + const { data: totalAgreements } = useReadContract({ + address: CONTRACT_ADDRESSES.ChainReCovenant as `0x${string}`, + abi: CHAINRECOVENANT_ABI, + functionName: 'getTotalAgreements', + }); + + // Read user agreements if connected + const { data: userAgreements } = useReadContract({ + address: CONTRACT_ADDRESSES.ChainReCovenant as `0x${string}`, + abi: CHAINRECOVENANT_ABI, + functionName: 'getUserAgreements', + args: address ? [address] : undefined, + query: { + enabled: !!address, + }, + }); + return ( -
-
- Next.js logo -
-

- To get started, edit the page.tsx file. -

-

- Looking for a starting point or more instructions? Head over to{" "} - - Templates - {" "} - or the{" "} - + {/* Header */} +

+
+
+ 📜 +

+ ChainReCovenant +

+
+ +
+
+ + {/* Hero Section */} +
+

+ Legal Agreements on the Blockchain +

+

+ Create, sign, and enforce legal-style agreements with automated term enforcement. + Trustless, transparent, and immutable. +

+ +
-
+ + {/* Stats Section */} +
+
+
+
+
+ {totalAgreements?.toString() || '0'} +
+
Total Agreements
+
+ +
+
🤝
+
+ {isConnected ? (userAgreements?.length.toString() || '0') : '0'} +
+
Your Agreements
+
+ +
+
+
+ Base +
+
Deployed on Base
+
+
+
+ + {/* Features */} +
+

Key Features

+
+ + + + + + +
+
+ + {/* Contract Info */} +
+
+

Deployed on Base Mainnet

+
+
+ ChainReCovenant: + + {CONTRACT_ADDRESSES.ChainReCovenant} + + + View on BaseScan ↗ + +
+
+
+
+ + {/* Footer */} +
+ +
+ ); +} + +function FeatureCard({ icon, title, description }: { icon: string; title: string; description: string }) { + return ( +
+
{icon}
+

{title}

+

{description}

); } From bb5a0ef959485c088bd936580a6a0e6bed680752 Mon Sep 17 00:00:00 2001 From: Oluwagbemiga Date: Mon, 8 Dec 2025 00:24:06 +0100 Subject: [PATCH 2/9] Refactor layout: replace Geist fonts with Inter font, update metadata for ChainReCovenant, and wrap children in Web3Provider for enhanced context management. --- frontend/app/layout.tsx | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/frontend/app/layout.tsx b/frontend/app/layout.tsx index f7fa87e..95af746 100644 --- a/frontend/app/layout.tsx +++ b/frontend/app/layout.tsx @@ -1,20 +1,13 @@ import type { Metadata } from "next"; -import { Geist, Geist_Mono } from "next/font/google"; +import { Inter } from "next/font/google"; import "./globals.css"; +import { Web3Provider } from "@/contexts/Web3Provider"; -const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], -}); - -const geistMono = Geist_Mono({ - variable: "--font-geist-mono", - subsets: ["latin"], -}); +const inter = Inter({ subsets: ["latin"] }); export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", + title: "ChainReCovenant - On-Chain Legal Agreements", + description: "Create and execute legal-style agreements on-chain with automated enforcement", }; export default function RootLayout({ @@ -24,10 +17,10 @@ export default function RootLayout({ }>) { return ( - - {children} + + + {children} + ); From 0beb622bd3ce52c198cd33263b631b04f436aee3 Mon Sep 17 00:00:00 2001 From: Oluwagbemiga Date: Mon, 8 Dec 2025 00:25:46 +0100 Subject: [PATCH 3/9] Add Coinbase Wallet SDK dependency to enhance wallet integration capabilities. --- frontend/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/package.json b/frontend/package.json index 55911de..027f305 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,6 +9,7 @@ "lint": "eslint" }, "dependencies": { + "@coinbase/wallet-sdk": "^4.3.7", "@reown/appkit": "^1.8.14", "@reown/appkit-adapter-wagmi": "^1.8.14", "@tanstack/react-query": "^5.90.12", From 3224b70ff83e1ba1f0b9b82f2da616df64d6a291 Mon Sep 17 00:00:00 2001 From: Oluwagbemiga Date: Mon, 8 Dec 2025 00:27:05 +0100 Subject: [PATCH 4/9] Add Gemini Wallet Core dependency to support additional wallet integration. --- frontend/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/package.json b/frontend/package.json index 027f305..d313216 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "@coinbase/wallet-sdk": "^4.3.7", + "@gemini-wallet/core": "^0.3.2", "@reown/appkit": "^1.8.14", "@reown/appkit-adapter-wagmi": "^1.8.14", "@tanstack/react-query": "^5.90.12", From db62eb7594f4302d3a5907a856e72166018f80c1 Mon Sep 17 00:00:00 2001 From: Oluwagbemiga Date: Mon, 8 Dec 2025 00:30:38 +0100 Subject: [PATCH 5/9] Add Safe Apps SDK and Provider dependencies to enhance wallet integration capabilities. --- frontend/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/package.json b/frontend/package.json index d313216..1765290 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -13,6 +13,8 @@ "@gemini-wallet/core": "^0.3.2", "@reown/appkit": "^1.8.14", "@reown/appkit-adapter-wagmi": "^1.8.14", + "@safe-global/safe-apps-provider": "^0.18.6", + "@safe-global/safe-apps-sdk": "^9.1.0", "@tanstack/react-query": "^5.90.12", "next": "16.0.7", "react": "19.2.0", From 84644f8fefee358fd1079023a7fe8dd1ebe0a604 Mon Sep 17 00:00:00 2001 From: Oluwagbemiga Date: Mon, 8 Dec 2025 00:34:56 +0100 Subject: [PATCH 6/9] Add MetaMask SDK dependency to expand wallet integration options. --- frontend/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/package.json b/frontend/package.json index 1765290..7e099da 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -11,6 +11,7 @@ "dependencies": { "@coinbase/wallet-sdk": "^4.3.7", "@gemini-wallet/core": "^0.3.2", + "@metamask/sdk": "^0.33.1", "@reown/appkit": "^1.8.14", "@reown/appkit-adapter-wagmi": "^1.8.14", "@safe-global/safe-apps-provider": "^0.18.6", From 10563594a12c16f40f008400fb42ae5e831fc860 Mon Sep 17 00:00:00 2001 From: Oluwagbemiga Date: Mon, 8 Dec 2025 00:37:33 +0100 Subject: [PATCH 7/9] Enhance Next.js configuration: add webpack rules to exclude test files from bundling, suppress TypeScript and ESLint warnings during builds, and update package.json to include WalletConnect Ethereum provider dependency. --- frontend/next.config.ts | 20 +++++++++++++++++++- frontend/package.json | 2 ++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/frontend/next.config.ts b/frontend/next.config.ts index e9ffa30..b68969f 100644 --- a/frontend/next.config.ts +++ b/frontend/next.config.ts @@ -1,7 +1,25 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { - /* config options here */ + webpack: (config, { isServer }) => { + // Exclude test files and unnecessary node_modules from bundling + config.module = config.module || {}; + config.module.rules = config.module.rules || []; + + config.module.rules.push({ + test: /node_modules\/thread-stream\/(test|bench)/, + use: 'ignore-loader', + }); + + return config; + }, + // Suppress warnings from WalletConnect/Reown dependencies + typescript: { + ignoreBuildErrors: false, + }, + eslint: { + ignoreDuringBuilds: false, + }, }; export default nextConfig; diff --git a/frontend/package.json b/frontend/package.json index 7e099da..0ceb957 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -17,6 +17,7 @@ "@safe-global/safe-apps-provider": "^0.18.6", "@safe-global/safe-apps-sdk": "^9.1.0", "@tanstack/react-query": "^5.90.12", + "@walletconnect/ethereum-provider": "^2.21.10", "next": "16.0.7", "react": "19.2.0", "react-dom": "19.2.0", @@ -30,6 +31,7 @@ "@types/react-dom": "^19", "eslint": "^9", "eslint-config-next": "16.0.7", + "ignore-loader": "^0.1.2", "tailwindcss": "^4", "typescript": "^5" } From 991e8fbe1874319a7d7174019dad6dd0531de012 Mon Sep 17 00:00:00 2001 From: Oluwagbemiga Date: Mon, 8 Dec 2025 00:39:42 +0100 Subject: [PATCH 8/9] Refactor Next.js configuration: remove custom webpack rules, enable Turbopack, and adjust TypeScript settings for improved build performance. --- frontend/next.config.ts | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/frontend/next.config.ts b/frontend/next.config.ts index b68969f..1dd5b79 100644 --- a/frontend/next.config.ts +++ b/frontend/next.config.ts @@ -1,25 +1,13 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { - webpack: (config, { isServer }) => { - // Exclude test files and unnecessary node_modules from bundling - config.module = config.module || {}; - config.module.rules = config.module.rules || []; - - config.module.rules.push({ - test: /node_modules\/thread-stream\/(test|bench)/, - use: 'ignore-loader', - }); - - return config; - }, - // Suppress warnings from WalletConnect/Reown dependencies + // Enable Turbopack (Next.js 16 default) + turbopack: {}, + + // TypeScript config typescript: { ignoreBuildErrors: false, }, - eslint: { - ignoreDuringBuilds: false, - }, }; export default nextConfig; From 5ce733fe1cc9b6a76fea3534009ad03f0be5a821 Mon Sep 17 00:00:00 2001 From: Oluwagbemiga Date: Mon, 8 Dec 2025 00:42:40 +0100 Subject: [PATCH 9/9] Add Porto dependency to package.json for enhanced project functionality. --- frontend/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/package.json b/frontend/package.json index 0ceb957..4461c69 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -19,6 +19,7 @@ "@tanstack/react-query": "^5.90.12", "@walletconnect/ethereum-provider": "^2.21.10", "next": "16.0.7", + "porto": "^0.2.37", "react": "19.2.0", "react-dom": "19.2.0", "viem": "^2.41.2",