Skip to content
Smart contracts Audit finding Intermediate

Stargate eth strategy rounding bug

The Stargate ETH strategy rounds deposits down to a multiple of 1e12 wei but records the full requested amount as allocated. A withdrawal of a non-aligned amount then reverts because the strategy expects more WETH than was actually deposited, permanently locking the funds.

LogicalJosselyn798 Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

57545 sc medium stargate eth strategy rounding bug

Submitted on Oct 27th 2025 at 05:58:51 UTC by @LogicalJosselyn798 for Audit Comp | Alchemix V3

Description

Brief/Intro

The Stargate ETH strategy (src/strategies/optimism/StargateEthPoolStrategy.sol) rounds deposits down to the nearest 1e12 wei but still reports the full requested amount as allocated. During withdrawal, the strategy insists that the original amount of WETH is present. Because only the rounded “truncated” amount was deposited (and the dust remains as raw ETH), any withdrawal for a non-1e12-aligned amount reverts. A single misaligned allocation permanently bricks the strategy, freezing all funds assigned to it.

Impact Details

  • Impact type: Permanent freezing of funds.
  • Loss surface: Once a misaligned amount is allocated, neither the vault nor any user can withdraw the associated funds; the strategy becomes unusable.
  • Severity: High; assets are locked forever with a single transaction.

References

  • Code: src/strategies/optimism/StargateEthPoolStrategy.sol
  • PoC: src/test/strategies/StargateEthPoolStrategy.t.sol (testDeallocateRevertsDueToRoundingDust)
  • Run: forge test --match-test testDeallocateRevertsDueToRoundingDust

Link to Proof of Concept

https://gist.github.com/therzv/0b38dfe2f0da270c1c191fcc819531b5

Proof of Concept

Proof of Concept

The exploit is reproduced by src/test/strategies/StargateEthPoolStrategy.t.sol:

Bash
forge test --match-test testDeallocateRevertsDueToRoundingDust

Test outline:

  1. Mint 1 ether + 123 wei of mock WETH to the strategy.
  2. Call _allocate; only 1 ether is deposited after rounding.
  3. Attempt _deallocate for the original amount.
  4. The call reverts with Strategy balance is less than the amount needed, proving the strategy is bricked.

PoC Gist: https://gist.github.com/therzv/0b38dfe2f0da270c1c191fcc819531b5

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

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 strategy records the requested allocation amount rather than the rounded amount actually deposited, so its accounting and its real balance diverge by the truncated dust.

Impact

A single misaligned allocation could permanently freeze all funds assigned to the strategy, since neither the vault nor any user can withdraw them.

What the attacker needed

Strategy receives a non-1e12-aligned amount

How it was found

  1. Mint a mock WETH amount that is not a multiple of 1e12 wei to the strategy.
  2. Call the allocate function, which deposits only the rounded-down amount.
  3. Attempt to deallocate the original, unrounded amount.
  4. The call reverts because the strategy balance is less than the amount needed.

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 strategy is a contract that puts money to work elsewhere. It quietly rounds the amount it sends down to a whole number of tiny units, but still writes down the bigger number as if all of it was sent. Later, when someone asks for that bigger number back, the contract checks its own balance, sees it is short by a few wei (the smallest unit of ether), and refuses, so the money stays stuck.

What is Smart contracts?

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

More from Alchemix V3

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.