| :-----------: | ----------- |
| 0 | `paymentsRemaining_` | `uint256` | `uint256` | |
### `pendingBorrower`
The address of the pending borrower.
```solidity
function pendingBorrower()
view
returns (
address pendingBorrower_
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------: | :-------: | :-----------: | ----------- |
| 0 | `pendingBorrower_` | `address` | `address` | |
### `pendingLender`
The address of the pending lender.
```solidity
function pendingLender()
view
returns (
address pendingLender_
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------: | :-------: | :-----------: | ----------- |
| 0 | `pendingLender_` | `address` | `address` | |
### `postCollateral`
Post collateral to the loan. FUNDS SHOULD NOT BE TRANSFERRED TO THIS CONTRACT NON-ATOMICALLY. IF THEY ARE, THE BALANCE MAY BE STOLEN USING \`skim\`.
```solidity
function postCollateral(
uint256 amount_
)
nonpayable
returns (
uint256 collateralPosted_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------: | :-------: | :-----------: | ------------------------------------------ |
| 0 | `amount_` | `uint256` | `uint256` | An amount to pull from the caller, if any. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------: | :-------: | :-----------: | ------------------ |
| 0 | `collateralPosted_` | `uint256` | `uint256` | The amount posted. |
### `principal`
The amount of principal owed (initially, the requested amount), which needs to be paid back.
```solidity
function principal()
view
returns (
uint256 principal_
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------: | :-------: | :-----------: | ----------- |
| 0 | `principal_` | `uint256` | `uint256` | |
### `principalRequested`
The initial principal amount requested by the borrower.
```solidity
function principalRequested()
view
returns (
uint256 principalRequested_
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :-------: | :-----------: | ----------- |
| 0 | `principalRequested_` | `uint256` | `uint256` | |
### `proposeNewTerms`
Propose new terms for refinance.
```solidity
function proposeNewTerms(
address refinancer_,
uint256 deadline_,
bytes[] calls_
)
nonpayable
returns (
bytes32 refinanceCommitment_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------: | :-------: | :-----------: | ------------------------------------------------- |
| 0 | `refinancer_` | `address` | `address` | The address of the refinancer contract. |
| 1 | `deadline_` | `uint256` | `uint256` | The deadline for accepting the new terms. |
| 2 | `calls_` | `bytes[]` | `bytes[]` | The encoded arguments to be passed to refinancer. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------------: | :-------: | :-----------: | --------------------------------------------- |
| 0 | `refinanceCommitment_` | `bytes32` | `bytes32` | The hash of the proposed refinance agreement. |
### `refinanceCommitment`
The hash of the proposed refinance agreement.
```solidity
function refinanceCommitment()
view
returns (
bytes32 refinanceCommitment_
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------------: | :-------: | :-----------: | ----------- |
| 0 | `refinanceCommitment_` | `bytes32` | `bytes32` | |
### `refinanceInterest`
Amount of unpaid interest that has accrued before a refinance was accepted.
```solidity
function refinanceInterest()
view
returns (
uint256 refinanceInterest_
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------------: | :-------: | :-----------: | ----------- |
| 0 | `refinanceInterest_` | `uint256` | `uint256` | |
### `rejectNewTerms`
Nullify the current proposed terms.
```solidity
function rejectNewTerms(
address refinancer_,
uint256 deadline_,
bytes[] calls_
)
nonpayable
returns (
bytes32 refinanceCommitment_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------: | :-------: | :-----------: | ------------------------------------------------- |
| 0 | `refinancer_` | `address` | `address` | The address of the refinancer contract. |
| 1 | `deadline_` | `uint256` | `uint256` | The deadline for accepting the new terms. |
| 2 | `calls_` | `bytes[]` | `bytes[]` | The encoded arguments to be passed to refinancer. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------------: | :-------: | :-----------: | --------------------------------------------- |
| 0 | `refinanceCommitment_` | `bytes32` | `bytes32` | The hash of the rejected refinance agreement. |
### `removeCollateral`
Remove collateral from the loan (opposite of posting collateral).
```solidity
function removeCollateral(
uint256 amount_,
address destination_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------: | :-------: | :-----------: | ----------------------------------------------- |
| 0 | `amount_` | `uint256` | `uint256` | The amount removed. |
| 1 | `destination_` | `address` | `address` | The destination to send the removed collateral. |
### `removeLoanImpairment`
Remove the loan impairment by restoring the original payment due date.
```solidity
function removeLoanImpairment()
nonpayable;
```
### `repossess`
Repossess collateral, and any funds, for a loan in default.
```solidity
function repossess(
address destination_
)
nonpayable
returns (
uint256 collateralRepossessed_,
uint256 fundsRepossessed_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------: | :-------: | :-----------: | ----------------------------------------------------------------------- |
| 0 | `destination_` | `address` | `address` | The address where the collateral and funds asset is to be sent, if any. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------------: | :-------: | :-----------: | ------------------------------------------- |
| 0 | `collateralRepossessed_` | `uint256` | `uint256` | The amount of collateral asset repossessed. |
| 1 | `fundsRepossessed_` | `uint256` | `uint256` | The amount of funds asset repossessed. |
### `returnFunds`
Return funds to the loan (opposite of drawing down). FUNDS SHOULD NOT BE TRANSFERRED TO THIS CONTRACT NON-ATOMICALLY. IF THEY ARE, THE BALANCE MAY BE STOLEN USING \`skim\`.
```solidity
function returnFunds(
uint256 amount_
)
nonpayable
returns (
uint256 fundsReturned_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------: | :-------: | :-----------: | ------------------------------------------ |
| 0 | `amount_` | `uint256` | `uint256` | An amount to pull from the caller, if any. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------: | :-------: | :-----------: | -------------------- |
| 0 | `fundsReturned_` | `uint256` | `uint256` | The amount returned. |
### `setImplementation`
Modifies the proxy's implementation address.
```solidity
function setImplementation(
address newImplementation_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------------: | :-------: | :-----------: | ------------------------------------------ |
| 0 | `newImplementation_` | `address` | `address` | The address of an implementation contract. |
### `setPendingBorrower`
Set the pendingBorrower to a new account.
```solidity
function setPendingBorrower(
address pendingBorrower_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------: | :-------: | :-----------: | --------------------------------------- |
| 0 | `pendingBorrower_` | `address` | `address` | The address of the new pendingBorrower. |
### `setPendingLender`
Set the pendingLender to a new account.
```solidity
function setPendingLender(
address pendingLender_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------: | :-------: | :-----------: | ------------------------------------- |
| 0 | `pendingLender_` | `address` | `address` | The address of the new pendingLender. |
### `skim`
Remove all token that is not accounted for by the loan (i.e. not \`collateral\` or \`drawableFunds\`).
```solidity
function skim(
address token_,
address destination_
)
nonpayable
returns (
uint256 skimmed_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------: | :-------: | :-----------: | ---------------------------------- |
| 0 | `token_` | `address` | `address` | The address of the token contract. |
| 1 | `destination_` | `address` | `address` | The recipient of the token. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------: | :-------: | :-----------: | ------------------------------------------ |
| 0 | `skimmed_` | `uint256` | `uint256` | The amount of token removed from the loan. |
### `upgrade`
Upgrades a contract implementation to a specific version. Access control logic critical since caller can force a selfdestruct via a malicious \`migrator\_\` which is delegatecalled.
```solidity
function upgrade(
uint256 toVersion_,
bytes arguments_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------: | :-------: | :-----------: | ---------------------------------------------- |
| 0 | `toVersion_` | `uint256` | `uint256` | The version to upgrade to. |
| 1 | `arguments_` | `bytes` | `bytes` | Some encoded arguments to use for the upgrade. |
## Events
### `BorrowerAccepted`
Borrower was accepted, and set to a new account.
```solidity
event BorrowerAccepted(
address borrower_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------: | :-------: | :-----------: | -------------------------------- |
| 0 | `borrower_` | `address` | `address` | The address of the new borrower. |
### `CollateralPosted`
Collateral was posted.
```solidity
event CollateralPosted(
uint256 amount_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------: | :-------: | :-----------: | -------------------------------- |
| 0 | `amount_` | `uint256` | `uint256` | The amount of collateral posted. |
### `CollateralRemoved`
Collateral was removed.
```solidity
event CollateralRemoved(
uint256 amount_,
address destination_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------: | :-------: | :-----------: | ---------------------------------------- |
| 0 | `amount_` | `uint256` | `uint256` | The amount of collateral removed. |
| 1 | `destination_` | `address` | `address` | The recipient of the collateral removed. |
### `Funded`
The loan was funded.
```solidity
event Funded(
address lender_,
uint256 amount_,
uint256 nextPaymentDueDate_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :-------: | :-----------: | --------------------------------- |
| 0 | `lender_` | `address` | `address` | The address of the lender. |
| 1 | `amount_` | `uint256` | `uint256` | The amount funded. |
| 2 | `nextPaymentDueDate_` | `uint256` | `uint256` | The due date of the next payment. |
### `FundsClaimed`
Funds were claimed.
```solidity
event FundsClaimed(
uint256 amount_,
address destination_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------: | :-------: | :-----------: | ----------------------------------- |
| 0 | `amount_` | `uint256` | `uint256` | The amount of funds claimed. |
| 1 | `destination_` | `address` | `address` | The recipient of the funds claimed. |
### `FundsDrawnDown`
Funds were drawn.
```solidity
event FundsDrawnDown(
uint256 amount_,
address destination_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------: | :-------: | :-----------: | -------------------------------------- |
| 0 | `amount_` | `uint256` | `uint256` | The amount of funds drawn. |
| 1 | `destination_` | `address` | `address` | The recipient of the funds drawn down. |
### `FundsReturned`
Funds were returned.
```solidity
event FundsReturned(
uint256 amount_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------: | :-------: | :-----------: | ----------------------------- |
| 0 | `amount_` | `uint256` | `uint256` | The amount of funds returned. |
### `ImpairmentRemoved`
The loan impairment was explicitly removed (i.e. not the result of a payment or new terms acceptance).
```solidity
event ImpairmentRemoved(
uint256 nextPaymentDueDate_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :-------: | :-----------: | ------------------------------ |
| 0 | `nextPaymentDueDate_` | `uint256` | `uint256` | The new next payment due date. |
### `Initialized`
Loan was initialized.
```solidity
event Initialized(
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 | `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]` | Fee parameters: \[0]: interestRate, \[1]: closingFeeRate, \[2]: lateFeeRate, \[3]: lateInterestPremiumRate |
| 7 | `fees_` | `uint256[2]` | `uint256[2]` | Array of fees: \[0]: delegateOriginationFee, \[1]: delegateServiceFee |
### `LenderAccepted`
Lender was accepted, and set to a new account.
```solidity
event LenderAccepted(
address lender_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------: | :-------: | :-----------: | ------------------------------ |
| 0 | `lender_` | `address` | `address` | The address of the new lender. |
### `LoanClosed`
Loan was repaid early and closed.
```solidity
event LoanClosed(
uint256 principalPaid_,
uint256 interestPaid_,
uint256 feesPaid_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------: | :-------: | :-----------: | ------------------------------------------------------------ |
| 0 | `principalPaid_` | `uint256` | `uint256` | The portion of the total amount that went towards principal. |
| 1 | `interestPaid_` | `uint256` | `uint256` | The portion of the total amount that went towards interest. |
| 2 | `feesPaid_` | `uint256` | `uint256` | The portion of the total amount that went towards fees. |
### `LoanImpaired`
The next payment due date was fast forwarded to the current time, activating the grace period. This is emitted when the pool delegate wants to force a payment (or default).
```solidity
event LoanImpaired(
uint256 nextPaymentDueDate_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------: | :-------: | :-----------: | ------------------------------ |
| 0 | `nextPaymentDueDate_` | `uint256` | `uint256` | The new next payment due date. |
### `NewTermsAccepted`
The terms of the refinance proposal were accepted.
```solidity
event NewTermsAccepted(
bytes32 refinanceCommitment_,
address refinancer_,
uint256 deadline_,
bytes[] calls_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------------: | :-------: | :-----------: | --------------------------------------------------------- |
| 0 | `refinanceCommitment_` | `bytes32` | `bytes32` | The hash of the refinancer, deadline, and calls proposed. |
| 1 | `refinancer_` | `address` | `address` | The address that will execute the refinance. |
| 2 | `deadline_` | `uint256` | `uint256` | The deadline for accepting the new terms. |
| 3 | `calls_` | `bytes[]` | `bytes[]` | The individual calls for the refinancer contract. |
### `NewTermsProposed`
A refinance was proposed.
```solidity
event NewTermsProposed(
bytes32 refinanceCommitment_,
address refinancer_,
uint256 deadline_,
bytes[] calls_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------------: | :-------: | :-----------: | --------------------------------------------------------- |
| 0 | `refinanceCommitment_` | `bytes32` | `bytes32` | The hash of the refinancer, deadline, and calls proposed. |
| 1 | `refinancer_` | `address` | `address` | The address that will execute the refinance. |
| 2 | `deadline_` | `uint256` | `uint256` | The deadline for accepting the new terms. |
| 3 | `calls_` | `bytes[]` | `bytes[]` | The individual calls for the refinancer contract. |
### `NewTermsRejected`
The terms of the refinance proposal were rejected.
```solidity
event NewTermsRejected(
bytes32 refinanceCommitment_,
address refinancer_,
uint256 deadline_,
bytes[] calls_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------------: | :-------: | :-----------: | --------------------------------------------------------- |
| 0 | `refinanceCommitment_` | `bytes32` | `bytes32` | The hash of the refinancer, deadline, and calls proposed. |
| 1 | `refinancer_` | `address` | `address` | The address that will execute the refinance. |
| 2 | `deadline_` | `uint256` | `uint256` | The deadline for accepting the new terms. |
| 3 | `calls_` | `bytes[]` | `bytes[]` | The individual calls for the refinancer contract. |
### `PaymentMade`
Payments were made.
```solidity
event PaymentMade(
uint256 principalPaid_,
uint256 interestPaid_,
uint256 fees_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------: | :-------: | :-----------: | ------------------------------------------------------------ |
| 0 | `principalPaid_` | `uint256` | `uint256` | The portion of the total amount that went towards principal. |
| 1 | `interestPaid_` | `uint256` | `uint256` | The portion of the total amount that went towards interest. |
| 2 | `fees_` | `uint256` | `uint256` | The portion of the total amount that went towards fees. |
### `PendingBorrowerSet`
Pending borrower was set.
```solidity
event PendingBorrowerSet(
address pendingBorrower_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------: | :-------: | :-----------: | ------------------------------------------ |
| 0 | `pendingBorrower_` | `address` | `address` | Address that can accept the borrower role. |
프로젝트로 돌아가기