Giter Site home page Giter Site logo

anastur / angle-router Goto Github PK

View Code? Open in Web Editor NEW

This project forked from angleprotocol/angle-router

0.0 0.0 0.0 2.09 MB

๐Ÿ›ฃ Routing contracts of the Angle Protocol

License: GNU General Public License v3.0

JavaScript 0.31% TypeScript 60.59% Solidity 39.10%

angle-router's Introduction

Angle Router Contracts Angle Router Contracts

CI

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

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:

yarn hardhat:test ./test/hardhat/router/baseRouter.test.ts

You can also check the coverage of the tests with:

yarn hardhat:coverage

Coverage

yarn hardhat:coverage

Deploying

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

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

Media

Don't hesitate to reach out on Twitter ๐Ÿฆ

angle-router's People

Contributors

sogipec avatar guillaumenervoxs avatar tamtamhero avatar picodes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.