Developers
Search…
Supply
The supply function transfers an asset into the protocol, which begins accumulating interest based on the current Supply Rate for the asset. The user receives a quantity of qTokens equal to the underlying tokens supplied, divided by the current Exchange Rate.

Qore

1
function supply(address qToken, uint underlyingAmount) external payable returns (uint);
Copied!
  • msg.sender: The account which shall supply the asset, and own the minted qTokens.
  • msg.value: (BNB only) The amount of BNB to be supplied, in wei.
  • qToken: The address of the qToken market to supply.
  • underlyingAmount: The amount of the asset to be supplied, in units of the underlying asset.
  • RETURN: The qToken amount minted.

Solidity

1
// BNB
2
Qore qore = Qore(<qoreAddress>);
3
uint qBNBAmount = qore.supply{ value: <underlyingAmount> }(<qBNBAddress>, <underlyingAmount>);
4
5
// Others
6
Qore qore = Qore(<qoreAddress>);
7
uint qTokenAmount = qore.supply(<qTokenAddress>, <underlyingAmount>);
Copied!

Ethers.js

1
// BNB
2
const qore = await ethers.getContractAt(<qoreABI>, <qoreAddress>);
3
const qBNBAmount = await qore.supply(<qBNBAddress>, <underlyingAmount>, { value: <underlyingAmount> });
4
5
// Others
6
const qore = await ethers.getContractAt(<qoreABI>, <qoreAddress>);
7
const qTokenAmount = await qore.supply(<qTokenAddress>, <underlyingAmount>);
Copied!
Last modified 2mo ago
Copy link