This repository contains the contracts of the Angle Protocol Borrowing module adapted to productive assets (e.g. staked tokens that can receive rewards).
For more details about what Angle or the Borrowing module are, you can check Angle documentation here or the contracts for the Borrowing module of the protocol using vanilla collateral assets here.
Other Angle-related smart contracts can be found in the following repositories:
- Angle Core module contracts
- Angle Strategies
- Angle Router contracts
- Angle Algorithmic Market Operations
Otherwise, for more info about the protocol, check out this portal of resources.
This repo contains the contracts and tests associated to this extension of the Borrowing module. Follow the steps described below if you want to be able to use it by yourself.
It only works with Foundry.
You can install all dependencies by running
yarn
forge i
Before being able to compile the contracts of the repo, you need to install the repository's submodules.
git submodule init
git submodule update --remote
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.
To automatically create headers, follow: https://github.com/Picodes/headers
curl -L https://foundry.paradigm.xyz | bash
source /root/.zshrc
# or, if you're under bash: source /root/.bashrc
foundryup
To install the standard library:
forge install foundry-rs/forge-std
To update libraries:
forge update
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.
docker pull ghcr.io/foundry-rs/foundry
docker tag ghcr.io/foundry-rs/foundry:latest foundry:latest
To run the container:
docker run -it --rm -v $(pwd):/app -w /app foundry sh
Then you are inside the container and can run Foundry’s commands.
You can run tests as follows:
forge test -vvvv --watch
forge test -vvvv --match-path test/foundry/vaultManager/VaultManagerListing.t.sol
forge test -vvvv --match-test "testAbc*"
You can also list tests:
forge test --list
forge test --list --json --match-test "testXXX*"
There is an example script in the scripts/foundry
folder. Then you can run:
yarn foundry:deploy <FILE_NAME> --rpc-url <NETWORK_NAME>
We recommend the use of this vscode extension.
yarn foundry:coverage
yarn foundry:gas
pip3 install slither-analyzer
pip3 install solc-select
solc-select install 0.8.11
solc-select use 0.8.11
slither .
Don't hesitate to reach out on Twitter 🐦