false
true
0

Contract Address Details

0x0047D1712D60168FfE559f9569Da504c359637a9

Contract Name
FoundationMarketWrapper
Creator
0xce0f3d–491b83 at 0x464e05–d8c269
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
Fetching transactions...
Transfers
Fetching transfers...
Gas Used
Fetching gas used...
Last Balance Update
25855376
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
FoundationMarketWrapper




Optimization enabled
true
Compiler version
v0.8.5+commit.a4f2e591




Optimization runs
999999
EVM Version
berlin




Verified at
2025-12-09T06:45:13.185927Z

Constructor Arguments

000000000000000000000000a7d94560dbd814af316dd96fde78b9136a977d1c

Arg [0] (address) : 0xa7d94560dbd814af316dd96fde78b9136a977d1c

              

contracts/market-wrapper/FoundationMarketWrapper.sol

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

// ============ External Imports ============
import {IFoundationMarket} from "../external/interfaces/IFoundationMarket.sol";

// ============ Internal Imports ============
import {IMarketWrapper} from "./IMarketWrapper.sol";

/**
 * @title FoundationMarketWrapper
 * @author Anna Carroll
 * @notice MarketWrapper contract implementing IMarketWrapper interface
 * according to the logic of Foundation's NFT Market
 * Original Foundation NFT Market code: https://etherscan.io/address/0xa7d94560dbd814af316dd96fde78b9136a977d1c#code
 */
contract FoundationMarketWrapper is IMarketWrapper {
    // ============ Internal Immutables ============

    IFoundationMarket internal immutable market;

    // ======== Constructor =========

    constructor(address _foundationMarket) {
        market = IFoundationMarket(_foundationMarket);
    }

    // ======== External Functions =========

    /**
     * @notice Determine whether there is an existing auction
     * for this token on the market
     * @return TRUE if the auction exists
     */
    function auctionExists(uint256 auctionId)
        public
        view
        override
        returns (bool)
    {
        // line 219 of NFTMarketReserveAuction, logic within placeBid() function (not exposed publicly)
        IFoundationMarket.ReserveAuction memory _auction =
            market.getReserveAuction(auctionId);
        return _auction.amount != 0;
    }

    /**
     * @notice Determine whether the given auctionId is
     * an auction for the tokenId + nftContract
     * @return TRUE if the auctionId matches the tokenId + nftContract
     */
    function auctionIdMatchesToken(
        uint256 auctionId,
        address nftContract,
        uint256 tokenId
    ) public view override returns (bool) {
        return auctionId == market.getReserveAuctionIdFor(nftContract, tokenId);
    }

    /**
     * @notice Query the current highest bidder for this auction
     * @return highest bidder
     */
    function getCurrentHighestBidder(uint256 auctionId)
        external
        view
        override
        returns (address)
    {
        // line 279 of NFTMarketReserveAuction, getMinBidAmount() function
        IFoundationMarket.ReserveAuction memory _auction =
            market.getReserveAuction(auctionId);
        return _auction.bidder;
    }

    /**
     * @notice Calculate the minimum next bid for this auction
     * @return minimum bid amount
     */
    function getMinimumBid(uint256 auctionId)
        external
        view
        override
        returns (uint256)
    {
        // line 279 of NFTMarketReserveAuction, getMinBidAmount() function
        return market.getMinBidAmount(auctionId);
    }

    /**
     * @notice Submit bid to Market contract
     */
    function bid(uint256 auctionId, uint256 bidAmount) external override {
        // line 217 of NFTMarketReserveAuction, placeBid() function
        (bool success, bytes memory returnData) =
            address(market).call{value: bidAmount}(
                abi.encodeWithSignature("placeBid(uint256)", auctionId)
            );
        require(success, string(returnData));
    }

    /**
     * @notice Determine whether the auction has been finalized
     * @return TRUE if the auction has been finalized
     */
    function isFinalized(uint256 auctionId)
        external
        view
        override
        returns (bool)
    {
        // line 266 of NFTMarketReserveAuction,
        // the auction is deleted at the end of the finalizeReserveAuction() function
        // since we checked that the auction DID exist when we deployed the partyBid,
        // if it no longer exists that means the auction has been finalized.
        return !auctionExists(auctionId);
    }

    /**
     * @notice Finalize the results of the auction
     */
    function finalize(uint256 auctionId) external override {
        // line 260 of finalizeReserveAuction, finalizeReserveAuction() function
        // will revert if auction has not started or still in progress
        market.finalizeReserveAuction(auctionId);
    }
}
        

/

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

interface IFoundationMarket {
    struct ReserveAuction {
        address nftContract;
        uint256 tokenId;
        address payable seller;
        uint256 duration;
        uint256 extensionDuration;
        uint256 endTime;
        address payable bidder;
        uint256 amount;
    }

    function getMinBidAmount(uint256 auctionId) external view returns (uint256);

    function placeBid(uint256 auctionId) external payable;

    function getReserveAuction(uint256 auctionId)
        external
        view
        returns (ReserveAuction memory);

    function getReserveAuctionIdFor(address nftContract, uint256 tokenId)
        external
        view
        returns (uint256);

    function finalizeReserveAuction(uint256 auctionId) external;
}
          

/

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

/**
 * @title IMarketWrapper
 * @author Anna Carroll
 * @notice IMarketWrapper provides a common interface for
 * interacting with NFT auction markets.
 * Contracts can abstract their interactions with
 * different NFT markets using IMarketWrapper.
 * NFT markets can become compatible with any contract
 * using IMarketWrapper by deploying a MarketWrapper contract
 * that implements this interface using the logic of their Market.
 *
 * WARNING: MarketWrapper contracts should NEVER write to storage!
 * When implementing a MarketWrapper, exercise caution; a poorly implemented
 * MarketWrapper contract could permanently lose access to the NFT or user funds.
 */
interface IMarketWrapper {
    /**
     * @notice Determine whether there is an existing auction
     * for this token on the underlying market
     * @return TRUE if the auction exists
     */
    function auctionExists(uint256 auctionId) external view returns (bool);

    /**
     * @notice Determine whether the given auctionId is
     * an auction for the tokenId + nftContract
     * @return TRUE if the auctionId matches the tokenId + nftContract
     */
    function auctionIdMatchesToken(
        uint256 auctionId,
        address nftContract,
        uint256 tokenId
    ) external view returns (bool);

    /**
     * @notice Calculate the minimum next bid for this auction
     * @return minimum bid amount
     */
    function getMinimumBid(uint256 auctionId) external view returns (uint256);

    /**
     * @notice Query the current highest bidder for this auction
     * @return highest bidder
     */
    function getCurrentHighestBidder(uint256 auctionId)
        external
        view
        returns (address);

    /**
     * @notice Submit bid to Market contract
     */
    function bid(uint256 auctionId, uint256 bidAmount) external;

    /**
     * @notice Determine whether the auction has been finalized
     * @return TRUE if the auction has been finalized
     */
    function isFinalized(uint256 auctionId) external view returns (bool);

    /**
     * @notice Finalize the results of the auction
     */
    function finalize(uint256 auctionId) external;
}
          

Compiler Settings

{"remappings":[],"optimizer":{"runs":999999,"enabled":true},"metadata":{"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"berlin","compilationTarget":{"contracts/market-wrapper/FoundationMarketWrapper.sol":"FoundationMarketWrapper"}}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_foundationMarket","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"auctionExists","inputs":[{"type":"uint256","name":"auctionId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"auctionIdMatchesToken","inputs":[{"type":"uint256","name":"auctionId","internalType":"uint256"},{"type":"address","name":"nftContract","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"bid","inputs":[{"type":"uint256","name":"auctionId","internalType":"uint256"},{"type":"uint256","name":"bidAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"finalize","inputs":[{"type":"uint256","name":"auctionId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getCurrentHighestBidder","inputs":[{"type":"uint256","name":"auctionId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMinimumBid","inputs":[{"type":"uint256","name":"auctionId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isFinalized","inputs":[{"type":"uint256","name":"auctionId","internalType":"uint256"}]}]
              

Contract Creation Code

0x60a060405234801561001057600080fd5b506040516109b03803806109b083398101604081905261002f91610044565b60601b6001600160601b031916608052610074565b60006020828403121561005657600080fd5b81516001600160a01b038116811461006d57600080fd5b9392505050565b60805160601c6108fb6100b5600039600081816101800152818161022601528181610316015281816103e701528181610472015261061501526108fb6000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80633c0868f01161005b5780633c0868f0146100e0578063456b09c1146100f3578063598647f81461012b57806397e2d3801461013e57600080fd5b806305261aea146100825780630600d4eb1461009757806333727c4d146100bd575b600080fd5b610095610090366004610777565b610151565b005b6100aa6100a5366004610777565b6101f4565b6040519081526020015b60405180910390f35b6100d06100cb366004610777565b6102bb565b60405190151581526020016100b4565b6100d06100ee366004610777565b6102cd565b610106610101366004610777565b61039e565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100b4565b6100956101393660046107e1565b61046d565b6100d061014c3660046107a9565b6105c6565b6040517f7430e0c6000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690637430e0c690602401600060405180830381600087803b1580156101d957600080fd5b505af11580156101ed573d6000803e3d6000fd5b5050505050565b6040517f47e35740000000000000000000000000000000000000000000000000000000008152600481018290526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906347e357409060240160206040518083038186803b15801561027d57600080fd5b505afa158015610291573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b59190610790565b92915050565b60006102c6826102cd565b1592915050565b6040517f9e79b41f00000000000000000000000000000000000000000000000000000000815260048101829052600090819073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690639e79b41f906024016101006040518083038186803b15801561035957600080fd5b505afa15801561036d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061039191906106ab565b60e0015115159392505050565b6040517f9e79b41f00000000000000000000000000000000000000000000000000000000815260048101829052600090819073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690639e79b41f906024016101006040518083038186803b15801561042a57600080fd5b505afa15801561043e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046291906106ab565b60c001519392505050565b6000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1683856040516024016104bb91815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f9979ef45000000000000000000000000000000000000000000000000000000001790525161053c9190610803565b60006040518083038185875af1925050503d8060008114610579576040519150601f19603f3d011682016040523d82523d6000602084013e61057e565b606091505b50915091508181906101ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105bd919061081f565b60405180910390fd5b6040517f2ab2b52b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152602482018390526000917f000000000000000000000000000000000000000000000000000000000000000090911690632ab2b52b9060440160206040518083038186803b15801561065957600080fd5b505afa15801561066d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106919190610790565b9093149392505050565b80516106a6816108a0565b919050565b60006101008083850312156106bf57600080fd5b6040519081019067ffffffffffffffff82118183101715610709577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b816040526107168461069b565b81526020840151602082015261072e6040850161069b565b6040820152606084015160608201526080840151608082015260a084015160a082015261075d60c0850161069b565b60c082015260e084015160e0820152809250505092915050565b60006020828403121561078957600080fd5b5035919050565b6000602082840312156107a257600080fd5b5051919050565b6000806000606084860312156107be57600080fd5b8335925060208401356107d0816108a0565b929592945050506040919091013590565b600080604083850312156107f457600080fd5b50508035926020909101359150565b60008251610815818460208701610870565b9190910192915050565b602081526000825180602084015261083e816040850160208701610870565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60005b8381101561088b578181015183820152602001610873565b8381111561089a576000848401525b50505050565b73ffffffffffffffffffffffffffffffffffffffff811681146108c257600080fd5b5056fea2646970667358221220c5c8649407aa552a1913b4a3dd70ac2514fad74401e80769918fa8b4cdd6237764736f6c63430008050033000000000000000000000000a7d94560dbd814af316dd96fde78b9136a977d1c

Deployed ByteCode

0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80633c0868f01161005b5780633c0868f0146100e0578063456b09c1146100f3578063598647f81461012b57806397e2d3801461013e57600080fd5b806305261aea146100825780630600d4eb1461009757806333727c4d146100bd575b600080fd5b610095610090366004610777565b610151565b005b6100aa6100a5366004610777565b6101f4565b6040519081526020015b60405180910390f35b6100d06100cb366004610777565b6102bb565b60405190151581526020016100b4565b6100d06100ee366004610777565b6102cd565b610106610101366004610777565b61039e565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100b4565b6100956101393660046107e1565b61046d565b6100d061014c3660046107a9565b6105c6565b6040517f7430e0c6000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000a7d94560dbd814af316dd96fde78b9136a977d1c73ffffffffffffffffffffffffffffffffffffffff1690637430e0c690602401600060405180830381600087803b1580156101d957600080fd5b505af11580156101ed573d6000803e3d6000fd5b5050505050565b6040517f47e35740000000000000000000000000000000000000000000000000000000008152600481018290526000907f000000000000000000000000a7d94560dbd814af316dd96fde78b9136a977d1c73ffffffffffffffffffffffffffffffffffffffff16906347e357409060240160206040518083038186803b15801561027d57600080fd5b505afa158015610291573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b59190610790565b92915050565b60006102c6826102cd565b1592915050565b6040517f9e79b41f00000000000000000000000000000000000000000000000000000000815260048101829052600090819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000a7d94560dbd814af316dd96fde78b9136a977d1c1690639e79b41f906024016101006040518083038186803b15801561035957600080fd5b505afa15801561036d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061039191906106ab565b60e0015115159392505050565b6040517f9e79b41f00000000000000000000000000000000000000000000000000000000815260048101829052600090819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000a7d94560dbd814af316dd96fde78b9136a977d1c1690639e79b41f906024016101006040518083038186803b15801561042a57600080fd5b505afa15801561043e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046291906106ab565b60c001519392505050565b6000807f000000000000000000000000a7d94560dbd814af316dd96fde78b9136a977d1c73ffffffffffffffffffffffffffffffffffffffff1683856040516024016104bb91815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f9979ef45000000000000000000000000000000000000000000000000000000001790525161053c9190610803565b60006040518083038185875af1925050503d8060008114610579576040519150601f19603f3d011682016040523d82523d6000602084013e61057e565b606091505b50915091508181906101ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105bd919061081f565b60405180910390fd5b6040517f2ab2b52b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152602482018390526000917f000000000000000000000000a7d94560dbd814af316dd96fde78b9136a977d1c90911690632ab2b52b9060440160206040518083038186803b15801561065957600080fd5b505afa15801561066d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106919190610790565b9093149392505050565b80516106a6816108a0565b919050565b60006101008083850312156106bf57600080fd5b6040519081019067ffffffffffffffff82118183101715610709577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b816040526107168461069b565b81526020840151602082015261072e6040850161069b565b6040820152606084015160608201526080840151608082015260a084015160a082015261075d60c0850161069b565b60c082015260e084015160e0820152809250505092915050565b60006020828403121561078957600080fd5b5035919050565b6000602082840312156107a257600080fd5b5051919050565b6000806000606084860312156107be57600080fd5b8335925060208401356107d0816108a0565b929592945050506040919091013590565b600080604083850312156107f457600080fd5b50508035926020909101359150565b60008251610815818460208701610870565b9190910192915050565b602081526000825180602084015261083e816040850160208701610870565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60005b8381101561088b578181015183820152602001610873565b8381111561089a576000848401525b50505050565b73ffffffffffffffffffffffffffffffffffffffff811681146108c257600080fd5b5056fea2646970667358221220c5c8649407aa552a1913b4a3dd70ac2514fad74401e80769918fa8b4cdd6237764736f6c63430008050033