EIP violation for `totalAssets()` in the `Vault`
The Vault's totalAssets() function can revert because it calls getPendingInterest(), which wraps an interest calculation in a try/catch that requires a minimum amount of gas in the catch block. This breaks the ERC-4626 rule that totalAssets() must not revert, so callers relying on it may fail.
Source: https://github.com/sherlock-audit/2025-12-monolith-stablecoin-factory-judging/issues/820
This issue has been acknowledged by the team but won't be fixed at this time.
Found by
0xeix, axelot, desaperh, magickenn, typicalHuman
Summary
According to the contest README:
Issues that break the EIP's MUST statements may be deemed valid Medium severity (even if the violation is in view functions and doesn't impact state functions) even if the impact is low/info, unless they conflict with common sense.
But totalAssets() can revert because of its call to getPendingInterest() function.
Root Cause
EIP4626 has the following statement regarding totalAssets():
MUST NOT revert
However, it's not respected in the current implementation.
Internal Pre-conditions
External Pre-conditions
Attack Path
totalAssets() function in the Vault calls getPendingInterest() in the Lender contract that, in its turn, calls calculateInterest() inside of the try/catch mechanism meaning the function is prone to reverts due to different errors (like division by zero or some other type of error) and, inside of the catch block, the function checks whether the call was with sufficient gas:
} catch {
require(gasBefore >= INTEREST_CALCULATION_GAS_REQUIREMENT, "Not enough gas for accrueInterest");
}
The value is set to 40000 gas and it won't have to require that amount if it didn't happen to revert in the first place. So if users doesn't provide more gas than estimated by RPC, the call will revert.
Impact
EIP violation -> medium severity.
PoC
Provided in the attack path.
Mitigation
Change the implementation so that totalAssets() can't revert.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the interest calculation is wrapped in a try/catch whose catch block requires a minimum gas amount, so a failed or under-funded call makes totalAssets() revert instead of returning a value.
Impact
The vault violates the ERC-4626 requirement that totalAssets() must not revert, which the contest rules treat as a medium-severity issue even though it is a view function.
What the attacker needed
Caller supplies less gas than estimated
The fix
The implementation should be changed so that totalAssets() cannot revert, for example by not letting the interest calculation's failure propagate.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A vault is a smart contract that holds users' tokens and reports how much it holds through a function called totalAssets(). A widely used standard for such vaults says that function must never fail. Here it can fail, because it depends on another calculation that can run out of gas or hit an error, so anything that reads the vault's total may break.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.