Skip to content

Commit 489ac6a

Browse files
authored
Merge pull request #176 from ampleforth/hardhat-refactor
migrate to hardhat
2 parents 3f21570 + c3bacb1 commit 489ac6a

40 files changed

+12659
-26585
lines changed

.coveralls.yml

-2
This file was deleted.

.eslintrc.js

-67
This file was deleted.

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,10 @@ scDebugLog
7272
coverage.json
7373
coverage/
7474
coverageEnv/
75+
76+
node_modules
77+
78+
#Buidler files
79+
cache
80+
artifacts
81+
.openzeppelin

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
12

.prettierrc

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"semi": false,
3+
"trailingComma": "all",
4+
"singleQuote": true,
5+
"bracketSpacing": true,
6+
"printWidth": 80,
7+
"overrides": [
8+
{
9+
"files": "*.sol",
10+
"options": {
11+
"printWidth": 100,
12+
"tabWidth": 4,
13+
"useTabs": false,
14+
"singleQuote": false,
15+
"bracketSpacing": false,
16+
"explicitTypes": "always"
17+
}
18+
}
19+
]
20+
}

.solcover.js

+2-14
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
const _require = require('app-root-path').require;
2-
const config = _require('/truffle.js').networks.testrpcCoverage;
3-
41
module.exports = {
5-
host: config.host,
6-
network_id: config.network_id,
7-
port: config.port,
8-
gas: config.gas,
9-
gasPrice: config.gasPrice,
10-
norpc: true,
11-
testCommand: 'npx truffle test ./test/unit/*.js',
12-
compileCommand: 'npx truffle compile',
13-
skipFiles: ['mocks'],
14-
copyPackages: ['openzeppelin-eth'],
15-
};
2+
skipFiles: ['mocks'],
3+
}

.solhint.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"extends": "default",
3-
"rules": {
4-
"not-rely-on-time": [false],
5-
"no-simple-event-func-name": [false],
6-
"indent": ["warn", 4],
7-
"max-line-length": ["error", 100]
8-
}
2+
"extends": "solhint:default",
3+
"plugins": ["prettier"],
4+
"rules": {
5+
"prettier/prettier": "error",
6+
"not-rely-on-time": "off",
7+
"max-line-length": ["error", 100]
8+
}
99
}

.travis.yml

+3-9
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,13 @@ dist: trusty
22
sudo: required
33
language: node_js
44
node_js:
5-
- "8"
5+
- '12'
66
cache:
77
directories:
88
- node_modules
9-
- $(npm config get prefix)/bin/ganache-cli
10-
before_install:
11-
- npm install -g [email protected] # Locking npm to 6.4.1
12-
- npm install -g npx
139
script:
14-
- ./scripts/setup-ci.sh
15-
- npm run lint
16-
- npm run test
17-
- npm run coverage
10+
- yarn test
11+
- yarn coverage
1812
after_success:
1913
- cat coverage/lcov.info | npx coveralls
2014
notifications:

README.md

+14-18
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Ampleforth (code name uFragments) is a decentralized elastic supply protocol. It
77
This repository is a collection of [smart contracts](http://ampleforth.org/docs) that implement the Ampleforth protocol on the Ethereum blockchain.
88

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

24-
2525
## Install
2626

2727
```bash
2828
# Install project dependencies
29-
npm install
30-
31-
# Install ethereum local blockchain(s) and associated dependencies
32-
npx setup-local-chains
29+
yarn
3330
```
3431

3532
## Testing
3633

37-
``` bash
38-
# You can use the following command to start a local blockchain instance
39-
npx start-chain [ganacheUnitTest|gethUnitTest]
40-
41-
# Run all unit tests
42-
npm test
43-
44-
# Run unit tests in isolation
45-
npx truffle --network ganacheUnitTest test test/unit/uFragments.js
34+
```bash
35+
# Run all unit tests (compatible with node v12+)
36+
yarn test
4637
```
4738

4839
## Testnets
40+
4941
There is a testnet deployment on Rinkeby. It rebases hourly using real market data.
42+
5043
- ERC-20 Token: [0x027dbcA046ca156De9622cD1e2D907d375e53aa7](https://rinkeby.etherscan.io/token/0x027dbcA046ca156De9622cD1e2D907d375e53aa7)
5144
- Supply Policy: [0x1D2771AFC894107c4edc072e3bd15Cb7F1BCC007](https://rinkeby.etherscan.io/address/0x1D2771AFC894107c4edc072e3bd15Cb7F1BCC007)
5245
- Orchestrator: [0xF473604Be74A69a6bB4ebED33A91a291f6C5b5DE](https://rinkeby.etherscan.io/address/0xF473604Be74A69a6bB4ebED33A91a291f6C5b5DE)
@@ -59,12 +52,15 @@ To report bugs within this package, create an issue in this repository.
5952
For security issues, please contact [email protected].
6053
When submitting code ensure that it is free of lint errors and has 100% test coverage.
6154

62-
``` bash
55+
```bash
6356
# Lint code
64-
npm run lint
57+
yarn lint
58+
59+
# Format code
60+
yarn format
6561

66-
# View code coverage
67-
npm run coverage
62+
# Run solidity coverage report (compatible with node v12)
63+
yarn coverage
6864
```
6965

7066
## License

docs/Orchestrator.md

-34
This file was deleted.

hardhat.config.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { HardhatUserConfig } from 'hardhat/config'
2+
3+
import '@nomiclabs/hardhat-ethers'
4+
import '@nomiclabs/hardhat-waffle'
5+
import '@openzeppelin/hardhat-upgrades'
6+
import 'solidity-coverage'
7+
8+
require('./scripts/deploy')
9+
10+
export default {
11+
solidity: {
12+
version: '0.4.24',
13+
},
14+
mocha: {
15+
timeout: 100000,
16+
},
17+
} as HardhatUserConfig

migrations/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)