Developers
Search…
⌃K

Repay Borrow

The repay function transfers an asset into the protocol, reducing the user's borrow balance.

Qore

function repayBorrow(address qToken, uint amount) external payable;
  • msg.sender: The account which borrowed the asset, and shall repay the borrow.
  • msg.value: (BNB only) The amount of BNB to be repaid, in wei.
  • qToken: The address of the qToken market to repay.
  • amount: The amount of the underlying borrowed asset to be repaid. A value of -1 (i.e
    225612^{256} -1
    ) can be used to repay the full amount only if not BNB.

Solidity

// BNB
Qore qore = Qore(<qoreAddress>);
qore.repayBorrow{ value: <underlyingAmount> }(<qBNBAddress>, <underlyingAmount>);
// Others
Qore qore = Qore(<qoreAddress>);
qore.repayBorrow(<qTokenAddress>, <underlyingAmount>);

Ethers.js

// BNB
const qore = await ethers.getContractAt(<qoreABI>, <qoreAddress>);
await qore.repayBorrow(<qBNBAddress>, <underlyingAmount>, { value: <underlyingAmount> });
// Others
const qore = await ethers.getContractAt(<qoreABI>, <qoreAddress>);
await qore.repayBorrow(<qTokenAddress>, <underlyingAmount>);