borrow-contracts
repo.VaultManager
contract per collateral type for each stablecoin. The same collateral could also have different associated VaultManager
contracts if different parameters are used.createVault()
: for a user to create a vault within the contractangle()
: for a user to compose actions with the contract. It can be used to create a vault, add collateral to it, borrow stablecoins against it, remove collateral from a vault, repay debt in a vault, approve the contract for a token through the permit
interface for tokens that allow it, or even get debt in a vault from another vaultliquidate()
function. They may call the checkLiquidation()
before that to simplify and pass the right parameters to the contract.VaultManager
contracts implement the ERC-721 standard and have minting right on their corresponding AgToken.VaultManager
contract. It allows users to (indirectly) deposit collateral in a VaultManager
and borrow stablecoins from it which are then invested in yield strategies. Stablecoins borrowed from deposited collateral are never accessible to users, they just get a portion of the yield made on it.deposit()
and mint
: for a user to deposit collateral in the strategywithdraw()
and redeem()
: for a user to redeem collateral from the strategyclaim()
: to claim stablecoin rewards accruing from the strategy.BaseReactor
implementation that all reactors should implement.flashLoanModule
. It has no minting rights over the stablecoin contracts.VaultManager
contracts associated to a stablecoin. There is one such Treasury
contract per stablecoin on mainnet.Treasury
contract that profits and losses from VaultManager
and FlashLoan
contracts are pooled before a portion is distributed (or not) to veANGLE holders.Treasury
contract has the ability to grant minting rights on its associated AgToken: it is hence the contract granting permissions to each new VaultManager
.Settlement
contracts can be used to settle that is to say to remove a VaultManager
from the protocol. Global settlement corresponds to the situation where all VaultManager
contracts associated to one stablecoin are settled at the same time.VaultManager
is transferred to the Settlement
contract to first allow owners of over-collateralized vault to claim their collateral upon repaying all their debt. Then owners of stablecoins can redeem collateral at oracle value (if there is enough left).CoreBorrow
contract which maintains the integrity of the roles at the module-level.CoreBorrow
contract whether the msg.sender
has the correct role.CoreBorrow
contract also introduces a FLASHLOANER_TREASURY_ROLE
given to Treasury
contracts associated to stablecoins on which flash loans can be taken.