I have come across a situation in my project ( Hardhat, Nextjs, TailwindCSS ) where I need to verify my smart contracts right after their deployment. Clearly, we have a mother smart contract that generates them and keep track of everything.

I know how the verification process is done by the hardhat console, but I don't want to do this part manually! In fact, I need every new smart contract to be verified after my command that I initiated from a Nextjs component.

Does anyone know how to run the "verify" command of the Hardhat console within my javascript file ( Nextjs component )?

1 Answer 1


Yes, you can use the Etherscan API to programmatically verify a contract. Alternatively, here is a list of similar guides for other popular chains:

Note that not all the popular blockchains right now have an endpoint for programmatically verifying a smart contract.

In your case, make a POST request to the Etherscan endpoint right after deployment sending all the required parameters in order to verify the targeted smart contract.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.