Developers
Search…
Repay Borrow
The repay function transfers an asset into the protocol, reducing the user's borrow balance.

Qore

1
function repayBorrow(address qToken, uint amount) external payable;
Copied!
  • 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

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

Ethers.js

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