### `principalOut`
Gets the amount of principal out.
```solidity
function principalOut()
view
returns (
uint128
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `uint128` | `uint128` | |
### `rejectNewTerms`
Reject/cancel proposed new terms for a loan.
```solidity
function rejectNewTerms(
address loan_,
address refinancer_,
uint256 deadline_,
bytes[] calls_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------: | :-------: | :-----------: | ----------------------------------------------------------- |
| 0 | `loan_` | `address` | `address` | The loan with the proposed new changes. |
| 1 | `refinancer_` | `address` | `address` | The refinancer to use in the refinance. |
| 2 | `deadline_` | `uint256` | `uint256` | The deadline by which the lender must accept the new terms. |
| 3 | `calls_` | `bytes[]` | `bytes[]` | The array of calls to be made to the refinancer. |
### `removeLoanImpairment`
Removes the loan impairment for a loan.
```solidity
function removeLoanImpairment(
address loan_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----: | :-------: | :-----------: | ----------------------------------- |
| 0 | `loan_` | `address` | `address` | Loan to remove the loan impairment. |
### `setAllowedSlippage`
Sets the allowed slippage for a collateral asset liquidation.
```solidity
function setAllowedSlippage(
address collateralAsset_,
uint256 allowedSlippage_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------: | :-------: | :-----------: | ---------------------------------- |
| 0 | `collateralAsset_` | `address` | `address` | Address of a collateral asset. |
| 1 | `allowedSlippage_` | `uint256` | `uint256` | New value for \`allowedSlippage\`. |
### `setImplementation`
Modifies the proxy's implementation address.
```solidity
function setImplementation(
address implementation_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------------: | :-------: | :-----------: | ----------- |
| 0 | `implementation_` | `address` | `address` | |
### `setMinRatio`
Sets the minimum ratio for a collateral asset liquidation. This ratio is expressed as a decimal representation of units of fundsAsset per unit collateralAsset in fundsAsset decimal precision.
```solidity
function setMinRatio(
address collateralAsset_,
uint256 minRatio_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------: | :-------: | :-----------: | ------------------------------ |
| 0 | `collateralAsset_` | `address` | `address` | Address of a collateral asset. |
| 1 | `minRatio_` | `uint256` | `uint256` | New value for \`minRatio\`. |
### `sortedPayments`
Gets the information of the sorted list.
```solidity
function sortedPayments(
uint256
)
view
returns (
uint24 previous,
uint24 next,
uint48 paymentDueDate
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | \`\` | `uint256` | `uint256` | |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------: | :------: | :-----------: | ----------- |
| 0 | `previous` | `uint24` | `uint24` | |
| 1 | `next` | `uint24` | `uint24` | |
| 2 | `paymentDueDate` | `uint48` | `uint48` | |
### `triggerDefault`
Triggers the default of a loan.
```solidity
function triggerDefault(
address loan_,
address liquidatorFactory_
)
nonpayable
returns (
bool liquidationComplete_,
uint256 remainingLosses_,
uint256 platformFees_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------------: | :-------: | :-----------: | --------------------------------------------------- |
| 0 | `loan_` | `address` | `address` | Loan to trigger the default. |
| 1 | `liquidatorFactory_` | `address` | `address` | Factory that will be used to deploy the liquidator. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------------: | :-------: | :-----------: | -------------------------------------------------------------------------------- |
| 0 | `liquidationComplete_` | `bool` | `bool` | True if the liquidation is completed in the same transaction (uncollateralized). |
| 1 | `remainingLosses_` | `uint256` | `uint256` | The amount of remaining losses. |
| 2 | `platformFees_` | `uint256` | `uint256` | The amount of platform fees. |
### `unrealizedLosses`
Returns the amount unrealized losses.
```solidity
function unrealizedLosses()
view
returns (
uint128
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `uint128` | `uint128` | |
### `updateAccounting`
Updates the issuance parameters of the LoanManager, callable by the Governor and the PoolDelegate. Useful to call when \`block.timestamp\` is greater than \`domainEnd\` and the LoanManager is not accruing interest.
```solidity
function updateAccounting()
nonpayable;
```
### `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 version_,
bytes arguments_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------: | :-------: | :-----------: | ---------------------------------------------- |
| 0 | `version_` | `uint256` | `uint256` | |
| 1 | `arguments_` | `bytes` | `bytes` | Some encoded arguments to use for the upgrade. |
## Events
### `AllowedSlippageSet`
Emitted when \`setAllowedSlippage\` is called.
```solidity
event AllowedSlippageSet(
address collateralAsset_,
uint256 newSlippage_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------: | :-------: | :-----------: | ---------------------------------- |
| 0 | `collateralAsset_` | `address` | `address` | Address of a collateral asset. |
| 1 | `newSlippage_` | `uint256` | `uint256` | New value for \`allowedSlippage\`. |
### `FundsDistributed`
Funds have been claimed and distributed into the Pool.
```solidity
event FundsDistributed(
address loan_,
uint256 principal_,
uint256 netInterest_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------: | :-------: | :-----------: | --------------------------------- |
| 0 | `loan_` | `address` | `address` | The address of the loan contract. |
| 1 | `principal_` | `uint256` | `uint256` | The amount of principal paid. |
| 2 | `netInterest_` | `uint256` | `uint256` | The amount of net interest paid. |
### `IssuanceParamsUpdated`
Emitted when the issuance parameters are changed.
```solidity
event IssuanceParamsUpdated(
uint48 domainEnd_,
uint256 issuanceRate_,
uint112 accountedInterest_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------------: | :-------: | :-----------: | --------------------------------- |
| 0 | `domainEnd_` | `uint48` | `uint48` | The timestamp of the domain end. |
| 1 | `issuanceRate_` | `uint256` | `uint256` | New value for the issuance rate. |
| 2 | `accountedInterest_` | `uint112` | `uint112` | The amount of accounted interest. |
### `LoanTransferAdminSet`
Emitted when the loanTransferAdmin is set by the PoolDelegate.
```solidity
event LoanTransferAdminSet(
address loanTransferAdmin_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------------: | :-------: | :-----------: | ------------------------------------------------- |
| 0 | `loanTransferAdmin_` | `address` | `address` | The address of the admin that can transfer loans. |
### `ManagementFeesPaid`
A fee payment was made.
```solidity
event ManagementFeesPaid(
address loan_,
uint256 delegateManagementFee_,
uint256 platformManagementFee_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------------: | :-------: | :-----------: | ------------------------------------------- |
| 0 | `loan_` | `address` | `address` | The address of the loan contract. |
| 1 | `delegateManagementFee_` | `uint256` | `uint256` | The amount of delegate management fee paid. |
| 2 | `platformManagementFee_` | `uint256` | `uint256` | The amount of platform management fee paid. |
### `MinRatioSet`
Emitted when \`setMinRatio\` is called.
```solidity
event MinRatioSet(
address collateralAsset_,
uint256 newMinRatio_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------: | :-------: | :-----------: | ------------------------------ |
| 0 | `collateralAsset_` | `address` | `address` | Address of a collateral asset. |
| 1 | `newMinRatio_` | `uint256` | `uint256` | New value for \`minRatio\`. |
### `PaymentAdded`
Emitted when a payment is removed from the LoanManager payments array.
```solidity
event PaymentAdded(
address loan_,
uint256 paymentId_,
uint256 platformManagementFeeRate_,
uint256 delegateManagementFeeRate_,
uint256 startDate_,
uint256 nextPaymentDueDate_,
uint256 netRefinanceInterest_,
uint256 newRate_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------------------: | :-------: | :-----------: | ----------------------------------------------- |
| 0 | `loan_` | `address` | `address` | The address of the loan. |
| 1 | `paymentId_` | `uint256` | `uint256` | The payment ID of the payment that was removed. |
| 2 | `platformManagementFeeRate_` | `uint256` | `uint256` | |
| 3 | `delegateManagementFeeRate_` | `uint256` | `uint256` | |
| 4 | `startDate_` | `uint256` | `uint256` | |
| 5 | `nextPaymentDueDate_` | `uint256` | `uint256` | |
| 6 | `netRefinanceInterest_` | `uint256` | `uint256` | |
| 7 | `newRate_` | `uint256` | `uint256` | |
### `PaymentRemoved`
Emitted when a payment is removed from the LoanManager payments array.
```solidity
event PaymentRemoved(
address loan_,
uint256 paymentId_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------: | :-------: | :-----------: | ----------------------------------------------- |
| 0 | `loan_` | `address` | `address` | The address of the loan. |
| 1 | `paymentId_` | `uint256` | `uint256` | The payment ID of the payment that was removed. |
### `PrincipalOutUpdated`
Emitted when principal out is updated
```solidity
event PrincipalOutUpdated(
uint128 principalOut_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------: | :-------: | :-----------: | -------------------------------- |
| 0 | `principalOut_` | `uint128` | `uint128` | The new value for principal out. |
### `UnrealizedLossesUpdated`
Emitted when unrealized losses is updated.
```solidity
event UnrealizedLossesUpdated(
uint256 unrealizedLosses_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------: | :-------: | :-----------: | ------------------------------------ |
| 0 | `unrealizedLosses_` | `uint256` | `uint256` | The new value for unrealized losses. |
### `Upgraded`
The instance was upgraded.
```solidity
event Upgraded(
uint256 toVersion_,
bytes arguments_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------: | :-------: | :-----------: | ------------------------------ |
| 0 | `toVersion_` | `uint256` | `uint256` | The new version of the loan. |
| 1 | `arguments_` | `bytes` | `bytes` | The upgrade arguments, if any. |
# FixedTermLoanManagerFactory
## Constructor
```solidity
constructor(
address mapleGlobals_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------: | :-------: | :-----------: | ---------------------------------------- |
| 0 | `mapleGlobals_` | `address` | `address` | The address of a Maple Globals contract. |
## Functions
### `createInstance`
Deploys a new instance proxying the default implementation version, with some initialization arguments. Uses a nonce and \`msg.sender\` as a salt for the CREATE2 opcode during instantiation to produce deterministic addresses.
```solidity
function createInstance(
bytes arguments_,
bytes32 salt_
)
nonpayable
returns (
address instance_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------: | :-------: | :-----------: | ------------------------------------------------------------------------ |
| 0 | `arguments_` | `bytes` | `bytes` | The initialization arguments to use for the instance deployment, if any. |
| 1 | `salt_` | `bytes32` | `bytes32` | The salt to use in the contract creation process. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------: | :-------: | :-----------: | ------------------------------------------- |
| 0 | `instance_` | `address` | `address` | The address of the deployed proxy contract. |
### `defaultImplementation`
The address of an implementation for proxies.
```solidity
function defaultImplementation()
view
returns (
address defaultImplementation_
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------------: | :-------: | :-----------: | ----------- |
| 0 | `defaultImplementation_` | `address` | `address` | |
### `defaultVersion`
The default version.
```solidity
function defaultVersion()
view
returns (
uint256
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `uint256` | `uint256` | |
### `disableUpgradePath`
Disables upgrading from a version to a version of a implementation. Only the Governor can call this function.
```solidity
function disableUpgradePath(
uint256 fromVersion_,
uint256 toVersion_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------: | :-------: | :-----------: | -------------------------------------------- |
| 0 | `fromVersion_` | `uint256` | `uint256` | The starting version of the upgrade path. |
| 1 | `toVersion_` | `uint256` | `uint256` | The destination version of the upgrade path. |
### `enableUpgradePath`
Enables upgrading from a version to a version of an implementation, with an optional migrator. Only the Governor can call this function.
```solidity
function enableUpgradePath(
uint256 fromVersion_,
uint256 toVersion_,
address migrator_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------: | :-------: | :-----------: | -------------------------------------------- |
| 0 | `fromVersion_` | `uint256` | `uint256` | The starting version of the upgrade path. |
| 1 | `toVersion_` | `uint256` | `uint256` | The destination version of the upgrade path. |
| 2 | `migrator_` | `address` | `address` | The address of the migrator, if any. |
### `getInstanceAddress`
Returns the deterministic address of a potential proxy, given some arguments and salt.
```solidity
function getInstanceAddress(
bytes arguments_,
bytes32 salt_
)
view
returns (
address instanceAddress_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------: | :-------: | :-----------: | ----------------------------------------------------------------- |
| 0 | `arguments_` | `bytes` | `bytes` | The initialization arguments to be used when deploying the proxy. |
| 1 | `salt_` | `bytes32` | `bytes32` | The salt to be used when deploying the proxy. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------: | :-------: | :-----------: | ----------------------------------------------- |
| 0 | `instanceAddress_` | `address` | `address` | The deterministic address of a potential proxy. |
### `implementationOf`
Returns the address of an implementation version.
```solidity
function implementationOf(
uint256 version_
)
view
returns (
address implementation_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------: | :-------: | :-----------: | --------------------------- |
| 0 | `version_` | `uint256` | `uint256` | The implementation version. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------------: | :-------: | :-----------: | ---------------------------------- |
| 0 | `implementation_` | `address` | `address` | The address of the implementation. |
### `isInstance`
Returns if a given address has been deployed by this factory/
```solidity
function isInstance(
address
)
view
returns (
bool
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | \`\` | `address` | `address` | |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :----: | :-----------: | ----------- |
| 0 | | `bool` | `bool` | |
### `mapleGlobals`
The address of the MapleGlobals contract.
```solidity
function mapleGlobals()
view
returns (
address
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `address` | `address` | |
### `migratorForPath`
Returns the address of a migrator contract for a migration path (from version, to version). If oldVersion\_ == newVersion\_, the migrator is an initializer.
```solidity
function migratorForPath(
uint256 oldVersion_,
uint256 newVersion_
)
view
returns (
address migrator_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------: | :-------: | :-----------: | ---------------- |
| 0 | `oldVersion_` | `uint256` | `uint256` | The old version. |
| 1 | `newVersion_` | `uint256` | `uint256` | The new version. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------: | :-------: | :-----------: | ----------------------------------- |
| 0 | `migrator_` | `address` | `address` | The address of a migrator contract. |
### `registerImplementation`
Registers the address of an implementation contract as a version, with an optional initializer. Only the Governor can call this function.
```solidity
function registerImplementation(
uint256 version_,
address implementationAddress_,
address initializer_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------------: | :-------: | :-----------: | --------------------------------------- |
| 0 | `version_` | `uint256` | `uint256` | The version to register. |
| 1 | `implementationAddress_` | `address` | `address` | The address of the implementation. |
| 2 | `initializer_` | `address` | `address` | The address of the initializer, if any. |
### `setDefaultVersion`
Sets the default version. Only the Governor can call this function.
```solidity
function setDefaultVersion(
uint256 version_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------: | :-------: | :-----------: | ------------------------------------------------- |
| 0 | `version_` | `uint256` | `uint256` | The implementation version to set as the default. |
### `setGlobals`
Sets the Maple Globals contract. Only the Governor can call this function.
```solid프로젝트로 돌아가기