-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathhardhat.config.js
61 lines (57 loc) · 1.8 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
require("@nomiclabs/hardhat-ethers");
const {
deploy_moon_lotto
} = require("./tasks/deploy_contracts")
task("deploy_contracts", "Deploys the MoonLotto contract")
.addOptionalParam("ticketPrice", "Price in ETH per submission to join the lottery")
.addOptionalParam("lotteryRoundTime", "Seconds that a lottery round will be open for submissions")
.addOptionalParam("minRoundPlayers", "Minimum number of players in a lottery round to pick a winner")
.setAction(async (taskArgs) => {
const ticketPrice = taskArgs.ticketPrice ? ethers.utils.parseUnits(taskArgs.ticketPrice, "ether") : ethers.utils.parseUnits("1", "gwei");
const lotteryRoundTime = taskArgs.lotteryRoundTime || 1800;
const minRoundPlayers = taskArgs.minRoundPlayers || 10;
await deploy_moon_lotto(ticketPrice, lotteryRoundTime, minRoundPlayers);
});
// Change private keys accordingly - ONLY FOR DEMOSTRATION PURPOSES - PLEASE STORE PRIVATE KEYS IN A SAFE PLACE
const developmentPK =
"99b3c12287537e38c90a9219d4cb074a89a16e9cdb20bf85728ebd97c343e342";
const productionPK = process.env.MOON_PRIVATE_KEY;
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
defaultNetwork: "moonbase",
networks: {
moonbase: {
url: "https://rpc.api.moonbase.moonbeam.network",
accounts: [productionPK],
gasPrice: 1000000000,
chainId: 1287,
},
dev: {
url: "http://127.0.0.1:9933",
accounts: [developmentPK],
network_id: "1281",
gasPrice: 0,
chainId: 1281,
},
},
solidity: {
compilers: [
{
version: "0.8.3",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
paths: {
sources: "./contracts",
cache: "./cache",
artifacts: "./artifacts",
},
};