Skip to content

Commit

Permalink
Feature flag the create2 verification.
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Viénot <[email protected]>
  • Loading branch information
svienot committed Oct 18, 2023
1 parent 100f26b commit 3585c71
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ui/public/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"GITHUB_IMPORT": false,
"CONTRACT_IMPORT": false,
"JSON_IMPORT": false,
"OPEN_IN_REMIX": false
"OPEN_IN_REMIX": false,
"CREATE2_VERIFICATION": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Create2Form from "./Create2Form";
import Invalid from "./Invalid";
import Label from "./Label";
import Missing from "./Missing";
import {configuration} from "../../../../utils/Configuration";

type CheckedContractProps = {
checkedContract: SendableContract;
Expand Down Expand Up @@ -112,7 +113,7 @@ const CheckedContract: React.FC<CheckedContractProps> = ({

{/* Collapsed section */}
<div className={`${collapsed ? "hidden" : ""} break-words px-4 p-4`}>
<div className="flex flex-row flex-wrap gap-3 mt-4 justify-center md:justify-start mb-6">
{configuration.create2Verification && <div className="flex flex-row flex-wrap gap-3 mt-4 justify-center md:justify-start mb-6">
<div className="">
<Button
type={
Expand All @@ -139,7 +140,7 @@ const CheckedContract: React.FC<CheckedContractProps> = ({
Verify create2 contract
</Button>
</div>
</div>
</div>}
{verifyMethodSelected === VerifyMethods.DEPLOYED &&
["perfect", "partial", "error"].includes(customStatus) && (
<ChainAddressForm
Expand Down
5 changes: 5 additions & 0 deletions ui/src/utils/Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class Configuration {
private _contractImport: boolean | undefined;
private _jsonImport: boolean | undefined;
private _openInRemix: boolean | undefined;
private _create2Verification: boolean | undefined;
private _repositoryServerUrlPartialMatch: string | undefined;
private _ipfsIpnsGatewayUrl: string | undefined;
private _sessionDataUrl: string | undefined;
Expand Down Expand Up @@ -94,6 +95,9 @@ export class Configuration {
get openInRemix(): boolean {
return this._openInRemix ?? false
}
get create2Verification(): boolean {
return this._create2Verification ?? false
}

public readConfig = async (): Promise<void> => {

Expand All @@ -117,6 +121,7 @@ export class Configuration {
this._contractImport = configData.CONTRACT_IMPORT
this._jsonImport = configData.JSON_IMPORT
this._openInRemix = configData.OPEN_IN_REMIX
this._create2Verification = configData.CREATE2_VERIFICATION

this._repositoryServerUrlFullMatch = `${this._repositoryServerUrl}/contracts/full_match`
this._repositoryServerUrlPartialMatch = `${this._repositoryServerUrl}/contracts/partial_match`
Expand Down

0 comments on commit 3585c71

Please sign in to comment.