Skip to content
Smart contracts Audit finding Intermediate

Incorrect implementation of `ERC4626ViewAdjustor`

The ERC4626ViewAdjustor contract swapped the implementations of toNominal and toReal, so conversions between real and nominal token values were reversed. An attacker could exploit this to make users deposit more tokens than intended, causing loss of funds.

Ziusz Follow with bretzel, h2134 and 1 other

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-04-burve-judging/issues/113

Found by

Ziusz, bretzel, h2134, newspacexyz

Summary

Adjustor contracts have 2 main functions which are toNominal and toReal, which convert between real and nominal values of a token.

ERC4626ViewAdjustor is an implementation for LSTs such as stETH. However, the implementation of toNominal and toReal is incorrect within this contract. Here's code snippets:

Solidity
    function toNominal(
        address token,
        uint256 real,
        bool
    ) external view returns (uint256 nominal) {
        IERC4626 vault = getVault(token);
        return vault.convertToShares(real);
    }

    function toReal(
        address token,
        uint256 nominal,
        bool
    ) external view returns (uint256 real) {
        IERC4626 vault = getVault(token);
        return vault.convertToAssets(nominal);
    }

The goal of toNominal is to convert a real value to a nominal value, such as converting stETH balance in ETH. In vice versa, toReal is to convert a nominal value to a real value, such as converting ETH to stETH.

But as shown in the code snippets above, the implementation of toNominal and toReal is reversed, as toNominal is using convertToShares and toReal is using convertToAssets.

Root Cause

The root cause of the issue is in ERC4626ViewAdjustor contract where the implementation of toNominal and toReal is reversed.

Internal Pre-conditions

One of LSTs is used in multi-token pool with ERC4626ViewAdjustor as the adjustor.

External Pre-conditions

None

Attack Path

  • Assume, stETH and WETH are used in the pool, and 1 stETH = 1.1 WETH.
  • Alice adds 100 value worth of tokens to the pool, which eventually will require 100 WETH and 100 WETH worth of stETH.
  • However, as toReal function which is used to calculate the amount of stETH uses convertToAssets, the amount of stETH to deposit becomes 110 stETH instead of 100/1.1 stETH.

Impact

Loss of funds for users as they deposit more than they should.

PoC

No response

Mitigation

The fix is to reverse the implementation of toNominal and toReal in ERC4626ViewAdjustor contract.

Discussion

sherlock-admin2

The protocol team fixed this issue in the following PRs/commits: https://github.com/itos-finance/Burve/commit/c14995d806cdabc20bfedb094d585ed7b8668c8c

The original report as published on Sherlock, by Ziusz. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

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

The functions toNominal and toReal were implemented with swapped conversion logic: toNominal used convertToShares instead of convertToAssets, and toReal used convertToAssets instead of convertToShares.

Impact

Users could lose funds because they deposit more tokens than they should.

What the attacker needed

One LST used in a multi-token pool; ERC4626ViewAdjustor is the adjustor

The fix

The fix is to reverse the implementation of toNominal and toReal in the ERC4626ViewAdjustor contract; the protocol team fixed this issue.

How it was found

  1. Assume stETH and WETH are used in the pool, and 1 stETH = 1.1 WETH.
  2. Alice adds 100 value worth of tokens to the pool, which requires 100 WETH and 100 WETH worth of stETH.
  3. Because toReal uses convertToAssets, the amount of stETH to deposit becomes 110 stETH instead of 100/1.1 stETH.

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.

This report is about a smart contract that helps a pool handle tokens like stETH, which represent staked ETH. The contract has two functions meant to convert between the actual token amount and a nominal value, but they were swapped. As a result, when someone deposited, the pool asked for too many tokens, so users lost money.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More by Ziusz

View all

2 more disclosed reports, best first.

More from Burve

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.