ETH Price: $3,361.46 (-0.66%)
Gas: 1 Gwei

Contract

0x1dE06D2875453a272628BbB957077d18eb4A84CD
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
0x60c03461160960912022-12-02 9:00:59575 days ago1669971659IN
 Create: OperatorFilterer
0 ETH0.00571615

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OperatorFilterer

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion
File 1 of 6 : OperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@manifoldxyz/creator-core-solidity/contracts/extensions/ERC721/IERC721CreatorExtensionApproveTransfer.sol";
import "@manifoldxyz/creator-core-solidity/contracts/extensions/ERC1155/IERC1155CreatorExtensionApproveTransfer.sol";
import {IOperatorFilterRegistry} from "operator-filter-registry/src/IOperatorFilterRegistry.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";

contract OperatorFilterer is IERC165 {
    error OperatorNotAllowed(address operator);

    address public immutable OPERATOR_FILTER_REGISTRY;
    address public immutable SUBSCRIPTION;

    constructor(address operatorFilterRegistry, address subscription) {
        OPERATOR_FILTER_REGISTRY = operatorFilterRegistry;
        SUBSCRIPTION = subscription;

        IOperatorFilterRegistry(OPERATOR_FILTER_REGISTRY).registerAndSubscribe(address(this), SUBSCRIPTION);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override (IERC165) returns (bool) {
        return interfaceId == type(IERC721CreatorExtensionApproveTransfer).interfaceId
            || interfaceId == type(IERC1155CreatorExtensionApproveTransfer).interfaceId
            || interfaceId == type(IERC165).interfaceId;
    }

    /**
     * @dev ERC1155: Called by creator contract to approve a transfer
     */
    function approveTransfer(address operator, address from, address, uint256[] calldata, uint256[] calldata)
        external
        view
        returns (bool)
    {
        return isOperatorAllowed(operator, from);
    }

    /**
     * @dev ERC721: Called by creator contract to approve a transfer
     */
    function approveTransfer(address operator, address from, address, uint256) external view returns (bool) {
        return isOperatorAllowed(operator, from);
    }

    /**
     * @dev Check OperatorFiltererRegistry to see if operator is approved
     */
    function isOperatorAllowed(address operator, address from) internal view returns (bool) {
        if (from != operator) {
            if (!IOperatorFilterRegistry(OPERATOR_FILTER_REGISTRY).isOperatorAllowed(address(this), operator)) {
                revert OperatorNotAllowed(operator);
            }
        }

        return true;
    }
}

File 2 of 6 : IERC1155CreatorExtensionApproveTransfer.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
 * Implement this if you want your extension to approve a transfer
 */
interface IERC1155CreatorExtensionApproveTransfer is IERC165 {

    /**
     * @dev Set whether or not the creator contract will check the extension for approval of token transfer
     */
    function setApproveTransfer(address creator, bool enabled) external;

    /**
     * @dev Called by creator contract to approve a transfer
     */
    function approveTransfer(address operator, address from, address to, uint256[] calldata tokenIds, uint256[] calldata amounts) external returns (bool);
}

File 3 of 6 : IERC721CreatorExtensionApproveTransfer.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
 * Implement this if you want your extension to approve a transfer
 */
interface IERC721CreatorExtensionApproveTransfer is IERC165 {

    /**
     * @dev Set whether or not the creator will check the extension for approval of token transfer
     */
    function setApproveTransfer(address creator, bool enabled) external;

    /**
     * @dev Called by creator contract to approve a transfer
     */
    function approveTransfer(address operator, address from, address to, uint256 tokenId) external returns (bool);
}

File 4 of 6 : ERC165Checker.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.2) (utils/introspection/ERC165Checker.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Library used to query support of an interface declared via {IERC165}.
 *
 * Note that these functions return the actual result of the query: they do not
 * `revert` if an interface is not supported. It is up to the caller to decide
 * what to do in these cases.
 */
library ERC165Checker {
    // As per the EIP-165 spec, no interface should ever match 0xffffffff
    bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;

    /**
     * @dev Returns true if `account` supports the {IERC165} interface,
     */
    function supportsERC165(address account) internal view returns (bool) {
        // Any contract that implements ERC165 must explicitly indicate support of
        // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
        return
            _supportsERC165Interface(account, type(IERC165).interfaceId) &&
            !_supportsERC165Interface(account, _INTERFACE_ID_INVALID);
    }

    /**
     * @dev Returns true if `account` supports the interface defined by
     * `interfaceId`. Support for {IERC165} itself is queried automatically.
     *
     * See {IERC165-supportsInterface}.
     */
    function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
        // query support of both ERC165 as per the spec and support of _interfaceId
        return supportsERC165(account) && _supportsERC165Interface(account, interfaceId);
    }

    /**
     * @dev Returns a boolean array where each value corresponds to the
     * interfaces passed in and whether they're supported or not. This allows
     * you to batch check interfaces for a contract where your expectation
     * is that some interfaces may not be supported.
     *
     * See {IERC165-supportsInterface}.
     *
     * _Available since v3.4._
     */
    function getSupportedInterfaces(address account, bytes4[] memory interfaceIds)
        internal
        view
        returns (bool[] memory)
    {
        // an array of booleans corresponding to interfaceIds and whether they're supported or not
        bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);

        // query support of ERC165 itself
        if (supportsERC165(account)) {
            // query support of each interface in interfaceIds
            for (uint256 i = 0; i < interfaceIds.length; i++) {
                interfaceIdsSupported[i] = _supportsERC165Interface(account, interfaceIds[i]);
            }
        }

        return interfaceIdsSupported;
    }

    /**
     * @dev Returns true if `account` supports all the interfaces defined in
     * `interfaceIds`. Support for {IERC165} itself is queried automatically.
     *
     * Batch-querying can lead to gas savings by skipping repeated checks for
     * {IERC165} support.
     *
     * See {IERC165-supportsInterface}.
     */
    function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
        // query support of ERC165 itself
        if (!supportsERC165(account)) {
            return false;
        }

        // query support of each interface in _interfaceIds
        for (uint256 i = 0; i < interfaceIds.length; i++) {
            if (!_supportsERC165Interface(account, interfaceIds[i])) {
                return false;
            }
        }

        // all interfaces supported
        return true;
    }

    /**
     * @notice Query if a contract implements an interface, does not check ERC165 support
     * @param account The address of the contract to query for support of an interface
     * @param interfaceId The interface identifier, as specified in ERC-165
     * @return true if the contract at account indicates support of the interface with
     * identifier interfaceId, false otherwise
     * @dev Assumes that account contains a contract that supports ERC165, otherwise
     * the behavior of this method is undefined. This precondition can be checked
     * with {supportsERC165}.
     * Interface identification is specified in ERC-165.
     */
    function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) {
        // prepare call
        bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId);

        // perform static call
        bool success;
        uint256 returnSize;
        uint256 returnValue;
        assembly {
            success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20)
            returnSize := returndatasize()
            returnValue := mload(0x00)
        }

        return success && returnSize >= 0x20 && returnValue > 0;
    }
}

File 5 of 6 : 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 6 of 6 : IOperatorFilterRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IOperatorFilterRegistry {
    function isOperatorAllowed(address registrant, address operator) external view returns (bool);
    function register(address registrant) external;
    function registerAndSubscribe(address registrant, address subscription) external;
    function registerAndCopyEntries(address registrant, address registrantToCopy) external;
    function unregister(address addr) external;
    function updateOperator(address registrant, address operator, bool filtered) external;
    function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
    function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
    function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
    function subscribe(address registrant, address registrantToSubscribe) external;
    function unsubscribe(address registrant, bool copyExistingEntries) external;
    function subscriptionOf(address addr) external returns (address registrant);
    function subscribers(address registrant) external returns (address[] memory);
    function subscriberAt(address registrant, uint256 index) external returns (address);
    function copyEntriesOf(address registrant, address registrantToCopy) external;
    function isOperatorFiltered(address registrant, address operator) external returns (bool);
    function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
    function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
    function filteredOperators(address addr) external returns (address[] memory);
    function filteredCodeHashes(address addr) external returns (bytes32[] memory);
    function filteredOperatorAt(address registrant, uint256 index) external returns (address);
    function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
    function isRegistered(address addr) external returns (bool);
    function codeHashOf(address addr) external returns (bytes32);
}

Settings
{
  "viaIR": true,
  "optimizer": {
    "enabled": true,
    "runs": 1000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"operatorFilterRegistry","type":"address"},{"internalType":"address","name":"subscription","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SUBSCRIPTION","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"approveTransfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"name":"approveTransfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60c0346100fa57610583906001600160401b03601f38849003908101601f1916830190828211848310176100d957808491604096879485528339810103126100fa57610056602061004f846100ff565b93016100ff565b608083905260a08190526001600160a01b0392831692833b156100fa5760446000928387519687948593633e9f1edf60e11b85523060048601521660248401525af180156100ef576100ca575b825161046f908161011482396080518181816101330152610342015260a051816101770152f35b81116100d957815238806100a3565b634e487b7160e01b600052604160045260246000fd5b83513d6000823e3d90fd5b600080fd5b51906001600160a01b03821682036100fa5756fe608080604052600436101561001357600080fd5b600090813560e01c90816301ffc9a71461019b575080630ffe8a071461015757806341f43434146101135780635e6a6f8a146100dd5763e48351771461005857600080fd5b346100d65760a03660031901126100d657610071610270565b61007961028b565b916100826102a1565b5067ffffffffffffffff906064358281116100d9576100a59036906004016102b7565b50506084359182116100d65760206100cc85856100c536600488016102b7565b50506102e8565b6040519015158152f35b80fd5b5080fd5b50346100d65760803660031901126100d65760206100cc6100fc610270565b61010461028b565b9061010d6102a1565b506102e8565b50346100d657806003193601126100d65760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346100d657806003193601126100d65760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b9050346100d95760203660031901126100d9576004357fffffffff00000000000000000000000000000000000000000000000000000000811680910361026c57602092507f45ffcdad000000000000000000000000000000000000000000000000000000008114908115610242575b8115610218575b5015158152f35b7f01ffc9a70000000000000000000000000000000000000000000000000000000091501438610211565b7fff16f350000000000000000000000000000000000000000000000000000000008114915061020a565b8280fd5b600435906001600160a01b038216820361028657565b600080fd5b602435906001600160a01b038216820361028657565b604435906001600160a01b038216820361028657565b9181601f840112156102865782359167ffffffffffffffff8311610286576020808501948460051b01011161028657565b6001600160a01b03908116918116829003610305575b5050600190565b6020604491604051928380927fc61711340000000000000000000000000000000000000000000000000000000082523060048301528660248301527f0000000000000000000000000000000000000000000000000000000000000000165afa90811561042d576000916103b0575b501561037f57806102fe565b602490604051907fede71dcc0000000000000000000000000000000000000000000000000000000082526004820152fd5b60203d8111610426575b601f8101601f1916820167ffffffffffffffff8111838210176103f9576020918391604052810103126100d957519081151582036100d6575038610373565b6024847f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b503d6103ba565b6040513d6000823e3d90fdfea2646970667358221220e577d1653201c068988f73406c8722579048194f5353ebb669dbaf9ed5a781dd64736f6c63430008110033000000000000000000000000000000000000aaeb6d7670e522a718067333cd4e0000000000000000000000003cc6cdda760b79bafa08df41ecfa224f810dceb6

Deployed Bytecode

0x608080604052600436101561001357600080fd5b600090813560e01c90816301ffc9a71461019b575080630ffe8a071461015757806341f43434146101135780635e6a6f8a146100dd5763e48351771461005857600080fd5b346100d65760a03660031901126100d657610071610270565b61007961028b565b916100826102a1565b5067ffffffffffffffff906064358281116100d9576100a59036906004016102b7565b50506084359182116100d65760206100cc85856100c536600488016102b7565b50506102e8565b6040519015158152f35b80fd5b5080fd5b50346100d65760803660031901126100d65760206100cc6100fc610270565b61010461028b565b9061010d6102a1565b506102e8565b50346100d657806003193601126100d65760206040516001600160a01b037f000000000000000000000000000000000000aaeb6d7670e522a718067333cd4e168152f35b50346100d657806003193601126100d65760206040516001600160a01b037f0000000000000000000000003cc6cdda760b79bafa08df41ecfa224f810dceb6168152f35b9050346100d95760203660031901126100d9576004357fffffffff00000000000000000000000000000000000000000000000000000000811680910361026c57602092507f45ffcdad000000000000000000000000000000000000000000000000000000008114908115610242575b8115610218575b5015158152f35b7f01ffc9a70000000000000000000000000000000000000000000000000000000091501438610211565b7fff16f350000000000000000000000000000000000000000000000000000000008114915061020a565b8280fd5b600435906001600160a01b038216820361028657565b600080fd5b602435906001600160a01b038216820361028657565b604435906001600160a01b038216820361028657565b9181601f840112156102865782359167ffffffffffffffff8311610286576020808501948460051b01011161028657565b6001600160a01b03908116918116829003610305575b5050600190565b6020604491604051928380927fc61711340000000000000000000000000000000000000000000000000000000082523060048301528660248301527f000000000000000000000000000000000000aaeb6d7670e522a718067333cd4e165afa90811561042d576000916103b0575b501561037f57806102fe565b602490604051907fede71dcc0000000000000000000000000000000000000000000000000000000082526004820152fd5b60203d8111610426575b601f8101601f1916820167ffffffffffffffff8111838210176103f9576020918391604052810103126100d957519081151582036100d6575038610373565b6024847f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b503d6103ba565b6040513d6000823e3d90fdfea2646970667358221220e577d1653201c068988f73406c8722579048194f5353ebb669dbaf9ed5a781dd64736f6c63430008110033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000000000000000aaeb6d7670e522a718067333cd4e0000000000000000000000003cc6cdda760b79bafa08df41ecfa224f810dceb6

-----Decoded View---------------
Arg [0] : operatorFilterRegistry (address): 0x000000000000AAeB6D7670E522A718067333cd4E
Arg [1] : subscription (address): 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000aaeb6d7670e522a718067333cd4e
Arg [1] : 0000000000000000000000003cc6cdda760b79bafa08df41ecfa224f810dceb6


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ 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.