You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
2 years ago
|
import { ethers } from "hardhat";
|
||
|
|
||
|
async function main() {
|
||
2 years ago
|
let provider = ethers.provider
|
||
|
let [operator,] = await ethers.getSigners();
|
||
|
let nonce = await operator.getTransactionCount()
|
||
|
|
||
|
|
||
|
let price = await provider.getFeeData()
|
||
|
console.log(price)
|
||
|
|
||
|
console.log(operator.address, nonce)
|
||
|
|
||
2 years ago
|
const Git3 = await ethers.getContractFactory("Git3Hub_ES");
|
||
2 years ago
|
const git3 = await Git3.deploy({ nonce: nonce });
|
||
|
|
||
2 years ago
|
let logicReceipt = await git3.deployed()
|
||
2 years ago
|
console.log(logicReceipt.deployTransaction.hash)
|
||
|
nonce++
|
||
|
|
||
2 years ago
|
|
||
2 years ago
|
let factory1 = await ethers.getContractFactory("UpgradeableProxy");
|
||
|
// Proxy don't need to init Git3 contract because the constructor is empty.
|
||
|
let initSelector = "0x";
|
||
2 years ago
|
|
||
2 years ago
|
let proxyInstance = await factory1
|
||
|
.connect(operator)
|
||
2 years ago
|
.deploy(git3.address, operator.address, initSelector, { nonce: nonce });
|
||
2 years ago
|
let proxyReceipt = await proxyInstance.deployed()
|
||
2 years ago
|
console.log(proxyReceipt.deployTransaction.hash)
|
||
2 years ago
|
|
||
|
// console.log({logicReceipt,proxyReceipt});
|
||
2 years ago
|
console.log("Logic Contract", git3.address);
|
||
|
console.log("Proxy Contract", proxyInstance.address);
|
||
2 years ago
|
}
|
||
|
|
||
|
// We recommend this pattern to be able to use async/await everywhere
|
||
|
// and properly handle errors.
|
||
|
main().catch((error) => {
|
||
|
console.error(error);
|
||
|
process.exitCode = 1;
|
||
|
});
|