diff --git a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/sources/ContractSourcesPage.tsx b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/sources/ContractSourcesPage.tsx index 99fb0761c63..0134c9729b0 100644 --- a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/sources/ContractSourcesPage.tsx +++ b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/sources/ContractSourcesPage.tsx @@ -34,7 +34,7 @@ interface VerificationResult { error?: string; } -async function verifyContract(contract: ThirdwebContract) { +export async function verifyContract(contract: ThirdwebContract) { try { const response = await fetch( "https://contract.thirdweb.com/verify/contract", diff --git a/apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx b/apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx index 1f8237dd256..e5eb538ddf7 100644 --- a/apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx +++ b/apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx @@ -18,6 +18,7 @@ import { FormControl, } from "@chakra-ui/react"; import { useMutation, useQuery } from "@tanstack/react-query"; +import { verifyContract } from "app/(dashboard)/(chain)/[chain_id]/[contractAddress]/sources/ContractSourcesPage"; import { NetworkSelectorButton } from "components/selects/NetworkSelectorButton"; import { SolidityInput } from "contract-ui/components/solidity-inputs"; import { useTrack } from "hooks/analytics/useTrack"; @@ -537,6 +538,13 @@ export const CustomContractForm: React.FC = ({ // do the actual deployment const contractAddr = await deployMutation.mutateAsync(formData); + // send verification request - no need to await + verifyContract({ + address: contractAddr, + chain: walletChain, + client: thirdwebClient, + }); + trackEvent({ category: "custom-contract", action: "deploy",