ABI & Code
Public Repo
ABI
FraxlendPairCore
An abstract contract which contains the core logic and storage for the FraxlendPair
constructor
The constructor
function is called on deployment
initialize
The initialize
function is called immediately after deployment
This function can only be called by the deployer
_totalAssetAvailable
The _totalAssetAvailable
function returns the total balance of Asset Tokens in the contract
_isSolvent
The _isSolvent
function determines if a given borrower is solvent given an exchange rate
_isPastMaturity
The _isPastMaturity
function determines if the current block timestamp is past the maturityDate date
isSolvent
Checks for solvency AFTER executing contract code
approvedBorrower
Checks if msg.sender is an approved Borrower
approvedLender
Checks if msg.sender and _receiver are both an approved Lender
isNotPastMaturity
Ensure function is not called when passed maturity
AddInterest
The AddInterest
event is emitted when interest is accrued by borrowers
UpdateRate
The UpdateRate
event is emitted when the interest rate is updated
addInterest
The addInterest
function is a public implementation of _addInterest and allows 3rd parties to trigger interest accrual
_addInterest
The _addInterest
function is invoked prior to every external function and is used to accrue interest and update interest rate
Can only called once per block
UpdateExchangeRate
The UpdateExchangeRate
event is emitted when the Collateral:Asset exchange rate is updated
updateExchangeRate
The updateExchangeRate
function is the external implementation of _updateExchangeRate.
This function is invoked at most once per block as these queries can be expensive
_updateExchangeRate
The _updateExchangeRate
function retrieves the latest exchange rate. i.e how much collateral to buy 1e18 asset.
This function is invoked at most once per block as these queries can be expensive
_deposit
The _deposit
function is the internal implementation for lending assets
Caller must invoke ERC20.approve
on the Asset Token contract prior to calling function
deposit
The deposit
function allows a user to Lend Assets by specifying the amount of Asset Tokens to lend
Caller must invoke ERC20.approve
on the Asset Token contract prior to calling function
mint
The mint
function allows a user to Lend assets by specifying the number of Assets Shares (fTokens) to mint
Caller must invoke ERC20.approve
on the Asset Token contract prior to calling function
_redeem
The _redeem
function is an internal implementation which allows a Lender to pull their Asset Tokens out of the Pair
Caller must invoke ERC20.approve
on the Asset Token contract prior to calling function
redeem
The redeem
function allows the caller to redeem their Asset Shares for Asset Tokens
withdraw
The withdraw
function allows a user to redeem their Asset Shares for a specified amount of Asset Tokens
BorrowAsset
The BorrowAsset
event is emitted when a borrower increases their position
_borrowAsset
The _borrowAsset
function is the internal implementation for borrowing assets
borrowAsset
The borrowAsset
function allows a user to open/increase a borrow position
Borrower must call ERC20.approve
on the Collateral Token contract if applicable
_addCollateral
The _addCollateral
function is an internal implementation for adding collateral to a borrowers position
addCollateral
The addCollateral
function allows the caller to add Collateral Token to a borrowers position
msg.sender must call ERC20.approve() on the Collateral Token contract prior to invocation
RemoveCollateral
The RemoveCollateral
event is emitted when collateral is removed from a borrower's position
_removeCollateral
The _removeCollateral
function is the internal implementation for removing collateral from a borrower's position
removeCollateral
The removeCollateral
function is used to remove collateral from msg.sender's borrow position
msg.sender must be solvent after invocation or transaction will revert
RepayAsset
The RepayAsset
event is emitted whenever a debt position is repaid
_repayAsset
The _repayAsset
function is the internal implementation for repaying a borrow position
The payer must have called ERC20.approve() on the Asset Token contract prior to invocation
repayAsset
The repayAsset
function allows the caller to pay down the debt for a given borrower.
Caller must first invoke ERC20.approve()
for the Asset Token contract
Liquidate
The Liquidate
event is emitted when a liquidation occurs
liquidate
The liquidate
function allows a third party to repay a borrower's debt if they have become insolvent
Caller must invoke ERC20.approve
on the Asset Token contract prior to calling Liquidate()
LeveragedPosition
The LeveragedPosition
event is emitted when a borrower takes out a new leveraged position
leveragedPosition
The leveragedPosition
function allows a user to enter a leveraged borrow position with minimal upfront Collateral
Caller must invoke ERC20.approve()
on the Collateral Token contract prior to calling function
RepayAssetWithCollateral
The RepayAssetWithCollateral
event is emitted whenever repayAssetWithCollateral()
is invoked
repayAssetWithCollateral
The repayAssetWithCollateral
function allows a borrower to repay their debt using existing collateral in contract
Last updated