Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Fix out of date info #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions docs/smart-contracts/core/adapters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ The [StrategyProxyFactory](factory) contract holds the address of the platform's
## Swap
All adapters must implement the `swap()` function in order to be usable by [Router](routers/routers-overview) contracts. Since it is expected that the [Router](routers/routers-overview) will interact with the `swap()` function via a delegate call the adapter's state variables (such as external contract addresses) must be defined in the deployment bytecode as `constant` or `immutable` variables.

## Spot Price
All adapters must implement the `spotPrice()` function in order to be usable by [Router](routers/routers-overview) contracts. This function estimates the price to exchange one token for another. Exchange fees are not included in the price estimate.

## Exchanges
Enso supports the following DEXes: Uniswap V2, Uniswap V3, Sushi, Balancer, Curve, and Synthetix. Interacting with these adapters allows a strategy to trade one token for another.

Expand Down
19 changes: 0 additions & 19 deletions docs/smart-contracts/core/routers/generic-router.mdx

This file was deleted.

19 changes: 19 additions & 0 deletions docs/smart-contracts/core/routers/multicall-router.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
id: multicall-router
title: Multicall Router
sidebar_position: 2
custom_edit_url: https://github.com/EnsoFinance/enso-docs/blob/main/docs/smart-contracts/core/routers/multicall-router.mdx
---

##### The MulticallRouter handles all trading functions (deposits, withdraws, rebalance, and restructures) using multicalls that are passed to the functions as bytecode.

---

## Call
The `Call` type is a `struct` that contains a target `address` and the `bytes` call data for a function that is on the target contract. The [Router](routers-overview) functions that are implemented by MulticallRouter taked a `Call[]` array which has been encoded into a `bytes` type. Using the `aggregate()` function in the `Multicall` library it loops through each `Call` and makes a function call to the target address.

## Delegate Swap
This contract implements the `delegateSwap` external function which wraps the internal `_delegateSwap` and allows it to be included within a `Multicall`. However, in order to prevent misuse, it restricts the address that may call it to the MulticallRouter address itself. In this way it acts as an internal function while also including the function in the contract's ABI to be used for building multicalls.

## Settlement Functions
There are several settlement functions implemented in the MulticallRouter to facilitate easier multicall creation. The basic purpose of these functions is to use the contract's current balance of a given token as the input amount for commonly used token functions. The functions are `settleSwap`, `settleTransfer`, and `settleTransferFrom`. All functions can only be called by the MulticallRouter and therefore can only be used as part of a multicall.