Repay Borrow Behalf

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

Qore

function repayBorrowBehalf(address qToken, address borrower, uint amount) external payable;
  • 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.

Solidity

// BNB
Qore qore = Qore(<qoreAddress>);
qore.repayBorrowBehalf{ value: <underlyingAmount> }(<qBNBAddress>, <borrower>, <underlyingAmount>);

// Others
Qore qore = Qore(<qoreAddress>);
qore.repayBorrowBehalf(<qTokenAddress>, <borrower>, <underlyingAmount>);

Ethers.js

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

// Others
const qore = await ethers.getContractAt(<qoreABI>, <qoreAddress>);
await qore.repayBorrowBehalf(<qTokenAddress>, <borrower>, <underlyingAmount>);

Last updated