tional fee for |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :-------: | :-----------: | ---------------------------------------------- |
| 0 | `delegateServiceFee_` | `uint256` | `uint256` | The amount of delegate service fee to be paid. |
### `getOriginationFees`
Gets the sum of all origination fees for the given loan.
```solidity
function getOriginationFees(
address loan_,
uint256 principalRequested_
)
view
returns (
uint256 originationFees_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :-------: | :-----------: | ---------------------------------------------- |
| 0 | `loan_` | `address` | `address` | The address of the loan contract. |
| 1 | `principalRequested_` | `uint256` | `uint256` | The amount of principal requested in the loan. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------: | :-------: | :-----------: | ------------------------------------------ |
| 0 | `originationFees_` | `uint256` | `uint256` | The amount of origination fees to be paid. |
### `getPlatformOriginationFee`
Gets the platform origination fee value for the given loan.
```solidity
function getPlatformOriginationFee(
address loan_,
uint256 principalRequested_
)
view
returns (
uint256 platformOriginationFee_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :-------: | :-----------: | ---------------------------------------------- |
| 0 | `loan_` | `address` | `address` | The address of the loan contract. |
| 1 | `principalRequested_` | `uint256` | `uint256` | The amount of principal requested in the loan. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------------: | :-------: | :-----------: | -------------------------------------------------- |
| 0 | `platformOriginationFee_` | `uint256` | `uint256` | The amount of platform origination fee to be paid. |
### `getPlatformServiceFeeForPeriod`
Gets the delegate service fee for the given loan.
```solidity
function getPlatformServiceFeeForPeriod(
address loan_,
uint256 principalRequested_,
uint256 interval_
)
view
returns (
uint256 platformServiceFee_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :-------: | :-----------: | ----------------------------------------------------- |
| 0 | `loan_` | `address` | `address` | The address of the loan contract. |
| 1 | `principalRequested_` | `uint256` | `uint256` | The amount of principal requested in the loan. |
| 2 | `interval_` | `uint256` | `uint256` | The time, in seconds, to get the proportional fee for |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :-------: | :-----------: | ---------------------------------------------- |
| 0 | `platformServiceFee_` | `uint256` | `uint256` | The amount of platform service fee to be paid. |
### `getServiceFeeBreakdown`
Gets the service fees for the given interval.
```solidity
function getServiceFeeBreakdown(
address loan_,
uint256 numberOfPayments_
)
view
returns (
uint256 delegateServiceFee_,
uint256 delegateRefinanceFee_,
uint256 platformServiceFee_,
uint256 platformRefinanceFee_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------: | :-------: | :-----------: | ---------------------------------- |
| 0 | `loan_` | `address` | `address` | The address of the loan contract. |
| 1 | `numberOfPayments_` | `uint256` | `uint256` | The number of payments being paid. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------------------: | :-------: | :-----------: | ------------------------------------------------ |
| 0 | `delegateServiceFee_` | `uint256` | `uint256` | The amount of delegate service fee to be paid. |
| 1 | `delegateRefinanceFee_` | `uint256` | `uint256` | The amount of delegate refinance fee to be paid. |
| 2 | `platformServiceFee_` | `uint256` | `uint256` | The amount of platform service fee to be paid. |
| 3 | `platformRefinanceFee_` | `uint256` | `uint256` | The amount of platform refinance fee to be paid. |
### `getServiceFees`
Gets the service fees for the given interval.
```solidity
function getServiceFees(
address loan_,
uint256 numberOfPayments_
)
view
returns (
uint256 serviceFees_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------: | :-------: | :-----------: | ---------------------------------- |
| 0 | `loan_` | `address` | `address` | The address of the loan contract. |
| 1 | `numberOfPayments_` | `uint256` | `uint256` | The number of payments being paid. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------: | :-------: | :-----------: | ---------------------------------------------- |
| 0 | `serviceFees_` | `uint256` | `uint256` | The amount of platform service fee to be paid. |
### `getServiceFeesForPeriod`
Gets the service fees for the given interval.
```solidity
function getServiceFeesForPeriod(
address loan_,
uint256 interval_
)
view
returns (
uint256 serviceFee_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------: | :-------: | :-----------: | ----------------------------------------------------- |
| 0 | `loan_` | `address` | `address` | The address of the loan contract. |
| 1 | `interval_` | `uint256` | `uint256` | The time, in seconds, to get the proportional fee for |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------: | :-------: | :-----------: | ---------------------------------------------- |
| 0 | `serviceFee_` | `uint256` | `uint256` | The amount of platform service fee to be paid. |
### `globals`
Gets the global contract address.
```solidity
function globals()
view
returns (
address
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `address` | `address` | |
### `payOriginationFees`
Called during \`fundLoan\`, performs fee payments to poolDelegate and treasury.
```solidity
function payOriginationFees(
address asset_,
uint256 principalRequested_
)
nonpayable
returns (
uint256 feePaid_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :-------: | :-----------: | ------------------------------------------------------------------------------ |
| 0 | `asset_` | `address` | `address` | The address asset in which fees were paid. |
| 1 | `principalRequested_` | `uint256` | `uint256` | The total amount of principal requested, which will be used to calculate fees. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------: | :-------: | :-----------: | ------------------------------ |
| 0 | `feePaid_` | `uint256` | `uint256` | The total amount of fees paid. |
### `payServiceFees`
Called during \`makePayment\`, performs fee payments to the pool delegate and treasury.
```solidity
function payServiceFees(
address asset_,
uint256 numberOfPayments_
)
nonpayable
returns (
uint256 feePaid_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------: | :-------: | :-----------: | ----------------------------------------------------------- |
| 0 | `asset_` | `address` | `address` | The address asset in which fees were paid. |
| 1 | `numberOfPayments_` | `uint256` | `uint256` | The number of payments for which service fees will be paid. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------: | :-------: | :-----------: | ----------- |
| 0 | `feePaid_` | `uint256` | `uint256` | |
### `platformRefinanceServiceFee`
Gets the platform fee rate for the given loan.
```solidity
function platformRefinanceServiceFee(
address
)
view
returns (
uint256
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | \`\` | `address` | `address` | |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `uint256` | `uint256` | |
### `platformServiceFee`
Gets the platform fee rate for the given loan.
```solidity
function platformServiceFee(
address
)
view
returns (
uint256
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | \`\` | `address` | `address` | |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `uint256` | `uint256` | |
### `updateDelegateFeeTerms`
Called during loan creation or refinance, sets the fee terms.
```solidity
function updateDelegateFeeTerms(
uint256 delegateOriginationFee_,
uint256 delegateServiceFee_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------------: | :-------: | :-----------: | -------------------------------------------------- |
| 0 | `delegateOriginationFee_` | `uint256` | `uint256` | The amount of delegate origination fee to be paid. |
| 1 | `delegateServiceFee_` | `uint256` | `uint256` | The amount of delegate service fee to be paid. |
### `updatePlatformServiceFee`
Function called by loans to update the saved platform service fee rate.
```solidity
function updatePlatformServiceFee(
uint256 principalRequested_,
uint256 paymentInterval_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :-------: | :-----------: | ----------- |
| 0 | `principalRequested_` | `uint256` | `uint256` | |
| 1 | `paymentInterval_` | `uint256` | `uint256` | |
### `updateRefinanceServiceFees`
Called during loan refinance to save the partial service fees accrued.
```solidity
function updateRefinanceServiceFees(
uint256 principalRequested_,
uint256 timeSinceLastDueDate_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------------------: | :-------: | :-----------: | ------------------------------------------------ |
| 0 | `principalRequested_` | `uint256` | `uint256` | The amount of principal pre-refinance requested. |
| 1 | `timeSinceLastDueDate_` | `uint256` | `uint256` | The amount of time since last payment due date. |
## Events
### `FeeTermsUpdated`
New fee terms have been set.
```solidity
event FeeTermsUpdated(
address loan_,
uint256 delegateOriginationFee_,
uint256 delegateServiceFee_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------------: | :-------: | :-----------: | ------------------------------------------- |
| 0 | `loan_` | `address` | `address` | The address of the loan contract. |
| 1 | `delegateOriginationFee_` | `uint256` | `uint256` | The new value for delegate origination fee. |
| 2 | `delegateServiceFee_` | `uint256` | `uint256` | The new value for delegate service fee. |
### `OriginationFeesPaid`
A fee payment was made.
```solidity
event OriginationFeesPaid(
address loan_,
uint256 delegateOriginationFee_,
uint256 platformOriginationFee_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------------: | :-------: | :-----------: | -------------------------------------------- |
| 0 | `loan_` | `address` | `address` | The address of the loan contract. |
| 1 | `delegateOriginationFee_` | `uint256` | `uint256` | The amount of delegate origination fee paid. |
| 2 | `platformOriginationFee_` | `uint256` | `uint256` | The amount of platform origination fee paid. |
### `PartialRefinanceServiceFeesUpdated`
New fee terms have been set.
```solidity
event PartialRefinanceServiceFeesUpdated(
address loan_,
uint256 partialPlatformServiceFee_,
uint256 partialDelegateServiceFee_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------------------: | :-------: | :-----------: | --------------------------------------- |
| 0 | `loan_` | `address` | `address` | The address of the loan contract. |
| 1 | `partialPlatformServiceFee_` | `uint256` | `uint256` | The value for the platform service fee. |
| 2 | `partialDelegateServiceFee_` | `uint256` | `uint256` | The value for the delegate service fee. |
### `PlatformServiceFeeUpdated`
New fee terms have been set.
```solidity
event PlatformServiceFeeUpdated(
address loan_,
uint256 platformServiceFee_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :-------: | :-----------: | ------------------------------------------- |
| 0 | `loan_` | `address` | `address` | The address of the loan contract. |
| 1 | `platformServiceFee_` | `uint256` | `uint256` | The new value for the platform service fee. |
### `ServiceFeesPaid`
A fee payment was made.
```solidity
event ServiceFeesPaid(
address loan_,
uint256 delegateServiceFee_,
uint256 partialRefinanceDelegateServiceFee_,
uint256 platformServiceFee_,
uint256 partialRefinancePlatformServiceFee_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------------------------: | :-------: | :-----------: | --------------------------------------------------------------- |
| 0 | `loan_` | `address` | `address` | The address of the loan contract. |
| 1 | `delegateServiceFee_` | `uint256` | `uint256` | The amount of delegate service fee paid. |
| 2 | `partialRefinanceDelegateServiceFee_` | `uint256` | `uint256` | The amount of partial delegate service fee from refinance paid. |
| 3 | `platformServiceFee_` | `uint256` | `uint256` | The amount of platform service fee paid. |
| 4 | `partialRefinancePlatformServiceFee_` | `uint256` | `uint256` | The amount of partial platform service fee from refinance paid. |
# FixedTermLoanInitializer
## Functions
### `decodeArguments`
Decodes the initialization arguments for a MapleLoan.
```solidity
function decodeArguments(
bytes encodedArguments_
)
pure
returns (
address borrower_,
address lender_,
address feeManager_,
address[2] assets_,
uint256[3] termDetails_,
uint256[3] amounts_,
uint256[4] rates_,
uint256[2] fees_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------: | :-----: | :-----------: | ----------- |
| 0 | `encodedArguments_` | `bytes` | `bytes` | |
#### Return Values:
| 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 | `feeManager_` | `address` | `address` | The address of the entity responsible for calculating fees. |
| 3 | `assets_` | `address[2]` | `address[2]` | Array of asset addresses. \[0]: collateralAsset, \[1]: fundsAsset |
| 4 | `termDetails_` | `uint256[3]` | `uint256[3]` | Array of loan parameters: \[0]: gracePeriod, \[1]: paymentInterval, \[2]: payments |
| 5 | `amounts_` | `uint256[3]` | `uint256[3]` | Requested amounts: \[0]: collateralRequired, \[1]: principalRequested, \[2]: endingPrincipal |
| 6 | `rates_` | `uint256[4]` | `uint256[4]` | Rates parameters: \[0]: interestRate, \[1]: closingFeeRate, \[2]: lateFeeRate, \[3]: lateInterestPremiumRate, |
| 7 | `fees_` | `uint256[2]` | `uint256[2]` | Array of fees: \[0]: delegateOriginationFee, \[1]: delegateServiceFee |
### `encodeArguments`
Encodes the initialization arguments for a MapleLoan.
```solidity
function encodeArguments(
address borrower_,
address lender_,
address feeManager_,
address[2] assets_,
uint256[3] termDetails_,
uint256[3] amounts_,
uint256[4] rates_,
uint256[2] fees_
)
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 | `feeManager_` | `address` | `address` | The address of the entity responsible for calculating fees. |
| 3 | `assets_` | `address[2]` | `address[2]` | Array of asset addresses. \[0]: collateralAsset, \[1]: fundsAsset |
| 4 | `termDetails_` | `uint256[3]` | `uint256[3]` | Array of loan parameters: \[0]: gracePeriod, \[1]: paymentInterval, \[2]: payments |
| 5 | `amounts_` | `uint256[3]` | `uint256[3]` | Requested amounts: \[0]: collateralRequired, \[1]: principalRequested, \[2]: endingPrincipal |
| 6 | `rates_` | `uint256[4]` | `uint256[4]` | Rates parameters: \[0]: interestRate, \[1]: closingFeeRate, \[2]: lateFeeRate, \[3]: lateInterestPremiumRate, |
| 7 | `fees_` | `uint256[2]` | `uint256[2]` | Array of fees: \[0]: delegateOriginationFee, \[1]: delegateServiceFee |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------: | :-----: | :-----------: | ----------- |
| 0 | `encodedArguments_` | `bytes` | `bytes` | |
## Events
### `BorrowerAccepted`
```solidity
event BorrowerAccepted(
address borrower_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------: | :-------: | :-----------: | ----------- |
| 0 | `borrower_` | `address` | `address` | |
### `CollateralPosted`
```solidity
event CollateralPosted(
uint256 amount_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------: | :-------: | :-----------: | ----------- |
| 0 | `amount_` | `uint256` | `uint256` | |
### `CollateralRemoved`
```solidity
event CollateralRemoved(
uint256 amount_,
address destination_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------: | :-------: | :-----------: | ----------- |
| 0 | `amount_` | `uint256` | `uint256` | |
| 1 | `destination_` | `address` | `address` | |
### `Funded`
```solidity
event Funded(
address lender_,
uint256 amount_,
uint256 nextPaymentDueDate_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :-------: | :-----------: | ----------- |
| 0 | `lender_` | `address` | `address` | |
| 1 | `amount_` | `uint256` | `uint256` | |
| 2 | `nextPaymentDueDate_` | `uint256` | `uint256` | |
### `FundsClaimed`
```solidity
event FundsClaimed(
uint256 amount_,
address destination_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------: | :-------: | :-----------: | ----------- |
| 0 | `amount_` | `uint256` | `uint256` | |
| 1 | `destination_` | `address` | `address` | |
### `FundsDrawnDown`
```solidity
event FundsDrawnDown(
uint256 amount_,
address destination_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------: | :-------: | :-----------: | ----------- |
| 0 | `amount_` | `uint256` | `uint256` | |
| 1 | `destination_` | `address` | `address` | |
### `FundsReturned`
```solidity
event FundsReturned(
uint256 amount_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------: |프로젝트로 돌아가기