/dss-conduits

Primary LanguageSolidityGNU Affero General Public License v3.0AGPL-3.0

dss-conduits

Foundry CI Foundry License: AGPL v3

Overview

The Conduit is a smart contract that facilitates the deployment of funds to yield bearing strategies as part of the DSS Allocator System. The Conduit has a standard interface, defined in the dss-allocator repo here. There are intended to be many Conduit implementations, each with a different use case. All Conduits can be found in the src directory.

Upgradeability

Since Conduits will likely require maintenance as their desired usage evolves, they will be upgradeable contracts, using upgradeable-proxy for upgradeable logic. This is a non-transparent proxy contract that gives upgrade rights to the PauseProxy.

Testing

To run the tests, do the following:

forge test

Functionality

deposit

The deposit function is used to move funds from a given ilks buffer into the Conduit. From the Conduit, the funds can be deployed to a yield bearing strategy. This can happen atomically in the case of DeFi protocols, or can happen in a separate function call made by a permissioned actor in the case of Real World Asset strategies.

withdraw

The withdraw function is used to move funds from the Conduit into a given ilks buffer. This can pull funds atomically from a yield bearing strategy in the case of DeFi protocols, or can pull the funds directly from the Conduit in the case of a Real World Asset strategy where the permissioned actor has returned the funds manually. Both situations require that there is available liquidity, which is why maxWithdraw exists. This view function should report the maximum amount of asset that can be withdrawn for a given ilk.

Disclaimer

This code belongs to the MakerDAO community and the Copyright for the code belongs to the Dai Foundation.