From 2507bfd65da092affaa4479a09bdcf98d207d30a Mon Sep 17 00:00:00 2001 From: murderteeth Date: Tue, 7 Apr 2026 21:43:28 +0000 Subject: [PATCH] Add disclaimer banner for hosted site The hosted site at safeutils.openzeppelin.com displays no indication that the tool is unaudited and intended as a proof of concept, despite the README explicitly stating this. Add a dismissible warning banner to the UI that mirrors the README disclaimer, including links to the Terms of Service and the GitHub repo for running locally. The banner is hidden on localhost since the README recommends local usage as the safer option. Set NEXT_PUBLIC_ALWAYS_SHOW_DISCLAIMER=true to force it on for local testing. Co-Authored-By: Claude Opus 4.6 (1M context) --- app/app/layout.tsx | 2 + app/components/disclaimer-banner.tsx | 60 ++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 app/components/disclaimer-banner.tsx diff --git a/app/app/layout.tsx b/app/app/layout.tsx index 648acfb..9d8dd28 100644 --- a/app/app/layout.tsx +++ b/app/app/layout.tsx @@ -6,6 +6,7 @@ import { Footer } from '@/components/footer' import { ThemeProvider } from '@/components/ThemeProvider' import { GoogleAnalytics } from '@next/third-parties/google' import Navbar from '@/components/navbar' +import { DisclaimerBanner } from '@/components/disclaimer-banner' const inter = Inter({ subsets: ['latin'] }) @@ -50,6 +51,7 @@ export default function RootLayout({
+
{children}
diff --git a/app/components/disclaimer-banner.tsx b/app/components/disclaimer-banner.tsx new file mode 100644 index 0000000..20b350a --- /dev/null +++ b/app/components/disclaimer-banner.tsx @@ -0,0 +1,60 @@ +"use client"; + +import { useState, useEffect } from "react"; +import { AlertTriangle, X } from "lucide-react"; + +const ALWAYS_SHOW = process.env.NEXT_PUBLIC_ALWAYS_SHOW_DISCLAIMER === "true"; + +export function DisclaimerBanner() { + const [dismissed, setDismissed] = useState(false); + const [isLocalhost, setIsLocalhost] = useState(!ALWAYS_SHOW); + + useEffect(() => { + if (ALWAYS_SHOW) return; + const host = window.location.hostname; + setIsLocalhost(host === "localhost" || host === "127.0.0.1"); + }, []); + + if (dismissed || isLocalhost) { + return null; + } + + return ( +
+
+
+ +

+ This tool has not been audited and is provided as a proof of concept. + Use at your own risk per our{" "} + + Terms of Service + + . Where possible, you should{" "} + + run this tool locally + + . +

+
+ +
+
+ ); +}