The updateReserveInterests
is used to update interests rates of the protocol but there are some places where is called unnecessarily.
Here are some instances where this happens :
-> While user deposited using deposit
function it calls to ReserveLibrary.updateReserveState(reserve, rateData);
which then calls to updateReserveInterests
and then calls ReserveLibrary.deposit(reserve, rateData, amount, msg.sender);
which later in the path calls updateReserveInterests
. making updations two times even when not needed
-> same scenario happens in withdraw
function.
-> The depositNFT function calls ReserveLibrary.updateReserveState before processing NFT deposits. However, NFT deposits are used solely as collateral and do not affect the liquidity or interest rate calculations tied to reserve assets.
The root cause is that the same update mechanism used . updating the reserve state in these context is redundant and potentially disruptive. can confuse off chain components based on the events because they are emitted like spamming
Remove the call to updateReserveInterests
where they can be avoided.
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.