Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
REACT_APP_SERVER_URL=http://localhost:5555
REACT_APP_REPOSITORY_URL=http://localhost:5173
REACT_APP_REPOSITORY_URL=http://repo.staging.sourcify.dev
REACT_APP_VERIFY_URL=http://verify.staging.sourcify.dev
REACT_APP_TAG=development
REACT_APP_OPENROUTER_API_KEY=
Expand Down
57 changes: 29 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
"react-dom": "18.3.1",
"react-dropzone": "11.7.1",
"react-icons": "5.6.0",
"react-router-dom": "7.14.1",
"react-router-dom": "7.14.2",
"react-select-search": "3.0.10",
"react-syntax-highlighter": "15.6.6",
"react-tooltip": "5.30.1",
"recharts": "2.15.4",
"web-vitals": "2.1.4",
"@openrouter/ai-sdk-provider": "2.5.1",
"ai": "6.0.159"
"@openrouter/ai-sdk-provider": "2.8.1",
"ai": "6.0.168"
},
"optionalDependencies": {
"fsevents": "2.3.3"
Expand Down Expand Up @@ -68,9 +68,9 @@
"@types/react-dom": "19.2.3",
"@types/react-syntax-highlighter": "13.5.2",
"autoprefixer": "10.5.0",
"postcss": "8.5.9",
"postcss": "8.5.12",
"react-scripts": "5.0.1",
"tailwindcss": "3.4.19"
},
"homepage": "./"
"homepage": "/"
}
12 changes: 12 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<script>
// Migrate legacy hash-router URLs (#/...) to clean paths.
// /lookup[/<rest>] → /address[/<rest>]; everything else: #/<rest> → /<rest>.
(function () {
var hash = window.location.hash;
if (hash.indexOf("#/") !== 0) return;
var path = hash.slice(1);
var match = path.match(/^\/lookup(\/.*)?$/);
if (match) path = "/address" + (match[1] || "");
window.history.replaceState(null, "", path + window.location.search);
})();
</script>
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@sourcifyeth" />
<meta name="og:title" content="sourcify.eth" />
Expand Down
3 changes: 2 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"bump"
],
"groupName": "all patch and minor dependencies",
"groupSlug": "all-patch-and-minor"
"groupSlug": "all-patch-and-minor",
"minimumReleaseAge": "14 days"
}
],
"ignoreDeps": ["node", "cimg/node"],
Expand Down
19 changes: 14 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { useEffect } from "react";
import { HashRouter, Route, Routes } from "react-router-dom";
import { BrowserRouter, Navigate, Route, Routes, useParams } from "react-router-dom";
import { Tooltip } from "react-tooltip";
import { ContextProvider } from "./Context";
import LandingPage from "./pages/LandingPage";
import Lookup from "./pages/Lookup";
import VerifyRedirect from "./pages/VerifyRedirect";

const LegacyLookupRedirect = () => {
const { address } = useParams();
return <Navigate to={address ? `/address/${address}` : "/address"} replace />;
};

function App() {
useEffect(() => {
if (process.env.REACT_APP_TAG !== "master") {
Expand All @@ -14,16 +20,19 @@ function App() {

return (
<div className="flex min-h-screen text-gray-800 bg-gray-50">
<Tooltip id="global-tooltip" delayHide={300} clickable style={{ zIndex: 9999, maxWidth: "16rem", fontSize: "0.75rem" }} />
<ContextProvider>
<HashRouter>
<BrowserRouter>
<Routes>
<Route path="/verifier" element={<VerifyRedirect />} />
<Route path="/lookup" element={<Lookup />} />
<Route path="/lookup/:address" element={<Lookup />} />
<Route path="/lookup" element={<LegacyLookupRedirect />} />
<Route path="/lookup/:address" element={<LegacyLookupRedirect />} />
<Route path="/address" element={<Lookup />} />
<Route path="/address/:address" element={<Lookup />} />
<Route path="/dataset-playground" element={<LandingPage />} />
<Route path="/" element={<LandingPage />} />
</Routes>
</HashRouter>
</BrowserRouter>
</ContextProvider>
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Tooltip } from "react-tooltip";
import { SiMatrix } from "react-icons/si";
import { RiTwitterXFill } from "react-icons/ri";
import logoText from "../../assets/logo-rounded.svg";
import { DOCS_URL, PLAYGROUND_URL } from "../../constants";
import { DOCS_URL, PLAYGROUND_URL, REPOSITORY_URL } from "../../constants";

const Header = ({ className }: { className?: string }) => {
const [showNav, setShowNav] = useState(false);
Expand Down Expand Up @@ -74,12 +74,12 @@ const Header = ({ className }: { className?: string }) => {
>
Verify
</a>
<Link className="link-underline mx-2 my-2 lg:mx-6 hover:text-ceruleanBlue-500" to="/lookup">
<Link className="link-underline mx-2 my-2 lg:mx-6 hover:text-ceruleanBlue-500" to="/address">
Lookup
</Link>
<a
className="link-underline mx-2 my-2 lg:mx-6 hover:text-ceruleanBlue-500"
href="https://repo.sourcify.dev"
href={REPOSITORY_URL}
>
Contract Repo
</a>
Expand Down
43 changes: 43 additions & 0 deletions src/components/MatchBadge/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { IoCheckmarkDoneCircle, IoCheckmarkCircle } from "react-icons/io5";

interface MatchBadgeProps {
match: "match" | "exact_match" | null;
className?: string;
small?: boolean;
}

const MatchBadge = ({ match, className = "", small = false }: MatchBadgeProps) => {
const sizeClasses = small ? "px-2 py-1 text-xs md:text-sm whitespace-nowrap" : "px-2 py-1 md:px-3 md:py-1 text-sm md:text-base whitespace-nowrap";
const iconSize = small ? "text-xl" : "text-2xl md:text-3xl";

if (!match) {
return (
<span
className={`inline-flex items-center ${sizeClasses} rounded-md font-semibold border bg-gray-100 text-gray-600 border-gray-200 flex-shrink-0 ${className}`}
>
<span className={`mr-1 ${iconSize}`}>-</span> No Match
</span>
);
}

const isExactMatch = match === "exact_match";
const label = isExactMatch ? "Exact Match" : "Match";
const tooltipContent = isExactMatch
? "Exact match: The onchain and compiled bytecode match exactly, including the metadata hashes."
: "Match: The onchain and compiled bytecode match, but metadata hashes differ or don't exist.";

return (
<span
className={`inline-flex items-center ${sizeClasses} rounded-md font-semibold border bg-green-100 text-green-800 border-green-200 cursor-help flex-shrink-0 ${className}`}
data-tooltip-id="global-tooltip"
data-tooltip-content={tooltipContent}
>
<span className={`mr-1 ${iconSize}`}>
{isExactMatch ? <IoCheckmarkDoneCircle /> : <IoCheckmarkCircle />}
</span>
{label}
</span>
);
};

export default MatchBadge;
35 changes: 35 additions & 0 deletions src/components/PageLayout/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import type { ReactNode } from "react";

interface PageLayoutProps {
children: ReactNode;
maxWidth?: "max-w-4xl" | "max-w-6xl";
title?: string;
subtitle?: string;
}

const PageLayout = ({ children, maxWidth = "max-w-4xl", title, subtitle }: PageLayoutProps) => {
return (
<div className="flex-1 bg-ceruleanBlue-50 pt-6 pb-12">
<div className={`${maxWidth} mx-auto px-4 md:px-8 mt-6 md:mt-12`}>
<div className="relative mt-4">
<div className="absolute w-full h-full bg-ceruleanBlue-500 rounded-lg -top-1" />
<div className="relative bg-white shadow-lg rounded-lg">
{(title || subtitle) && (
<div className="text-center p-4 md:p-8 border-b border-gray-200">
{title && (
<h1 className="text-2xl md:text-3xl font-semibold text-gray-900 tracking-tight">{title}</h1>
)}
{subtitle && (
<p className="max-w-2xl mx-auto text-sm md:text-base text-gray-600 mt-1">{subtitle}</p>
)}
</div>
)}
<div className="p-4 md:p-8">{children}</div>
</div>
</div>
</div>
</div>
);
};

export default PageLayout;
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const REPOSITORY_URL = process.env.REACT_APP_REPOSITORY_URL;
export const VERIFY_URL = process.env.REACT_APP_VERIFY_URL;
export const SERVER_URL = process.env.REACT_APP_SERVER_URL;
export const BIGQUERY_API_URL = process.env.REACT_APP_BIGQUERY_API_URL;
export const BIGQUERY_DATASET_NAME =
Expand Down
Loading
Loading