Skip to content

Commit 7632ed1

Browse files
authored
Merge pull request #20 from sourcifyeth/staging
Update "perfect"/"partial" naming
2 parents 6d2502a + b1cfa06 commit 7632ed1

File tree

10 files changed

+42
-98
lines changed

10 files changed

+42
-98
lines changed

.env.build.main

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
REACT_APP_SERVER_URL=https://sourcify.dev/server
2-
REACT_APP_REPOSITORY_SERVER_URL=https://repo.sourcify.dev
2+
REACT_APP_REPOSITORY_URL=https://repo.sourcify.dev
33
# Use DNSLink for IPNS
44
REACT_APP_IPNS=repo.sourcify.dev
5-
REACT_APP_TAG=master
5+
REACT_APP_TAG=master

.env.build.staging

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
REACT_APP_SERVER_URL=https://staging.sourcify.dev/server
2-
REACT_APP_REPOSITORY_SERVER_URL=https://repo.staging.sourcify.dev
2+
REACT_APP_REPOSITORY_URL=https://repo.staging.sourcify.dev
33
# Use DNSLink for IPNS
44
REACT_APP_IPNS=repo.staging.sourcify.dev
5-
REACT_APP_TAG=staging
5+
REACT_APP_TAG=staging

.env.development

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
REACT_APP_SERVER_URL=http://localhost:5555
2-
REACT_APP_REPOSITORY_SERVER_URL=http://localhost:10000
2+
REACT_APP_REPOSITORY_URL=http://localhost:3000
33
REACT_APP_IPNS=repo.staging.sourcify.dev
4-
REACT_APP_TAG=development
4+
REACT_APP_TAG=development

src/constants.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
export const REPOSITORY_SERVER_URL =
2-
process.env.REACT_APP_REPOSITORY_SERVER_URL;
1+
export const REPOSITORY_URL = process.env.REACT_APP_REPOSITORY_URL;
32
export const SERVER_URL = process.env.REACT_APP_SERVER_URL;
43
export const DOCS_URL = "https://docs.sourcify.dev";
54
export const PLAYGROUND_URL = "https://playground.sourcify.dev";
65

7-
export const REPOSITORY_SERVER_URL_FULL_MATCH = `${REPOSITORY_SERVER_URL}/contracts/full_match`;
8-
export const REPOSITORY_SERVER_URL_PARTIAL_MATCH = `${REPOSITORY_SERVER_URL}/contracts/partial_match`;
96
export const IPFS_IPNS_GATEWAY_URL = `https://cloudflare-ipfs.com/ipns/${process.env.REACT_APP_IPNS}`;
107
export const GITTER_URL = `https://gitter.im/ethereum/source-verify`;
118
export const GITHUB_URL = `https://github.com/ethereum/sourcify`;

src/pages/LandingPage/ChartSection.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const Chart = () => {
3838
useEffect(() => {
3939
// We are temporarily putting the stats.json file in the static folder on GCP.
4040
// This assumes that the file is available.
41-
fetch(`/static/stats.json`)
41+
fetch(`https://sourcify.dev/static/stats.json`)
4242
.then((res) => res.json())
4343
.then((json) => setStats(json))
4444
.catch(() => console.error("error fetching stats"));
@@ -178,8 +178,8 @@ const Chart = () => {
178178
tick={{ fontSize: windowWidth < 768 ? 8 : 12 }}
179179
/>
180180
<Legend verticalAlign="top" align="center" height={36} />
181-
<Bar name="Full Matches" dataKey="fullMatch" fill="#2B50AA" stackId="a" />
182-
<Bar name="Partial Matches" dataKey="partialMatch" fill="#7693DA" stackId="a" />
181+
<Bar name="Exact Matches" dataKey="fullMatch" fill="#2B50AA" stackId="a" />
182+
<Bar name="Matches" dataKey="partialMatch" fill="#7693DA" stackId="a" />
183183
</BarChart>
184184
</ResponsiveContainer>
185185
</div>

src/pages/LandingPage/FAQ.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ export default function FAQ() {
107107
for more.
108108
</li>
109109
<li>
110-
Sourcify supports "full match"es, which means the verified source-code is cryptographically guaranteed to
110+
Sourcify supports "exact match"es, which means the verified source-code is cryptographically guaranteed to
111111
be the same as the original one, even whitespaces, comments etc. See{" "}
112112
<a
113-
href="https://docs.sourcify.dev/docs/full-vs-partial-match/"
113+
href="https://docs.sourcify.dev/docs/exact-match-vs-match/"
114114
target="_blank"
115115
rel="noreferrer"
116116
className="underline"

src/pages/Lookup/Result.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { HiBadgeCheck, HiOutlineArrowLeft, HiOutlineInformationCircle, HiX } fro
44
import { Link } from "react-router-dom";
55
import { Tooltip } from "react-tooltip";
66
import Button from "../../components/Button";
7-
import { REPOSITORY_SERVER_URL_FULL_MATCH, REPOSITORY_SERVER_URL_PARTIAL_MATCH } from "../../constants";
7+
import { REPOSITORY_URL } from "../../constants";
88
import { Context } from "../../Context";
99
import { CheckAllByAddressResult } from "../../types";
1010
import { isBrowser } from "react-device-detect";
@@ -20,10 +20,9 @@ const URL_TYPE = {
2020
};
2121

2222
const generateUrl = (type: string, chainId: string, address: string, status: string) => {
23-
const REPO_URL = status === "partial" ? REPOSITORY_SERVER_URL_PARTIAL_MATCH : REPOSITORY_SERVER_URL_FULL_MATCH;
2423
if (type === URL_TYPE.REMIX)
2524
return `https://remix.ethereum.org/?#activate=contract-verification&call=contract-verification//lookupAndSave//sourcify//${chainId}//${address}`;
26-
return `${REPO_URL}/${chainId}/${address}/`;
25+
return `${REPOSITORY_URL}/${chainId}/${address}/`;
2726
};
2827

2928
type NetworkRowProp = {
@@ -45,19 +44,19 @@ type MatchStatusProps = {
4544
};
4645
const PerfectMatchInfoText = (
4746
<span>
48-
A perfect match indicates the Solidity source code does not deviate a single byte from the source code when
49-
deployed. <br /> See{" "}
50-
<a href="https://docs.sourcify.dev/docs/full-vs-partial-match" className="underline cursor">
47+
An exact match indicates the Solidity source code does not deviate a single byte from the source code when deployed.{" "}
48+
<br /> See{" "}
49+
<a href="https://docs.sourcify.dev/docs/exact-match-vs-match" className="underline cursor">
5150
docs
5251
</a>{" "}
5352
for details.
5453
</span>
5554
);
5655
const PartialMatchInfoText = (
5756
<span>
58-
A partial match indicates the Solidity source code functionally corresponds to the deployed contract but some
59-
aspects of the source code might differ from the original source code. <br /> See{" "}
60-
<a href="https://docs.sourcify.dev/docs/full-vs-partial-match" className="underline cursor">
57+
A match indicates the Solidity source code functionally corresponds to the deployed contract but some aspects of the
58+
source code might differ from the original source code. <br /> See{" "}
59+
<a href="https://docs.sourcify.dev/docs/exact-match-vs-match" className="underline cursor">
6160
docs
6261
</a>{" "}
6362
for details.
@@ -74,7 +73,7 @@ const MatchStatusBadge = ({ status }: MatchStatusProps) => {
7473
data-tooltip-id="perfect-info"
7574
data-html={true}
7675
>
77-
{status} match
76+
exact match
7877
</span>
7978
</>
8079
);
@@ -89,7 +88,7 @@ const MatchStatusBadge = ({ status }: MatchStatusProps) => {
8988
data-tooltip-id="partial-info"
9089
data-html={true}
9190
>
92-
{status} match
91+
match
9392
</span>
9493
</>
9594
);
@@ -152,7 +151,7 @@ const InfoText = () => (
152151
<span>
153152
Sourcify verification means a matching Solidity source code of the <br /> contract is available on the Sourcify
154153
repo. <br /> See{" "}
155-
<a href="https://docs.sourcify.dev/docs/full-vs-partial-match" className="underline cursor">
154+
<a href="https://docs.sourcify.dev/docs/exact-match-vs-match" className="underline cursor">
156155
docs
157156
</a>{" "}
158157
for details.

src/pages/Verifier/CheckedContractsView/CheckedContract/ChainAddressForm/Message.tsx

Lines changed: 16 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import { useContext } from "react";
22
import { HiCheck, HiExclamation } from "react-icons/hi";
33
import { Context } from "../../../../../Context";
4-
import {
5-
CheckAllByAddressResult,
6-
SendableContract,
7-
} from "../../../../../types";
8-
import { generateRepoLink } from "../../../../../utils/utils";
4+
import { CheckAllByAddressResult, SendableContract } from "../../../../../types";
5+
import { REPOSITORY_URL } from "../../../../../constants";
96

107
// Message displayed after each interaction inside the container
118
type MessageProps = {
@@ -20,38 +17,31 @@ type RepoLinkProps = {
2017
address: string;
2118
overrideLabel?: string;
2219
};
23-
const RepoLinks = ({
24-
chainIds,
25-
status,
26-
address,
27-
overrideLabel,
28-
}: RepoLinkProps) => {
20+
const RepoLinks = ({ chainIds, status, address, overrideLabel }: RepoLinkProps) => {
2921
const { sourcifyChainMap } = useContext(Context);
3022

3123
return (
3224
<p>
3325
{status === "perfect" && !overrideLabel && (
3426
<>
35-
<b>Fully verified</b> at{" "}
27+
<b>verified (exact match)</b> at{" "}
3628
</>
3729
)}
3830
{status === "partial" && !overrideLabel && (
3931
<>
40-
<b>Partially verified</b> at{" "}
32+
<b>verified (match)</b> at{" "}
4133
</>
4234
)}
4335
{chainIds.map((chainId, i) => {
4436
return (
4537
<span>
4638
{i > 0 && ", "}
4739
<a
48-
href={generateRepoLink(chainId, address, status)}
40+
href={`${REPOSITORY_URL}/${chainId}/${address}/`}
4941
className="underline"
5042
key={`${address}-${chainId}-repo-link`}
5143
>
52-
{overrideLabel ||
53-
sourcifyChainMap[parseInt(chainId)].title ||
54-
sourcifyChainMap[parseInt(chainId)].name}{" "}
44+
{overrideLabel || sourcifyChainMap[parseInt(chainId)].title || sourcifyChainMap[parseInt(chainId)].name}{" "}
5545
(#{chainId})
5646
</a>
5747
</span>
@@ -60,37 +50,20 @@ const RepoLinks = ({
6050
</p>
6151
);
6252
};
63-
const Message = ({
64-
customStatus,
65-
foundMatches,
66-
checkedContract,
67-
}: MessageProps) => {
53+
const Message = ({ customStatus, foundMatches, checkedContract }: MessageProps) => {
6854
const { sourcifyChainMap } = useContext(Context);
6955
const chain = sourcifyChainMap[parseInt(checkedContract.chainId as string)];
70-
const bgColor =
71-
customStatus === "perfect" ? "bg-green-100" : "bg-partialMatch-100";
72-
const outlineColor =
73-
customStatus === "perfect"
74-
? "outline-green-400"
75-
: "outline-partialMatch-400";
76-
const textColor =
77-
customStatus === "perfect" ? "text-green-500" : "text-partialMatch-500";
78-
const darkTextColor =
79-
customStatus === "perfect" ? "text-green-700" : "text-partialMatch-700";
56+
const bgColor = customStatus === "perfect" ? "bg-green-100" : "bg-partialMatch-100";
57+
const outlineColor = customStatus === "perfect" ? "outline-green-400" : "outline-partialMatch-400";
58+
const textColor = customStatus === "perfect" ? "text-green-500" : "text-partialMatch-500";
8059
// Show success after successful verification
8160
if (chain && (customStatus === "perfect" || customStatus === "partial")) {
8261
return (
83-
<div
84-
className={`${bgColor} px-4 py-2 rounded-md outline-2 ${outlineColor} outline`}
85-
>
62+
<div className={`${bgColor} px-4 py-2 rounded-md outline-2 ${outlineColor} outline`}>
8663
<p className="break-all">
8764
<HiCheck className={`${textColor} inline mr-1 align-middle`} />
88-
Verification successful!{" "}
89-
<span className={`${darkTextColor} font-bold`}>
90-
{customStatus}ly
91-
</span>{" "}
92-
verified at <b>{chain.title || chain.name}</b>:
93-
{checkedContract.address}
65+
Verification successful! verified {customStatus === "perfect" ? "(exact match) " : "(match) "}
66+
at <b>{chain.title || chain.name}</b>:{checkedContract.address}
9467
{checkedContract?.address && (
9568
<RepoLinks
9669
chainIds={[chain.chainId.toString()]}
@@ -132,18 +105,10 @@ const Message = ({
132105
Contract <b>{foundMatches.address}</b> is already verified:
133106
</p>
134107
{perfectMatchChainIds.length > 0 && (
135-
<RepoLinks
136-
chainIds={perfectMatchChainIds}
137-
status="perfect"
138-
address={foundMatches.address}
139-
/>
108+
<RepoLinks chainIds={perfectMatchChainIds} status="perfect" address={foundMatches.address} />
140109
)}
141110
{partialMatchChainIds.length > 0 && (
142-
<RepoLinks
143-
chainIds={partialMatchChainIds}
144-
status="partial"
145-
address={foundMatches.address}
146-
/>
111+
<RepoLinks chainIds={partialMatchChainIds} status="partial" address={foundMatches.address} />
147112
)}
148113
</div>
149114
);

src/pages/Verifier/CheckedContractsView/CheckedContract/Label.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ interface ILABELS {
88
[key: string]: string;
99
}
1010
const LABELS: ILABELS = {
11-
perfect: "Perfect Match",
12-
partial: "Partial Match",
11+
perfect: "Exact Match",
12+
partial: "Match",
1313
missing: "Files Missing",
1414
invalid: "Invalid Files",
1515
error: "Chain & Address Missing",
@@ -34,12 +34,7 @@ const LABEL_TEXT: ILABELS = {
3434
const Label: React.FC<LabelProps> = ({ customStatus }) => {
3535
return (
3636
<span
37-
className={
38-
`px-3 py-2 mr-2 text-xs rounded-full ` +
39-
LABEL_BG[customStatus] +
40-
" " +
41-
LABEL_TEXT[customStatus]
42-
}
37+
className={`px-3 py-2 mr-2 text-xs rounded-full ` + LABEL_BG[customStatus] + " " + LABEL_TEXT[customStatus]}
4338
// className={`px-3 py-2 mr-2 bg-opacity-70 bg-${LABEL_BG[customStatus]} text-${LABEL_TEXT[customStatus]} text-xs rounded-full`}
4439
>
4540
{LABELS[customStatus]}

src/utils/utils.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)