Skip to content
Verified contractExactMIT

NftHalfFloorShop

Address0xaebff89c9c59dee2ba2b614c94b9a0406f968130
Balance

0 ETH

 

Transactions

4

 

Compiler

solc 0.8.20

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.20+commit.a1b79de6
Language
solidity
Optimization
Yes, 200 runs
EVM version
shanghai
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,072,162
Creation transaction
0x005179379a…6176be1417

src/NftHalfFloorShop.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

interface IERC721 {
    function ownerOf(uint256 tokenId) external view returns (address);
    function transferFrom(address from, address to, uint256 tokenId) external;
}

/// @title Multi-collection NFT shop
/// @notice Anyone can buy a deposited ERC-721 at the collection's listed price.
///         ETH is paid to the seller in the buy transaction. The seller can
///         reclaim unsold tokens and set / update collection prices.
///
/// Prices are 50% of live floors as of 2026-09-28:
/// - Persona 0xbAbaFdd8...  floor 0.0082  -> 0.0041 ETH
/// - CNP Jobs 0xc4FeDAF6... floor 0.0027  -> 0.00135 ETH
/// - PD5 0x6740CE1b...      floor 0.014   -> 0.007 ETH
/// - Animus 0xEc99492d...   floor 0.0105  -> 0.00525 ETH
contract NftHalfFloorShop {
    address public constant SELLER = 0x02DCD01d534477b5e76628A7284e7FA71C7A7Ed7;

    mapping(address => uint256) public priceOf;

    error NotSeller();
    error NoPrice();
    error WrongPrice();
    error NotHeld();
    error EthTransferFailed();

    event PriceSet(address indexed nft, uint256 price);
    event Sold(address indexed nft, uint256 indexed tokenId, address indexed buyer, uint256 price);
    event Reclaimed(address indexed nft, uint256 indexed tokenId);

    constructor() {
        priceOf[0xbAbaFdd8045740449a42B788a26E9b3A32F88aC1] = 0.0041 ether;
        priceOf[0xc4FeDaF6f2B6B900f5d5F8b702aa09D9BdBFDC21] = 0.00135 ether;
        priceOf[0x6740ce1bDBbFAD351Ec6232faa8c110eBEae36Bf] = 0.007 ether;
        priceOf[0xEC99492DD9EF8cA48f691acd67D2c96A0a43935f] = 0.00525 ether;
    }

    function setPrice(address nft, uint256 price) external {
        if (msg.sender != SELLER) revert NotSeller();
        priceOf[nft] = price;
        emit PriceSet(nft, price);
    }

    function buy(address nft, uint256 tokenId) external payable {
        uint256 price = priceOf[nft];
        if (price == 0) revert NoPrice();
        if (msg.value != price) revert WrongPrice();
        if (IERC721(nft).ownerOf(tokenId) != address(this)) revert NotHeld();

        IERC721(nft).transferFrom(address(this), msg.sender, tokenId);

        (bool ok,) = SELLER.call{value: msg.value}("");
        if (!ok) revert EthTransferFailed();
        emit Sold(nft, tokenId, msg.sender, msg.value);
    }

    function reclaim(address nft, uint256 tokenId) external {
        if (msg.sender != SELLER) revert NotSeller();
        if (IERC721(nft).ownerOf(tokenId) != address(this)) revert NotHeld();

        IERC721(nft).transferFrom(address(this), SELLER, tokenId);
        emit Reclaimed(nft, tokenId);
    }

    function onERC721Received(address, address, uint256, bytes calldata)
        external
        pure
        returns (bytes4)
    {
        return 0x150b7a02;
    }
}
Compiler settingsShow
{
  "viaIR": false,
  "metadata": {
    "appendCBOR": true,
    "bytecodeHash": "ipfs",
    "useLiteralContent": false
  },
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "shanghai"
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.