Reproduced Exploit

A failed reward send still consumes the remainder

receiveRewards computes each whitelist share, subtracts it from remain, and then sends it. The quoted code subtracts first. A member that rejects ETH leaves the coins in the contract, and remain no longer includes them, so the later forward of remain does not move them.

Undated•Ethereum•logic•2 min read

Loss

100 of rewards stays in the contract. remain is already 0, so the failed share is not forwarded

Chain

Ethereum

Category

logic

Date

Undated

Source

AuditVault

EVM Playground

Source-level debugger — step opcodes and Solidity in sync

evm-hack-analyzer

The attack replays in your browser. Step through it by Solidity line or by opcode.

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.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 50856-unaccounted-funds-in-rewards-distribution-logic-halborn-core. Standalone Foundry PoC and full write-up: 50856-unaccounted-funds-in-rewards-distribution-logic-halborn-core_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/logic/failed-transfer · vuln/defi/reward-accounting

Key info#

FieldValue
Loss100 of rewards stays in the contract. remain is already 0, so the failed share is not forwarded
Vulnerable contractRewards.receiveRewards
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit at 0x15452ec016c4dc8c549e7fe6ff4b26324ea8b7a4
Attack txExploit.run() with value 100
Chain / block / dateEthereum model · block 0 · 1970-01
Compilersolc 0.8.27, cancun, via IR
Bug classremain is reduced before send, and a failed send does not restore it
flowchart TD A["receiveRewards is called with 100"] --> B["remain is reduced by the member's share before the send"] B --> C["The member rejects the ETH"] C --> D["VULN remain is 0 and the contract still holds 100"] B --> E["Control restores remain when the send fails"] E --> F["The 100 is forwarded to the foundation"]

TL;DR#

receiveRewards computes each whitelist share, subtracts it from remain, and then sends it. The quoted code subtracts first. A member that rejects ETH leaves the coins in the contract, and remain no longer includes them, so the later forward of remain does not move them.

A call with 100 and one member who rejects it ends with remain 0 and 100 still in the contract. The control restores remain on failure and forwards that 100 to the foundation. The contract is left empty.

The finding has no month, so the date marker is 1970-01.

The vulnerable code#

SOLIDITY
remain -= share;
(bool ok,) = member.call{value: share}("");
failed = !ok;
stuck = address(this).balance; // @> VULN: the failed share was already removed from remain

Impact#

The member's 100 is neither delivered nor left in remain. It sits in the contract outside the distribution that was supposed to assign it.

How to reproduce#

BASH
cd 50856-unaccounted-funds-in-rewards-distribution-logic-halborn-core_exp
forge test -vv

test_exploit_failed_send_leaves_100_unaccounted asserts remain 0 and a balance of 100. test_control_failed_send_forwards_the_remainder asserts the foundation receives 100 and the contract is empty.

Sources#


Sources & further analysis#

Reproductions & code

Alerts & third-party analyses

  • Web3Sec X hacked database: search.
  • Rekt leaderboard: search.
  • Solodit incident search: search.

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.