Skip to content

Commit

Permalink
Merge pull request #338 from ethereum/hardhat-env-variables
Browse files Browse the repository at this point in the history
Add dotenv for hardhat config
  • Loading branch information
xuhcc authored Apr 13, 2021
2 parents e57b0d5 + b4dc5c1 commit c71b75e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions contracts/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ETHEREUM_JSONRPC_HTTP_URL=https://eth-rinkeby.alchemyapi.io/v2/ADD_API_KEY
1 change: 1 addition & 0 deletions contracts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules
snark-params
state.json
tally.json
.env
11 changes: 7 additions & 4 deletions contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import fs from 'fs';
import path from 'path';
import dotenv from 'dotenv'

import { HardhatUserConfig, task } from 'hardhat/config'
import '@nomiclabs/hardhat-waffle'
import '@nomiclabs/hardhat-ganache'

dotenv.config()

const GAS_LIMIT = 10000000

const config: HardhatUserConfig = {
Expand All @@ -14,7 +17,7 @@ const config: HardhatUserConfig = {
blockGasLimit: GAS_LIMIT,
},
localhost: {
url: "http://127.0.0.1:18545"
url: 'http://127.0.0.1:18545',
},
ganache: {
// Workaround for https://github.com/nomiclabs/hardhat/issues/518
Expand All @@ -32,11 +35,11 @@ const config: HardhatUserConfig = {
},
},
paths: {
artifacts: "build/contracts",
tests: "tests"
artifacts: 'build/contracts',
tests: 'tests',
},
solidity: {
version: "0.6.12",
version: '0.6.12',
settings: {
optimizer: {
enabled: true,
Expand Down
1 change: 1 addition & 0 deletions contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"dependencies": {
"@openzeppelin/contracts": "3.2.0",
"dotenv": "^8.2.0",
"maci-contracts": "0.6.7",
"solidity-rlp": "2.0.3"
},
Expand Down

0 comments on commit c71b75e

Please sign in to comment.