Skip to content

Commit

Permalink
deps fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvolear committed Dec 1, 2023
1 parent 1ad5cca commit 0d7fce4
Show file tree
Hide file tree
Showing 8 changed files with 13,735 additions and 29,361 deletions.
7 changes: 0 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,3 @@ BSCSCAN_KEY=BSCSCAN API KEY
POLYGONSCAN_KEY=POLYGONSCAN API KEY
AVALANCHE_KEY=AVALANCHE API KEY
COINMARKETCAP_KEY=COINMARKETCAP API KEY

# Available targets: 'ethers-v6', 'truffle-v5' and 'web3-v1'
# By default 'ethers-v6'
TYPECHAIN_TARGET=TYPECHAIN TARGET

# Set 'false' to not automatically generate types
TYPECHAIN_FORCE=TYPECHAIN FORCE
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ coverage

# Typechain generated files
generated-types

# Hardhat migrate
.storage.json
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ coverage

# Typechain generated files
generated-types

# Hardhat migrate
.storage.json
7 changes: 3 additions & 4 deletions deploy/1_token.migration.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Deployer, Reporter } from "@solarity/hardhat-migrate";
import { artifacts } from "hardhat";

const ERC20Mock = artifacts.require("ERC20Mock");
import { ERC20Mock__factory } from "@ethers-v6";

export = async (deployer: Deployer) => {
const erc20 = await deployer.deploy(ERC20Mock, ["Mock", "Mock", 18]);
const erc20 = await deployer.deploy(ERC20Mock__factory, ["Mock", "Mock", 18]);

Reporter.reportContracts(["ERC20Mock", erc20.address]);
Reporter.reportContracts(["ERC20Mock", await erc20.getAddress()]);
};
18 changes: 2 additions & 16 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import "@nomiclabs/hardhat-web3";
import "@nomiclabs/hardhat-truffle5";
import "@nomicfoundation/hardhat-ethers";
import "@nomicfoundation/hardhat-chai-matchers";
import "@solarity/hardhat-migrate";
Expand All @@ -20,24 +18,13 @@ function privateKey() {
return process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [];
}

function typechainTarget() {
const target = process.env.TYPECHAIN_TARGET;

return target === "" || target === undefined ? "ethers-v6" : target;
}

function forceTypechain() {
return process.env.TYPECHAIN_FORCE === "false";
}

const config: HardhatUserConfig = {
networks: {
hardhat: {
initialDate: "1970-01-01T00:00:00Z",
},
localhost: {
url: "http://127.0.0.1:8545",
initialDate: "1970-01-01T00:00:00Z",
gasMultiplier: 1.2,
},
goerli: {
Expand Down Expand Up @@ -130,11 +117,10 @@ const config: HardhatUserConfig = {
coinmarketcap: `${process.env.COINMARKETCAP_KEY}`,
},
typechain: {
outDir: `generated-types/${typechainTarget().split("-")[0]}`,
target: typechainTarget(),
outDir: "generated-types/ethers",
target: "ethers-v6",
alwaysGenerateOverloads: true,
discriminateTypes: true,
dontOverrideCompile: forceTypechain(),
},
};

Expand Down
Loading

0 comments on commit 0d7fce4

Please sign in to comment.