Reproduced Exploit
Groupcoin: launching to Uniswap wraps 1 ETH and leaves 0.001616692 ETH stuck in the factory
launchGroupCoinToUniswapV3 wraps only config.token1Amount. Buying 8,357,110 tokens still clears the launch threshold and pays 1.001616692 ETH. One ETH is wrapped. The other 0.001616692 ETH stays on the factory, and the contract has no withdraw. The control wraps the whole balance and leaves 0.
Loss
0.001616692 ETH left on GroupcoinFactory after launch
Chain
Ethereum
Category
dos
Date
Oct 2024
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. Query opens a search over the trace: previous and next writes, balance changes and calls, breakpoints, and a diff of everything that changed between two steps. No backend, no live RPC.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 41352-h-02-eth-gets-locked-in-the-groupcoinfactory-contract-pashov. Standalone Foundry PoC and full write-up: 41352-h-02-eth-gets-locked-in-the-groupcoinfactory-contract-pashov_exp in the
evm-hack-registrymirror.
Vulnerability classes:
vuln/dos/frozen-funds·vuln/logic/missing-check
Key info#
| Field | Value |
|---|---|
| Loss | 0.001616692 ETH left on GroupcoinFactory after launch |
| Vulnerable contract | GroupcoinFactory.launchGroupCoinToUniswapV3 |
| Attacker EOA | 0x1111111111111111111111111111111111111111 |
| Attack contract | Exploit |
| Attack tx | Exploit.run() |
| Chain / block / date | Ethereum model · block 0 · 2024-10 |
| Compiler | solc 0.8.27, cancun, via IR |
| Bug class | Fixed WETH wrap ignores ETH above config.token1Amount |
TL;DR#
launchGroupCoinToUniswapV3 wraps only config.token1Amount. Buying 8,357,110 tokens still clears the launch threshold and pays 1.001616692 ETH. One ETH is wrapped. The other 0.001616692 ETH stays on the factory, and the contract has no withdraw. The control wraps the whole balance and leaves 0.
Background#
Pashov Audit Group's Groupcoin review, published 2024-10-11, finding H-02. The factory is supposed to put every ETH raised by the bonding curve into the new Uniswap v3 position. The wrap uses a configured constant instead of address(this).balance. The report's modified testLaunchToUniswapV3 buys 8,357,110 tokens and asserts a non-zero factory balance of about 0.001616692 ETH.
The vulnerable code#
// @> VULN: only config.token1Amount is wrapped, so every wei above that stays in the factory with no withdraw
IWETH9(WETH).deposit{ value: config.token1Amount }();
Root cause#
The launch path never reads the factory's ETH balance. Anything the curve collected above config.token1Amount is not wrapped, not sent to the pool, and not recoverable.
Preconditions#
config.token1Amountis 1 ETH in this model.- The buyer pays that amount plus 1,616,692,000,000,000 wei, the dust quoted for an 8,357,110 token buy.
- Launch is allowed once the threshold is reached. No second transaction and no admin call are required.
Attack walkthrough#
- The buyer calls
buywith 1.001616692 ETH for 8,357,110 tokens. - The factory records the full payment. Its native balance is the same number.
launchGroupCoinToUniswapV3wraps exactly 1 ETH.- WETH credits the factory 1 ETH.
- The factory's native balance is 0.001616692 ETH.
- The control wraps
address(this).balanceand finishes at 0.
Diagrams#
Impact#
The factory holds 1,616,692,000,000,000 wei that buyers paid and that the Uniswap position never received. That ETH cannot be withdrawn. The control, which deposits the whole balance, wraps 1.001616692 ETH and leaves the factory empty.
Remediation#
Wrap address(this).balance after the launch checks, or add a sweep for the surplus. The report's note that an onlyOwner sweep assumes a trusted owner is still true. The wrap itself should not leave a remainder.
How to reproduce#
cd 41352-h-02-eth-gets-locked-in-the-groupcoinfactory-contract-pashov_exp
forge test -vv
test_exploit_leaves_1616692000000000_wei_locked asserts the dust and a 1 ETH WETH credit. test_control_wrapping_the_full_balance_leaves_nothing asserts a zero native balance. Captured output is output.txt.
Sources#
- AuditVault finding: https://github.com/Auditware/AuditVault/blob/main/findings/41352-h-02-eth-gets-locked-in-the-groupcoinfactory-contract-pashov.md
- Pashov report: https://github.com/pashov/audits/blob/master/team/md/Groupcoin-security-review.md
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 41352-h-02-eth-gets-locked-in-the-groupcoinfactory-contract-pashov_exp (evm-hack-registry mirror).
- AuditVault finding: 41352-h-02-eth-gets-locked-in-the-groupcoinfactory-contract-pashov.
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.