Goerli Testnet

Contract

0x67D8ed102E2168A46FA342e39A5f7D16c103Bd0d

Overview

ETH Balance

0 ETH

Token Holdings

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Value
Cancel103412332024-01-08 10:12:2495 days ago1704708744IN
0x67D8ed10...6c103Bd0d
0 ETH0.000062761.50000001
List103411822024-01-08 9:57:2495 days ago1704707844IN
0x67D8ed10...6c103Bd0d
0 ETH0.000256541.50000001
Fulfill97796812023-09-29 12:58:36196 days ago1695992316IN
0x67D8ed10...6c103Bd0d
0 ETH0.000168791.5
Change Buyer All...97796782023-09-29 12:57:24196 days ago1695992244IN
0x67D8ed10...6c103Bd0d
0 ETH0.000089461.5
List97796562023-09-29 12:50:36196 days ago1695991836IN
0x67D8ed10...6c103Bd0d
0 ETH0.000256491.50000001
Change Buyer All...93664592023-07-18 16:25:24269 days ago1689697524IN
0x67D8ed10...6c103Bd0d
0 ETH0.000286354.80107173
List93664552023-07-18 16:24:12269 days ago1689697452IN
0x67D8ed10...6c103Bd0d
0 ETH0.000640833.74820713
Cancel93664452023-07-18 16:21:00269 days ago1689697260IN
0x67D8ed10...6c103Bd0d
0 ETH0.000123452.94974103
List93664282023-07-18 16:15:48269 days ago1689696948IN
0x67D8ed10...6c103Bd0d
0 ETH0.000509872.98144002
Cancel93664132023-07-18 16:11:36269 days ago1689696696IN
0x67D8ed10...6c103Bd0d
0 ETH0.000129623.09702693
Change Buyer All...93662982023-07-18 15:43:00269 days ago1689694980IN
0x67D8ed10...6c103Bd0d
0 ETH0.000182473.05936951
List93662942023-07-18 15:41:36269 days ago1689694896IN
0x67D8ed10...6c103Bd0d
0 ETH0.000534783.12794096
Cancel93662912023-07-18 15:41:00269 days ago1689694860IN
0x67D8ed10...6c103Bd0d
0 ETH0.000146293.49546141
Change Buyer All...93662732023-07-18 15:37:00269 days ago1689694620IN
0x67D8ed10...6c103Bd0d
0 ETH0.000249254.17896826
List93662412023-07-18 15:27:36269 days ago1689694056IN
0x67D8ed10...6c103Bd0d
0 ETH0.000960735.61775536
List92953352023-07-05 16:49:24282 days ago1688575764IN
0x67D8ed10...6c103Bd0d
0 ETH0.0028642216.74955768
List91785852023-06-14 17:54:36303 days ago1686765276IN
0x67D8ed10...6c103Bd0d
0 ETH0.001279217.47961411
0x6080604090993022023-05-31 21:34:24317 days ago1685568864IN
 Create: SchmackoSwap
0 ETH0.008609597.79542702

Latest 10 internal transactions

Advanced mode:
Parent Txn Hash Block From To Value
103411822024-01-08 9:57:2495 days ago1704707844
0x67D8ed10...6c103Bd0d
0 ETH
97796812023-09-29 12:58:36196 days ago1695992316
0x67D8ed10...6c103Bd0d
0 ETH
97796812023-09-29 12:58:36196 days ago1695992316
0x67D8ed10...6c103Bd0d
0 ETH
97796562023-09-29 12:50:36196 days ago1695991836
0x67D8ed10...6c103Bd0d
0 ETH
93664552023-07-18 16:24:12269 days ago1689697452
0x67D8ed10...6c103Bd0d
0 ETH
93664282023-07-18 16:15:48269 days ago1689696948
0x67D8ed10...6c103Bd0d
0 ETH
93662942023-07-18 15:41:36269 days ago1689694896
0x67D8ed10...6c103Bd0d
0 ETH
93662412023-07-18 15:27:36269 days ago1689694056
0x67D8ed10...6c103Bd0d
0 ETH
92953352023-07-05 16:49:24282 days ago1688575764
0x67D8ed10...6c103Bd0d
0 ETH
91785852023-06-14 17:54:36303 days ago1686765276
0x67D8ed10...6c103Bd0d
0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SchmackoSwap

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 11 : SchmackoSwap.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { ReentrancyGuard } from "solmate/utils/ReentrancyGuard.sol";
import { SafeTransferLib } from "solmate/utils/SafeTransferLib.sol";
import { ERC165 } from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol";

enum ListingState {
    LISTED,
    CANCELLED,
    FULFILLED
}

/// @title SchmackoSwap
/// @author molecule.to
/// @notice a sales contract that lets NFT holders list items with an ask price and control who can fulfill their offers. Accepts arbitrary ERC20 tokens as payment.
contract SchmackoSwap is ERC165, ReentrancyGuard {
    using SafeERC20 for IERC20;
    /// ERRORS ///

    /// @notice Thrown when user tries to initiate an action without being authorized
    error Unauthorized();

    /// @notice Thrown when trying to purchase a listing that doesn't exist
    error ListingNotFound();

    /// @notice Thrown when the user tries to buy a listing for which they are not approved
    error NotOnAllowlist();

    /// @notice Thrown when the buyer hasn't approved the marketplace to transfer their payment tokens
    error InsufficientAllowance();

    /// EVENTS ///

    /// @notice Emitted when a new listing is created
    /// @param listingId The id of the newly-created listing
    /// @param listing The newly-created listing
    event Listed(uint256 listingId, Listing listing);

    /// @notice Emitted when a listing is cancelled
    /// @param listingId The id of the removed listing
    /// @param listing The removed listing
    event Unlisted(uint256 listingId, Listing listing);

    /// @notice Emitted when a listing is purchased
    /// @param listingId The id of the purchased listing
    /// @param buyer The address of the buyer
    /// @param listing The purchased listing
    event Purchased(uint256 listingId, address indexed buyer, Listing listing);

    /// @notice Emitted when an address is added or removed from the allowlist
    /// @param listingId The listing that is getting updated
    /// @param buyer The address of the buyer that is added
    /// @param _isAllowed If address is added or removed from allowlist
    event AllowlistUpdated(uint256 listingId, address indexed buyer, bool _isAllowed);

    /// @notice Used as a counter for the next sale index.
    /// @dev Initialised at 1 because it makes the first transaction slightly cheaper.
    uint256 internal saleCounter = 1;

    /// @dev Parameters for listings
    /// @param tokenContract The IERC721 contract for the listed token
    /// @param tokenId The ID of the listed token
    /// @param creator The address of the seller
    /// @param askPrice The amount the seller is asking for in exchange for the token
    struct Listing {
        IERC721 tokenContract;
        uint256 tokenId;
        address creator;
        IERC20 paymentToken;
        uint256 askPrice;
        address beneficiary;
        ListingState listingState;
    }

    //mapping(uint256 => mapping(address => bool)) listingOperators;

    /// @notice An indexed list of listings
    mapping(uint256 => Listing) public listings;

    /// @notice An indexed list of allowlist spots
    mapping(uint256 => mapping(address => bool)) allowlist;

    /// @notice Lists the full supply of an ERC1155 token for sale
    /// @param tokenContract The ERC1155 contract for the token you're listing
    /// @param tokenId The ID of the token you're listing
    /// @param askPrice How much you want to receive in exchange for the token
    /// @return The ID of the created listing
    /// @dev Remember to call `setApprovalForAll(<address of this contract>, true)` on the ERC1155's contract before calling this function
    function list(IERC721 tokenContract, uint256 tokenId, IERC20 paymentToken, uint256 askPrice) public returns (uint256) {
        return list(tokenContract, tokenId, paymentToken, askPrice, msg.sender);
    }

    /**
     * {inheritDoc list}
     * @param beneficiary address the account that will receive the funds after fulfillment. In case of fractionalization this should be the FractionalizerL2Dispatcher
     */
    function list(IERC721 tokenContract, uint256 tokenId, IERC20 paymentToken, uint256 askPrice, address beneficiary) public returns (uint256) {
        if (!tokenContract.isApprovedForAll(msg.sender, address(this))) {
            revert InsufficientAllowance();
        }

        Listing memory listing = Listing({
            tokenContract: tokenContract,
            tokenId: tokenId,
            paymentToken: paymentToken,
            askPrice: askPrice,
            creator: msg.sender,
            beneficiary: beneficiary,
            listingState: ListingState.LISTED
        });

        uint256 listingId = uint256(keccak256(abi.encode(listing, block.number)));

        listings[listingId] = listing;

        emit Listed(listingId, listing);

        //todo: this stays unmentioned in the emitted event!
        return listingId;
    }

    /// @notice Cancel an existing listing
    /// @param listingId The ID for the listing you want to cancel
    function cancel(uint256 listingId) public {
        Listing memory listing = listings[listingId];
        if (listing.creator != msg.sender) {
            revert Unauthorized();
        }

        if (listing.listingState != ListingState.LISTED) {
            revert("cant cancel an inactive listing");
        }
        listings[listingId].listingState = ListingState.CANCELLED;
        emit Unlisted(listingId, listings[listingId]);
    }

    /// @notice Purchase one of the listed tokens
    /// @param listingId The ID for the listing you want to purchase
    function fulfill(uint256 listingId) public nonReentrant {
        Listing memory listing = listings[listingId];
        if (listing.creator == address(0)) revert ListingNotFound();
        if (allowlist[listingId][msg.sender] != true) revert NotOnAllowlist();
        if (listing.listingState != ListingState.LISTED) revert("listing not active anymore");

        IERC20 paymentToken = listing.paymentToken;

        listings[listingId].listingState = ListingState.FULFILLED;

        listing.tokenContract.safeTransferFrom(listing.creator, msg.sender, listing.tokenId);
        paymentToken.safeTransferFrom(msg.sender, listing.beneficiary, listing.askPrice);

        emit Purchased(listingId, msg.sender, listings[listingId]);
    }

    /// @notice lets the seller allow or disallow a certain buyer to fulfill the listing
    /// @param listingId The ID for the listing you want to purchase
    /// @param buyerAddress the address to change allowance for
    /// @param _isAllowed whether to allow or disallow `buyerAddress` to fulfill the listing
    function changeBuyerAllowance(uint256 listingId, address buyerAddress, bool _isAllowed) public {
        Listing memory listing = listings[listingId];

        if (listing.creator == address(0)) revert ListingNotFound();
        if (listing.creator != msg.sender) revert Unauthorized();
        require(buyerAddress != address(0), "Can't add ZERO address to allowlist");

        allowlist[listingId][buyerAddress] = _isAllowed;

        emit AllowlistUpdated(listingId, buyerAddress, _isAllowed);
    }

    function changeBuyerAllowance(uint256 listingId, address[] calldata buyerAddresses, bool _isAllowed) external {
        for (uint256 i = 0; i < buyerAddresses.length; i++) {
            changeBuyerAllowance(listingId, buyerAddresses[i], _isAllowed);
        }
    }

    function isAllowed(uint256 listingId, address buyerAddress) public view returns (bool) {
        return allowlist[listingId][buyerAddress];
    }

    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165) returns (bool) {
        return super.supportsInterface(interfaceId);
    }
}

File 3 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 4 of 11 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 5 of 11 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

/// @notice Gas optimized reentrancy protection for smart contracts.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/ReentrancyGuard.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol)
abstract contract ReentrancyGuard {
    uint256 private locked = 1;

    modifier nonReentrant() virtual {
        require(locked == 1, "REENTRANCY");

        locked = 2;

        _;

        locked = 1;
    }
}

File 6 of 11 : SafeTransferLib.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

import {ERC20} from "../tokens/ERC20.sol";

/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @dev Caution! This library won't check that a token has code, responsibility is delegated to the caller.
library SafeTransferLib {
    /*//////////////////////////////////////////////////////////////
                             ETH OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferETH(address to, uint256 amount) internal {
        bool success;

        assembly {
            // Transfer the ETH and store if it succeeded or not.
            success := call(gas(), to, amount, 0, 0, 0, 0)
        }

        require(success, "ETH_TRANSFER_FAILED");
    }

    /*//////////////////////////////////////////////////////////////
                            ERC20 OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferFrom(
        ERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // We'll write our calldata to this slot below, but restore it later.
            let memPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(0, 0x23b872dd00000000000000000000000000000000000000000000000000000000)
            mstore(4, from) // Append the "from" argument.
            mstore(36, to) // Append the "to" argument.
            mstore(68, amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 100 because that's the total length of our calldata (4 + 32 * 3)
                // Counterintuitively, this call() must be positioned after the or() in the
                // surrounding and() because and() evaluates its arguments from right to left.
                call(gas(), token, 0, 0, 100, 0, 32)
            )

            mstore(0x60, 0) // Restore the zero slot to zero.
            mstore(0x40, memPointer) // Restore the memPointer.
        }

        require(success, "TRANSFER_FROM_FAILED");
    }

    function safeTransfer(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // We'll write our calldata to this slot below, but restore it later.
            let memPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(0, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)
            mstore(4, to) // Append the "to" argument.
            mstore(36, amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because that's the total length of our calldata (4 + 32 * 2)
                // Counterintuitively, this call() must be positioned after the or() in the
                // surrounding and() because and() evaluates its arguments from right to left.
                call(gas(), token, 0, 0, 68, 0, 32)
            )

            mstore(0x60, 0) // Restore the zero slot to zero.
            mstore(0x40, memPointer) // Restore the memPointer.
        }

        require(success, "TRANSFER_FAILED");
    }

    function safeApprove(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // We'll write our calldata to this slot below, but restore it later.
            let memPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(0, 0x095ea7b300000000000000000000000000000000000000000000000000000000)
            mstore(4, to) // Append the "to" argument.
            mstore(36, amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because that's the total length of our calldata (4 + 32 * 2)
                // Counterintuitively, this call() must be positioned after the or() in the
                // surrounding and() because and() evaluates its arguments from right to left.
                call(gas(), token, 0, 0, 68, 0, 32)
            )

            mstore(0x60, 0) // Restore the zero slot to zero.
            mstore(0x40, memPointer) // Restore the memPointer.
        }

        require(success, "APPROVE_FAILED");
    }
}

File 7 of 11 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 8 of 11 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 9 of 11 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 10 of 11 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 11 of 11 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 12 of 11 : ERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 amount);

    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /*//////////////////////////////////////////////////////////////
                            METADATA STORAGE
    //////////////////////////////////////////////////////////////*/

    string public name;

    string public symbol;

    uint8 public immutable decimals;

    /*//////////////////////////////////////////////////////////////
                              ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

    mapping(address => mapping(address => uint256)) public allowance;

    /*//////////////////////////////////////////////////////////////
                            EIP-2612 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;

        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
    }

    /*//////////////////////////////////////////////////////////////
                               ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/

    function approve(address spender, uint256 amount) public virtual returns (bool) {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    function transfer(address to, uint256 amount) public virtual returns (bool) {
        balanceOf[msg.sender] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(msg.sender, to, amount);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual returns (bool) {
        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.

        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;

        balanceOf[from] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(from, to, amount);

        return true;
    }

    /*//////////////////////////////////////////////////////////////
                             EIP-2612 LOGIC
    //////////////////////////////////////////////////////////////*/

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");

        // Unchecked because the only math done is incrementing
        // the owner's nonce which cannot realistically overflow.
        unchecked {
            address recoveredAddress = ecrecover(
                keccak256(
                    abi.encodePacked(
                        "\x19\x01",
                        DOMAIN_SEPARATOR(),
                        keccak256(
                            abi.encode(
                                keccak256(
                                    "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
                                ),
                                owner,
                                spender,
                                value,
                                nonces[owner]++,
                                deadline
                            )
                        )
                    )
                ),
                v,
                r,
                s
            );

            require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                    keccak256(bytes(name)),
                    keccak256("1"),
                    block.chainid,
                    address(this)
                )
            );
    }

    /*//////////////////////////////////////////////////////////////
                        INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(address to, uint256 amount) internal virtual {
        totalSupply += amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(address(0), to, amount);
    }

    function _burn(address from, uint256 amount) internal virtual {
        balanceOf[from] -= amount;

        // Cannot underflow because a user's balance
        // will never be larger than the total supply.
        unchecked {
            totalSupply -= amount;
        }

        emit Transfer(from, address(0), amount);
    }
}

Settings
{
  "remappings": [
    "@moleculeprotocol/token-vesting/=lib/token-vesting-contract/contracts/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@prb/math/=lib/prb-math/src/",
    "ERC721B/=lib/ERC721B/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/token-vesting-contract/lib/openzeppelin-contracts/lib/erc4626-tests/",
    "erc721b/=lib/ERC721B/contracts/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "safe-contracts/=lib/safe-contracts/contracts/",
    "safe-global/safe-contracts/=lib/safe-contracts/contracts/",
    "solady/=lib/token-vesting-contract/lib/solady/src/",
    "solmate/=lib/solmate/src/",
    "token-vesting-contract/=lib/token-vesting-contract/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract ABI

[{"inputs":[],"name":"InsufficientAllowance","type":"error"},{"inputs":[],"name":"ListingNotFound","type":"error"},{"inputs":[],"name":"NotOnAllowlist","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"listingId","type":"uint256"},{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"bool","name":"_isAllowed","type":"bool"}],"name":"AllowlistUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"listingId","type":"uint256"},{"components":[{"internalType":"contract IERC721","name":"tokenContract","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"contract IERC20","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"askPrice","type":"uint256"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"enum ListingState","name":"listingState","type":"uint8"}],"indexed":false,"internalType":"struct SchmackoSwap.Listing","name":"listing","type":"tuple"}],"name":"Listed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"listingId","type":"uint256"},{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"components":[{"internalType":"contract IERC721","name":"tokenContract","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"contract IERC20","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"askPrice","type":"uint256"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"enum ListingState","name":"listingState","type":"uint8"}],"indexed":false,"internalType":"struct SchmackoSwap.Listing","name":"listing","type":"tuple"}],"name":"Purchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"listingId","type":"uint256"},{"components":[{"internalType":"contract IERC721","name":"tokenContract","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"contract IERC20","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"askPrice","type":"uint256"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"enum ListingState","name":"listingState","type":"uint8"}],"indexed":false,"internalType":"struct SchmackoSwap.Listing","name":"listing","type":"tuple"}],"name":"Unlisted","type":"event"},{"inputs":[{"internalType":"uint256","name":"listingId","type":"uint256"}],"name":"cancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"listingId","type":"uint256"},{"internalType":"address","name":"buyerAddress","type":"address"},{"internalType":"bool","name":"_isAllowed","type":"bool"}],"name":"changeBuyerAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"listingId","type":"uint256"},{"internalType":"address[]","name":"buyerAddresses","type":"address[]"},{"internalType":"bool","name":"_isAllowed","type":"bool"}],"name":"changeBuyerAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"listingId","type":"uint256"}],"name":"fulfill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"listingId","type":"uint256"},{"internalType":"address","name":"buyerAddress","type":"address"}],"name":"isAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC721","name":"tokenContract","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"contract IERC20","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"askPrice","type":"uint256"},{"internalType":"address","name":"beneficiary","type":"address"}],"name":"list","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721","name":"tokenContract","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"contract IERC20","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"askPrice","type":"uint256"}],"name":"list","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"listings","outputs":[{"internalType":"contract IERC721","name":"tokenContract","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"contract IERC20","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"askPrice","type":"uint256"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"enum ListingState","name":"listingState","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

608060405260016000556001805534801561001957600080fd5b50611235806100296000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c806399b922f31161006657806399b922f314610132578063b2801f4914610145578063de74e57b14610158578063e97fbf94146101cb578063ea8cdb1f146101ec57600080fd5b806301ffc9a71461009857806340e58ee5146100d15780635faa299a146100e6578063753b88071461011f575b600080fd5b6100bc6100a6366004610d7b565b6001600160e01b0319166301ffc9a760e01b1490565b60405190151581526020015b60405180910390f35b6100e46100df366004610da5565b6101ff565b005b6100bc6100f4366004610dd6565b60009182526003602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6100e461012d366004610da5565b610395565b6100e4610140366004610e14565b610657565b6100e4610153366004610e56565b61081d565b6101b8610166366004610da5565b60026020819052600091825260409091208054600182015492820154600383015460048401546005909401546001600160a01b039384169594928416939182169291811690600160a01b900460ff1687565b6040516100c89796959493929190610f20565b6101de6101d9366004610f6f565b610872565b6040519081526020016100c8565b6101de6101fa366004610fce565b610a98565b6000818152600260208181526040808420815160e08101835281546001600160a01b0390811682526001830154948201949094528185015484169281019290925260038101548316606083015260048101546080830152600581015492831660a08301529092909160c0840191600160a01b90910460ff169081111561028757610287610ee8565b600281111561029857610298610ee8565b90525060408101519091506001600160a01b031633146102ca576040516282b42960e81b815260040160405180910390fd5b60008160c0015160028111156102e2576102e2610ee8565b146103345760405162461bcd60e51b815260206004820152601f60248201527f63616e742063616e63656c20616e20696e616374697665206c697374696e670060448201526064015b60405180910390fd5b6000828152600260205260409081902060058101805460ff60a01b1916600160a01b17905590517f94f98581a1bc72dd14598dac60e9344e30b9f784da9f9af6388a8cbf8d4f65129161038991859190611016565b60405180910390a15050565b6000546001146103d45760405162461bcd60e51b815260206004820152600a6024820152695245454e5452414e435960b01b604482015260640161032b565b6002600081815582815260208281526040808320815160e08101835281546001600160a01b0390811682526001830154948201949094528186015484169281019290925260038101548316606083015260048101546080830152600581015492831660a0830152929390929160c0840191600160a01b90910460ff169081111561046057610460610ee8565b600281111561047157610471610ee8565b90525060408101519091506001600160a01b03166104a257604051630fc87cc760e31b815260040160405180910390fd5b600082815260036020908152604080832033845290915290205460ff1615156001146104e15760405163231e418360e01b815260040160405180910390fd5b60008160c0015160028111156104f9576104f9610ee8565b146105465760405162461bcd60e51b815260206004820152601a60248201527f6c697374696e67206e6f742061637469766520616e796d6f7265000000000000604482015260640161032b565b60608101516000838152600260209081526040918290206005018054600160a11b60ff60a01b19909116179055835182850151918501519251632142170760e11b81526001600160a01b039283166004820152336024820152604481019390935216906342842e0e90606401600060405180830381600087803b1580156105cc57600080fd5b505af11580156105e0573d6000803e3d6000fd5b50505060a0830151608084015161060492506001600160a01b038416913391610ab2565b60008381526002602052604090819020905133917f5a8076c0be73f36722dd7442f2168a50e4700bfee3969bb66d12f3a0b36fad5191610645918791611016565b60405180910390a25050600160005550565b6000838152600260208181526040808420815160e08101835281546001600160a01b0390811682526001830154948201949094528185015484169281019290925260038101548316606083015260048101546080830152600581015492831660a08301529092909160c0840191600160a01b90910460ff16908111156106df576106df610ee8565b60028111156106f0576106f0610ee8565b90525060408101519091506001600160a01b031661072157604051630fc87cc760e31b815260040160405180910390fd5b60408101516001600160a01b0316331461074d576040516282b42960e81b815260040160405180910390fd5b6001600160a01b0383166107af5760405162461bcd60e51b815260206004820152602360248201527f43616e277420616464205a45524f206164647265737320746f20616c6c6f776c6044820152621a5cdd60ea1b606482015260840161032b565b60008481526003602090815260408083206001600160a01b03871680855290835292819020805460ff19168615159081179091558151888152928301527f0b39b8705388179ba4a98df9c9c12598313d891f175dd06e571b7aaa02bd607d910160405180910390a250505050565b60005b8281101561086b576108598585858481811061083e5761083e61108c565b905060200201602081019061085391906110a2565b84610657565b80610863816110bf565b915050610820565b5050505050565b60405163e985e9c560e01b81523360048201523060248201526000906001600160a01b0387169063e985e9c590604401602060405180830381865afa1580156108bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e391906110e6565b610900576040516313be252b60e01b815260040160405180910390fd5b60006040518060e00160405280886001600160a01b03168152602001878152602001336001600160a01b03168152602001866001600160a01b03168152602001858152602001846001600160a01b031681526020016000600281111561096857610968610ee8565b81525090506000814360405160200161098292919061115b565b60408051808303601f1901815291815281516020928301206000818152600280855290839020865181546001600160a01b03199081166001600160a01b039283161783559588015160018301559387015181830180548716918616919091179055606087015160038201805487169186169190911790556080870151600482015560a087015160058201805496871691909516908117855560c088015193965087959194926001600160a81b03199092161790600160a01b908490811115610a4c57610a4c610ee8565b02179055509050507fff936dd8c8767e4b8fd4cdb0a3b8811d01b4ac0c4a9d15cc41b1810d6293cc248183604051610a85929190611177565b60405180910390a1979650505050505050565b6000610aa78585858533610872565b90505b949350505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610b0c908590610b12565b50505050565b6000610b67826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610be99092919063ffffffff16565b805190915015610be45780806020019051810190610b8591906110e6565b610be45760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161032b565b505050565b6060610bf88484600085610c02565b90505b9392505050565b606082471015610c635760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161032b565b600080866001600160a01b03168587604051610c7f91906111b0565b60006040518083038185875af1925050503d8060008114610cbc576040519150601f19603f3d011682016040523d82523d6000602084013e610cc1565b606091505b5091509150610cd287838387610cdd565b979650505050505050565b60608315610d4c578251600003610d45576001600160a01b0385163b610d455760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161032b565b5081610aaa565b610aaa8383815115610d615781518083602001fd5b8060405162461bcd60e51b815260040161032b91906111cc565b600060208284031215610d8d57600080fd5b81356001600160e01b031981168114610bfb57600080fd5b600060208284031215610db757600080fd5b5035919050565b6001600160a01b0381168114610dd357600080fd5b50565b60008060408385031215610de957600080fd5b823591506020830135610dfb81610dbe565b809150509250929050565b8015158114610dd357600080fd5b600080600060608486031215610e2957600080fd5b833592506020840135610e3b81610dbe565b91506040840135610e4b81610e06565b809150509250925092565b60008060008060608587031215610e6c57600080fd5b84359350602085013567ffffffffffffffff80821115610e8b57600080fd5b818701915087601f830112610e9f57600080fd5b813581811115610eae57600080fd5b8860208260051b8501011115610ec357600080fd5b6020830195508094505050506040850135610edd81610e06565b939692955090935050565b634e487b7160e01b600052602160045260246000fd5b60038110610f1c57634e487b7160e01b600052602160045260246000fd5b9052565b6001600160a01b038881168252602082018890528681166040830152858116606083015260808201859052831660a082015260e08101610f6360c0830184610efe565b98975050505050505050565b600080600080600060a08688031215610f8757600080fd5b8535610f9281610dbe565b9450602086013593506040860135610fa981610dbe565b9250606086013591506080860135610fc081610dbe565b809150509295509295909350565b60008060008060808587031215610fe457600080fd5b8435610fef81610dbe565b935060208501359250604085013561100681610dbe565b9396929550929360600135925050565b82815281546001600160a01b03908116602083015260018301546040830152600283015481166060830152600383015481166080830152600483015460a080840191909152600584015480831660c0850152610100840192916110839060e086019083901c60ff16610efe565b50509392505050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156110b457600080fd5b8135610bfb81610dbe565b6000600182016110df57634e487b7160e01b600052601160045260246000fd5b5060010190565b6000602082840312156110f857600080fd5b8151610bfb81610e06565b60018060a01b0380825116835260208201516020840152806040830151166040840152806060830151166060840152608082015160808401528060a08301511660a08401525060c0810151610be460c0840182610efe565b610100810161116a8285611103565b8260e08301529392505050565b8281526101008101610bfb6020830184611103565b60005b838110156111a757818101518382015260200161118f565b50506000910152565b600082516111c281846020870161118c565b9190910192915050565b60208152600082518060208401526111eb81604085016020870161118c565b601f01601f1916919091016040019291505056fea26469706673582212209ee36d14c248b672e9030a28e246af356bd768d8ecd6aaf20798b33d9f4a3da164736f6c63430008120033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100935760003560e01c806399b922f31161006657806399b922f314610132578063b2801f4914610145578063de74e57b14610158578063e97fbf94146101cb578063ea8cdb1f146101ec57600080fd5b806301ffc9a71461009857806340e58ee5146100d15780635faa299a146100e6578063753b88071461011f575b600080fd5b6100bc6100a6366004610d7b565b6001600160e01b0319166301ffc9a760e01b1490565b60405190151581526020015b60405180910390f35b6100e46100df366004610da5565b6101ff565b005b6100bc6100f4366004610dd6565b60009182526003602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6100e461012d366004610da5565b610395565b6100e4610140366004610e14565b610657565b6100e4610153366004610e56565b61081d565b6101b8610166366004610da5565b60026020819052600091825260409091208054600182015492820154600383015460048401546005909401546001600160a01b039384169594928416939182169291811690600160a01b900460ff1687565b6040516100c89796959493929190610f20565b6101de6101d9366004610f6f565b610872565b6040519081526020016100c8565b6101de6101fa366004610fce565b610a98565b6000818152600260208181526040808420815160e08101835281546001600160a01b0390811682526001830154948201949094528185015484169281019290925260038101548316606083015260048101546080830152600581015492831660a08301529092909160c0840191600160a01b90910460ff169081111561028757610287610ee8565b600281111561029857610298610ee8565b90525060408101519091506001600160a01b031633146102ca576040516282b42960e81b815260040160405180910390fd5b60008160c0015160028111156102e2576102e2610ee8565b146103345760405162461bcd60e51b815260206004820152601f60248201527f63616e742063616e63656c20616e20696e616374697665206c697374696e670060448201526064015b60405180910390fd5b6000828152600260205260409081902060058101805460ff60a01b1916600160a01b17905590517f94f98581a1bc72dd14598dac60e9344e30b9f784da9f9af6388a8cbf8d4f65129161038991859190611016565b60405180910390a15050565b6000546001146103d45760405162461bcd60e51b815260206004820152600a6024820152695245454e5452414e435960b01b604482015260640161032b565b6002600081815582815260208281526040808320815160e08101835281546001600160a01b0390811682526001830154948201949094528186015484169281019290925260038101548316606083015260048101546080830152600581015492831660a0830152929390929160c0840191600160a01b90910460ff169081111561046057610460610ee8565b600281111561047157610471610ee8565b90525060408101519091506001600160a01b03166104a257604051630fc87cc760e31b815260040160405180910390fd5b600082815260036020908152604080832033845290915290205460ff1615156001146104e15760405163231e418360e01b815260040160405180910390fd5b60008160c0015160028111156104f9576104f9610ee8565b146105465760405162461bcd60e51b815260206004820152601a60248201527f6c697374696e67206e6f742061637469766520616e796d6f7265000000000000604482015260640161032b565b60608101516000838152600260209081526040918290206005018054600160a11b60ff60a01b19909116179055835182850151918501519251632142170760e11b81526001600160a01b039283166004820152336024820152604481019390935216906342842e0e90606401600060405180830381600087803b1580156105cc57600080fd5b505af11580156105e0573d6000803e3d6000fd5b50505060a0830151608084015161060492506001600160a01b038416913391610ab2565b60008381526002602052604090819020905133917f5a8076c0be73f36722dd7442f2168a50e4700bfee3969bb66d12f3a0b36fad5191610645918791611016565b60405180910390a25050600160005550565b6000838152600260208181526040808420815160e08101835281546001600160a01b0390811682526001830154948201949094528185015484169281019290925260038101548316606083015260048101546080830152600581015492831660a08301529092909160c0840191600160a01b90910460ff16908111156106df576106df610ee8565b60028111156106f0576106f0610ee8565b90525060408101519091506001600160a01b031661072157604051630fc87cc760e31b815260040160405180910390fd5b60408101516001600160a01b0316331461074d576040516282b42960e81b815260040160405180910390fd5b6001600160a01b0383166107af5760405162461bcd60e51b815260206004820152602360248201527f43616e277420616464205a45524f206164647265737320746f20616c6c6f776c6044820152621a5cdd60ea1b606482015260840161032b565b60008481526003602090815260408083206001600160a01b03871680855290835292819020805460ff19168615159081179091558151888152928301527f0b39b8705388179ba4a98df9c9c12598313d891f175dd06e571b7aaa02bd607d910160405180910390a250505050565b60005b8281101561086b576108598585858481811061083e5761083e61108c565b905060200201602081019061085391906110a2565b84610657565b80610863816110bf565b915050610820565b5050505050565b60405163e985e9c560e01b81523360048201523060248201526000906001600160a01b0387169063e985e9c590604401602060405180830381865afa1580156108bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e391906110e6565b610900576040516313be252b60e01b815260040160405180910390fd5b60006040518060e00160405280886001600160a01b03168152602001878152602001336001600160a01b03168152602001866001600160a01b03168152602001858152602001846001600160a01b031681526020016000600281111561096857610968610ee8565b81525090506000814360405160200161098292919061115b565b60408051808303601f1901815291815281516020928301206000818152600280855290839020865181546001600160a01b03199081166001600160a01b039283161783559588015160018301559387015181830180548716918616919091179055606087015160038201805487169186169190911790556080870151600482015560a087015160058201805496871691909516908117855560c088015193965087959194926001600160a81b03199092161790600160a01b908490811115610a4c57610a4c610ee8565b02179055509050507fff936dd8c8767e4b8fd4cdb0a3b8811d01b4ac0c4a9d15cc41b1810d6293cc248183604051610a85929190611177565b60405180910390a1979650505050505050565b6000610aa78585858533610872565b90505b949350505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610b0c908590610b12565b50505050565b6000610b67826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610be99092919063ffffffff16565b805190915015610be45780806020019051810190610b8591906110e6565b610be45760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161032b565b505050565b6060610bf88484600085610c02565b90505b9392505050565b606082471015610c635760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161032b565b600080866001600160a01b03168587604051610c7f91906111b0565b60006040518083038185875af1925050503d8060008114610cbc576040519150601f19603f3d011682016040523d82523d6000602084013e610cc1565b606091505b5091509150610cd287838387610cdd565b979650505050505050565b60608315610d4c578251600003610d45576001600160a01b0385163b610d455760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161032b565b5081610aaa565b610aaa8383815115610d615781518083602001fd5b8060405162461bcd60e51b815260040161032b91906111cc565b600060208284031215610d8d57600080fd5b81356001600160e01b031981168114610bfb57600080fd5b600060208284031215610db757600080fd5b5035919050565b6001600160a01b0381168114610dd357600080fd5b50565b60008060408385031215610de957600080fd5b823591506020830135610dfb81610dbe565b809150509250929050565b8015158114610dd357600080fd5b600080600060608486031215610e2957600080fd5b833592506020840135610e3b81610dbe565b91506040840135610e4b81610e06565b809150509250925092565b60008060008060608587031215610e6c57600080fd5b84359350602085013567ffffffffffffffff80821115610e8b57600080fd5b818701915087601f830112610e9f57600080fd5b813581811115610eae57600080fd5b8860208260051b8501011115610ec357600080fd5b6020830195508094505050506040850135610edd81610e06565b939692955090935050565b634e487b7160e01b600052602160045260246000fd5b60038110610f1c57634e487b7160e01b600052602160045260246000fd5b9052565b6001600160a01b038881168252602082018890528681166040830152858116606083015260808201859052831660a082015260e08101610f6360c0830184610efe565b98975050505050505050565b600080600080600060a08688031215610f8757600080fd5b8535610f9281610dbe565b9450602086013593506040860135610fa981610dbe565b9250606086013591506080860135610fc081610dbe565b809150509295509295909350565b60008060008060808587031215610fe457600080fd5b8435610fef81610dbe565b935060208501359250604085013561100681610dbe565b9396929550929360600135925050565b82815281546001600160a01b03908116602083015260018301546040830152600283015481166060830152600383015481166080830152600483015460a080840191909152600584015480831660c0850152610100840192916110839060e086019083901c60ff16610efe565b50509392505050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156110b457600080fd5b8135610bfb81610dbe565b6000600182016110df57634e487b7160e01b600052601160045260246000fd5b5060010190565b6000602082840312156110f857600080fd5b8151610bfb81610e06565b60018060a01b0380825116835260208201516020840152806040830151166040840152806060830151166060840152608082015160808401528060a08301511660a08401525060c0810151610be460c0840182610efe565b610100810161116a8285611103565b8260e08301529392505050565b8281526101008101610bfb6020830184611103565b60005b838110156111a757818101518382015260200161118f565b50506000910152565b600082516111c281846020870161118c565b9190910192915050565b60208152600082518060208401526111eb81604085016020870161118c565b601f01601f1916919091016040019291505056fea26469706673582212209ee36d14c248b672e9030a28e246af356bd768d8ecd6aaf20798b33d9f4a3da164736f6c63430008120033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.