A user's debt in LendingPool can be paid in 2 ways:
Calling repay function
Calling repayonBehalft function
Both of them call _repay
function which have the following comments above it:
So, the comments say that If onBehalfOf is set to address(0), the function defaults to repaying the caller's own debt.
which is wrong, because we see that the code has this check if (onBehalfOf == address(0)) revert AddressCannotBeZero();
so, everything that is written in that comment is wrong, and the function will revert in the case that the address onBehalfOf is address(0).
Which also means that if the user wanted to pay their own debt via calling repayOnBehalf
with address(0) passed as onBehalfOf param, the function will revert. See repayOnBehalf function for reference:
Code is not doing what it's supposed to do, causing confusion and impacting user experience.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.