uint256 public constant LOAN_MANAGER_REVISION = 0x1;
HUNDRED_PERCENT
uint256 public constant HUNDRED_PERCENT = 1e6;
SCALED_ONE
uint256 private constant SCALED_ONE = 1e18;
PRECISION
uint256 public constant PRECISION = 1e27;
ADDRESSES_PROVIDER
IPoolAddressesProvider public immutable ADDRESSES_PROVIDER;
Functions
constructor
constructor(IPoolAddressesProvider provider_);
initialize
function initialize(address asset_) external override initializer;
whenNotPaused
Can only be called when the function is not paused
modifier whenNotPaused();
onlyPoolAdminOrGovernor
Can only be called by the Pool Admin or the Governor
modifier onlyPoolAdminOrGovernor();
onlyPoolAdmin
Can only be called by the Pool Admin
modifier onlyPoolAdmin();
onlyPoolConfigurator
Can only be called by the PoolConfigurator
modifier onlyPoolConfigurator();
getRevision
Returns the revision number of the contract
Needs to be defined in the inherited class as a constant.
function getRevision() public pure virtual override returns (uint256 revision_);
Returns
Name
Type
Description
revision_
uint256
The revision number
onERC721Received
Whenever an {IERC721} tokenId token is transferred to this contract via {IERC721-safeTransferFrom} by operator from from, this function is called. It must return its Solidity selector to confirm the token transfer. If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. The selector can be obtained in Solidity with IERC721Receiver.onERC721Received.selector.
function onERC721Received(address, address, uint256, bytes calldata) external pure override returns (bytes4);
getLoanInfo
Gets the loan info.
function getLoanInfo(uint16 loanId_) external view returns (Loan.Info memory loan_);
Parameters
Name
Type
Description
loanId_
uint16
The id of the loan.
Returns
Name
Type
Description
loan_
Loan.Info
Struct that contains the info of the loan.
accruedInterest
Gets the amount of interest up until this point in time.
function accruedInterest() public view override returns (uint256 accruedInterest_);
Returns
Name
Type
Description
accruedInterest_
uint256
The amount of accrued interest up until this point in time.
assetsUnderManagement
Gets the total assets under management.
function assetsUnderManagement() public view override returns (uint256 assetsUnderManagement_);
Returns
Name
Type
Description
assetsUnderManagement_
uint256
The total value of assets under management.
getLoanPaymentDetailedBreakdown
Gets the detailed payment breakdown of a loan up until this point in time.
function getLoanPaymentDetailedBreakdown(
uint16 loanId_
)
public
view
override
returns (uint256 principal_, uint256[2] memory interest_);
Parameters
Name
Type
Description
loanId_
uint16
The id of the loan.
Returns
Name
Type
Description
principal_
uint256
The principal due for the loan.
interest_
uint256[2]
Interest Parameter:
[0]: The interest due for the loan.
[1]: The late interest due for the loan.
getLoanPaymentBreakdown
Gets the payment breakdown of a loan up until this point in time.
function getLoanPaymentBreakdown(uint16 loanId_) public view override returns (uint256 principal_, uint256 interest_);
Parameters
Name
Type
Description
loanId_
uint16
The id of the loan.
Returns
Name
Type
Description
principal_
uint256
The principal due for the loan.
interest_
uint256
The total interest due for the loan.
updateAccounting
Manually updates the accounting state of the pool.
function updateAccounting() external whenNotPaused onlyPoolAdminOrGovernor;
requestLoan
Used by buyer to request a loan from the pool with the following terms.