Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update truffle to use contract-helpers repo #834

Merged
merged 2 commits into from
Oct 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions packages/aragon-cli/config/environments.default.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"aragon:local": {
"network": "development"
"network": "rpc"
},
"aragon:rinkeby": {
"apm": {
Expand Down Expand Up @@ -31,15 +31,5 @@
"registry": "0x314159265dd8dbb310642f98f50c066173c1259b",
"wsRPC": "wss://mainnet.eth.aragon.network/ws",
"network": "mainnet"
},
"aragon:ropsten": {
"apm": {
"ipfs": {
"gateway": "https://ipfs.eth.aragon.network/ipfs"
}
},
"registry": "0x6afe2cacee211ea9179992f89dc61ff25c61e923",
"wsRPC": "wss://ropsten.eth.aragon.network/ws",
"network": "ropsten"
}
}
114 changes: 1 addition & 113 deletions packages/aragon-cli/config/truffle.default.js
Original file line number Diff line number Diff line change
@@ -1,113 +1 @@
const homedir = require('homedir')
const path = require('path')

const HDWalletProvider = require('truffle-hdwallet-provider')

const DEFAULT_MNEMONIC =
'explain tackle mirror kit van hammer degree position ginger unfair soup bonus'

const defaultRPC = network => `https://${network}.eth.aragon.network`

const configFilePath = filename => path.join(homedir(), `.aragon/${filename}`)

const mnemonic = () => {
try {
return require(configFilePath('mnemonic.json')).mnemonic
} catch (e) {
return DEFAULT_MNEMONIC
}
}

const settingsForNetwork = network => {
try {
return require(configFilePath(`${network}_key.json`))
} catch (e) {
return {}
}
}

// Lazily loaded provider
const providerForNetwork = network => () => {
let { rpc, keys } = settingsForNetwork(network)

rpc = rpc || defaultRPC(network)

if (!keys || keys.length === 0) {
return new HDWalletProvider(mnemonic(), rpc)
}

return new HDWalletProvider(keys, rpc)
}

const mochaGasSettings = {
reporter: 'eth-gas-reporter',
reporterOptions: {
currency: 'USD',
gasPrice: 3,
},
}

const mocha = process.env.GAS_REPORTER ? mochaGasSettings : {}

module.exports = {
networks: {
rpc: {
network_id: 15,
host: 'localhost',
port: 8545,
gas: 6.9e6,
gasPrice: 15000000001,
},
devnet: {
network_id: 16,
host: 'localhost',
port: 8535,
gas: 6.9e6,
gasPrice: 15000000001,
},
mainnet: {
network_id: 1,
provider: providerForNetwork('mainnet'),
gas: 7.9e6,
gasPrice: 3000000001,
},
ropsten: {
network_id: 3,
provider: providerForNetwork('ropsten'),
gas: 4.712e6,
},
rinkeby: {
network_id: 4,
provider: providerForNetwork('rinkeby'),
gas: 6.9e6,
gasPrice: 15000000001,
},
kovan: {
network_id: 42,
provider: providerForNetwork('kovan'),
gas: 6.9e6,
},
coverage: {
host: 'localhost',
network_id: '*',
port: 8555,
gas: 0xffffffffff,
gasPrice: 0x01,
},
development: {
host: 'localhost',
network_id: '*',
port: 8545,
gas: 6.9e6,
gasPrice: 15000000001,
},
},
build: {},
mocha,
solc: {
optimizer: {
enabled: true,
runs: 10000,
},
},
}
module.exports = require('@aragon/truffle-config-v4/truffle-config')
2 changes: 1 addition & 1 deletion packages/aragon-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@aragon/apps-shared-minime": "^1.0.1",
"@aragon/aragen": "^5.0.0",
"@aragon/cli-utils": "^0.0.8",
"@aragon/truffle-config-v4": "^1.0.0",
"@aragon/wrapper": "^5.0.0-rc.17",
"ajv": "^6.6.2",
"bn.js": "^5.0.0",
Expand Down Expand Up @@ -79,7 +80,6 @@
"tmp-promise": "^2.0.1",
"truffle": "4.1.14",
"truffle-flattener": "^1.2.9",
"truffle-hdwallet-provider": "^1.0.2",
"web3": "^1.2.0",
"which": "^1.3.1",
"yargs": "^13.2.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/aragon-cli/src/middleware/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ module.exports = function environmentMiddleware(argv) {
)
process.exit(1)
}
if (!network) network = 'development'
if (!network) network = 'rpc'
return { network: configureNetwork(argv, network) }
}

Expand Down