From 2ac6106979c8cf0a94b51faca49b30090f558776 Mon Sep 17 00:00:00 2001 From: Poafs1 Date: Mon, 13 Jan 2025 14:40:58 +0700 Subject: [PATCH] fix(pages): pr comment --- .../components/EvmContractDetailsOverview.tsx | 6 +++--- src/lib/pages/evm-contract-details/index.tsx | 2 +- src/lib/pages/evm-contract-verify/index.tsx | 8 +++----- src/lib/pages/evm-contract-verify/types.ts | 9 +-------- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/lib/pages/evm-contract-details/components/EvmContractDetailsOverview.tsx b/src/lib/pages/evm-contract-details/components/EvmContractDetailsOverview.tsx index a3216bfdf..6e484da65 100644 --- a/src/lib/pages/evm-contract-details/components/EvmContractDetailsOverview.tsx +++ b/src/lib/pages/evm-contract-details/components/EvmContractDetailsOverview.tsx @@ -20,7 +20,7 @@ import { EvmContractDetailsTxs } from "./EvmContractDetailsTxs"; interface EvmContractDetailsOverviewProps { contractAddressBech: BechAddr20; - contractAddress: HexAddr20; + contractAddressHex: HexAddr20; hash: Option; evmHash: Nullish; sender: Option; @@ -34,7 +34,7 @@ interface EvmContractDetailsOverviewProps { export const EvmContractDetailsOverview = ({ contractAddressBech, - contractAddress, + contractAddressHex, hash, evmHash, sender, @@ -52,7 +52,7 @@ export const EvmContractDetailsOverview = ({ return ( {/* // TODO: Support all status */} - + { () => [ { 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", }, ], [] diff --git a/src/lib/pages/evm-contract-verify/types.ts b/src/lib/pages/evm-contract-verify/types.ts index 248085906..fa8a23f11 100644 --- a/src/lib/pages/evm-contract-verify/types.ts +++ b/src/lib/pages/evm-contract-verify/types.ts @@ -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", @@ -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 !== ""), });