Contracts - Twyne Collateral Vault Factory
Summary
The primary purpose of the collateral vault factory contract is to create Twyne collateral vaults. There is also a governance-controlled pause functionality in the factory contract, which individual Twyne Collateral Vaults refer to on functions that use the whenNotPaused()
modifier.
Function Calls
The key function in the factory contract is createCollateralVault()
, which users call through the EVC to create their Twyne collateral vault:
/// @notice This function is called when a borrower wants to deploy a new collateral vault.
/// @param _asset address of vault asset
/// @param _targetVault address of the target vault, used for the lookup of the beacon proxy implementation contract
/// @param _liqLTV user-specified target LTV
/// @return vault address of the newly created collateral vault
function createCollateralVault(address _asset, address _targetVault, uint _liqLTV)
The frontend combines this function call in a batch that includes the user’s first deposit and borrow.