OpenTermLoan
Functions
HUNDRED_PERCENT
HUNDRED_PERCENTThe value that represents 100%, to be easily comparable with the loan rates.
function HUNDRED_PERCENT()
view
returns (
uint256
);Return Values:
0
uint256
uint256
acceptBorrower
acceptBorrowerAccept the borrower role, must be called by pendingBorrower.
function acceptBorrower()
nonpayable;acceptLender
acceptLenderAccept the lender role, must be called by pendingLender.
acceptNewTerms
acceptNewTermsAccept the proposed terms and trigger refinance execution.
Parameters:
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:
0
refinanceCommitment_
bytes32
bytes32
The hash of the accepted refinance agreement.
borrower
borrowerThe borrower of the loan, responsible for repayments.
Return Values:
0
address
address
calledPrincipal
calledPrincipalThe amount of principal yet to be returned to satisfy the loan call.
Return Values:
0
uint256
uint256
callPrincipal
callPrincipalThe lender called the loan, giving the borrower a notice period within which to return principal and pro-rata interest.
Parameters:
0
principalToReturn_
uint256
uint256
The minimum amount of principal the borrower must return.
Return Values:
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
dateCalledThe timestamp of the date the loan was called.
Return Values:
0
uint40
uint40
dateFunded
dateFundedThe timestamp of the date the loan was funded.
Return Values:
0
uint40
uint40
dateImpaired
dateImpairedThe timestamp of the date the loan was impaired.
Return Values:
0
uint40
uint40
datePaid
datePaidThe timestamp of the date the loan was last paid.
Return Values:
0
uint40
uint40
defaultDate
defaultDateThe timestamp of the date the loan will be in default.
Return Values:
0
paymentDefaultDate_
uint40
uint40
delegateServiceFeeRate
delegateServiceFeeRateThe annualized delegate service fee rate.
Return Values:
0
uint64
uint64
factory
factoryThe address of the proxy factory.
Return Values:
0
factory_
address
address
fund
fundLend funds to the loan/borrower.
Return Values:
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
fundsAssetThe address of the fundsAsset funding the loan.
Return Values:
0
address
address
getPaymentBreakdown
getPaymentBreakdownGet the breakdown of the total payment needed to satisfy the next payment installment.
Parameters:
0
timestamp_
uint256
uint256
The timestamp that corresponds to when the payment is to be made.
Return Values:
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
globalsThe Maple globals address
Return Values:
0
globals_
address
address
gracePeriod
gracePeriodThe amount of time the borrower has, after a payment is due, to make a payment before being in default.
Return Values:
0
uint32
uint32
impair
impairFast forward the payment due date to the current time. This enables the pool delegate to force a payment (or default).
Return Values:
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
implementationThe address of the implementation contract being proxied.
Return Values:
0
implementation_
address
address
interestRate
interestRateThe annualized interest rate (APR), in units of 1e18, (i.e. 1% is 0.01e18).
Return Values:
0
uint64
uint64
isCalled
isCalledWhether the loan is called.
Return Values:
0
isCalled_
bool
bool
isImpaired
isImpairedWhether the loan is impaired.
Return Values:
0
isImpaired_
bool
bool
isInDefault
isInDefaultWhether the loan is in default.
Return Values:
0
isInDefault_
bool
bool
lateFeeRate
lateFeeRateThe rate charged at late payments.
Return Values:
0
uint64
uint64
lateInterestPremiumRate
lateInterestPremiumRateThe premium over the regular interest rate applied when paying late.
Return Values:
0
uint64
uint64
lender
lenderThe lender of the Loan.
Return Values:
0
address
address
makePayment
makePaymentMake a payment to the loan.
Parameters:
0
principalToReturn_
uint256
uint256
The amount of principal to return, to the lender to reduce future interest payments.
Return Values:
0
interest_
uint256
uint256
The portion of the amount paying interest.
1
lateInterest_
uint256
uint256
The portion of the amount paying late interest.
2
delegateServiceFee_
uint256
uint256
The portion of the amount paying delegate service fees.
3
platformServiceFee_
uint256
uint256
The portion of the amount paying platform service fees.
migrate
migrateModifies the proxy's storage by delegate-calling a migrator contract with some arguments. Access control logic critical since caller can force a selfdestruct via a malicious `migrator_` which is delegatecalled.
Parameters:
0
migrator_
address
address
The address of a migrator contract.
1
arguments_
bytes
bytes
Some encoded arguments to use for the migration.
noticePeriod
noticePeriodThe amount of time the borrower has, after the loan is called, to make a payment, paying back the called principal.
Return Values:
0
uint32
uint32
paymentDueDate
paymentDueDateThe timestamp of the due date of the next payment.
Return Values:
0
paymentDueDate_
uint40
uint40
paymentInterval
paymentIntervalThe specified time between loan payments.
Return Values:
0
uint32
uint32
pendingBorrower
pendingBorrowerThe address of the pending borrower.
Return Values:
0
address
address
pendingLender
pendingLenderThe address of the pending lender.
Return Values:
0
address
address
platformServiceFeeRate
platformServiceFeeRateThe annualized platform service fee rate.
Return Values:
0
uint64
uint64
principal
principalThe amount of principal owed (initially, the requested amount), which needs to be paid back.
Return Values:
0
uint256
uint256
proposeNewTerms
proposeNewTermsPropose new terms for refinance.
Parameters:
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:
0
refinanceCommitment_
bytes32
bytes32
The hash of the proposed refinance agreement.
refinanceCommitment
refinanceCommitmentThe hash of the proposed refinance agreement.
Return Values:
0
bytes32
bytes32
rejectNewTerms
rejectNewTermsNullify the current proposed terms.
Parameters:
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:
0
refinanceCommitment_
bytes32
bytes32
The hash of the rejected refinance agreement.
removeCall
removeCallRemove the loan's called status.
Return Values:
0
paymentDueDate_
uint40
uint40
The restored payment due date.
1
defaultDate_
uint40
uint40
The date the loan will be in default.
removeImpairment
removeImpairmentRemove the loan impairment by restoring the original payment due date.
Return Values:
0
paymentDueDate_
uint40
uint40
The restored payment due date.
1
defaultDate_
uint40
uint40
The timestamp of the date the loan will be in default.
repossess
repossessRepossess collateral, and any funds, for a loan in default.
Parameters:
0
destination_
address
address
The address where the collateral and funds asset is to be sent, if any.
Return Values:
0
fundsRepossessed_
uint256
uint256
The amount of funds asset repossessed.
setImplementation
setImplementationModifies the proxy's implementation address.
Parameters:
0
newImplementation_
address
address
The address of an implementation contract.
setPendingBorrower
setPendingBorrowerSet the `pendingBorrower` to a new account.
Parameters:
0
pendingBorrower_
address
address
The address of the new pendingBorrower.
setPendingLender
setPendingLenderSet the `pendingLender` to a new account.
Parameters:
0
pendingLender_
address
address
The address of the new pendingLender.
skim
skimRemove all available balance of a specified token. NOTE: Open Term Loans are not designed to hold custody of tokens, so this is designed as a safety feature.
Parameters:
0
token_
address
address
The address of the token contract.
1
destination_
address
address
The recipient of the token.
Return Values:
0
skimmed_
uint256
uint256
The amount of token removed from the loan.
upgrade
upgradeUpgrades a contract implementation to a specific version. Access control logic critical since caller can force a selfdestruct via a malicious `migrator_` which is delegatecalled.
Parameters:
0
toVersion_
uint256
uint256
The version to upgrade to.
1
arguments_
bytes
bytes
Some encoded arguments to use for the upgrade.
Events
BorrowerAccepted
BorrowerAcceptedBorrower was accepted, and set to a new account.
Parameters:
0
borrower_
address
address
The address of the new borrower.
CallRemoved
CallRemovedThe lender reverted the action of the loan being called and the payment due date was restored to it's original value.
Parameters:
0
paymentDueDate_
uint40
uint40
The restored payment due date.
1
defaultDate_
uint40
uint40
The date the loan will be in default.
Funded
FundedThe loan was funded.
Parameters:
0
amount_
uint256
uint256
The amount funded.
1
paymentDueDate_
uint40
uint40
The due date of the first payment.
2
defaultDate_
uint40
uint40
The date the loan will be in default.
Impaired
ImpairedThe 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).
Parameters:
0
paymentDueDate_
uint40
uint40
The new payment due date.
1
defaultDate_
uint40
uint40
The date the loan will be in default.
ImpairmentRemoved
ImpairmentRemovedThe payment due date was restored to it's original value, reverting the action of loan impairment.
Parameters:
0
paymentDueDate_
uint40
uint40
The restored payment due date.
1
defaultDate_
uint40
uint40
The date the loan will be in default.
Initialized
InitializedLoan was initialized.
Parameters:
0
borrower_
address
address
The address of the borrower.
1
lender_
address
address
The address of the lender.
2
fundsAsset_
address
address
The address of the lent asset.
3
principalRequested_
uint256
uint256
The amount of principal requested.
4
termDetails_
uint32[3]
uint32[3]
Array of loan parameters: [0]: gracePeriod, [1]: noticePeriod, [2]: paymentInterval
5
rates_
uint64[4]
uint64[4]
Array of rate parameters: [0]: delegateServiceFeeRate, [1]: interestRate, [2]: lateFeeRate, [3]: lateInterestPremiumRate
LenderAccepted
LenderAcceptedLender was accepted, and set to a new account.
Parameters:
0
lender_
address
address
The address of the new lender.
NewTermsAccepted
NewTermsAcceptedThe terms of the refinance proposal were accepted.
Parameters:
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
NewTermsProposedA refinance was proposed.
Parameters:
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
NewTermsRejectedThe terms of the refinance proposal were rejected.
Parameters:
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
PaymentMadePayments were made.
Parameters:
0
lender_
address
address
The address of the lender the payment was made to.
1
principalPaid_
uint256
uint256
The portion of the total amount that went towards paying down principal.
2
interestPaid_
uint256
uint256
The portion of the total amount that went towards interest.
3
lateInterestPaid_
uint256
uint256
The portion of the total amount that went towards late interest.
4
delegateServiceFee_
uint256
uint256
The portion of the total amount that went towards delegate service fees.
5
platformServiceFee_
uint256
uint256
The portion of the total amount that went towards platform service fee.
6
paymentDueDate_
uint40
uint40
The new payment due date.
7
defaultDate_
uint40
uint40
The date the loan will be in default.
PendingBorrowerSet
PendingBorrowerSetPending borrower was set.
Parameters:
0
pendingBorrower_
address
address
Address that can accept the borrower role.
PendingLenderSet
PendingLenderSetPending lender was set.
Parameters:
0
pendingLender_
address
address
The address that can accept the lender role.
PrincipalCalled
PrincipalCalledThe lender called the loan, giving the borrower a notice period within which to return principal and pro-rata interest.
Parameters:
0
principalToReturn_
uint256
uint256
The minimum amount of principal the borrower must return.
1
paymentDueDate_
uint40
uint40
The new payment due date.
2
defaultDate_
uint40
uint40
The date the loan will be in default.
PrincipalReturned
PrincipalReturnedPrincipal was returned to lender, to close the loan or return future interest payments.
Parameters:
0
principalReturned_
uint256
uint256
The amount of principal returned.
1
principalRemaining_
uint256
uint256
The amount of principal remaining on the loan.
Repossessed
RepossessedThe loan was in default and funds and collateral was repossessed by the lender.
Parameters:
0
fundsRepossessed_
uint256
uint256
The amount of funds asset repossessed.
1
destination_
address
address
The address of the recipient of the funds, if any.
Skimmed
SkimmedSome token was removed from the loan.
Parameters:
0
token_
address
address
The address of the token contract.
1
amount_
uint256
uint256
The amount of token remove from the loan.
2
destination_
address
address
The recipient of the token.
Upgraded
UpgradedThe instance was upgraded.
Parameters:
0
toVersion_
uint256
uint256
The new version of the loan.
1
arguments_
bytes
bytes
The upgrade arguments, if any.
Last updated