Skip to content

Commit 8b89603

Browse files
committed
Fix auto verification of contracts
1 parent bc5b543 commit 8b89603

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/sources/ContractSourcesPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ interface VerificationResult {
3434
error?: string;
3535
}
3636

37-
async function verifyContract(contract: ThirdwebContract) {
37+
export async function verifyContract(contract: ThirdwebContract) {
3838
try {
3939
const response = await fetch(
4040
"https://contract.thirdweb.com/verify/contract",

apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
FormControl,
1919
} from "@chakra-ui/react";
2020
import { useMutation, useQuery } from "@tanstack/react-query";
21+
import { verifyContract } from "app/(dashboard)/(chain)/[chain_id]/[contractAddress]/sources/ContractSourcesPage";
2122
import { NetworkSelectorButton } from "components/selects/NetworkSelectorButton";
2223
import { SolidityInput } from "contract-ui/components/solidity-inputs";
2324
import { useTrack } from "hooks/analytics/useTrack";
@@ -537,6 +538,13 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
537538
// do the actual deployment
538539
const contractAddr = await deployMutation.mutateAsync(formData);
539540

541+
// send verification request - no need to await
542+
verifyContract({
543+
address: contractAddr,
544+
chain: walletChain,
545+
client: thirdwebClient,
546+
});
547+
540548
trackEvent({
541549
category: "custom-contract",
542550
action: "deploy",

0 commit comments

Comments
 (0)