description |
---|
Users may provide funds to the lending pool in exchange for iTokens, which represent shares in the pool. |
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
Name | Type | Description |
---|---|---|
receiver | address | the receiver of the tokens |
depositAmount | uint256 | the amount of underlying tokens provided on the loan. (Not the number of loan tokens to mint). |
useLM | bool | if true -> deposit the pool tokens into the Liquidity Mining contract |
Returns
The amount of loan tokens minted
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 |