Reproduced Exploit
Radiant swapWethToRdnt sells RDNT and pays the caller in WETH
swapWethToRdnt is supposed to swap WETH for RDNT. The quoted call passes RDNT_ADDRESS as tokenIn and REAL_WETH_ADDR as tokenOut. Any caller can spend the helper's RDNT inventory and receive WETH. In the PoC that is 100 WETH out and 100 RDNT gone. The control passes WETH then RDNT, so the same inven…
Loss
100 WETH paid to a permissionless caller while 100 RDNT of helper inventory is sold
Chain
Ethereum
Category
logic
Date
Undated
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
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.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 31661-c-01-incorrect-token-order-passed-for-weth-rdnt-swaps-pashov. Standalone Foundry PoC and full write-up: 31661-c-01-incorrect-token-order-passed-for-weth-rdnt-swaps-pashov_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/logic/wrong-order · vuln/logic/wrong-condition
Key info#
| Field | Value |
|---|---|
| Loss | 100 WETH paid to a permissionless caller while 100 RDNT of helper inventory is sold |
| Vulnerable contract | BalancerPoolHelper.swapWethToRdnt |
| Attacker EOA | 0x1111111111111111111111111111111111111111 |
| Attack contract | Exploit |
| Attack tx | Exploit.run() |
| Chain / block / date | Ethereum model · block 0 · 1970-01 |
| Compiler | solc 0.8.27, cancun, via IR |
| Bug class | Input and output tokens are reversed on the WETH to RDNT swap |
TL;DR#
swapWethToRdnt is supposed to swap WETH for RDNT. The quoted call passes RDNT_ADDRESS as tokenIn and REAL_WETH_ADDR as tokenOut. Any caller can spend the helper's RDNT inventory and receive WETH. In the PoC that is 100 WETH out and 100 RDNT gone. The control passes WETH then RDNT, so the same inventory is untouched and the caller receives RDNT.
Background#
Pashov Audit Group, Radiant. BalancerPoolHelper.swapWethToRdnt builds a Balancer swap on the WETH/RDNT pool and sets the recipient to msg.sender. The report's diff swaps the first two arguments of _swap.
The vulnerable code#
amountOut = this._swap(RDNT_ADDRESS, REAL_WETH_ADDR, _wethAmount, _minAmountOut, WETH_RDNT_POOL_ID, msg.sender);
_swap transfers tokenIn from the helper into the pool and asks the pool to pay tokenOut to the recipient.
Root cause#
The argument order does not match the function name. WETH is never pulled. RDNT is. The pool then sends WETH to the caller. A zero minAmountOut does not stop it.
Preconditions#
- The helper holds RDNT (here, 100).
- The pool can pay the same amount of WETH.
swapWethToRdntis callable without an admin check.
Attack walkthrough#
- The helper is seeded with 100 RDNT. The pool holds 1000 of each token.
- The caller invokes
swapWethToRdnt(100, 0)and does not send WETH. _swaptransfers 100 RDNT from the helper into the pool.- The pool transfers 100 WETH to the caller.
- The helper's RDNT balance is 0.
Diagrams#
Impact#
The caller is paid 100 WETH that the swap was not supposed to send, and the protocol's 100 RDNT inventory is sold. The corrected order spends WETH that was deposited for the swap and leaves the RDNT inventory at 100.
Remediation#
Pass WETH as tokenIn and RDNT as tokenOut, matching the report diff:
_swap(wethAddr, RDNT_ADDRESS, _wethAmount, _minAmountOut, WETH_RDNT_POOL_ID, msg.sender);
How to reproduce#
cd 31661-c-01-incorrect-token-order-passed-for-weth-rdnt-swaps-pashov_exp
forge test -vv
test_reversed_swap_pays_weth_from_rdnt_inventory asserts the caller received 100 WETH and the helper's RDNT is 0. test_control_weth_in_rdnt_out_keeps_inventory asserts the RDNT inventory is unchanged and the caller received 100 RDNT instead of WETH.
Sources#
- AuditVault finding: https://github.com/Auditware/AuditVault/blob/main/findings/31661-c-01-incorrect-token-order-passed-for-weth-rdnt-swaps-pashov.md
- Report: https://github.com/pashov/audits/blob/master/team/md/Radiant-security-review.md
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 31661-c-01-incorrect-token-order-passed-for-weth-rdnt-swaps-pashov_exp (evm-hack-registry mirror).
- AuditVault finding: 31661-c-01-incorrect-token-order-passed-for-weth-rdnt-swaps-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.