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

Buidler migration #59

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@ node_modules
*/**/coverage.json
*/**/allFiredEvents
*/**/scTopics

*/**/.coverage_*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, is this from the new solidity-coverage version? Can we remove some of the previous lines on ignoring the previous version's coverage output?

# lerna
lerna-debug.log

# build artifacts
*/**/dist

# truffle build artifacts
# contract build artifacts
# Ignore only for first level to select just the contract build directories
*/*/abi
*/*/build
*/*/artifacts
*/*/cache

# lock files
package-lock.json
yarn.lock

# Misc
.DS_Store
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,13 @@ This installs global package dependencies and also bootstraps the entire monorep

> **Note**: the monorepo is set up in such a way that you **must** install it through a `lerna bootstrap` (done automatically after an `npm install`).
>
> If you're only interested in the contract dependencies, and not the frontends, you can use `INSTALL_FRONTEND=false npm install` instead.
>
> If you're only interested in bootstrapping one package, you can use `npx lerna bootstrap --scope @aragon/<package> --include-filtered-dependencies`

Running tests on all apps can be done by running `npm run test` at the root directory (note that running all of the tests can take a significant amount of time!).

Running tests of an individual app can be done by running `npm run test` inside an individual app's directory, or through the selective `npm run test:<app>` scripts.

By default, tests are run on an in-memory instance of ganache.
By default, tests are run on an in-memory instance of buidler.

## Contributing

Expand Down
6 changes: 0 additions & 6 deletions apps/token-wrapper/.solcover.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
module.exports = {
norpc: true,
copyPackages: [
'@aragon/os',
'@aragon/apps-voting',
'@aragonone/voting-connectors-contract-utils'
],
skipFiles: [
'examples',
'test',
Expand Down
16 changes: 13 additions & 3 deletions apps/token-wrapper/app/.babelrc
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this extra newline :)

{
"presets": [
[
"@babel/preset-env",
{
"modules": false,
"targets": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget exactly, but is the browserlist in the package.json enough or do we need to specify targets here as well for @babel/present-env?

"browsers": [
"> 1%",
"last 3 versions",
"ie >= 9",
"ios >= 8",
"android >= 4.2"
]
},
"useBuiltIns": "entry",
"core-js": 3,
"corejs": 3,
"shippedProposals": true,
}
]
],
"plugins": [
"@babel/plugin-proposal-class-properties",
[
"styled-components",
{
"displayName": true
}
]
]
}
}
7 changes: 4 additions & 3 deletions apps/token-wrapper/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@
"build:app": "parcel build index.html -d ../dist/ --public-url \".\" --no-cache",
"build:script": "parcel build src/script.js --out-dir ../dist/ --no-cache",
"watch:script": "parcel watch src/script.js --out-dir ../dist/ --no-hmr",
"devserver": "parcel serve index.html -p 8001 --out-dir ../dist/ --no-cache",
"start": "npm run sync-assets && npm run watch:script & npm run devserver",
"sync-assets": "copy-aragon-ui-assets ../dist && copyfiles -u 1 './public/**/*' ../dist"
"serve": "parcel serve index.html --out-dir ../dist/ --no-cache",
"watch": "npm run watch:script",
"sync-assets": "copy-aragon-ui-assets ../dist && copyfiles -u 1 './public/**/*' ../dist",
"start": "npm run sync-assets && npm run watch:script & npm run serve"
},
"browserslist": [
">2%",
Expand Down
8 changes: 5 additions & 3 deletions apps/token-wrapper/arapp.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"environments": {
"default": {
"appName": "token-wrapper.open.aragonpm.eth",
"network": "rpc"
"localhost": {
"appName": "token-wrapper.aragonpm.eth",
"network": "rpc",
"registry": "0x5f6f7e8cc7346a11ca2def8f827b7a0b612c56a1"
},
"mainnet": {
"appName": "token-wrapper.hatch.aragonpm.eth",
Expand All @@ -29,6 +30,7 @@
"wsRPC": "wss://rinkeby.eth.aragon.network/ws"
}
},
"appName": "token-wrapper.aragonpm.eth",
"roles": [],
"path": "contracts/TokenWrapper.sol"
}
64 changes: 64 additions & 0 deletions apps/token-wrapper/buidler.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
const { usePlugin } = require('@nomiclabs/buidler/config')
const hooks = require('./scripts/buidler-hooks')

usePlugin('@aragon/buidler-aragon')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this plugin is not really in active development anymore, what do you think about removing any configuration or dependencies that rely on it? Or was this still essential to your workflow?

usePlugin('@nomiclabs/buidler-solhint')
usePlugin('buidler-gas-reporter')
usePlugin('solidity-coverage')

const ACCOUNTS = (process.env.ETH_KEYS ? process.env.ETH_KEYS.split(',') : [])
.map(key => key.trim())

module.exports = {
defaultNetwork: 'localhost',
networks: {
localhost: {
url: 'http://localhost:8545',
accounts: {
mnemonic: "explain tackle mirror kit van hammer degree position ginger unfair soup bonus"
}
},
mainnet: {
url: 'https://mainnet.eth.aragon.network',
accounts: ACCOUNTS,
},
// Rinkeby network configured with Aragon node.
rinkeby: {
url: 'https://rinkeby.eth.aragon.network',
accounts: ACCOUNTS,
},
// Network configured to interact with Frame wallet. Requires
// to have Frame running on your machine. Download it from:
// https://frame.sh
frame: {
httpHeaders: { origin: 'buidler' },
url: 'http://localhost:1248',
},
xdai:{
url: 'https://xdai.poanetwork.dev',
accounts: ACCOUNTS,
gasPrice: 20,
gas: 12000000,
},
coverage: {
url: 'http://localhost:8555',
},
},
solc: {
version: '0.4.24',
optimizer: {
enabled: true,
runs: 10000,
},
},
gasReporter: {
enabled: process.env.GAS_REPORTER ? true : false,
},
aragon: {
appServePort: 8001,
clientServePort: 3000,
appSrcPath: 'app/',
appBuildOutputPath: 'dist/',
hooks,
},
}
83 changes: 0 additions & 83 deletions apps/token-wrapper/contracts/examples/ExampleTemplate.sol

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion apps/token-wrapper/contracts/test/TestImports.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import "@aragon/os/contracts/acl/ACL.sol";
import "@aragon/os/contracts/kernel/Kernel.sol";
import "@aragon/os/contracts/factory/EVMScriptRegistryFactory.sol";
import "@aragon/os/contracts/factory/DAOFactory.sol";
import "@aragon/apps-shared-migrations/contracts/Migrations.sol";

import "./mocks/ERC20Sample.sol";

Expand Down
5 changes: 0 additions & 5 deletions apps/token-wrapper/migrations/1_initial_migration.js

This file was deleted.

51 changes: 28 additions & 23 deletions apps/token-wrapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,42 @@
"/test"
],
"scripts": {
"prepare": "cd app && npm install && cd ..",
"apm:prepublish": "npm run compile",
"apm:publish": "node scripts/publish",
"compile": "truffle compile",
"build": "cd app && npm run build && cd ..",
"lint": "solium --dir ./contracts",
"test": "TRUFFLE_TEST=true npm run ganache-cli:test",
"coverage": "SOLIDITY_COVERAGE=true npx truffle run coverage",
"start": "npm run start:ipfs",
"start:app": "cd app && npm start && cd ..",
"start:ipfs": "./scripts/run.sh ipfs",
"start:http": "./scripts/run.sh http",
"ganache-cli:test": "./node_modules/@aragon/contract-test-helpers/ganache-cli.sh",
"abi:extract": "truffle-extract --output abi/ --keys abi",
"prepublishOnly": "truffle compile --all && npm run abi:extract -- --no-compile"
"postinstall": "npm run compile && npm run build-app",
"build-app": "cd app && npm install && cd ..",
"console": "buidler console",
"compile": "buidler compile --force",
"build": "cd app && yarn build",
"devchain": "buidler node",
"test": "buidler test --network buidlerevm",
"test:gas": "cross-env REPORT_GAS=true buidler test --network localhost",
"coverage": "buidler coverage --network coverage",
"abi:extract": "buidler-extract --output abi/ --keys abi",
"start": "buidler start --network localhost",
"publish:patch": "buidler publish patch",
"publish:minor": "buidler publish minor",
"publish:major": "buidler publish major",
"lint": "solium --dir ./contracts"
},
"dependencies": {
"@aragon/os": "4.3.0",
"@aragonone/voting-connectors-contract-utils": "^1.0.0"
},
"devDependencies": {
"@aragon/apps-shared-migrations": "^1.0.0",
"@aragon/apps-shared-minime": "^1.0.0",
"@aragon/apps-shared-minime": "^1.0.1",
"@aragon/apps-voting": "^2.0.0",
"@aragon/cli": "^6.4.4",
"@aragon/buidler-aragon": "^0.2.0",
"@aragon/contract-helpers-test": "^0.1.0",
"@aragon/contract-test-helpers": "^0.0.1",
"@aragon/truffle-config-v5": "^1.0.0",
"ganache-cli": "^6.4.3",
"@nomiclabs/buidler": "^1.3.0",
"@nomiclabs/buidler-etherscan": "^1.3.0",
"@nomiclabs/buidler-solhint": "^1.3.3",
"@nomiclabs/buidler-truffle5": "^1.3.0",
"@nomiclabs/buidler-web3": "^1.3.0",
"buidler-extract": "^1.0.0",
"buidler-gas-reporter": "^0.1.4",
"cross-env": "^5.2.0",
"ethlint": "^1.2.4",
"solidity-coverage": "^0.7.5",
"solium": "^1.2.3",
"truffle": "^5.1.1",
"truffle-extract": "^1.2.1"
"web3": "^1.2.0"
}
}
Loading