ILoanManagerDelegator
Inherits: ILoanManager, ILoanConfigManager
Author: bull.haus
Delegator which forwards loan methods on delegatee contracts.
Loan contracts are split due to EIP-170 size restrictions. Calls are done within the storage context of the delegator contract.
Functions
initialize
Initialize deployed contract and set proxy contracts.
function initialize(
address accessManager,
ILoanConfigManager loanConfigManager,
ILoanManager loanManager,
IAssetManager assetManager_,
ILoaNFT loaNFT_,
LoanConfigLimits calldata limits_
) external;
Parameters
Name | Type | Description |
---|---|---|
accessManager | address | AccessManager authority instance. |
loanConfigManager | ILoanConfigManager | LoanConfigManager delegate contract address. |
loanManager | ILoanManager | LoanManager delegate contract address. |
assetManager_ | IAssetManager | AssetManager contract address. |
loaNFT_ | ILoaNFT | LoaNFT contract address. |
limits_ | LoanConfigLimits | Platform limits for loan configs. |
pause
Pause contract.
function pause() external;
unpause
Unpause contract.
function unpause() external;
getLoan
Get loan data.
function getLoan(uint256 loanId) external view returns (ILoanConfigManager.LoanInfo memory);
Parameters
Name | Type | Description |
---|---|---|
loanId | uint256 | loan id to get loan data from |
Returns
Name | Type | Description |
---|---|---|
<none> | ILoanConfigManager.LoanInfo | Loan info |
getLoanAssets
Get loan asset data.
function getLoanAssets(uint256 loanId) external view returns (CollateralAssets memory);
Parameters
Name | Type | Description |
---|---|---|
loanId | uint256 | loan id to get loan asset data for |
getLoanConfig
Get loan accepted usage of asset for loan configuration.
function getLoanConfig(uint256 configId)
external
view
returns (
address lender,
bool enabled,
uint256 total,
LoanConfigUser memory loanConfig,
LoanConfigAssetUsage memory assetUsage
);
Parameters
Name | Type | Description |
---|---|---|
configId | uint256 | configuration id of loan config to get data from. Request ID 1 .. getLoanConfigCounter() |
Returns
Name | Type | Description |
---|---|---|
lender | address | lender owning loan config |
enabled | bool | true when loan config is enabled, false when disabled |
total | uint256 | sum of all currently open loans using this loan config |
loanConfig | LoanConfigUser | loan config |
assetUsage | LoanConfigAssetUsage | asset configuration for loan config |
getLoanConfigCounter
Get loan configuration counter.
function getLoanConfigCounter() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | amount of loan configurations |
getLoanCounter
Get loan counter.
function getLoanCounter() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | amount of loans |
getUserConfigId
Get loan configuration id of user, by configuration index
Each user can configure up to 10 configurations per asset
function getUserConfigId(address lender, uint256 assetId, uint256 index) external view returns (uint256 configId);
Parameters
Name | Type | Description |
---|---|---|
lender | address | user address to get configuration id for |
assetId | uint256 | asset ID to get configuration id for |
index | uint256 | index of configuration (0 .. 9) |
Returns
Name | Type | Description |
---|---|---|
configId | uint256 | loan configuration id at index. 0 when no loan configuration is stored at the given index. |