HomeCode
Jeremy Bernier (@jeremybernier)

How to Deploy a Smart Contract with Code

You can deploy a smart contract with the following 3 lines of code using ethers v5.7.2

const factory = new ethers.ContractFactory(abi, bytecode, signer); const contract = await factory.deploy(...constructorArgs); await contract.deployed();

You can get the ABI and bytecode by compiling your smart contract with Remix (in the browser) , Hardhat, Truffle, Foundry, etc.

To deploy without code, go back home


You can check out my other projects at jbernier.com. If you're feeling generous, feel free to direct any tips to jbernier.eth