Deploy smart contracts to any EVM chain w/ ThirdWeb
Tags: web3, vscode, thirdweb, solidity
Published: 2023-03-30 10:24:08

Deploying contracts with VS Code can feel very daunting especially because you have to expose your private Keys. The slightest mishap will have your keys exposed and your projects and wallets compromised. ThirdWeb provides a link in vs code that leads to their dashboard where you can easily connect your Dev wallet & deploy on any EVM chain. 

ThirdWeb, is the first chain-agnostic web3 framework & now works out-of-the-box with any smart contract on any EVM-compatible blockchain. This means that you can use their best-in-class tools to deploy, manage, and interact with smart contracts and web3 applications, no matter which blockchain you are using. In this blog post, I will show you how to deploy a contract with ThirdWeb, step-by-step.

Prerequisites 
- vs code
- basic solidity knowledge to build a custom contract
- third web account

if you don't know solidity you are better of using ThirdWeb to find a contract that suites your demand

if you still reading then you have vs code installed basic solidity contract stored in a directory ProjectName/contracts/test.sol. Great now lets carry on

NB: If your test contracts imports from OpenZeppelin contracts this for other npm sources this will be the best time to install or directly import them

Open the ProjectName Folder in VS Code and then access the Terminal with keyboard shorcut "CTRL+Shift+`" and paste the following in the terminal: "npx thirdweb deploy"

NB: At this point make sure your ProjectName Folder has a folder called "contracts" with solidity contracts inside of it other you will see this "No contracts detected in this directory" and dependencies will not get the deploy link instead before this You will receive a prompt asking you to install the dependencies.

After the process is done you will be hit with a prompt
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k233kw4066rte3edxg9k.png)

hit enter to continue and allow for contracts to compile

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/el2oj0sjf0csrygie71i.png)

All done with compiling now wait a few seconds for the link to deploy

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t5ozxnbv82ge2phsp76i.png)

(https://thirdweb.com/contracts/deploy/Qme6eB8pDG9u3HNuGgUjdyXNaQCGFbVXXQTT85JyuhKyh9) 
PS: this link can deploy the same instance several times across several EVM chains for any wallet, pretty cool right?!
now you can click on the link or paste the link a browser with dev MetaMask wallet extension

and you should end up here
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w9drf3e6koq61yytdjpb.png)

from here you just need to make sure the network in your wallet matches the configuration in the dashboard. You can change this at will to customs or default EVM chains

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tzthwcvq2dx648lsstlt.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7434hifmownfgxzdnlfi.png)

confirm deployment & listing on ThirdWeb dashboard and your all set to verify your contract and more!!

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ipcim7uobpst5m26if43.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ea6okrfvoumuyd1i8p9z.png)

contract:
https://thirdweb.com/sepolia/0xA07f49794E93f203bBE7Ad0F200B052275c8AeEF

source:
https://blog.thirdweb.com/any-contract-any-evm-chain/