diff --git a/contracts/.env.example b/contracts/.env.example new file mode 100644 index 000000000..c9be2096c --- /dev/null +++ b/contracts/.env.example @@ -0,0 +1 @@ +ETHEREUM_JSONRPC_HTTP_URL=https://eth-rinkeby.alchemyapi.io/v2/ADD_API_KEY \ No newline at end of file diff --git a/contracts/.gitignore b/contracts/.gitignore index 726b47e2d..22b6d5697 100644 --- a/contracts/.gitignore +++ b/contracts/.gitignore @@ -4,3 +4,4 @@ node_modules snark-params state.json tally.json +.env \ No newline at end of file diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index d4b453c19..435063e6a 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -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 = { @@ -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 @@ -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, diff --git a/contracts/package.json b/contracts/package.json index c80e1832f..28a276827 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -22,6 +22,7 @@ }, "dependencies": { "@openzeppelin/contracts": "3.2.0", + "dotenv": "^8.2.0", "maci-contracts": "0.6.7", "solidity-rlp": "2.0.3" },