Oko contract explorer
Contract

Code for 0xe31a…ed25 (TransferManagerERC721)

Since block 15223525

Verified contract

{{
  "language": "Solidity",
  "sources": {
    "contracts/transferManagers/TransferManagerERC721.sol": {
      "content": "/**\n                                                ....                      ....                              ....       \n                                                 #@@@?                    ^@@@@                             :@@@@       \n                                                 P&&&!                    :@@@@                             :@@@@       \n     ....  ....  ....     .....................  ....   ............   ...!@@@@:...   ............  ........!@@@@       \n    !@@@&  @@@@: G@@@Y   .@@@@@@@@@@@@@@@@@@@@@. #@@@? !@@@@@@@@@@@@~ J@@@@@@@@@@@@^ P@@@@@@@@@@@@. B@@@@@@@@@@@@       \n    !@@@&  @@@@: G@@@5   .@@@@&&&&@@@@@&&&&@@@@. #@@@? !@@@@&&&&@@@@~ 7&&&&@@@@&&&&: P@@@@#&&&@@@@. B@@@@&&&&@@@@       \n    ~&&&G  #&&&. G@@@5   .@@@@.   G@@@5   .@@@@. #@@@? !@@@&    &@@@~     ^@@@@      P@@@G...~@@@@. B@@@Y   ^@@@@       \n                 G@@@5   .@@@@.   G@@@5   .@@@@. #@@@? !@@@&    &@@@~     ^@@@@      P@@@@@@@@@@@@. B@@@J   :@@@@       \n                 G@@@5   .@@@@.   G@@@5   .@@@@. #@@@? !@@@&    &@@@~     ^@@@@      P@@@@#&&&##&#. B@@@J   :@@@@       \n     ............B@@@5   .@@@@.   G@@@5   .@@@@. #@@@? !@@@&    &@@@~     ^@@@@      P@@@G........  B@@@5...!@@@@       \n    !@@@@@@@@@@@@@@@@5   .@@@@.   G@@@5   .@@@@. #@@@? 7@@@&    &@@@~     ^@@@@      P@@@@@@@@@@@@. B@@@@@@@@@@@@       \n    ~&&&&&&&&&&&&&&&&?   .&&&#    Y&&&?   .&&&#. P&&&! ~&&&G    B&&&^     :&&&#      J&&&&&&&&&&&&. 5&&&&&&&&&&&#   \n                                                                                                                                                                                            \n*/\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport {IERC721} from \"@openzeppelin/contracts/token/ERC721/IERC721.sol\";\n\nimport {ITransferManagerNFT} from \"../interfaces/ITransferManagerNFT.sol\";\n\n/**\n * @title TransferManagerERC721\n * @notice It allows the transfer of ERC721 tokens.\n */\ncontract TransferManagerERC721 is ITransferManagerNFT {\n    address public immutable MINTED_EXCHANGE;\n\n    /**\n     * @notice Constructor\n     * @param _mintedExchange address of the Minted exchange\n     */\n    constructor(address _mintedExchange) {\n        MINTED_EXCHANGE = _mintedExchange;\n    }\n\n    /**\n     * @notice Transfer ERC721 token\n     * @param collection address of the collection\n     * @param from address of the sender\n     * @param to address of the recipient\n     * @param tokenId tokenId\n     * @dev For ERC721, amount is not used\n     */\n    function transferNonFungibleToken(\n        address collection,\n        address from,\n        address to,\n        uint256 tokenId,\n        uint256\n    ) external override {\n        require(msg.sender == MINTED_EXCHANGE, \"Transfer: Only Minted Exchange\");\n        // https://docs.openzeppelin.com/contracts/2.x/api/token/erc721#IERC721-safeTransferFrom\n        IERC721(collection).safeTransferFrom(from, to, tokenId);\n    }\n}\n"
    },
    "@openzeppelin/contracts/token/ERC721/IERC721.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n    /**\n     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n    /**\n     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n     */\n    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n    /**\n     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n     */\n    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n    /**\n     * @dev Returns the number of tokens in ``owner``'s account.\n     */\n    function balanceOf(address owner) external view returns (uint256 balance);\n\n    /**\n     * @dev Returns the owner of the `tokenId` token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     */\n    function ownerOf(uint256 tokenId) external view returns (address owner);\n\n    /**\n     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n     * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must exist and be owned by `from`.\n     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n     *\n     * Emits a {Transfer} event.\n     */\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    /**\n     * @dev Transfers `tokenId` token from `from` to `to`.\n     *\n     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must be owned by `from`.\n     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    /**\n     * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n     * The approval is cleared when the token is transferred.\n     *\n     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n     *\n     * Requirements:\n     *\n     * - The caller must own the token or be an approved operator.\n     * - `tokenId` must exist.\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address to, uint256 tokenId) external;\n\n    /**\n     * @dev Returns the account approved for `tokenId` token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     */\n    function getApproved(uint256 tokenId) external view returns (address operator);\n\n    /**\n     * @dev Approve or remove `operator` as an operator for the caller.\n     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n     *\n     * Requirements:\n     *\n     * - The `operator` cannot be the caller.\n     *\n     * Emits an {ApprovalForAll} event.\n     */\n    function setApprovalForAll(address operator, bool _approved) external;\n\n    /**\n     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n     *\n     * See {setApprovalForAll}\n     */\n    function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n    /**\n     * @dev Safely transfers `tokenId` token from `from` to `to`.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must exist and be owned by `from`.\n     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n     *\n     * Emits a {Transfer} event.\n     */\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId,\n        bytes calldata data\n    ) external;\n}\n"
    },
    "contracts/interfaces/ITransferManagerNFT.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface ITransferManagerNFT {\n    function transferNonFungibleToken(\n        address collection,\n        address from,\n        address to,\n        uint256 tokenId,\n        uint256 amount\n    ) external;\n}\n"
    },
    "@openzeppelin/contracts/utils/introspection/IERC165.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "libraries": {}
  }
}}

Contract sourced from Etherscan. Solidity version v0.8.4+commit.c7e474f2.

Panoramix decompilation

# Palkeoramix decompiler. 

const MINTED_EXCHANGE = 0x40cbf9c75a46b147e0fd9ab47df5e064ae015f92

#
#  Regular functions
#

def _fallback(?) payable: # default function
  revert

def transferNonFungibleToken(address collection, address from, address to, uint256 tokenId, uint256 _param5) payable: 
  require calldata.size - 4 >=′ 160
  require collection == collection
  require from == from
  require to == to
  if caller != 0x40cbf9c75a46b147e0fd9ab47df5e064ae015f92:
      revert with 0, 'Transfer: Only Minted Exchange'
  require ext_code.size(collection)
  call collection.safeTransferFrom(address from, address to, uint256 tokenId) with:
       gas gas_remaining wei
      args address(from), address(to), tokenId
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]

Decompilation generated by Panoramix.

Raw bytecode

0x608060405234801561001057600080fd5b50600436106100365760003560e01c806323c24c791461003b57806333f2fa9f1461007e575b600080fd5b6100627f00000000000000000000000040cbf9c75a46b147e0fd9ab47df5e064ae015f9281565b6040516001600160a01b03909116815260200160405180910390f35b61009161008c36600461019c565b610093565b005b336001600160a01b037f00000000000000000000000040cbf9c75a46b147e0fd9ab47df5e064ae015f92161461010f5760405162461bcd60e51b815260206004820152601e60248201527f5472616e736665723a204f6e6c79204d696e7465642045786368616e67650000604482015260640160405180910390fd5b604051632142170760e11b81526001600160a01b0385811660048301528481166024830152604482018490528616906342842e0e90606401600060405180830381600087803b15801561016157600080fd5b505af1158015610175573d6000803e3d6000fd5b505050505050505050565b80356001600160a01b038116811461019757600080fd5b919050565b600080600080600060a086880312156101b3578081fd5b6101bc86610180565b94506101ca60208701610180565b93506101d860408701610180565b9497939650939460608101359450608001359291505056fea264697066735822122019ec063d58fb721db8b95bcb883f2cb190b2c4597eb5bab0b28b6d2974d120e864736f6c63430008040033