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

Qore

1
function repayBorrowBehalf(address qToken, address borrower, uint amount) external payable;
Copied!
  • msg.sender: The account which 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.
  • borrower: The account which borrowed the asset to be repaid.
  • 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.repayBorrowBehalf{ value: <underlyingAmount> }(<qBNBAddress>, <borrower>, <underlyingAmount>);
4
5
// Others
6
Qore qore = Qore(<qoreAddress>);
7
qore.repayBorrowBehalf(<qTokenAddress>, <borrower>, <underlyingAmount>);
Copied!

Ethers.js

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