-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhardhat.config.ts
122 lines (108 loc) · 3.18 KB
/
hardhat.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import { config as dotEnvConfig } from "dotenv";
dotEnvConfig();
import { HardhatUserConfig } from "hardhat/types";
import "@typechain/hardhat";
// import "@nomiclabs/hardhat-ethers";
import "@nomiclabs/hardhat-waffle";
import "@openzeppelin/hardhat-upgrades";
import "@nomiclabs/hardhat-etherscan";
import { task } from "hardhat/config";
import "@graphprotocol/hardhat-graph";
import "hardhat-contract-sizer";
import "solidity-coverage";
import "@openzeppelin/hardhat-defender";
// https://hardhat.org/guides/create-task.html
task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
const accounts = await hre.ethers.getSigners();
for (const account of accounts) {
console.log(account.address);
}
});
task("deploy", "Deploys the passed contract")
.addParam("contractName", "The name of the contract")
.setAction(async (taskArgs, hre) => {
const { contractName } = taskArgs;
await hre.run("compile");
const address = await deploy(hre, contractName);
await hre.run("graph", { contractName, address });
});
const deploy = async (hre: any, contractName: string): Promise<string> => {
const contractArtifacts = await hre.ethers.getContractFactory(contractName);
const contract = await contractArtifacts.deploy();
await contract.deployed();
return contract.address;
};
const INFURA_API_KEY = process.env.INFURA_API_KEY;
const PRIVATE_KEY = process.env.PRIVATE_KEY! || "0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3";
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY;
const ARBI_API_KEY = process.env.ARBI_API_KEY;
const config = {
defender: {
apiKey: process.env.DEFENDER_TEAM_API_KEY,
apiSecret: process.env.DEFENDER_TEAM_API_SECRET_KEY,
},
solidity: {
compilers: [
{
version: "0.8.9",
settings: {
optimizer: { enabled: true, runs: 100 },
},
},
],
},
defaultNetwork: "hardhat",
networks: {
hardhat: {
allowUnlimitedContractSize: true,
forking: {
url: "https://arb-mainnet.g.alchemy.com/v2/XY2OuQR0tqpTi-WY_yljupj20HFlfVok",
blockNumber: 116915111,
},
},
arbitrum_goerli: {
url: "https://goerli-rollup.arbitrum.io/rpc/",
accounts: [PRIVATE_KEY],
},
arbitrum: {
url: "https://arb-mainnet.g.alchemy.com/v2/XY2OuQR0tqpTi-WY_yljupj20HFlfVok",
accounts: [PRIVATE_KEY],
},
arbitrum_staging: {
url: "https://arb-mainnet.g.alchemy.com/v2/XY2OuQR0tqpTi-WY_yljupj20HFlfVok",
accounts: [PRIVATE_KEY],
},
goerli: {
url: `https://goerli.infura.io/v3/${INFURA_API_KEY}`,
accounts: [PRIVATE_KEY],
},
sepolia: {
url: `https://sepolia.infura.io/v3/${INFURA_API_KEY}`,
accounts: [PRIVATE_KEY],
},
},
subgraph: {
name: "tribe3-perp",
},
paths: {
subgraph: "tribe3-perp-subgraph",
},
etherscan: {
apiKey: {
mainnet: String(ETHERSCAN_API_KEY),
arbitrumOne: String(ARBI_API_KEY),
arbitrumGoerli: String(ARBI_API_KEY),
},
},
mocha: {
timeout: 80000,
},
contractSizer: {
alphaSort: true,
disambiguatePaths: false,
runOnCompile: true,
strict: true,
only: [],
},
};
export default config;