-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.js
115 lines (104 loc) · 3.03 KB
/
hardhat.config.js
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
require("dotenv").config();
require("@nomiclabs/hardhat-etherscan");
require("@nomiclabs/hardhat-waffle");
require("hardhat-gas-reporter");
require("solidity-coverage");
const { assert, expect } = require("chai");
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-sushi-farm", "Deploys a new Sushi farm strategy")
.addParam("name", "The farm name, e.g. \"Arbi's Sushi USDC/ETH LP Farm Shares\"")
.addParam("symbol", "The farm symbol")
.addParam("depositToken", "The SLP deposit token address")
.addParam("pid", "The farm ID")
.addParam(
"factory",
"The SushiLPFarmStrategyFactory address",
"0xaE598cE4982103Ad994f4A368DBD5F8b8b11b9fB",
)
.addParam(
"stakingContract",
"The staking contract address",
"0xF4d73326C13a4Fc5FD7A064217e12780e9Bd62c3",
)
.addParam(
"router",
"The SushiSwapV2 router address",
"0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506",
)
.setAction(async (taskArgs, hre) => {
console.log("Creating farm with params: ", taskArgs);
const sushiToken = "0xd4d42F0b6DEF4CE0383636770eF773390d85c61A";
const SushiLPFarmStrategyFactory = await ethers.getContractFactory("SushiLPFarmStrategyFactory");
const factory = await SushiLPFarmStrategyFactory.attach(taskArgs.factory);
const numFarms = await factory.farmsCount();
console.log("Number of existing farms: ", numFarms.toString());
await factory.addFarm(
taskArgs.name,
taskArgs.symbol,
taskArgs.depositToken,
sushiToken,
taskArgs.stakingContract,
taskArgs.router,
taskArgs.pid
);
const newNumFarms = await factory.farmsCount();
assert(newNumFarms.eq(newNumFarms.add(1)), "Farm wasn't added");
const farmAddr = await factory.farms(newNumFarms - 1);
console.log("Strategy deployed at ", farmAddr);
});
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: {
compilers: [
{
version: "0.8.1"
},
{
version: "0.8.4"
},
{
version: "0.8.7"
},
{
version: "0.8.9"
},
],
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
},
"defaultNetwork": "localhost",
networks: {
hardhat: {
initialBaseFeePerGas: 0, // workaround from https://github.com/sc-forks/solidity-coverage/issues/652#issuecomment-896330136 . Remove when that issue is closed.
},
arbitrum_rinkeby: {
url: process.env.ARBITRUM_RINKEBY_URL,
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
arbitrum_mainnet: {
url: process.env.ARBITRUM_MAINNET_URL,
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
gas: 8578000,
}
},
gasReporter: {
enabled: process.env.REPORT_GAS !== undefined,
currency: "USD",
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
};