ILoanManagerDelegator

Git Source

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

NameTypeDescription
accessManageraddressAccessManager authority instance.
loanConfigManagerILoanConfigManagerLoanConfigManager delegate contract address.
loanManagerILoanManagerLoanManager delegate contract address.
assetManager_IAssetManagerAssetManager contract address.
loaNFT_ILoaNFTLoaNFT contract address.
limits_LoanConfigLimitsPlatform 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

NameTypeDescription
loanIduint256loan id to get loan data from

Returns

NameTypeDescription
<none>ILoanConfigManager.LoanInfoLoan info

getLoanAssets

Get loan asset data.

function getLoanAssets(uint256 loanId) external view returns (CollateralAssets memory);

Parameters

NameTypeDescription
loanIduint256loan 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

NameTypeDescription
configIduint256configuration id of loan config to get data from. Request ID 1 .. getLoanConfigCounter()

Returns

NameTypeDescription
lenderaddresslender owning loan config
enabledbooltrue when loan config is enabled, false when disabled
totaluint256sum of all currently open loans using this loan config
loanConfigLoanConfigUserloan config
assetUsageLoanConfigAssetUsageasset configuration for loan config

getLoanConfigCounter

Get loan configuration counter.

function getLoanConfigCounter() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256amount of loan configurations

getLoanCounter

Get loan counter.

function getLoanCounter() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256amount 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

NameTypeDescription
lenderaddressuser address to get configuration id for
assetIduint256asset ID to get configuration id for
indexuint256index of configuration (0 .. 9)

Returns

NameTypeDescription
configIduint256loan configuration id at index. 0 when no loan configuration is stored at the given index.