Reproduced Exploit
Xyro: withdrawRakeback always reverts and earned XYRO stays in the treasury
withdrawRakeback debits earnedRakeback and calls IERC20Mint.mint, which is declared returns (bool). XyroToken.mint writes the balance and returns no data. The ABI decode reverts, the debit rolls back, and the 1000 XYRO claim stays stuck. A mint that returns true pays the same claim.
Loss
1000 XYRO of earned rakeback cannot be withdrawn
Chain
Other
Category
dependency
Date
Aug 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: 45669-withdrawrakeback-function-will-always-be-failed-zokyo-none-x. Standalone Foundry PoC and full write-up: 45669-withdrawrakeback-function-will-always-be-failed-zokyo-none-x_exp in the
evm-hack-registrymirror.
Vulnerability classes:
vuln/dependency/unsafe-external-call·vuln/dos/frozen-funds
Key info#
| Field | Value |
|---|---|
| Loss | 1000 XYRO of earned rakeback cannot be withdrawn |
| Vulnerable contract | Treasury.withdrawRakeback |
| Attacker EOA | 0x1111111111111111111111111111111111111111 |
| Attack contract | Exploit |
| Attack tx | Exploit.run() |
| Chain / block / date | Local synthetic · 2024-08 |
| Compiler | solc 0.8.27, cancun, via IR |
| Bug class | Mint is called through an interface that expects a bool |
TL;DR#
withdrawRakeback debits earnedRakeback and calls IERC20Mint.mint, which is declared returns (bool). XyroToken.mint writes the balance and returns no data. The ABI decode reverts, the debit rolls back, and the 1000 XYRO claim stays stuck. A mint that returns true pays the same claim.
The vulnerable code#
function withdrawRakeback(uint256 amount) public {
require(earnedRakeback[msg.sender] >= amount, "Amount is greated than earned rakeback");
earnedRakeback[msg.sender] -= amount;
IERC20Mint(address(token)).mint(msg.sender, amount);
}
Drop returns (bool) from the interface so it matches XyroToken.mint.
Root cause#
The treasury and the token disagree on the mint return type. The high-level call requires 32 bytes of returndata that the token never writes.
Preconditions#
- The caller has
earnedRakebackof 1000 XYRO. - The treasury's token is the Xyro token whose mint returns nothing.
Attack walkthrough#
- Credit 1000 XYRO of earned rakeback. The credit event logs that stored balance.
withdrawRakeback(1000)debits the mapping and calls mint.- The call reverts because the returndata is empty.
- The caller still holds 0 XYRO and
earnedRakebackis still 1000.
Diagrams#
Impact#
Every rakeback claim reverts. The 1000 XYRO credited in this run cannot be withdrawn until the interface matches the token.
How to reproduce#
cd 45669-withdrawrakeback-function-will-always-be-failed-zokyo-none-x_exp
forge test -vv
Sources#
- AuditVault finding: https://github.com/Auditware/AuditVault/blob/main/findings/45669-withdrawrakeback-function-will-always-be-failed-zokyo-none-x.md
- Zokyo review: https://github.com/solodit/solodit_content/blob/main/reports/Zokyo/2024-08-29-Xyro.md
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 45669-withdrawrakeback-function-will-always-be-failed-zokyo-none-x_exp (evm-hack-registry mirror).
- AuditVault finding: 45669-withdrawrakeback-function-will-always-be-failed-zokyo-none-x.
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.