Skip to content

migrate to hardhat #176

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

Merged
merged 1 commit into from
Jan 8, 2021
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
2 changes: 0 additions & 2 deletions .coveralls.yml

This file was deleted.

67 changes: 0 additions & 67 deletions .eslintrc.js

This file was deleted.

7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,10 @@ scDebugLog
coverage.json
coverage/
coverageEnv/

node_modules

#Buidler files
cache
artifacts
.openzeppelin
Copy link
Member

Choose a reason for hiding this comment

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

newlines at EOF -- I have this configured in my editor settings

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12
20 changes: 20 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"semi": false,
"trailingComma": "all",
"singleQuote": true,
"bracketSpacing": true,
"printWidth": 80,
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 100,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false,
"explicitTypes": "always"
}
}
]
}
16 changes: 2 additions & 14 deletions .solcover.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
const _require = require('app-root-path').require;
const config = _require('/truffle.js').networks.testrpcCoverage;

module.exports = {
host: config.host,
network_id: config.network_id,
port: config.port,
gas: config.gas,
gasPrice: config.gasPrice,
norpc: true,
testCommand: 'npx truffle test ./test/unit/*.js',
compileCommand: 'npx truffle compile',
skipFiles: ['mocks'],
copyPackages: ['openzeppelin-eth'],
};
skipFiles: ['mocks'],
}
14 changes: 7 additions & 7 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"extends": "default",
"rules": {
"not-rely-on-time": [false],
"no-simple-event-func-name": [false],
"indent": ["warn", 4],
"max-line-length": ["error", 100]
}
"extends": "solhint:default",
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error",
"not-rely-on-time": "off",
"max-line-length": ["error", 100]
}
}
12 changes: 3 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,13 @@ dist: trusty
sudo: required
language: node_js
node_js:
- "8"
- '12'
cache:
directories:
- node_modules
- $(npm config get prefix)/bin/ganache-cli
before_install:
- npm install -g [email protected] # Locking npm to 6.4.1
- npm install -g npx
script:
- ./scripts/setup-ci.sh
- npm run lint
- npm run test
- npm run coverage
- yarn test
- yarn coverage
after_success:
- cat coverage/lcov.info | npx coveralls
notifications:
Expand Down
32 changes: 14 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Ampleforth (code name uFragments) is a decentralized elastic supply protocol. It
This repository is a collection of [smart contracts](http://ampleforth.org/docs) that implement the Ampleforth protocol on the Ethereum blockchain.

The official mainnet addresses are:

- ERC-20 Token: [0xD46bA6D942050d489DBd938a2C909A5d5039A161](https://etherscan.io/token/0xd46ba6d942050d489dbd938a2c909a5d5039a161)
- Supply Policy: [0x1B228a749077b8e307C5856cE62Ef35d96Dca2ea](https://etherscan.io/address/0x1b228a749077b8e307c5856ce62ef35d96dca2ea)
- Orchestrator: [0x6fb00a180781e75f87e2b690af0196baa77c7e7c](https://etherscan.io/address/0x6fb00a180781e75f87e2b690af0196baa77c7e7c)
Expand All @@ -21,32 +22,24 @@ The official mainnet addresses are:
- [Contribute](#contribute)
- [License](#license)


## Install

```bash
# Install project dependencies
npm install

# Install ethereum local blockchain(s) and associated dependencies
npx setup-local-chains
yarn
```

## Testing

``` bash
# You can use the following command to start a local blockchain instance
npx start-chain [ganacheUnitTest|gethUnitTest]

# Run all unit tests
npm test

# Run unit tests in isolation
npx truffle --network ganacheUnitTest test test/unit/uFragments.js
```bash
# Run all unit tests (compatible with node v12+)
yarn test
```

## Testnets

There is a testnet deployment on Rinkeby. It rebases hourly using real market data.

- ERC-20 Token: [0x027dbcA046ca156De9622cD1e2D907d375e53aa7](https://rinkeby.etherscan.io/token/0x027dbcA046ca156De9622cD1e2D907d375e53aa7)
- Supply Policy: [0x1D2771AFC894107c4edc072e3bd15Cb7F1BCC007](https://rinkeby.etherscan.io/address/0x1D2771AFC894107c4edc072e3bd15Cb7F1BCC007)
- Orchestrator: [0xF473604Be74A69a6bB4ebED33A91a291f6C5b5DE](https://rinkeby.etherscan.io/address/0xF473604Be74A69a6bB4ebED33A91a291f6C5b5DE)
Expand All @@ -59,12 +52,15 @@ To report bugs within this package, create an issue in this repository.
For security issues, please contact [email protected].
When submitting code ensure that it is free of lint errors and has 100% test coverage.

``` bash
```bash
# Lint code
npm run lint
yarn lint

# Format code
yarn format

# View code coverage
npm run coverage
# Run solidity coverage report (compatible with node v12)
yarn coverage
```

## License
Expand Down
34 changes: 0 additions & 34 deletions docs/Orchestrator.md

This file was deleted.

17 changes: 17 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { HardhatUserConfig } from 'hardhat/config'

import '@nomiclabs/hardhat-ethers'
import '@nomiclabs/hardhat-waffle'
import '@openzeppelin/hardhat-upgrades'
import 'solidity-coverage'

require('./scripts/deploy')

export default {
solidity: {
version: '0.4.24',
},
mocha: {
timeout: 100000,
},
} as HardhatUserConfig
Empty file removed migrations/.gitkeep
Empty file.
Loading