From ebcc7a0de16c7a3e5dc7b214a6a15d3811315a07 Mon Sep 17 00:00:00 2001 From: cyl19970726 <15258378443@163.com> Date: Tue, 17 Jan 2023 22:02:12 +0800 Subject: [PATCH] refactor: update deploy script --- scripts/deploy.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/deploy.ts b/scripts/deploy.ts index 99d063b..cb15f81 100644 --- a/scripts/deploy.ts +++ b/scripts/deploy.ts @@ -3,10 +3,20 @@ import { ethers } from "hardhat"; async function main() { const Git3 = await ethers.getContractFactory("Git3Hub"); const git3 = await Git3.deploy(); - let receipt = await git3.deployed(); + let logicReceipt = await git3.deployed() - console.log(receipt); - console.log(git3.address); + let factory1 = await ethers.getContractFactory("UpgradeableProxy"); + // Proxy don't need to init Git3 contract because the constructor is empty. + let initSelector = "0x"; + let [operator,] = await ethers.getSigners(); + let proxyInstance = await factory1 + .connect(operator) + .deploy(git3.address, operator.address, initSelector); + let proxyReceipt = await proxyInstance.deployed() + + // console.log({logicReceipt,proxyReceipt}); + console.log("Logic Contract",git3.address); + console.log("Proxy Contract",git3.address); } // We recommend this pattern to be able to use async/await everywhere