Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 1.84 KB

File metadata and controls

42 lines (27 loc) · 1.84 KB
description
Users may provide funds to the lending pool in exchange for iTokens, which represent shares in the pool.

Mint

Mint with ERC20

In order to provide funds to the pool, call mint on the respective iToken contract. This will take your deposit and give you iTokens in return. The function retrieves the tokens from the message sender, so make sure to first approve the loan token contract to access your funds.

function mint(address receiver, uint256 depositAmount, bool useLM) external nonpayable nonReentrant globallyNonReentrant 
returns(uint256 minted)

Arguments

NameTypeDescription
receiveraddressthe receiver of the tokens
depositAmountuint256the amount of underlying tokens provided on the loan. (Not the number of loan tokens to mint).
useLMboolif true -> deposit the pool tokens into the Liquidity Mining contract

Returns

The amount of loan tokens minted

Mint with RBTC

In order to provide funds to the RBTC lending pool, call mintWithBTC on the iWRBTC contract. This will take your deposit and give you iWRBTC in return.

function mintWithBTC(address receiver, bool useLM) external payable nonReentrant globallyNonReentrant 
returns(mintAmount uint256)

Arguments

Name Type Description
receiver address the receiver of the tokens
useLM bool if true -> deposit the pool tokens into the Liquidity Mining contract