Debt tracked in LendingPool and by DebtToken balanceOf function are different. When borrowing the tokens the user receives the debt tokens and his debt is tracked in LendingPool in userData data structure.
Paste this test file into test/unit/core/pools/LendingPool/LendingPool.test.js and run npx hardhat test test/unit/core/pools/LendingPool/LendingPool.test.js.
Output should look like this
We can see that these values differ from each other. This means that the debt is calculated using incorrect value and the user will have to pay wrong amount of intereset.
The debt is not tracked correctly which leads to a scenario where users has to pay different interest amount than he should in reality.
Manual Review, Hardhat
Fix the debt tracking methods so that they always return the same values and the interest is calculated based on the same values.
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.