From be8a1e4d6350c771a4424702c3014f1b9321b266 Mon Sep 17 00:00:00 2001 From: Emre <72754835+0xemrekaya@users.noreply.github.com> Date: Wed, 21 Feb 2024 19:09:24 +0300 Subject: [PATCH 1/2] Update deploy.ts --- contract-deploy-demo/scripts/deploy.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contract-deploy-demo/scripts/deploy.ts b/contract-deploy-demo/scripts/deploy.ts index ffc6369..a594f0c 100644 --- a/contract-deploy-demo/scripts/deploy.ts +++ b/contract-deploy-demo/scripts/deploy.ts @@ -7,10 +7,10 @@ async function main() { const lockedAmount = ethers.utils.parseEther("0.00000001"); - const Lock = await ethers.getContractFactory("Lock"); - const lock = await Lock.deploy(unlockTime, { value: lockedAmount }); - - await lock.deployed(); + const lock = await ethers.deployContract("Lock", [unlockTime], { + value: lockedAmount, + }); + await lock.waitForDeployment(); console.log(`Lock with 0.00000001 ETH and unlock timestamp ${unlockTime} deployed to ${lock.address}`); console.log(`Block explorer URL: https://blockscout.scroll.io/address/${lock.address}`); From 195e6194695ccb7ecd29731124987cce01d55762 Mon Sep 17 00:00:00 2001 From: Emre <72754835+0xemrekaya@users.noreply.github.com> Date: Wed, 21 Feb 2024 19:14:46 +0300 Subject: [PATCH 2/2] Update deploy.ts, use 'target' instead of 'address' --- contract-deploy-demo/scripts/deploy.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contract-deploy-demo/scripts/deploy.ts b/contract-deploy-demo/scripts/deploy.ts index a594f0c..c841577 100644 --- a/contract-deploy-demo/scripts/deploy.ts +++ b/contract-deploy-demo/scripts/deploy.ts @@ -12,8 +12,8 @@ async function main() { }); await lock.waitForDeployment(); - console.log(`Lock with 0.00000001 ETH and unlock timestamp ${unlockTime} deployed to ${lock.address}`); - console.log(`Block explorer URL: https://blockscout.scroll.io/address/${lock.address}`); + console.log(`Lock with 0.00000001 ETH and unlock timestamp ${unlockTime} deployed to ${lock.target}`); + console.log(`Block explorer URL: https://blockscout.scroll.io/address/${lock.target}`); } // We recommend this pattern to be able to use async/await everywhere