Skip to content

Commit

Permalink
wip: hardhat configured for ganache
Browse files Browse the repository at this point in the history
  • Loading branch information
fforbeck committed Sep 15, 2021
1 parent 104d991 commit f1ffce5
Show file tree
Hide file tree
Showing 7 changed files with 2,842 additions and 71 deletions.
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
### Tribute Contract CLI

### Build

> npm ci
### Setup

In the root folder of the project:

- Create the `.env` file, and set the env vars:
In the root folder of the project, create the `.env` file, and set the env vars:

```
# The DAO Address to interact with
Expand All @@ -18,7 +12,7 @@ In the root folder of the project:
MNEMONIC=...
# The snapshot-hub URL to connect
SNAPSHOT_HUB_API_URL=https://...
SNAPSHOT_HUB_API_URL=http://...
# The space name defined in the Snapshot Hub API
SNAPSHOT_HUB_SPACE=...
Expand Down Expand Up @@ -54,7 +48,7 @@ In the root folder of the project:
| [v0.1.1](https://github.com/openlawteam/tribute-contracts-cli/releases/tag/v0.1.1) | [v1.2.0](https://github.com/openlawteam/snapshot-js-erc712/releases/tag/v1.2.0) | [v1.0.0](https://github.com/openlawteam/tribute-contracts/releases/tag/v1.0.0) | [v5.0.0-erc712](https://github.com/openlawteam/snapshot-hub/releases/tag/v5.0.0-erc712) |
| [v0.1.2](https://github.com/openlawteam/tribute-contracts-cli/releases/tag/v0.1.2) | [v1.2.0](https://github.com/openlawteam/snapshot-js-erc712/releases/tag/v1.2.0) | [v1.0.2](https://github.com/openlawteam/tribute-contracts/releases/tag/v1.0.2) | [v5.0.1-erc712](https://github.com/openlawteam/snapshot-hub/releases/tag/v5.0.1-erc712) |
| [v0.2.1](https://github.com/openlawteam/tribute-contracts-cli/releases/tag/v0.2.1) | [v1.3.0](https://github.com/openlawteam/snapshot-js-erc712/releases/tag/v1.3.0) | [v2.0.4](https://github.com/openlawteam/tribute-contracts/releases/tag/v2.0.4) | [v5.0.2-erc712](https://github.com/openlawteam/snapshot-hub/releases/tag/v5.0.2-erc712) |
| [v0.2.2](https://github.com/openlawteam/tribute-contracts-cli/releases/tag/v0.2.2) | [v1.3.0](https://github.com/openlawteam/snapshot-js-erc712/releases/tag/v1.3.0) | [v2.2.0](https://github.com/openlawteam/tribute-contracts/releases/tag/v2.2.0) | [v5.0.2-erc712](https://github.com/openlawteam/snapshot-hub/releases/tag/v5.0.2-erc712) |
| [v0.2.2](https://github.com/openlawteam/tribute-contracts-cli/releases/tag/v0.2.2) | [v1.3.0](https://github.com/openlawteam/snapshot-js-erc712/releases/tag/v1.3.0) | [v2.2.1](https://github.com/openlawteam/tribute-contracts/releases/tag/v2.2.0) | [v5.0.2-erc712](https://github.com/openlawteam/snapshot-hub/releases/tag/v5.0.2-erc712) |

### Packages

Expand Down
67 changes: 67 additions & 0 deletions hardhat.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
const { ethers } = require("ethers");
const { configs } = require("./cli-config");

if (!process.env.TRUFFLE_MNEMONIC) {
throw new Error("Please set your TRUFFLE_MNEMONIC in a .env file");
}
const mnemonic = process.env.TRUFFLE_MNEMONIC;

module.exports = {
defaultNetwork: "ganache",
networks: {
ganache: {
url: "http://127.0.0.1:7545",
network_id: "1337",
accounts: {
count: 10,
initialIndex: 0,
mnemonic,
path: "m/44'/60'/0'/0",
},
},
rinkeby: {
provider: () => {
const provider = ethers.getDefaultProvider(network, {
alchemyKey: configs.alchemyApiKey
? configs.alchemyApiKey
: configs.infuraApiKey,
});
return provider;
},
network_id: 4,
skipDryRun: true,
networkCheckTimeout: 10000,
deploymentPollingInterval: 10000,
},
mainnet: {
provider: () => {
const provider = ethers.getDefaultProvider(network, {
alchemyKey: configs.alchemyApiKey
? configs.alchemyApiKey
: configs.infuraApiKey,
});
return provider;
},
network_id: 1,
skipDryRun: true,
},
},
solidity: {
version: "0.8.0",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
paths: {
tests: "./test",
sources: "./build/contracts",
cache: "./build/cache",
artifacts: "./build/artifacts",
},
mocha: {
timeout: 20000,
},
};

0 comments on commit f1ffce5

Please sign in to comment.