In the LendingPool contract the functions _depositIntoVault
and _withdrawFromVault
are executed to rebalance and ensure liquidity, the problem is that they deposit and withdraw funds from the LendingPool which is not supposed to have those funds, the liquidity is actually held by the reserveRTokenAddress
.
This issue was overlooked because in the LendingPool tests the curve vault address is never set and both _ensureLiquidity
and _rebalanceLiquidity
have the following condition:
Because of this early return _depositIntoVault
and _withdrawFromVault
were never executed during the tests
By modifing one of the tests in the LendingPool.test.js file we can see that the funds held by the LendingPool are zero, and thus no deposit can be made from this address:
_rebalanceLiquidity
will always revert, thus borrow
, deposit
and withdraw
will always revert.
Manual review + Hardhat test
Send the funds from reserveRTokenAddress to the LendingPool before deposit, and from the LendingPool back to the reserveRTokenAddress after withdrawal.
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.