3.1 Flip Token Contracts
Each token market is structured as a smart contract that implements the ERC-20 token specification. User balances are represented as FLIP balances; users can mint (minimum quantity) FLIP by supplying assets to the market, or exchange (minimum quantity) FLIP for the underlying asset. The price (exchange rate) between FLIP and the underlying asset increases over time, as borrowers of the asset accrue interest, and is equal to:
As the total market loan balance increases (based on the borrower's interest accrual), the the exchange rate between FLIP and the underlying asset increases.
Function ABI
Description
mint(uint256 amountUnderlying)
Transfers an underlying asset into the market, updates msg.sender’s FLIP balance.
borrow(uint amount)
Checks msg.sender collateral value, and if sufficient, transfers the underlying asset out of the market to msg.sender, and updates msg.sender’s borrow balance.
repayBorrow(uint amount) repayBorrowBehalf(address account, uint amount)
Transfers the underlying asset into the market, updates the borrower’s borrow balance.
liquidate(address borrower, address collateralAsset, uint closeAmount)
Transfers the underlying asset into the market, updates the borrower’s borrow balance, then transfers cToken collateral from the borrower to msg.sender
Last updated
Was this helpful?