-
Notifications
You must be signed in to change notification settings - Fork 4
/
hardhat.config.ts
65 lines (58 loc) · 1.69 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
import { HardhatUserConfig, task, types } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import "@nomiclabs/hardhat-etherscan";
// import dotenv and execute it
import { config as dotEnvConfig } from "dotenv";
dotEnvConfig();
// FYI - this is a randomly generated private key with no funds
const privateKey = process.env.PRIVATE_KEY || '';
const INFURA_KEY = process.env.INFURA_KEY || '';
const ETHERSCAN_KEY = process.env.ETHERSCAN_KEY;
// network rpc urls
const GOERLI_RPC = 'https://goerli.infura.io/v3/' + INFURA_KEY;
const SEPOLIA_RPC = 'https://sepolia.infura.io/v3/' + INFURA_KEY;
const config: HardhatUserConfig = {
defaultNetwork: "hardhat",
solidity: {
compilers: [
{
version: "0.8.4",
},
{
version: "0.5.0",
},
],
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
networks: {
hardhat: {
chainId: 1337,
},
goerli: {
url: GOERLI_RPC,
accounts: [privateKey],
},
sepolia: {
url: SEPOLIA_RPC,
accounts: [privateKey],
},
},
etherscan: {
apiKey: ETHERSCAN_KEY,
},
};
// Social Lock Deployment task to make deployment easier
task("deploySocialLock", "Deploys Social Lock")
.addParam('aud', 'Google OAuth aud value, e.g. 1234567890-1234567890.apps.googleusercontent.com', undefined, types.string)
.addParam('jwks', 'JWKS Oracle address', undefined, types.string)
.setAction(async ({ aud, jwks }, hre) => {
const SocialLock = await hre.ethers.getContractFactory("SocialLock");
const socialLock = await SocialLock.deploy(aud, jwks);
console.log(`socialLock deployed to ${socialLock.address}`);
});
export default config;