Skip to content

Commit

Permalink
Bill broker (#203)
Browse files Browse the repository at this point in the history
* bill broker

* BB Internal audit fixes (#210)

* internal audit fixes

* code review fixes

* Update spot-vaults/contracts/_interfaces/BillBrokerErrors.sol

Co-authored-by: Brandon Iles <brandon@fragments.org>

---------

Co-authored-by: Brandon Iles <brandon@fragments.org>

---------

Co-authored-by: Brandon Iles <brandon@fragments.org>
  • Loading branch information
aalavandhan and brandoniles authored May 30, 2024
1 parent 23cf94d commit d1794f8
Show file tree
Hide file tree
Showing 38 changed files with 6,772 additions and 1,100 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,12 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "./spot-contracts/coverage/lcov.info"

- name: spot-vaults run coverage
run: yarn workspace @ampleforthorg/spot-vaults run coverage

- name: spot-vaults report coverage
uses: coverallsapp/github-action@v2.2.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "./spot-vaults/coverage/lcov.info"
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
branches: [main,dev]

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
20
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"packageManager": "yarn@3.2.1",
"workspaces": [
"spot-contracts",
"spot-subgraph"
"spot-subgraph",
"spot-vaults"
]
}
4 changes: 4 additions & 0 deletions spot-vaults/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
artifacts
cache
coverage
46 changes: 46 additions & 0 deletions spot-vaults/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
module.exports = {
env: {
browser: false,
es2021: true,
mocha: true,
node: true,
},
plugins: ["@typescript-eslint", "no-only-tests", "unused-imports"],
extends: ["standard", "plugin:prettier/recommended", "plugin:node/recommended"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 12,
warnOnUnsupportedTypeScriptVersion: false,
},
rules: {
"node/no-unsupported-features/es-syntax": ["error", { ignores: ["modules"] }],
"node/no-missing-import": [
"error",
{
tryExtensions: [".ts", ".js", ".json"],
},
],
"node/no-unpublished-import": [
"error",
{
allowModules: [
"hardhat",
"ethers",
"@openzeppelin/upgrades-core",
"chai",
"@nomicfoundation/hardhat-ethers",
"@nomicfoundation/hardhat-chai-matchers",
"@nomicfoundation/hardhat-verify",
"@nomicfoundation/hardhat-toolbox",
"@openzeppelin/hardhat-upgrades",
"solidity-coverage",
"hardhat-gas-reporter",
"dotenv",
],
},
],
"no-only-tests/no-only-tests": "error",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": ["warn", { vars: "all" }],
},
};
Empty file added spot-vaults/.eslintrc.yaml
Empty file.
14 changes: 14 additions & 0 deletions spot-vaults/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
node_modules
.env

# Hardhat files
/cache
/artifacts

# TypeChain files
/typechain
/typechain-types

# solidity-coverage files
/coverage
/coverage.json
12 changes: 12 additions & 0 deletions spot-vaults/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# folders
artifacts/
build/
cache/
coverage/
dist/
lib/
node_modules/
typechain/

# files
coverage.json
17 changes: 17 additions & 0 deletions spot-vaults/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"arrowParens": "avoid",
"bracketSpacing": true,
"endOfLine":"auto",
"printWidth": 90,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "all",
"overrides": [
{
"files": "*.sol",
"options": {
"tabWidth": 4
}
}
]
}
3 changes: 3 additions & 0 deletions spot-vaults/.solcover.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
skipFiles: ["_test", "_interfaces", "_external"],
};
10 changes: 10 additions & 0 deletions spot-vaults/.solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "solhint:recommended",
"rules": {
"compiler-version": ["error", "^0.8.0"],
"func-visibility": ["warn", { "ignoreConstructors": true }],
"reason-string": ["warn", { "maxLength": 64 }],
"not-rely-on-time": "off",
"max-states-count": ["warn", 17]
}
}
1 change: 1 addition & 0 deletions spot-vaults/.solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
34 changes: 34 additions & 0 deletions spot-vaults/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# spot-vaults

This repository is a collection of vault strategies leveraging the SPOT system.

## Install

```bash
# Install project dependencies
yarn
```

## Testing

```bash
# Run all unit tests (compatible with node v12+)
yarn test
```

## Contribute

To report bugs within this package, create an issue in this repository.
For security issues, please contact dev-support@ampleforth.org.
When submitting code ensure that it is free of lint errors and has 100% test coverage.

```bash
# Lint code
yarn lint:fix

# Run solidity coverage report (compatible with node v12)
yarn coverage

# Run solidity gas usage report
yarn profile
```
Loading

0 comments on commit d1794f8

Please sign in to comment.