https://github.com/angleprotocol/angle-router
🛣 Routing contracts of the Angle Protocol
https://github.com/angleprotocol/angle-router
ethereum-contract foundry hardhat
Last synced: 17 days ago
JSON representation
🛣 Routing contracts of the Angle Protocol
- Host: GitHub
- URL: https://github.com/angleprotocol/angle-router
- Owner: AngleProtocol
- License: gpl-3.0
- Created: 2022-03-11T17:29:11.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-02T08:46:39.000Z (9 months ago)
- Last Synced: 2025-05-06T19:12:17.132Z (17 days ago)
- Topics: ethereum-contract, foundry, hardhat
- Language: TypeScript
- Homepage:
- Size: 2.5 MB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#
Angle Router Contracts
[](https://github.com/AngleProtocol/angle-router/actions?query=workflow%3ACI)
## Documentation
This repository contains router contracts for the Angle Protocol. These contracts are designed to facilitate the composition of actions on top of Angle and other protocols in a single transaction.
There is one router contract per chain on which the protocol is natively deployed with a very similar implementation each time.
Across all chains, router contracts implementations rely on a **mixer()** function that can be called with a set of instructions, including the different actions it can perform and their parameters.
Instructions can range from transferring funds to another address, performing a swap on 1Inch, opening a perpetual, depositing in an ERC4626 contract, wrapping the native token of a chain (e.g ETH to wETH), ...
Some actions are possible on some chains but not on others, and we recommend to look at the implementation of the contract to view what kind of actions are supported.
The list of all potentially available actions is defined in the `ActionType` enum.
## Setup
### 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:
- `MNEMONIC`
- network key
- `ETHERSCAN_API_KEY`For additional keys, you can check the `.env.example` file.
Warning: always keep your confidential information safe.
### Tests
Contracts in this repo rely on Hardhat tests. You can run tests as follows:
```bash
yarn hardhat:test ./test/hardhat/router/baseRouter.test.ts
```You can also check the coverage of the tests with:
```bash
yarn hardhat:coverage
```### Coverage
```bash
yarn hardhat:coverage
```### Deploying
```bash
yarn deploy mainnet
```Make sure to change the tag corresponding to the file you're deploying, and to adapt the `CoreBorrow`, `Treasury` and `ProxyAdmin` to your use case.
## 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
```## Media
Don't hesitate to reach out on [Twitter](https://twitter.com/AngleProtocol) 🐦