egateServiceFeeRate`
```solidity
function delegateServiceFeeRate()
view
returns (
uint64
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :------: | :-----------: | ----------- |
| 0 | | `uint64` | `uint64` | |
### `encodeArguments`
Encodes the initialization arguments for a MapleLoan.
```solidity
function encodeArguments(
address borrower_,
address lender_,
address fundsAsset_,
uint256 principalRequested_,
uint32[3] termDetails_,
uint64[4] rates_
)
pure
returns (
bytes encodedArguments_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :---------: | :-----------: | ---------------------------------------------------------------------------------------------------------------------------- |
| 0 | `borrower_` | `address` | `address` | The address of the borrower. |
| 1 | `lender_` | `address` | `address` | The address of the lender. |
| 2 | `fundsAsset_` | `address` | `address` | The address of the lent asset. |
| 3 | `principalRequested_` | `uint256` | `uint256` | The amount of principal requested. |
| 4 | `termDetails_` | `uint32[3]` | `uint32[3]` | Array of loan parameters: \[0]: gracePeriod, \[1]: noticePeriod, \[2]: paymentInterval |
| 5 | `rates_` | `uint64[4]` | `uint64[4]` | Array of rate parameters: \[0]: delegateServiceFeeRate, \[1]: interestRate, \[2]: lateFeeRate, \[3]: lateInterestPremiumRate |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------: | :-----: | :-----------: | ---------------------------------------------- |
| 0 | `encodedArguments_` | `bytes` | `bytes` | The encoded arguments for initializing a loan. |
### `fundsAsset`
```solidity
function fundsAsset()
view
returns (
address
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `address` | `address` | |
### `gracePeriod`
```solidity
function gracePeriod()
view
returns (
uint32
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :------: | :-----------: | ----------- |
| 0 | | `uint32` | `uint32` | |
### `interestRate`
```solidity
function interestRate()
view
returns (
uint64
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :------: | :-----------: | ----------- |
| 0 | | `uint64` | `uint64` | |
### `lateFeeRate`
```solidity
function lateFeeRate()
view
returns (
uint64
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :------: | :-----------: | ----------- |
| 0 | | `uint64` | `uint64` | |
### `lateInterestPremiumRate`
```solidity
function lateInterestPremiumRate()
view
returns (
uint64
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :------: | :-----------: | ----------- |
| 0 | | `uint64` | `uint64` | |
### `lender`
```solidity
function lender()
view
returns (
address
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `address` | `address` | |
### `noticePeriod`
```solidity
function noticePeriod()
view
returns (
uint32
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :------: | :-----------: | ----------- |
| 0 | | `uint32` | `uint32` | |
### `paymentInterval`
```solidity
function paymentInterval()
view
returns (
uint32
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :------: | :-----------: | ----------- |
| 0 | | `uint32` | `uint32` | |
### `pendingBorrower`
```solidity
function pendingBorrower()
view
returns (
address
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `address` | `address` | |
### `pendingLender`
```solidity
function pendingLender()
view
returns (
address
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `address` | `address` | |
### `platformServiceFeeRate`
```solidity
function platformServiceFeeRate()
view
returns (
uint64
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :------: | :-----------: | ----------- |
| 0 | | `uint64` | `uint64` | |
### `principal`
```solidity
function principal()
view
returns (
uint256
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `uint256` | `uint256` | |
### `refinanceCommitment`
```solidity
function refinanceCommitment()
view
returns (
bytes32
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `bytes32` | `bytes32` | |
## Events
### `BorrowerAccepted`
```solidity
event BorrowerAccepted(
address borrower_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------: | :-------: | :-----------: | ----------- |
| 0 | `borrower_` | `address` | `address` | |
### `CallRemoved`
```solidity
event CallRemoved(
uint40 paymentDueDate_,
uint40 defaultDate_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------------: | :------: | :-----------: | ----------- |
| 0 | `paymentDueDate_` | `uint40` | `uint40` | |
| 1 | `defaultDate_` | `uint40` | `uint40` | |
### `Funded`
```solidity
event Funded(
uint256 amount_,
uint40 paymentDueDate_,
uint40 defaultDate_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------------: | :-------: | :-----------: | ----------- |
| 0 | `amount_` | `uint256` | `uint256` | |
| 1 | `paymentDueDate_` | `uint40` | `uint40` | |
| 2 | `defaultDate_` | `uint40` | `uint40` | |
### `Impaired`
```solidity
event Impaired(
uint40 paymentDueDate_,
uint40 defaultDate_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------------: | :------: | :-----------: | ----------- |
| 0 | `paymentDueDate_` | `uint40` | `uint40` | |
| 1 | `defaultDate_` | `uint40` | `uint40` | |
### `ImpairmentRemoved`
```solidity
event ImpairmentRemoved(
uint40 paymentDueDate_,
uint40 defaultDate_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------------: | :------: | :-----------: | ----------- |
| 0 | `paymentDueDate_` | `uint40` | `uint40` | |
| 1 | `defaultDate_` | `uint40` | `uint40` | |
### `Initialized`
```solidity
event Initialized(
address borrower_,
address lender_,
address fundsAsset_,
uint256 principalRequested_,
uint32[3] termDetails_,
uint64[4] rates_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :---------: | :-----------: | ----------- |
| 0 | `borrower_` | `address` | `address` | |
| 1 | `lender_` | `address` | `address` | |
| 2 | `fundsAsset_` | `address` | `address` | |
| 3 | `principalRequested_` | `uint256` | `uint256` | |
| 4 | `termDetails_` | `uint32[3]` | `uint32[3]` | |
| 5 | `rates_` | `uint64[4]` | `uint64[4]` | |
### `LenderAccepted`
```solidity
event LenderAccepted(
address lender_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------: | :-------: | :-----------: | ----------- |
| 0 | `lender_` | `address` | `address` | |
### `NewTermsAccepted`
```solidity
event NewTermsAccepted(
bytes32 refinanceCommitment_,
address refinancer_,
uint256 deadline_,
bytes[] calls_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------------: | :-------: | :-----------: | ----------- |
| 0 | `refinanceCommitment_` | `bytes32` | `bytes32` | |
| 1 | `refinancer_` | `address` | `address` | |
| 2 | `deadline_` | `uint256` | `uint256` | |
| 3 | `calls_` | `bytes[]` | `bytes[]` | |
### `NewTermsProposed`
```solidity
event NewTermsProposed(
bytes32 refinanceCommitment_,
address refinancer_,
uint256 deadline_,
bytes[] calls_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------------: | :-------: | :-----------: | ----------- |
| 0 | `refinanceCommitment_` | `bytes32` | `bytes32` | |
| 1 | `refinancer_` | `address` | `address` | |
| 2 | `deadline_` | `uint256` | `uint256` | |
| 3 | `calls_` | `bytes[]` | `bytes[]` | |
### `NewTermsRejected`
```solidity
event NewTermsRejected(
bytes32 refinanceCommitment_,
address refinancer_,
uint256 deadline_,
bytes[] calls_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------------: | :-------: | :-----------: | ----------- |
| 0 | `refinanceCommitment_` | `bytes32` | `bytes32` | |
| 1 | `refinancer_` | `address` | `address` | |
| 2 | `deadline_` | `uint256` | `uint256` | |
| 3 | `calls_` | `bytes[]` | `bytes[]` | |
### `PaymentMade`
```solidity
event PaymentMade(
address lender_,
uint256 principalPaid_,
uint256 interestPaid_,
uint256 lateInterestPaid_,
uint256 delegateServiceFee_,
uint256 platformServiceFee_,
uint40 paymentDueDate_,
uint40 defaultDate_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :-------: | :-----------: | ----------- |
| 0 | `lender_` | `address` | `address` | |
| 1 | `principalPaid_` | `uint256` | `uint256` | |
| 2 | `interestPaid_` | `uint256` | `uint256` | |
| 3 | `lateInterestPaid_` | `uint256` | `uint256` | |
| 4 | `delegateServiceFee_` | `uint256` | `uint256` | |
| 5 | `platformServiceFee_` | `uint256` | `uint256` | |
| 6 | `paymentDueDate_` | `uint40` | `uint40` | |
| 7 | `defaultDate_` | `uint40` | `uint40` | |
### `PendingBorrowerSet`
```solidity
event PendingBorrowerSet(
address pendingBorrower_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------: | :-------: | :-----------: | ----------- |
| 0 | `pendingBorrower_` | `address` | `address` | |
### `PendingLenderSet`
```solidity
event PendingLenderSet(
address pendingLender_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------: | :-------: | :-----------: | ----------- |
| 0 | `pendingLender_` | `address` | `address` | |
### `PrincipalCalled`
```solidity
event PrincipalCalled(
uint256 principalToReturn_,
uint40 paymentDueDate_,
uint40 defaultDate_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------------: | :-------: | :-----------: | ----------- |
| 0 | `principalToReturn_` | `uint256` | `uint256` | |
| 1 | `paymentDueDate_` | `uint40` | `uint40` | |
| 2 | `defaultDate_` | `uint40` | `uint40` | |
### `PrincipalReturned`
```solidity
event PrincipalReturned(
uint256 principalReturned_,
uint256 principalRemaining_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :-------: | :-----------: | ----------- |
| 0 | `principalReturned_` | `uint256` | `uint256` | |
| 1 | `principalRemaining_` | `uint256` | `uint256` | |
### `Repossessed`
```solidity
event Repossessed(
uint256 fundsRepossessed_,
address destination_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------: | :-------: | :-----------: | ----------- |
| 0 | `fundsRepossessed_` | `uint256` | `uint256` | |
| 1 | `destination_` | `address` | `address` | |
### `Skimmed`
```solidity
event Skimmed(
address token_,
uint256 amount_,
address destination_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------: | :-------: | :-----------: | ----------- |
| 0 | `token_` | `address` | `address` | |
| 1 | `amount_` | `uint256` | `uint256` | |
| 2 | `destination_` | `address` | `address` | |
# OpenTermLoanManager
## Functions
### `HUNDRED_PERCENT`
Returns the value considered as the hundred percent.
```solidity
function HUNDRED_PERCENT()
view
returns (
uint256
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `uint256` | `uint256` | |
### `PRECISION`
Returns the precision used for the contract.
```solidity
function PRECISION()
view
returns (
uint256
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `uint256` | `uint256` | |
### `accountedInterest`
Gets the amount of accounted interest.
```solidity
function accountedInterest()
view
returns (
uint112
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `uint112` | `uint112` | |
### `accruedInterest`
Gets the amount of accrued interest up until this point in time.
```solidity
function accruedInterest()
view
returns (
uint256 accruedInterest_
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------: | :-------: | :-----------: | ----------------------------------------------------------- |
| 0 | `accruedInterest_` | `uint256` | `uint256` | The amount of accrued interest up until this point in time. |
### `assetsUnderManagement`
Gets the amount of assets under the management of the contract.
```solidity
function assetsUnderManagement()
view
returns (
uint256 assetsUnderManagement_
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------------: | :-------: | :-----------: | ---------------------------------------------------------- |
| 0 | `assetsUnderManagement_` | `uint256` | `uint256` | The amount of assets under the management of the contract. |
### `callPrincipal`
Calls a loan.
```solidity
function callPrincipal(
address loan_,
uint256 principal_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------: | :-------: | :-----------: | ------------------------------------------ |
| 0 | `loan_` | `address` | `address` | Loan to be called. |
| 1 | `principal_` | `uint256` | `uint256` | Amount of principal to call the Loan with. |
### `claim`
Called by loans when payments are made, updating the accounting.
```solidity
function claim(
int256 principal_,
uint256 interest_,
uint256 delegateServiceFee_,
uint256 platformServiceFee_,
uint40 nextPaymentDueDate_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :-------: | :-----------: | ---------------------------------------------------------------------------------------------------------------------------- |
| 0 | `principal_` | `int256` | `int256` | The difference in principal. Positive if net principal change moves funds into pool, negative if it moves funds out of pool. |
| 1 | `interest_` | `uint256` | `uint256` | The amount of interest paid. |
| 2 | `delegateServiceFee_` | `uint256` | `uint256` | The amount of delegate service fee paid. |
| 3 | `platformServiceFee_` | `uint256` | `uint256` | The amount of platform service fee paid. |
| 4 | `nextPaymentDueDate_` | `uint40` | `uint40` | |
### `domainStart`
Gets the timestamp of the domain start.
```solidity
function domainStart()
view
returns (
uint40
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :------: | :-----------: | ----------- |
| 0 | | `uint40` | `uint40` | |
### `factory`
The address of the proxy factory.
```solidity
function factory()
view
returns (
address factory_
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------: | :-------: | :-----------: | ----------- |
| 0 | `factory_` | `address` | `address` | |
### `fund`
Funds a new loan.
```solidity
function fund(
address loan_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----: | :-------: | :-----------: | ------------------ |
| 0 | `loan_` | `address` | `address` | Loan to be funded. |
### `fundsAsset`
Gets the address of the funds asset.
```solidity
function fundsAsset()
view
returns (
address
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `address` | `address` | |
### `impairLoan`
Triggers the impairment of a loan.
```solidity
function impairLoan(
address loan_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----: | :-------: | :-----------: | ------------------------------------ |
| 0 | `loan_` | `address` | `address` | Loan to trigger the loan impairment. |
### `impairmentFor`
Gets the information for an impairment.
```solidity
function impairmentFor(
address
)
view
returns (
uint40 impairedDate,
bool impairedByGovernor
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | \`\` | `address` | `address` | |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------------: | :------: | :-----------: | ----------------------------------------------------- |
| 0 | `impairedDate` | `uint40` | `uint40` | The date the impairment was triggered. |
| 1 | `impairedByGovernor` | `bool` | `bool` | True if the impairment was triggered by the governor. |
### `implementation`
The address of the implementation contract being proxied.
```solidity
function implementation()
view
returns (
address implementation_
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------------: | :-------: | :-----------: | ----------- |
| 0 | `implementation_` | `address` | `address` | |
### `issuanceRate`
Gets the current issuance rate.
```solidity
function issuanceRate()
view
returns (
uint256
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `uint256` | `uint256` | |
### `migrate`
Modifies the proxy's storage by delegate-calling a migrator contract with some arguments. Access control logic critical since caller can force a selfdestruct via a malicious \`migrator\_\` which is delegatecalled.
```solidity
function migrate(
address migrator_,
bytes arguments_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------: | :-------: | :-----------: | ------------------------------------------------ |
| 0 | `migrator_` | `address` | `address` | The address of a migrator contract. |
| 1 | `arguments_` | `bytes` | `bytes` | Some encoded arguments to use for the migration. |
### `paymentFor`
Gets the information for a payment.
```solidity
function paymentFor(
address
)
view
returns (
uint24 platformManagementFeeRate,
uint24 delegateManagementFeeRate,
uint40 startDate,
uint168 issuanceRate
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | \`\` | `address` | `address` | |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------------: | :-------: | :-----------: | ----------------------------------------------- |
| 0 | `platformManagementFeeRate` | 프로젝트로 돌아가기