Skip to content

Commit

Permalink
fix(pages): pr comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Poafs1 committed Jan 13, 2025
1 parent 4cfa055 commit 2ac6106
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { EvmContractDetailsTxs } from "./EvmContractDetailsTxs";

interface EvmContractDetailsOverviewProps {
contractAddressBech: BechAddr20;
contractAddress: HexAddr20;
contractAddressHex: HexAddr20;
hash: Option<string>;
evmHash: Nullish<string>;
sender: Option<BechAddr>;
Expand All @@ -34,7 +34,7 @@ interface EvmContractDetailsOverviewProps {

export const EvmContractDetailsOverview = ({
contractAddressBech,
contractAddress,
contractAddressHex,
hash,
evmHash,
sender,
Expand All @@ -52,7 +52,7 @@ export const EvmContractDetailsOverview = ({
return (
<Stack gap={8}>
{/* // TODO: Support all status */}
<NotVerifiedDetails contractAddress={contractAddress} />
<NotVerifiedDetails contractAddress={contractAddressHex} />
<Stack gap={4}>
<Grid
gridTemplateColumns={{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/pages/evm-contract-details/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const EvmContractDetailsBody = ({
<TabPanel p={0} pt={8}>
<EvmContractDetailsOverview
contractAddressBech={contractAddressBechAddr}
contractAddress={contractAddress}
contractAddressHex={contractAddress}
hash={evmContractInfoData?.hash}
evmHash={evmHash}
sender={evmContractInfoData?.sender}
Expand Down
8 changes: 3 additions & 5 deletions src/lib/pages/evm-contract-verify/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ import { useForm } from "react-hook-form";
import {
EvmContractVerifyForm,
EvmProgrammingLanguage,
LicenseType,
VerificationOptions,
zEvmContractVerifyForm,
zEvmContractVerifyOptionForm,
} from "./types";
import { zodResolver } from "@hookform/resolvers/zod";
import { truncate } from "lib/utils";
Expand Down Expand Up @@ -59,15 +57,15 @@ export const EvmContractVerify = () => {
() => [
{
label: "1. No License (None)",
value: LicenseType.NoLicense,
value: "no-license",
},
{
label: "2. The Unlicense (Unlicense)",
value: LicenseType.TheUnLicense,
value: "the-unlicense",
},
{
label: "3. MIT License (MIT)",
value: LicenseType.MIT,
value: "mit",
},
],
[]
Expand Down
9 changes: 1 addition & 8 deletions src/lib/pages/evm-contract-verify/types.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import { zHexAddr20 } from "lib/types";
import { z } from "zod";

// TODO: Add more license types
export enum LicenseType {
NoLicense = "no-license",
TheUnLicense = "the-unlicense",
MIT = "mit",
}

export enum EvmProgrammingLanguage {
Solidity = "solidity",
Vyper = "vyper",
Expand Down Expand Up @@ -75,7 +68,7 @@ export const zEvmContractVerifyOptionForm = z.union([

export const zEvmContractAddressAndLicenseForm = z.object({
contractAddress: zHexAddr20,
licenseType: z.nativeEnum(LicenseType),
licenseType: z.string().refine((val) => val !== ""),
language: z.nativeEnum(EvmProgrammingLanguage),
compilerVersion: z.string().refine((val) => val !== ""),
});
Expand Down

0 comments on commit 2ac6106

Please sign in to comment.