Ethers v5 -> v6 migration
Updated dependencies and removed unused ones.
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
import "@nomiclabs/hardhat-ethers";
|
||||
import "@nomiclabs/hardhat-etherscan";
|
||||
import { BigNumber } from "ethers";
|
||||
import "@nomicfoundation/hardhat-ethers";
|
||||
import * as fs from "fs";
|
||||
import { ethers, network } from "hardhat";
|
||||
import hre from "hardhat";
|
||||
|
||||
import { Deploys } from "../test/utils/interfaces";
|
||||
|
||||
let deploysJson: Deploys;
|
||||
const supply: BigNumber = ethers.utils.parseEther("20000000");
|
||||
const supply: BigInt = ethers.parseEther("20000000");
|
||||
|
||||
const main = async () => {
|
||||
try {
|
||||
@@ -25,15 +22,11 @@ const main = async () => {
|
||||
const [deployer] = await ethers.getSigners();
|
||||
console.log(`Deploying contracts with ${deployer.address}`);
|
||||
|
||||
const ERC20Factory = await ethers.getContractFactory(
|
||||
"MockToken",
|
||||
);
|
||||
const erc20 = await ERC20Factory.deploy(supply);
|
||||
await erc20.deployed();
|
||||
let erc20 = await ethers.deployContract("MockToken", [supply]);
|
||||
erc20 = await erc20.waitForDeployment();
|
||||
|
||||
deploysJson.token = erc20.address;
|
||||
console.log("🚀 Mock Token Deployed:", erc20.address);
|
||||
await erc20.deployTransaction.wait(6);
|
||||
deploysJson.token = await erc20.getAddress();
|
||||
console.log("🚀 Mock Token Deployed:", await erc20.getAddress());
|
||||
|
||||
fs.writeFileSync(
|
||||
`./deploys/${network.name}.json`,
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import "@nomiclabs/hardhat-ethers";
|
||||
import "@nomiclabs/hardhat-etherscan";
|
||||
import "@nomicfoundation/hardhat-ethers";
|
||||
import * as fs from "fs";
|
||||
import { ethers, network } from "hardhat";
|
||||
import hre from "hardhat";
|
||||
|
||||
import { Deploys } from "../test/utils/interfaces";
|
||||
|
||||
@@ -23,32 +21,24 @@ const main = async () => {
|
||||
const [deployer] = await ethers.getSigners();
|
||||
console.log(`Deploying contracts with ${deployer.address}`);
|
||||
|
||||
const Reputation = await ethers.getContractFactory(
|
||||
"Reputation",
|
||||
);
|
||||
const Multicall = await ethers.getContractFactory(
|
||||
"Multicall",
|
||||
);
|
||||
const reputation = await Reputation.deploy();
|
||||
await reputation.deployed();
|
||||
const mutlicall = await Multicall.deploy();
|
||||
await mutlicall.deployed();
|
||||
|
||||
const P2PIX = await ethers.getContractFactory("P2PIX");
|
||||
const p2pix = await P2PIX.deploy(
|
||||
let reputation = await ethers.deployContract("Reputation");
|
||||
let multicall = await ethers.deployContract("Multicall");
|
||||
let p2pix = await ethers.deployContract("P2PIX", [
|
||||
10,
|
||||
deploysJson.signers,
|
||||
reputation.address,
|
||||
reputation.target,
|
||||
[deploysJson.token],
|
||||
[true],
|
||||
);
|
||||
await p2pix.deployed();
|
||||
]);
|
||||
|
||||
deploysJson.p2pix = p2pix.address;
|
||||
console.log("🚀 P2PIX Deployed:", p2pix.address);
|
||||
console.log("🌠 Reputation Deployed:", reputation.address);
|
||||
console.log("🛰 Multicall Deployed:", mutlicall.address);
|
||||
await p2pix.deployTransaction.wait(6);
|
||||
reputation = await reputation.waitForDeployment();
|
||||
multicall = await multicall.waitForDeployment();
|
||||
p2pix = await p2pix.waitForDeployment();
|
||||
|
||||
deploysJson.p2pix = await p2pix.getAddress();
|
||||
console.log("🚀 P2PIX Deployed:", await p2pix.getAddress());
|
||||
console.log("🌠 Reputation Deployed:", await reputation.getAddress());
|
||||
console.log("🛰 Multicall Deployed:", await multicall.getAddress());
|
||||
|
||||
fs.writeFileSync(
|
||||
`./deploys/${network.name}.json`,
|
||||
|
||||
Reference in New Issue
Block a user