Maple Finance 백서

Maple Finance

원문

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

--------------------------------------------- | | 0 | `toVersion_` | `uint256` | `uint256` | The implementation version to upgrade the proxy contract to. | | 1 | `arguments_` | `bytes` | `bytes` | The migration arguments, if any. | ### `versionOf` Returns the version of an implementation contract. ```solidity function versionOf( address implementation_ ) view returns ( uint256 version_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :---------------: | :-------: | :-----------: | ------------------------------------------ | | 0 | `implementation_` | `address` | `address` | The address of an implementation contract. | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--------: | :-------: | :-----------: | ------------------------------------------- | | 0 | `version_` | `uint256` | `uint256` | The version of the implementation contract. | ## Events ### `DefaultVersionSet` A default version was set. ```solidity event DefaultVersionSet( uint256 version_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :--------: | :-------: | :-----------: | -------------------- | | 0 | `version_` | `uint256` | `uint256` | The default version. | ### `ImplementationRegistered` A version of an implementation, at some address, was registered, with an optional initializer. ```solidity event ImplementationRegistered( uint256 version_, address implementationAddress_, address initializer_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :----------------------: | :-------: | :-----------: | --------------------------------------- | | 0 | `version_` | `uint256` | `uint256` | The version registered. | | 1 | `implementationAddress_` | `address` | `address` | The address of the implementation. | | 2 | `initializer_` | `address` | `address` | The address of the initializer, if any. | ### `InstanceDeployed` A proxy contract was deployed with some initialization arguments. ```solidity event InstanceDeployed( uint256 version_, address instance_, bytes initializationArguments_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :------------------------: | :-------: | :-----------: | ------------------------------------------------------------------------------- | | 0 | `version_` | `uint256` | `uint256` | The version of the implementation being proxied by the deployed proxy contract. | | 1 | `instance_` | `address` | `address` | The address of the proxy contract deployed. | | 2 | `initializationArguments_` | `bytes` | `bytes` | The arguments used to initialize the proxy contract, if any. | ### `InstanceUpgraded` A instance has upgraded by proxying to a new implementation, with some migration arguments. ```solidity event InstanceUpgraded( address instance_, uint256 fromVersion_, uint256 toVersion_, bytes migrationArguments_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-------------------: | :-------: | :-----------: | ------------------------------------------------- | | 0 | `instance_` | `address` | `address` | The address of the proxy contract. | | 1 | `fromVersion_` | `uint256` | `uint256` | The initial implementation version being proxied. | | 2 | `toVersion_` | `uint256` | `uint256` | The new implementation version being proxied. | | 3 | `migrationArguments_` | `bytes` | `bytes` | The arguments used to migrate, if any. | ### `MapleGlobalsSet` The MapleGlobals was set. ```solidity event MapleGlobalsSet( address mapleGlobals_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-------------: | :-------: | :-----------: | ---------------------------------------- | | 0 | `mapleGlobals_` | `address` | `address` | The address of a Maple Globals contract. | ### `UpgradePathDisabled` An upgrade path was disabled, with an optional migrator contract. ```solidity event UpgradePathDisabled( uint256 fromVersion_, uint256 toVersion_ ); ``` #### 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. | ### `UpgradePathEnabled` An upgrade path was enabled, with an optional migrator contract. ```solidity event UpgradePathEnabled( uint256 fromVersion_, uint256 toVersion_, address migrator_ ); ``` #### 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. | # LiquidatorInitializer ## Functions ### `collateralAsset` Returns the address of the collateral asset. ```solidity function collateralAsset() view returns ( address ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `address` | `address` | | ### `collateralRemaining` Returns the amount of collateral yet to be liquidated. ```solidity function collateralRemaining() view returns ( uint256 ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `uint256` | `uint256` | | ### `decodeArguments` ```solidity function decodeArguments( bytes calldata_ ) pure returns ( address loanManager_, address collateralAsset_, address fundsAsset_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :---------: | :-----: | :-----------: | ----------- | | 0 | `calldata_` | `bytes` | `bytes` | | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :----------------: | :-------: | :-----------: | ----------- | | 0 | `loanManager_` | `address` | `address` | | | 1 | `collateralAsset_` | `address` | `address` | | | 2 | `fundsAsset_` | `address` | `address` | | ### `encodeArguments` ```solidity function encodeArguments( address loanManager_, address collateralAsset_, address fundsAsset_ ) pure returns ( bytes calldata_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :----------------: | :-------: | :-----------: | ----------- | | 0 | `loanManager_` | `address` | `address` | | | 1 | `collateralAsset_` | `address` | `address` | | | 2 | `fundsAsset_` | `address` | `address` | | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :---------: | :-----: | :-----------: | ----------- | | 0 | `calldata_` | `bytes` | `bytes` | | ### `fundsAsset` Returns the address of the funding asset. ```solidity function fundsAsset() view returns ( address ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `address` | `address` | | ### `loanManager` Returns the address of the loan manager contract. ```solidity function loanManager() view returns ( address ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `address` | `address` | | # OpenTermLoan ## Functions ### `HUNDRED_PERCENT` The value that represents 100%, to be easily comparable with the loan rates. ```solidity function HUNDRED_PERCENT() view returns ( uint256 ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `uint256` | `uint256` | | ### `acceptBorrower` Accept the borrower role, must be called by pendingBorrower. ```solidity function acceptBorrower() nonpayable; ``` ### `acceptLender` Accept the lender role, must be called by pendingLender. ```solidity function acceptLender() nonpayable; ``` ### `acceptNewTerms` Accept the proposed terms and trigger refinance execution. ```solidity function acceptNewTerms( 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 accepted refinance agreement. | ### `borrower` The borrower of the loan, responsible for repayments. ```solidity function borrower() view returns ( address ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `address` | `address` | | ### `calledPrincipal` The amount of principal yet to be returned to satisfy the loan call. ```solidity function calledPrincipal() view returns ( uint256 ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `uint256` | `uint256` | | ### `callPrincipal` The lender called the loan, giving the borrower a notice period within which to return principal and pro-rata interest. ```solidity function callPrincipal( uint256 principalToReturn_ ) nonpayable returns ( uint40 paymentDueDate_, uint40 defaultDate_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :------------------: | :-------: | :-----------: | --------------------------------------------------------- | | 0 | `principalToReturn_` | `uint256` | `uint256` | The minimum amount of principal the borrower must return. | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :---------------: | :------: | :-----------: | ----------------------------------------------------------------------------------------- | | 0 | `paymentDueDate_` | `uint40` | `uint40` | The new payment due date for returning the principal and pro-rate interest to the lender. | | 1 | `defaultDate_` | `uint40` | `uint40` | The date the loan will be in default. | ### `dateCalled` The timestamp of the date the loan was called. ```solidity function dateCalled() view returns ( uint40 ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :------: | :-----------: | ----------- | | 0 | | `uint40` | `uint40` | | ### `dateFunded` The timestamp of the date the loan was funded. ```solidity function dateFunded() view returns ( uint40 ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :------: | :-----------: | ----------- | | 0 | | `uint40` | `uint40` | | ### `dateImpaired` The timestamp of the date the loan was impaired. ```solidity function dateImpaired() view returns ( uint40 ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :------: | :-----------: | ----------- | | 0 | | `uint40` | `uint40` | | ### `datePaid` The timestamp of the date the loan was last paid. ```solidity function datePaid() view returns ( uint40 ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :------: | :-----------: | ----------- | | 0 | | `uint40` | `uint40` | | ### `defaultDate` The timestamp of the date the loan will be in default. ```solidity function defaultDate() view returns ( uint40 paymentDefaultDate_ ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :-------------------: | :------: | :-----------: | ----------- | | 0 | `paymentDefaultDate_` | `uint40` | `uint40` | | ### `delegateServiceFeeRate` The annualized delegate service fee rate. ```solidity function delegateServiceFeeRate() view returns ( uint64 ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :------: | :-----------: | ----------- | | 0 | | `uint64` | `uint64` | | ### `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` Lend funds to the loan/borrower. ```solidity function fund() nonpayable returns ( uint256 fundsLent_, uint40 paymentDueDate_, uint40 defaultDate_ ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :---------------: | :-------: | :-----------: | ------------------------------------------------------ | | 0 | `fundsLent_` | `uint256` | `uint256` | The amount funded. | | 1 | `paymentDueDate_` | `uint40` | `uint40` | The due date of the first payment. | | 2 | `defaultDate_` | `uint40` | `uint40` | The timestamp of the date the loan will be in default. | ### `fundsAsset` The address of the fundsAsset funding the loan. ```solidity function fundsAsset() view returns ( address ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `address` | `address` | | ### `getPaymentBreakdown` Get the breakdown of the total payment needed to satisfy the next payment installment. ```solidity function getPaymentBreakdown( uint256 timestamp_ ) view returns ( uint256 principal_, uint256 interest_, uint256 lateInterest_, uint256 delegateServiceFee_, uint256 platformServiceFee_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :----------: | :-------: | :-----------: | ----------------------------------------------------------------- | | 0 | `timestamp_` | `uint256` | `uint256` | The timestamp that corresponds to when the payment is to be made. | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :-------------------: | :-------: | :-----------: | --------------------------------------------------------------------------- | | 0 | `principal_` | `uint256` | `uint256` | The portion of the total amount that will go towards principal. | | 1 | `interest_` | `uint256` | `uint256` | The portion of the total amount that will go towards interest fees. | | 2 | `lateInterest_` | `uint256` | `uint256` | The portion of the total amount that will go towards late interest fees. | | 3 | `delegateServiceFee_` | `uint256` | `uint256` | The portion of the total amount that will go towards delegate service fees. | | 4 | `platformServiceFee_` | `uint256` | `uint256` | The portion of the total amount that will go towards platform service fees. | ### `globals` The Maple globals address ```solidity function globals() view returns ( address globals_ ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--------: | :-------: | :-----------: | ----------- | | 0 | `globals_` | `address` | `address` | | ### `gracePeriod` The amount of time the borrower has, after a payment is due, to make a payment before being in default. ```solidity function gracePeriod() view returns ( uint32 ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :------: | :-----------: | ----------- | | 0 | | `uint32` | `uint32` | | ### `impair` Fast forward the payment due date to the current time. This enables the pool delegate to force a payment (or default). ```solidity function impair() nonpayable returns ( uint40 paymentDueDate_, uint40 defaultDate_ ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :---------------: | :------: | :-----------: | ---------------------------------------------------------------------------------- | | 0 | `paymentDueDate_` | `uint40` | `uint40` | The new payment due date to result in the removal of the loan's impairment status. | | 1 | `defaultDate_` | `uint40` | `uint40` | The timestamp of the date the loan will be in default. | ### `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` | | ### `interestRate` The annualized interest rate (APR), in units of 1e18, (i.e. 1% is 0.01e18). ```solidity function interestRate() view returns ( uint64 ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :------: | :-----------: | ----------- | | 0 | | `uint64` | `uint64` | | ### `isCalled` Whether the loan is called. ```solidity function isCalled() view returns ( bool isCalled_ ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :---------: | :----: | :-----------: | ----------- | | 0 | `isCalled_` | `bool` | `bool` | | ### `isImpaired` Whether the loan is impaired. ```solidity function isImpaired() view returns ( bool isImpaired_ ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :-----------: | :----: | :-----------: | ----------- | | 0 | `isImpaired_` | `bool` | `bool` | | ### `isInDefault` Whether the loan is in default. ```solidity function isInDefault() view returns ( bool isInDefault_ ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :------------: | :----: | :-----------: | ----------- | | 0 | `isInDefault_` | `bool` | `bool` | | ### `lateFeeRate` The rate charged at late payments. ```solidity function lateFeeRate() view returns ( uint64 ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :------: | :-----------: | ----------- | | 0 | | `uint64` | `uint64` | | ### `lateInterestPremiumRate` The premium over the regular interest rate applied when paying late. ```solidity function lateInterestPremiumRate() view returns ( uint64 ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :------: | :-----------: | ----------- | | 0 | | `uint64` | `uint64` | | ### `lender` The lender of the Loan. ```solidity function lender() view returns ( address ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `address` | `address` | | ### `makePayment` Make a payment to the loan. ```solidity function makePayment( uint256 principalToReturn_ ) nonpayable returns ( uint256 interest_, uint256 lateInterest_, uint256 delegateServiceFee_, uint256 platformServiceFee_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :------------------: | :-------: | :-----------: | ----------------------------------------------------------------------------
프로젝트로 돌아가기