Reproduced Exploit
Liquid Ron — totalAssets wrong when operatorFeeAmount > 0
1. Operator fee sits in the vault balance and is tracked in operatorFeeAmount. 2. totalAssets() still counts that fee toward share pricing. 3. New depositor mints fewer shares (priced against inflated assets). 4. Operator fetchOperatorFee removes the fee from the vault → totalAssets drops.
Chain
Other
Category
untagged
Date
Jan 2025
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. No backend, no live RPC.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 50051-h-01-the-calculation-of-totalassets-could-be-wrong-if-operat. Standalone Foundry PoC and full write-up: 50051-h-01-the-calculation-of-totalassets-could-be-wrong-if-operat_exp in the
evm-hack-registrymirror.
Vulnerability classes: fee-accounting · arithmetic/precision-loss · data-corruption/accounting-error · loss-of-funds/indirect-loss
Reproduction: self-contained Foundry PoC with only
forge-std— no fork. Full trace: output.txt. PoC: test/50051-h-01-the-calculation-of-totalassets-could-be-wrong-if-operat_exp.sol.
Key info#
| Impact | HIGH — new depositors mint against inflated assets including operator fee; redeem less after fee withdrawal |
| Protocol | Liquid Ron — LiquidRon.totalAssets |
| Vulnerable code | totalAssets() = balance + staked + rewards without subtracting operatorFeeAmount |
| Bug class | Fee included in ERC-4626 asset base |
| Finding | Code4rena 2025-01-liquid-ron · #50051 · H-01 · reporter 0xvd |
| Report | code4rena.com/reports/2025-01-liquid-ron |
| Source | AuditVault |
| Status | Confirmed and mitigated (subtract operatorFeeAmount). |
| Compiler | ^0.8.24 (PoC) |
TL;DR#
- Operator fee sits in the vault balance and is tracked in
operatorFeeAmount. totalAssets()still counts that fee toward share pricing.- New depositor mints fewer shares (priced against inflated assets).
- Operator
fetchOperatorFeeremoves the fee from the vault →totalAssetsdrops. - Depositor redeems less than
previewRedeemat deposit time — loss.
The vulnerable code#
function totalAssets() public view override returns (uint256) {
// @> VULN: operator fee included in asset base
return super.totalAssets() + getTotalStaked() + getTotalRewards();
// FIX: … - operatorFeeAmount;
}
Root cause#
Operator fee is an accounting liability (claimable by operator) but is treated as user-backing assets in the 4626 totalAssets formula.
Preconditions#
operatorFeeAmount > 0(after harvest).- New user deposits, then operator claims fee before user redeems.
Attack walkthrough#
- User1 deposits 100 ETH.
- Harvest books 10 ETH operator fee (balance still holds it).
- User2 deposits 100 ETH while
totalAssetsincludes the 10 fee. - Operator fetches fee.
- User2 redeems → receives strictly less than pre-fee preview.
Diagrams#
Impact#
Consistent dilution of deposits whenever a non-zero operator fee is outstanding; can also make fee irredeemable if vault is emptied.
Taxonomy#
genome: fee-accounting,arithmetic/precision-loss,data-corruption/accounting-error,loss-of-funds/indirect-lossseverity/high·sector/vault·platform/code4rena
Sources#
- AuditVault finding #50051
- Code4rena report 2025-01-liquid-ron
- Repo@commit: code-423n4/2025-01-liquid-ron@e4b0b7c L293–L295
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 50051-h-01-the-calculation-of-totalassets-could-be-wrong-if-operat_exp (evm-hack-registry mirror).
- AuditVault finding: 50051-h-01-the-calculation-of-totalassets-could-be-wrong-if-operat.
Alerts & third-party analyses
These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.