ETH Price: $2,133.24 (-0.37%)

Contract

0xF33CDcE72fA31932CFB104000DBBfc5F2C4F005d
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
X2Y2Market

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: UNLICENSED

pragma solidity 0.8.17;

import "../../interfaces/tokens/IERC721.sol";
import "../../interfaces/tokens/IERC1155.sol";

library X2Y2Market {

    address public constant _x2y2 = 0x74312363e45DCaBA76c59ec49a7Aa8A65a67EeD3;  // Ethereum Mainnet

    struct TradeDataX2Y2{
        bytes data;
        uint256 value;
        address addr;
        uint256 tokenId;
        string ercType;
    }
    event Log(string message);
    event LogBytes(bytes4 message);

    function execute(bytes memory tradeData) public {
        TradeDataX2Y2 memory params = abi.decode(tradeData, (TradeDataX2Y2));

        if (params.data[0] == 0x35 &&
            params.data[1] == 0x7a &&
            params.data[2] == 0x15 &&
            params.data[3] == 0x0b ) {

            (bool success,) = _x2y2.call{value: params.value}(params.data);

            if(success && keccak256(abi.encodePacked(params.ercType)) == keccak256(abi.encodePacked('erc721'))){
                IERC721(params.addr).transferFrom(
                    address(this),
                    msg.sender,
                    params.tokenId
                );
            } else if (success && keccak256(abi.encodePacked(params.ercType)) == keccak256(abi.encodePacked('erc1155'))){
                IERC1155(params.addr).safeTransferFrom(
                    address(this),
                    msg.sender,
                    params.tokenId,
                    1,
                    ""
                );
            }

        } else {
            revert("Invalid method.");
        }
    }
}

// SPDX-License-Identifier: MIT

pragma solidity 0.8.17;

interface IERC1155 {
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) external;

    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) external;

    function balanceOf(address _owner, uint256 _id) external view returns (uint256);
}

// SPDX-License-Identifier: MIT

pragma solidity 0.8.17;

interface IERC721 {
    /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE
    ///  TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE
    ///  THEY MAY BE PERMANENTLY LOST
    /// @dev Throws unless `msg.sender` is the current owner, an authorized
    ///  operator, or the approved address for this NFT. Throws if `_from` is
    ///  not the current owner. Throws if `_to` is the zero address. Throws if
    ///  `_tokenId` is not a valid NFT.
    /// @param _from The current owner of the NFT
    /// @param _to The new owner
    /// @param _tokenId The NFT to transfer
    function transferFrom(address _from, address _to, uint256 _tokenId) external payable;

    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) external;

    function setApprovalForAll(address operator, bool approved) external;

    function approve(address to, uint256 tokenId) external;

    function isApprovedForAll(address owner, address operator) external view returns (bool);

    function balanceOf(address _owner) external view returns (uint256);
}

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

Contract Security Audit

Contract ABI

API
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"message","type":"string"}],"name":"Log","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes4","name":"message","type":"bytes4"}],"name":"LogBytes","type":"event"},{"inputs":[],"name":"_x2y2","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

6108d561003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100405760003560e01c806309c5eabe146100455780631a2f139814610067575b600080fd5b81801561005157600080fd5b50610065610060366004610666565b6100ab565b005b6100827374312363e45dcaba76c59ec49a7aa8a65a67eed381565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6000818060200190518101906100c1919061078a565b905080600001516000815181106100da576100da610854565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f350000000000000000000000000000000000000000000000000000000000000014801561018b575080518051600190811061014057610140610854565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f7a00000000000000000000000000000000000000000000000000000000000000145b80156101f257508051805160029081106101a7576101a7610854565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f1500000000000000000000000000000000000000000000000000000000000000145b8015610259575080518051600390811061020e5761020e610854565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f0b00000000000000000000000000000000000000000000000000000000000000145b156105135760007374312363e45dcaba76c59ec49a7aa8a65a67eed373ffffffffffffffffffffffffffffffffffffffff16826020015183600001516040516102a29190610883565b60006040518083038185875af1925050503d80600081146102df576040519150601f19603f3d011682016040523d82523d6000602084013e6102e4565b606091505b5050905080801561035f57506040517f657263373231000000000000000000000000000000000000000000000000000060208201526026016040516020818303038152906040528051906020012082608001516040516020016103479190610883565b60405160208183030381529060405280519060200120145b156103ff57604080830151606084015191517f23b872dd000000000000000000000000000000000000000000000000000000008152306004820152336024820152604481019290925273ffffffffffffffffffffffffffffffffffffffff16906323b872dd90606401600060405180830381600087803b1580156103e257600080fd5b505af11580156103f6573d6000803e3d6000fd5b50505050505050565b80801561047657506040517f6572633131353500000000000000000000000000000000000000000000000000602082015260270160405160208183030381529060405280519060200120826080015160405160200161045e9190610883565b60405160208183030381529060405280519060200120145b1561050e57604080830151606084015191517ff242432a00000000000000000000000000000000000000000000000000000000815230600482015233602482015260448101929092526001606483015260a06084830152600060a483015273ffffffffffffffffffffffffffffffffffffffff169063f242432a9060c401600060405180830381600087803b1580156103e257600080fd5b505050565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f496e76616c6964206d6574686f642e0000000000000000000000000000000000604482015260640160405180910390fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160a0810167ffffffffffffffff811182821017156105cb576105cb610579565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561061857610618610579565b604052919050565b600067ffffffffffffffff82111561063a5761063a610579565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60006020828403121561067857600080fd5b813567ffffffffffffffff81111561068f57600080fd5b8201601f810184136106a057600080fd5b80356106b36106ae82610620565b6105d1565b8181528560208385010111156106c857600080fd5b81602084016020830137600091810160200191909152949350505050565b60005b838110156107015781810151838201526020016106e9565b50506000910152565b60006107186106ae84610620565b905082815283838301111561072c57600080fd5b61073a8360208301846106e6565b9392505050565b805173ffffffffffffffffffffffffffffffffffffffff8116811461076557600080fd5b919050565b600082601f83011261077b57600080fd5b61073a8383516020850161070a565b60006020828403121561079c57600080fd5b815167ffffffffffffffff808211156107b457600080fd5b9083019060a082860312156107c857600080fd5b6107d06105a8565b8251828111156107df57600080fd5b8301601f810187136107f057600080fd5b6107ff8782516020840161070a565b8252506020830151602082015261081860408401610741565b60408201526060830151606082015260808301518281111561083957600080fd5b6108458782860161076a565b60808301525095945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082516108958184602087016106e6565b919091019291505056fea2646970667358221220b6a1aff5bd0c6140db4f90486ff2026a5c8bd721cd11f7de45a7782df1b5e97a64736f6c63430008110033

Deployed Bytecode

0x73f33cdce72fa31932cfb104000dbbfc5f2c4f005d30146080604052600436106100405760003560e01c806309c5eabe146100455780631a2f139814610067575b600080fd5b81801561005157600080fd5b50610065610060366004610666565b6100ab565b005b6100827374312363e45dcaba76c59ec49a7aa8a65a67eed381565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6000818060200190518101906100c1919061078a565b905080600001516000815181106100da576100da610854565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f350000000000000000000000000000000000000000000000000000000000000014801561018b575080518051600190811061014057610140610854565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f7a00000000000000000000000000000000000000000000000000000000000000145b80156101f257508051805160029081106101a7576101a7610854565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f1500000000000000000000000000000000000000000000000000000000000000145b8015610259575080518051600390811061020e5761020e610854565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f0b00000000000000000000000000000000000000000000000000000000000000145b156105135760007374312363e45dcaba76c59ec49a7aa8a65a67eed373ffffffffffffffffffffffffffffffffffffffff16826020015183600001516040516102a29190610883565b60006040518083038185875af1925050503d80600081146102df576040519150601f19603f3d011682016040523d82523d6000602084013e6102e4565b606091505b5050905080801561035f57506040517f657263373231000000000000000000000000000000000000000000000000000060208201526026016040516020818303038152906040528051906020012082608001516040516020016103479190610883565b60405160208183030381529060405280519060200120145b156103ff57604080830151606084015191517f23b872dd000000000000000000000000000000000000000000000000000000008152306004820152336024820152604481019290925273ffffffffffffffffffffffffffffffffffffffff16906323b872dd90606401600060405180830381600087803b1580156103e257600080fd5b505af11580156103f6573d6000803e3d6000fd5b50505050505050565b80801561047657506040517f6572633131353500000000000000000000000000000000000000000000000000602082015260270160405160208183030381529060405280519060200120826080015160405160200161045e9190610883565b60405160208183030381529060405280519060200120145b1561050e57604080830151606084015191517ff242432a00000000000000000000000000000000000000000000000000000000815230600482015233602482015260448101929092526001606483015260a06084830152600060a483015273ffffffffffffffffffffffffffffffffffffffff169063f242432a9060c401600060405180830381600087803b1580156103e257600080fd5b505050565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f496e76616c6964206d6574686f642e0000000000000000000000000000000000604482015260640160405180910390fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160a0810167ffffffffffffffff811182821017156105cb576105cb610579565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561061857610618610579565b604052919050565b600067ffffffffffffffff82111561063a5761063a610579565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60006020828403121561067857600080fd5b813567ffffffffffffffff81111561068f57600080fd5b8201601f810184136106a057600080fd5b80356106b36106ae82610620565b6105d1565b8181528560208385010111156106c857600080fd5b81602084016020830137600091810160200191909152949350505050565b60005b838110156107015781810151838201526020016106e9565b50506000910152565b60006107186106ae84610620565b905082815283838301111561072c57600080fd5b61073a8360208301846106e6565b9392505050565b805173ffffffffffffffffffffffffffffffffffffffff8116811461076557600080fd5b919050565b600082601f83011261077b57600080fd5b61073a8383516020850161070a565b60006020828403121561079c57600080fd5b815167ffffffffffffffff808211156107b457600080fd5b9083019060a082860312156107c857600080fd5b6107d06105a8565b8251828111156107df57600080fd5b8301601f810187136107f057600080fd5b6107ff8782516020840161070a565b8252506020830151602082015261081860408401610741565b60408201526060830151606082015260808301518281111561083957600080fd5b6108458782860161076a565b60808301525095945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082516108958184602087016106e6565b919091019291505056fea2646970667358221220b6a1aff5bd0c6140db4f90486ff2026a5c8bd721cd11f7de45a7782df1b5e97a64736f6c63430008110033

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

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.