How to Migrate from Hardhat to thirdweb

How to Migrate from Hardhat to thirdweb

thirdweb is a free and open-source alternative to Hardhat that offers various tools for web3 development.

It provides a safe smart contract deployment tool and a user-friendly UI for contract management, similar to the Hardhat dashboard.

With thirdweb, you can:

  • Deploy your contract built with Hardhat or Foundry to any supported EVM chain without exposing your private keys.
  • Manage your contract’s functions and configurations through a user interface.
  • Import deployed contracts for easy interaction in the dashboard.
  • Publish your contract for other developers and users to deploy in a contract marketplace.

This guide provides a technical walkthrough on how to use thirdweb’s deploy tool with your contract to deploy on the Linea Testnet. The Deploy feature allows you to deploy a smart contract to any EVM blockchain without the need to run scripts or pass private keys into a .env file.

Deploy Smart Contract

To deploy a contract using thirdweb deploy:

1. Navigate to the root of your smart contract repository using the Command Line Interface (CLI). Then, run the command npx thirdweb deploy.

Redirecting to the browser message to authenticate

2. To deploy from your desired wallet in your browser, connect and authorize your device.

Link your device to your thirdweb account page on the browser

3. Once completed, your browser will open a user interface that allows you to fill out the parameters of your contract.

Form to add in contract parameters

4. Fill in the necessary fields, then find the Network / Chain drop-down menu to select a network for deployment. Choose the Add to dashboard option and click Deploy Now. This will require you to sign a transaction in your connected wallet.

Switching networks at bottom of form

5. Once deployed, you can manage your contract through the thirdweb dashboard.

Dashboard home view with contract checklist and overview

Through the dashboard, you can access code snippets that will help you integrate your contract into an application. Additionally, you can interact with your contract's functions through an explorer, view analytics and emitted events, and configure NFTs or other permission settings if your contract supports them.

To learn more about how to use the dashboard, please refer to our dashboard documentation. If you are ready to build an application with your deployed contract, visit our contract SDK documentation.

Congrats! You now learned a new way to easily deploy your contract. We'd love to see your contracts- share us links to your contract dashboard on our socials. :)


Need help?

Please contact our support team for assistance.