-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00d98ef
commit 6af2ca8
Showing
8 changed files
with
21,219 additions
and
5,875 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ node_modules | |
/localDeploy | ||
/run | ||
/vendor | ||
/artifacts | ||
/cache | ||
|
||
# Secrets | ||
.secret | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,8 @@ | ||
const fs = require('fs'); | ||
|
||
const privateKeys = | ||
JSON.parse(fs.readFileSync('config/accounts.json'))["private_keys"] | ||
const accounts = Object.entries(privateKeys) | ||
.map(entry => ({ | ||
secretKey: `0x${entry[1]}`, | ||
balance: '0x01158e460913d00000' | ||
})) | ||
const {getAccountsWithBalance} = require('./config/getAccounts') | ||
|
||
module.exports = { | ||
port: 8555, | ||
testCommand: 'mocha --timeout 5000', | ||
measureStatementCoverage: false, | ||
providerOptions: { accounts } | ||
providerOptions: { accounts: getAccountsWithBalance('secretKey') } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const fs = require('fs'); | ||
const privateKeys = JSON.parse(fs.readFileSync('config/accounts.json'))["private_keys"] | ||
|
||
function getAccountsWithBalance(secretPropName) { | ||
return Object.entries(privateKeys) | ||
.map(entry => ({ | ||
[secretPropName]: `0x${entry[1]}`, | ||
balance: '0x02b5e3af16b1880000' // 50 ETH | ||
} | ||
)) | ||
} | ||
|
||
function getAccounts() { | ||
return Object.entries(privateKeys) | ||
.map( | ||
entry => `0x${entry[1]}` | ||
) | ||
} | ||
|
||
module.exports = { | ||
getAccounts, | ||
getAccountsWithBalance, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
require("@nomiclabs/hardhat-truffle5"); // todo do not use truffle plugin for tests | ||
require("solidity-coverage"); | ||
require('hardhat-contract-sizer'); | ||
require('dotenv').config(); | ||
const {getAccounts, getAccountsWithBalance} = require('./config/getAccounts') //todo getAccounts might not be required | ||
|
||
const INFURA_KEY = process.env.INFURA_API_KEY; | ||
const DEPLOYER_PRIVATE_KEY = process.env.PK; | ||
|
||
module.exports = { | ||
solidity: { | ||
version: "0.7.1", | ||
settings: { | ||
optimizer: { | ||
enabled: true, | ||
runs: 10 | ||
} | ||
} | ||
}, | ||
defaultNetwork: "hardhat", | ||
networks: { | ||
hardhat: { | ||
accounts: getAccountsWithBalance('privateKey'), | ||
chainId: 1 | ||
}, | ||
test: { | ||
url: `http://${process.env.HOST}:${process.env.PORT}`, | ||
}, | ||
rinkeby: { | ||
url: `https://rinkeby.infura.io/v3/${INFURA_KEY}`, | ||
accounts: [ | ||
DEPLOYER_PRIVATE_KEY, | ||
] | ||
}, | ||
}, | ||
mocha: { | ||
timeout: 120000 | ||
} | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.