Debt DAO Docs
Search…
⌃K

Escrow.sol

Core functions and methods of Escrow.sol
  • Allows a Borrower to deposit tokens as collateral for a Line of Credit
  • Allows a Borrower to withdraw collateral so long as it doesn't cause the status of a Line to be LIQUIDATABLE
  • Allows Arbiter to whitelist (enable) specific collateral allowed for a Line
  • Allows Arbiter to liquidate collateral if the status is LIQUIDATABLE
  • External calls to - Oracle.sol, LineOfCredit.sol
  • Libraries - LineLib.sol, CreditLib.sol, EscrowLib.sol
External Functions
function enableCollateral(address token) external returns (bool)
function addCollateral(uint256 amount, address token) external payable nonReentrant returns (uint256)
function getCollateralRatio() external returns (uint256)
function getCollateralValue() external returns (uint256)
function releaseCollateral(uint256 amount, address token, address to) external nonReentrant returns (uint256)
function liquidate(uint256 amount, address token, address to) external nonReentrant returns (bool)
function updateLine(address _line) external returns(bool)
function line() external view override returns(address)
function isLiquidatable() external returns(bool)
Methods
function enableCollateral(): Allows an Arbiter to whitelist an ERC-20 token or ERC-4626 vault to be used as collateral
function addCollateral(): Allows a Borrower to adds whitelisted (enabled) tokens as collateral after which the app updates the collateral ratio
function getCollateralRatio(): Returns the ratio of the value of collateral to outstanding debt
function getCollateralValue(): Returns the latest value of the collateral deposited by a Borrower (in USD)
function releaseCollateral(): Allows a Borrower to withdraw any amount of collateral as long as the minimum collateral ratio is maintained.
function liquidate(): Allows the Arbiter to liquidate collateral
function updateLine(): Allows a Borrower to transfer (roll over) collateral to a new Line of Credit.
function line(): Returns the address of the the current controller of the Escrow contract
function isLiquidatable(): Returns true if the collateral ratio is lower than minimum collateral ratio