-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore: adding initial repo files #1
Merged
Merged
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
83dbb47
chore: adding initial repo files
kupermind c161ecc
feat: docs, abis, deployment scripts
kupermind d252a3a
chore: correcting chiado node
kupermind 6483e26
chore: linter
kupermind d5bd082
chore: skipping coverage for test contracts
kupermind ad308e3
doc: correcting readme
kupermind 0e054c0
doc: readme update
kupermind 9eb5609
chore: renaming
kupermind 939accc
test: correcting paths in foundry tests
kupermind 045bf71
chore: updating abis
kupermind File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
audits/* | ||
coverage* | ||
lib/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
module.exports = { | ||
"env": { | ||
"browser": true, | ||
"commonjs": true, | ||
"es2021": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"parserOptions": { | ||
"ecmaVersion": 13 | ||
}, | ||
"ignorePatterns": [ | ||
"artifacts/*", | ||
"cache/*", | ||
"node_modules/*", | ||
"third_party/*" | ||
], | ||
"rules": { | ||
"camelcase": [ | ||
2, { | ||
"properties": "always" | ||
} | ||
], | ||
"indent": [ | ||
"error", | ||
4 | ||
], | ||
"linebreak-style": [ | ||
"error", | ||
"unix" | ||
], | ||
"quotes": [ | ||
"error", | ||
"double" | ||
], | ||
"semi": [ | ||
"error", | ||
"always" | ||
], | ||
"no-unused-vars": "warn" | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Workflow | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
continue-on-error: False | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository and submodules | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Get a specific Node.js version such that hardhat does not hang periodically | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18.15.0" | ||
|
||
# Install modules | ||
- name: Install modules | ||
run: yarn install | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
# Run linters | ||
- name: Run ESLint | ||
run: ./node_modules/.bin/eslint . --ext .js,.jsx,.ts,.tsx | ||
- name: Run solhint | ||
run: ./node_modules/.bin/solhint contracts/p1/*.sol contracts/test/*.sol | ||
|
||
# Compile the code and run tests and deploy script(s) | ||
- name: Compile the code | ||
run: ./node_modules/.bin/hardhat compile | ||
- name: Run tests | ||
run: ./node_modules/.bin/hardhat test | ||
|
||
# Run hardhat coverage and upload codecov report | ||
- name: Solidity coverage summary | ||
run: ./node_modules/.bin/hardhat coverage | ||
|
||
# Compile the code and run foundry tests | ||
- name: Run foundry tests | ||
run: forge test --hh -vvv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# Object file | ||
*.o | ||
node_modules | ||
.env | ||
coverage | ||
coverage.json | ||
typechain | ||
*.DS_Store | ||
.idea | ||
|
||
# Ada Library Information | ||
*.ali | ||
# Hardhat files | ||
cache | ||
artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "lib/autonolas-registries"] | ||
path = lib/autonolas-registries | ||
url = https://github.com/valory-xyz/autonolas-registries.git | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
skipFiles: [ | ||
"test/ABICreator.sol", | ||
"test/ERC20Token.sol", | ||
"test/MockAgentMech.sol", | ||
"test/SafeNonceLib.sol" | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"extends": "solhint:recommended", | ||
"plugins": [], | ||
"rules": { | ||
"compiler-version": ["warn", ">=0.8.21"], | ||
"func-visibility": ["warn",{"ignoreConstructors":true}], | ||
"no-empty-blocks": "off", | ||
"not-rely-on-time": "off", | ||
"const-name-snakecase": "off", | ||
"avoid-suicide": "error", | ||
"avoid-sha3": "warn", | ||
"var-name-mixedcase": "off", | ||
"mark-callable-contracts": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,73 @@ | ||
# autonolas-staking-programmes | ||
Autonolas Staking Programmes | ||
# Autonolas Staking Programmes | ||
|
||
## Introduction | ||
This repository contains the Autonolas Staking Programmes set of contracts. It is built on top of a core service staking | ||
functionality of [autonolas-staking-programmes](https://github.com/valory-xyz/autonolas-staking-programmes). | ||
|
||
## Development | ||
|
||
### Prerequisites | ||
- This repository follows the standard [`Hardhat`](https://hardhat.org/tutorial/) development process. | ||
- The code is written on Solidity `0.8.21`. | ||
- The standard versions of Node.js along with Yarn are required to proceed further (confirmed to work with Yarn `1.22.19` and npx/npm `10.1.0` and node `v18.17.0`). | ||
|
||
### Install the dependencies | ||
The project has submodules to get the dependencies. Make sure you run `git clone --recursive` or init the submodules yourself. | ||
The dependency list is managed by the `package.json` file, and the setup parameters are stored in the `hardhat.config.js` file. | ||
Simply run the following command to install the project: | ||
``` | ||
yarn install | ||
``` | ||
|
||
### Core components | ||
The contracts, deployment scripts and tests are located in the following folders respectively: | ||
``` | ||
contracts | ||
scripts | ||
test | ||
``` | ||
|
||
### Compile the code and run | ||
Compile the code: | ||
``` | ||
npx hardhat compile | ||
``` | ||
Run the tests: | ||
``` | ||
npx hardhat test | ||
``` | ||
Run tests with forge: | ||
``` | ||
forge test --hh -vvv | ||
``` | ||
|
||
|
||
### Linters | ||
- [`ESLint`](https://eslint.org) is used for JS code. | ||
- [`solhint`](https://github.com/protofire/solhint) is used for Solidity linting. | ||
|
||
|
||
### Github Workflows | ||
The PR process is managed by github workflows, where the code undergoes several steps in order to be verified. | ||
Those include: | ||
- code installation | ||
- running linters | ||
- running tests | ||
|
||
## Deployment | ||
The deployment of contracts to the test- and main-net is split into step-by-step series of scripts for more control and checkpoint convenience. | ||
The description of deployment procedure can be found here: [deployment](https://github.com/valory-xyz/autonolas-staking-programmes/blob/main/scripts/deployment). | ||
|
||
The finalized contract ABIs for deployment and their number of optimization passes are located here: [ABIs](https://github.com/valory-xyz/autonolas-staking-programmes/blob/main/abis). | ||
Each folder there contains contracts compiled with the solidity version before their deployment. | ||
|
||
### Audits | ||
The audit is provided as development matures. The latest audit report can be found here: [audits](https://github.com/valory-xyz/autonolas-staking-programmes/blob/main/audits). | ||
|
||
|
||
## Acknowledgements | ||
The staking programmes contracts were inspired and based on the following sources: | ||
- [Rari-Capital Solmate](https://github.com/Rari-Capital/solmate). | ||
- [Autonolas Registries](https://github.com/valory-xyz/autonolas-registries). | ||
- [Gnosis Mech](https://github.com/gnosis/mech). | ||
- [Safe Ecosystem Safe Contracts](https://github.com/safe-global/safe-contracts). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean registries here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good catch, it was registries before, but the renaming changed it :)