The LendingPool attempts to deposit reserve assets into Curve once it is above a particular threshold, _depositIntoVault
function assumes that the reserve assets are held by the lending pool contract when attempting to deposit into Curve. However, the assets are actually held by RToken. This misalignment causes deposit attempts to fail, effectively breaking core protocol functionality.
The _rebalanceLiquidity function correctly checks the balance in the RToken contract and calls _depositIntoVaultif the current balance is greater than the desired balance.
However, _depositIntoVault attempts to:
Approve spending from the lending pool contract
Deposit tokens from the lending pool contract
The deposit transactions will always fail as Curve Vault will attempt to transfer the deposited tokens from the msg.sender
Here is an implementation of the deposit function from Curve Vault docs.
All deposits to Curve vault will fail
Protocol cannot optimize yield through Curve strategy
Key functions (deposit, withdraw, borrow) will revert when attempting to rebalance once Curve vault is set
Manual code review
The lending pool should first withdraw from RTokenbefore depositing to Curve
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.