Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: low
Invalid

updateReserveInterests will silently fail following deposit flow

In this flow LiquidityPool::deposit => ReserveLibrary::deposit => updateInterestRatesAndLiquidity => updateReserveInterests will silently fail. Because, at the beginning of ReserveLibrary::deposit, updateReserveInterests is called:

function deposit(
ReserveData storage reserve,
ReserveRateData storage rateData,
uint256 amount,
address depositor
) internal returns (uint256 amountMinted) {
if (amount < 1) revert InvalidAmount();
// Update reserve interests
updateReserveInterests(reserve, rateData);

Then, at the end of updateInterestRatesAndLiquidity updateReserveInterests is called once again.

// Update the reserve interests
updateReserveInterests(reserve, rateData);

But due to the following lines in updateReserveInterests

function updateReserveInterests(
ReserveData storage reserve,
ReserveRateData storage rateData
) internal {
uint256 timeDelta = block.timestamp -
uint256(reserve.lastUpdateTimestamp);
if (timeDelta < 1) {
return;
}
...
...
// Update the last update timestamp
reserve.lastUpdateTimestamp = uint40(block.timestamp);

Since timeDelta is still the same, this call will silently fail.

Recommendation

Remove the second call

Updates

Lead Judging Commences

inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!