Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/angleprotocol/boilerplate
π©βπ» Angle Boilerplate for starting new web3 projects
https://github.com/angleprotocol/boilerplate
blockchain-technology solidity
Last synced: 28 days ago
JSON representation
π©βπ» Angle Boilerplate for starting new web3 projects
- Host: GitHub
- URL: https://github.com/angleprotocol/boilerplate
- Owner: AngleProtocol
- License: gpl-3.0
- Created: 2022-07-27T13:34:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-11T13:54:31.000Z (about 1 year ago)
- Last Synced: 2024-04-18T05:54:36.658Z (9 months ago)
- Topics: blockchain-technology, solidity
- Language: Solidity
- Homepage:
- Size: 144 KB
- Stars: 20
- Watchers: 3
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Angle Project Boilerplate
[![CI](https://github.com/AngleProtocol/boilerplate/actions/workflows/ci.yml/badge.svg)](https://github.com/AngleProtocol/boilerplate/actions)
[![Coverage](https://codecov.io/gh/AngleProtocol/boilerplate/branch/main/graph/badge.svg)](https://codecov.io/gh/AngleProtocol/boilerplate)This repository proposes a template that is based on foundry frameworks. It also provides templates for EVM compatible smart contracts (in `./contracts/example`), tests and deployment scripts.
## Starting
### Install packages
You can install all dependencies by running
```bash
yarn
forge i
```### Create `.env` file
In order to interact with non local networks, you must create an `.env` that has:
- `PRIVATE_KEY`
- `MNEMONIC`
- network key (eg. `ALCHEMY_NETWORK_KEY`)
- `ETHERSCAN_API_KEY`For additional keys, you can check the `.env.example` file.
Warning: always keep your confidential information safe.
## Headers
To automatically create headers, follow:
## Hardhat Command line completion
Follow these instructions to have hardhat command line arguments completion:
## Foundry Installation
```bash
curl -L https://foundry.paradigm.xyz | bashsource /root/.zshrc
# or, if you're under bash: source /root/.bashrcfoundryup
```To install the standard library:
```bash
forge install foundry-rs/forge-std
```To update libraries:
```bash
forge update
```### Foundry on Docker π³
**If you donβt want to install Rust and Foundry on your computer, you can use Docker**
Image is available here [ghcr.io/foundry-rs/foundry](http://ghcr.io/foundry-rs/foundry).```bash
docker pull ghcr.io/foundry-rs/foundry
docker tag ghcr.io/foundry-rs/foundry:latest foundry:latest
```To run the container:
```bash
docker run -it --rm -v $(pwd):/app -w /app foundry sh
```Then you are inside the container and can run Foundryβs commands.
### Tests
You can run tests as follows:
```bash
forge test -vvvv --watch
forge test -vvvv --match-path contracts/forge-tests/KeeperMulticall.t.sol
forge test -vvvv --match-test "testAbc*"
forge test -vvvv --fork-url https://eth-mainnet.alchemyapi.io/v2/Lc7oIGYeL_QvInzI0Wiu_pOZZDEKBrdf
```You can also list tests:
```bash
forge test --list
forge test --list --json --match-test "testXXX*"
```### Deploying
There is an example script in the `scripts/foundry` folder. Then you can run:
```bash
yarn foundry:deploy --rpc-url
```Example:
```bash
yarn foundry:deploy scripts/foundry/DeployMockAgEUR.s.sol --rpc-url goerli
```### Coverage
We recommend the use of this [vscode extension](ryanluker.vscode-coverage-gutters).
```bash
yarn hardhat:coverage
yarn foundry:coverage
```### Simulate
You can simulate your transaction live or in fork mode. For both option you need to
complete the `scripts/foundry/Simulate.s.sol` with your values: address sending the tx,
address caled and the data to give to this address call.For live simulation
```bash
yarn foundry:simulate
```For fork simulation
```bash
yarn foundry:fork
yarn foundry:simulate:fork
```For fork simulation at a given block
```bash
yarn foundry:fork:block ${XXXX}
yarn foundry:simulate:fork
```### Gas report
```bash
yarn foundry:gas
```## Slither
```bash
pip3 install slither-analyzer
pip3 install solc-select
solc-select install 0.8.11
solc-select use 0.8.11
slither .
```## Media
Don't hesitate to reach out on [Twitter](https://twitter.com/AngleProtocol) π¦