Inherits: IERC4626

Interface for an ERC4626 that manages ITinteroLoan contracts. The vault’s assets are either lent to Loan contracts or delegated to other addresses to maximize the utilization of the assets.

Functions

totalAssetsDelegated

The total amount of idle assets delegated.

function totalAssetsDelegated() external view returns (uint256);

delegatedTo

The total amount of idle assets delegated to an address.

function delegatedTo(address delegate) external view returns (uint256);

totalAssetsLent

The total amount of assets lent to Loan contracts.

function totalAssetsLent() external view returns (uint256);

lentTo

The total amount of assets lent to a Loan contract.

function lentTo(address loan) external view returns (uint256);

isLoan

Whether a Loan contract is managed by this vault.

function isLoan(address loan) external view returns (bool);

askDelegation

Delegates assets to an address.

function askDelegation(uint256 amount) external;

refundDelegation

Refunds delegated assets from an address.

function refundDelegation(uint256 amount) external;

forceRefundDelegation

function forceRefundDelegation(address delegate, uint256 amount) external;

requestLoan

Creates a new instance of a Loan contract with the provided parameters.

function requestLoan(
    address collateralCollection,
    address beneficiary,
    uint24 defaultThreshold,
    PaymentLib.Payment[] calldata payments,
    uint256[] calldata collateralTokenIds,
    bytes32 salt
) external;

pushPayments

Adds a list of payments to a Loan contract. Calls Loan#pushPayments.

function pushPayments(ITinteroLoan loan, uint256[] calldata collateralTokenIds, PaymentLib.Payment[] calldata payments)
    external;

onDebit

Debits an outstanding principal from a Loan contract.

function onDebit(uint256 principal) external;

pushTranches

Adds a list of tranches to a Loan contract. Calls Loan#pushTranches.

function pushTranches(ITinteroLoan loan, uint96[] calldata paymentIndexes, address[] calldata recipients) external;

fundN

Funds n payments from a Loan contract. Calls Loan#fundN.

function fundN(ITinteroLoan loan, uint256 n) external;

repossess

Repossess a range of payments from a Loan contract. Calls Loan#repossess.

function repossess(ITinteroLoan loan, uint256 start, uint256 end, address receiver) external;

upgradeLoan

Upgrades a Loan contract to a new implementation. Calls Loan#upgradeLoan.

function upgradeLoan(ITinteroLoan loan, address newImplementation, bytes calldata data) external;

Events

LoanCreated

Emitted when a Loan contract is created by this vault.

event LoanCreated(address loan, address collateralCollection, address beneficiary, uint24 defaultThreshold);

DelegateAssets

Emitted when assets are delegated to an address.

event DelegateAssets(address delegate, uint256 amount);

DelegateRefunded

Emitted when assets are refunded from an address.

event DelegateRefunded(address delegate, uint256 amount);

Errors

DuplicatedLoan

Reverts if a Loan contract is already created by this vault.

error DuplicatedLoan();

OnlyManagedLoan

Reverts if the caller is not a Loan contract created by this vault.

error OnlyManagedLoan();