Maple Finance 백서

Maple Finance

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 56쪽

`uint24` | `uint24` | The value for the platform management fee rate. | | 1 | `delegateManagementFeeRate` | `uint24` | `uint24` | The value for the delegate management fee rate. | | 2 | `startDate` | `uint40` | `uint40` | The start date of the payment. | | 3 | `issuanceRate` | `uint168` | `uint168` | The issuance rate for the loan. | ### `poolManager` Gets the address of the pool manager. ```solidity function poolManager() view returns ( address ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `address` | `address` | | ### `principalOut` Gets the amount of principal out. ```solidity function principalOut() view returns ( uint128 ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `uint128` | `uint128` | | ### `proposeNewTerms` Proposes new terms for a loan. ```solidity function proposeNewTerms( address loan_, address refinancer_, uint256 deadline_, bytes[] calls_ ) nonpayable; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----------: | :-------: | :-----------: | ------------------------------------------------------------- | | 0 | `loan_` | `address` | `address` | The loan to propose new changes to. | | 1 | `refinancer_` | `address` | `address` | The refinancer to use in the refinance. | | 2 | `deadline_` | `uint256` | `uint256` | The deadline by which the borrower must accept the new terms. | | 3 | `calls_` | `bytes[]` | `bytes[]` | The array of calls to be made to the refinancer. | ### `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 borrower must accept the new terms. | | 3 | `calls_` | `bytes[]` | `bytes[]` | The array of calls to be made to the refinancer. | ### `removeCall` Removes a loan call. ```solidity function removeCall( address loan_ ) nonpayable; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----: | :-------: | :-----------: | ------------------------ | | 0 | `loan_` | `address` | `address` | Loan to remove call for. | ### `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. | ### `setImplementation` Modifies the proxy's implementation address. ```solidity function setImplementation( address implementation_ ) nonpayable; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :---------------: | :-------: | :-----------: | ----------- | | 0 | `implementation_` | `address` | `address` | | ### `triggerDefault` Triggers the default of a loan. ```solidity function triggerDefault( address loan_, address liquidatorFactory_ ) nonpayable returns ( bool liquidationComplete_, uint256 remainingLosses_, uint256 unrecoveredPlatformFees_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :------------------: | :-------: | :-----------: | ---------------------------- | | 0 | `loan_` | `address` | `address` | Loan to trigger the default. | | 1 | `liquidatorFactory_` | `address` | `address` | | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :------------------------: | :-------: | :-----------: | --------------------------------------------------------------------------- | | 0 | `liquidationComplete_` | `bool` | `bool` | | | 1 | `remainingLosses_` | `uint256` | `uint256` | The amount of un-recovered principal and interest (net of management fees). | | 2 | `unrecoveredPlatformFees_` | `uint256` | `uint256` | The amount of un-recovered platform fees. | ### `triggerDefault` Triggers the default of a loan. ```solidity function triggerDefault( address loan_ ) nonpayable returns ( uint256 remainingLosses_, uint256 unrecoveredPlatformFees_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----: | :-------: | :-----------: | ---------------------------- | | 0 | `loan_` | `address` | `address` | Loan to trigger the default. | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :------------------------: | :-------: | :-----------: | --------------------------------------------------------------------------- | | 0 | `remainingLosses_` | `uint256` | `uint256` | The amount of un-recovered principal and interest (net of management fees). | | 1 | `unrecoveredPlatformFees_` | `uint256` | `uint256` | The amount of un-recovered 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` | | ### `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 ### `AccountingStateUpdated` Emitted when the accounting state of the loan manager is updated. ```solidity event AccountingStateUpdated( uint256 issuanceRate_, uint112 accountedInterest_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :------------------: | :-------: | :-----------: | --------------------------------- | | 0 | `issuanceRate_` | `uint256` | `uint256` | New value for the issuance rate. | | 1 | `accountedInterest_` | `uint112` | `uint112` | The amount of accounted interest. | ### `ClaimedFundsDistributed` Funds have been claimed and distributed to the Pool, Pool Delegate, and Maple Treasury. ```solidity event ClaimedFundsDistributed( address loan_, uint256 principal_, uint256 netInterest_, uint256 delegateManagementFee_, uint256 delegateServiceFee_, uint256 platformManagementFee_, uint256 platformServiceFee_ ); ``` #### 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. | | 3 | `delegateManagementFee_` | `uint256` | `uint256` | The amount of delegate management fees paid. | | 4 | `delegateServiceFee_` | `uint256` | `uint256` | The amount of delegate service fees paid. | | 5 | `platformManagementFee_` | `uint256` | `uint256` | The amount of platform management fees paid. | | 6 | `platformServiceFee_` | `uint256` | `uint256` | The amount of platform service fees paid. | ### `ExpectedClaim` Funds that were expected to be claimed and distributed to the Pool and Maple Treasury. ```solidity event ExpectedClaim( address loan_, uint256 principal_, uint256 netInterest_, uint256 platformManagementFee_, uint256 platformServiceFee_ ); ``` #### 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 that was expected to be paid. | | 2 | `netInterest_` | `uint256` | `uint256` | The amount of net interest that was expected to be paid. | | 3 | `platformManagementFee_` | `uint256` | `uint256` | The amount of platform management fees that were expected to be paid. | | 4 | `platformServiceFee_` | `uint256` | `uint256` | The amount of platform service fees that were expected to paid. | ### `LiquidatedFundsDistributed` Funds that were liquidated and distributed to the Pool, Maple Treasury, and Borrower. ```solidity event LiquidatedFundsDistributed( address loan_, uint256 toBorrower_, uint256 toPool_, uint256 toTreasury_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----------: | :-------: | :-----------: | ------------------------------------------------------------------- | | 0 | `loan_` | `address` | `address` | The address of the loan contract that defaulted and was liquidated. | | 1 | `toBorrower_` | `uint256` | `uint256` | The amount of recovered funds transferred to the Borrower. | | 2 | `toPool_` | `uint256` | `uint256` | The amount of recovered funds transferred to the Pool. | | 3 | `toTreasury_` | `uint256` | `uint256` | The amount of recovered funds transferred to the Treasury. | ### `PaymentAdded` Emitted when a payment is added to the LoanManager payments mapping. ```solidity event PaymentAdded( address loan_, uint256 platformManagementFeeRate_, uint256 delegateManagementFeeRate_, uint256 paymentDueDate_, uint256 issuanceRate_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :--------------------------: | :-------: | :-----------: | -------------------------------------------------------------------------------------- | | 0 | `loan_` | `address` | `address` | The address of the loan. | | 1 | `platformManagementFeeRate_` | `uint256` | `uint256` | The amount of platform management rate that will be used for the payment distribution. | | 2 | `delegateManagementFeeRate_` | `uint256` | `uint256` | The amount of delegate management rate that will be used for the payment distribution. | | 3 | `paymentDueDate_` | `uint256` | `uint256` | The due date of the payment. | | 4 | `issuanceRate_` | `uint256` | `uint256` | The issuance of the payment, 1e27 precision. | ### `PaymentRemoved` Emitted when a payment is removed from the LoanManager payments mapping. ```solidity event PaymentRemoved( address loan_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----: | :-------: | :-----------: | ------------------------ | | 0 | `loan_` | `address` | `address` | The address of the loan. | ### `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( uint128 unrealizedLosses_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----------------: | :-------: | :-----------: | ------------------------------------ | | 0 | `unrealizedLosses_` | `uint128` | `uint128` | 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. | # OpenTermLoanManagerFactory ## Constructor ```solidity constructor( address globals_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :--------: | :-------: | :-----------: | ----------- | | 0 | `globals_` | `address` | `address` | | ## 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
프로젝트로 돌아가기