ETH Price: $1,943.68 (-2.23%)
 

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
Match Orders242337802026-01-14 15:16:5939 days ago1768403819IN
0x4E992E34...49277B6CD
0.0469 ETH0.001092342.7786913
Match Orders241262952025-12-30 15:19:1154 days ago1767107951IN
0x4E992E34...49277B6CD
0.026 ETH0.000828372.21278165
Match Orders240520902025-12-20 6:42:4764 days ago1766212967IN
0x4E992E34...49277B6CD
0.0001 ETH0.000009690.02512267
Batch Match Orde...240519362025-12-20 6:11:5964 days ago1766211119IN
0x4E992E34...49277B6CD
0.0001 ETH0.000009160.02355222
Match Orders240518562025-12-20 5:55:5964 days ago1766210159IN
0x4E992E34...49277B6CD
0.0001 ETH0.000781592.0251539
Match Orders240517552025-12-20 5:35:4764 days ago1766208947IN
0x4E992E34...49277B6CD
0.0001 ETH0.000008070.02115585
Match Orders240456852025-12-19 9:16:2365 days ago1766135783IN
0x4E992E34...49277B6CD
0.026 ETH0.000009570.02451332
Batch Match Orde...240448172025-12-19 6:21:2365 days ago1766125283IN
0x4E992E34...49277B6CD
0.0002 ETH0.001315962.02723535
Batch Match Orde...240447882025-12-19 6:15:3565 days ago1766124935IN
0x4E992E34...49277B6CD
0.0001 ETH0.000791222.03171582
Match Orders240447162025-12-19 6:00:4765 days ago1766124047IN
0x4E992E34...49277B6CD
0.0001 ETH0.000740552.0313834
Batch Match Orde...240446822025-12-19 5:53:4765 days ago1766123627IN
0x4E992E34...49277B6CD
0.0002 ETH0.000016830.02592916
Batch Match Orde...240445432025-12-19 5:25:5965 days ago1766121959IN
0x4E992E34...49277B6CD
0.002 ETH0.000017520.027
Match Orders240445102025-12-19 5:19:2365 days ago1766121563IN
0x4E992E34...49277B6CD
0.0001 ETH0.000791562.02584926
Batch Match Orde...240439002025-12-19 3:15:4765 days ago1766114147IN
0x4E992E34...49277B6CD
0.004 ETH0.000025760.03968481
Batch Match Orde...240198782025-12-15 18:45:1169 days ago1765824311IN
0x4E992E34...49277B6CD
0.0001 ETH0.000066640.17326676
Match Orders240198012025-12-15 18:29:4769 days ago1765823387IN
0x4E992E34...49277B6CD
0.0001 ETH0.000045610.11818843
Batch Match Orde...240197112025-12-15 18:11:4769 days ago1765822307IN
0x4E992E34...49277B6CD
0.0001 ETH0.000053470.13902667
Match Orders240194492025-12-15 17:19:1169 days ago1765819151IN
0x4E992E34...49277B6CD
0.0001 ETH0.000059250.15352514
Batch Match Orde...239978902025-12-12 17:00:1172 days ago1765558811IN
0x4E992E34...49277B6CD
0.0002 ETH0.00004690.0722499
Match Orders239978572025-12-12 16:53:3572 days ago1765558415IN
0x4E992E34...49277B6CD
0.0001 ETH0.000808182.09133357
Batch Match Orde...239976132025-12-12 16:04:4772 days ago1765555487IN
0x4E992E34...49277B6CD
0.0002 ETH0.001694432.61022516
Batch Match Orde...239974932025-12-12 15:40:4772 days ago1765554047IN
0x4E992E34...49277B6CD
0.004 ETH0.001630672.51190894
Match Orders239974512025-12-12 15:32:2372 days ago1765553543IN
0x4E992E34...49277B6CD
0.0001 ETH0.000902622.33565063
Batch Match Orde...239937462025-12-12 2:58:5972 days ago1765508339IN
0x4E992E34...49277B6CD
0.0002 ETH0.001371232.11224837
Match Orders239201112025-12-01 17:26:2383 days ago1764609983IN
0x4E992E34...49277B6CD
0.001 ETH0.000894182.2882545
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Method Block
From
To
Transfer242337802026-01-14 15:16:5939 days ago1768403819
0x4E992E34...49277B6CD
0.0469 ETH
Receive ETH242337802026-01-14 15:16:5939 days ago1768403819
0x4E992E34...49277B6CD
0x4E992E34...49277B6CD
0.0469 ETH
Transfer241262952025-12-30 15:19:1154 days ago1767107951
0x4E992E34...49277B6CD
0.026 ETH
Receive ETH241262952025-12-30 15:19:1154 days ago1767107951
0x4E992E34...49277B6CD
0x4E992E34...49277B6CD
0.026 ETH
Transfer240520902025-12-20 6:42:4764 days ago1766212967
0x4E992E34...49277B6CD
0.0001 ETH
Receive ETH240520902025-12-20 6:42:4764 days ago1766212967
0x4E992E34...49277B6CD
0x4E992E34...49277B6CD
0.0001 ETH
Transfer240519362025-12-20 6:11:5964 days ago1766211119
0x4E992E34...49277B6CD
0.0001 ETH
Receive ETH240519362025-12-20 6:11:5964 days ago1766211119
0x4E992E34...49277B6CD
0x4E992E34...49277B6CD
0.0001 ETH
Transfer240518562025-12-20 5:55:5964 days ago1766210159
0x4E992E34...49277B6CD
0.0001 ETH
Receive ETH240518562025-12-20 5:55:5964 days ago1766210159
0x4E992E34...49277B6CD
0x4E992E34...49277B6CD
0.0001 ETH
Transfer240517552025-12-20 5:35:4764 days ago1766208947
0x4E992E34...49277B6CD
0.0001 ETH
Receive ETH240517552025-12-20 5:35:4764 days ago1766208947
0x4E992E34...49277B6CD
0x4E992E34...49277B6CD
0.0001 ETH
Transfer240456852025-12-19 9:16:2365 days ago1766135783
0x4E992E34...49277B6CD
0.026 ETH
Receive ETH240456852025-12-19 9:16:2365 days ago1766135783
0x4E992E34...49277B6CD
0x4E992E34...49277B6CD
0.026 ETH
Transfer240448172025-12-19 6:21:2365 days ago1766125283
0x4E992E34...49277B6CD
0.0001 ETH
Receive ETH240448172025-12-19 6:21:2365 days ago1766125283
0x4E992E34...49277B6CD
0x4E992E34...49277B6CD
0.0001 ETH
Transfer240448172025-12-19 6:21:2365 days ago1766125283
0x4E992E34...49277B6CD
0.0001 ETH
Receive ETH240448172025-12-19 6:21:2365 days ago1766125283
0x4E992E34...49277B6CD
0x4E992E34...49277B6CD
0.0001 ETH
Transfer240447882025-12-19 6:15:3565 days ago1766124935
0x4E992E34...49277B6CD
0.0001 ETH
Receive ETH240447882025-12-19 6:15:3565 days ago1766124935
0x4E992E34...49277B6CD
0x4E992E34...49277B6CD
0.0001 ETH
Transfer240447162025-12-19 6:00:4765 days ago1766124047
0x4E992E34...49277B6CD
0.0001 ETH
Receive ETH240447162025-12-19 6:00:4765 days ago1766124047
0x4E992E34...49277B6CD
0x4E992E34...49277B6CD
0.0001 ETH
Transfer240446822025-12-19 5:53:4765 days ago1766123627
0x4E992E34...49277B6CD
0.0001 ETH
Receive ETH240446822025-12-19 5:53:4765 days ago1766123627
0x4E992E34...49277B6CD
0x4E992E34...49277B6CD
0.0001 ETH
Transfer240446822025-12-19 5:53:4765 days ago1766123627
0x4E992E34...49277B6CD
0.0001 ETH
View All Internal Transactions
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:
ExchangeProxy

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
istanbul EvmVersion
// Copyright 2024 Energi Core

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

// Energi Governance system is the fundamental part of Energi Core.

// NOTE: It's not allowed to change the compiler due to byte-to-byte
//       match requirement.

/// @title  ExchangeProxy
/// @author Energi Core
/// @notice Proxy contract for Exchange
/// @dev    Proxy contract delegates calls to it's implementation contract

pragma solidity 0.8.24;

import { ReentrancyGuard } from '@openzeppelin/contracts/utils/ReentrancyGuard.sol';
import { ERC1967Proxy } from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';

import { IERC20 } from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import { IERC721 } from '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import { IERC1155 } from '@openzeppelin/contracts/token/ERC1155/IERC1155.sol';

/**
 * SC-9: This contract has no chance of being updated. It must be stupid simple.
 *
 * If another upgrade logic is required in the future - it can be done as proxy stage II.
 */
contract ExchangeProxy is ERC1967Proxy, ReentrancyGuard {
    constructor(address _implementation, bytes memory _data) ERC1967Proxy(_implementation, _data) {}

    modifier senderOrigin() {
        // Internal calls are expected to use implementation directly.
        // That's due to use of call() instead of delegatecall() on purpose.
        require(tx.origin == msg.sender, 'ExchangeGovernedProxy: Only direct calls are allowed!');
        _;
    }

    modifier onlyImplementation() {
        require(
            msg.sender == address(_implementation()),
            'ExchangeGovernedProxy: Only calls from implementation are allowed!'
        );
        _;
    }

    event Match(
        bytes32 leftHash,
        bytes32 rightHash,
        address leftMaker,
        address rightMaker,
        uint256 newLeftFill,
        uint256 newRightFill
    );

    event CancelOrder(bytes32 hash);

    event Transfer(
        bytes4 indexed assetClass,
        address indexed from,
        address indexed to,
        bytes assetData,
        uint256 assetValue,
        bytes4 transferDirection,
        bytes4 transferType
    );

    function safeTransferERC20(IERC20 token, address to, uint256 value) external nonReentrant onlyImplementation {
        require(token.transfer(to, value), 'ExchangeGovernedProxy: safe transfer of ERC20 token failed');
    }

    function safeTransferERC20From(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) external nonReentrant onlyImplementation {
        require(token.transferFrom(from, to, value), 'ExchangeGovernedProxy: safe transferFrom of ERC20 token failed');
    }

    function safeTransferERC721From(
        IERC721 token,
        address from,
        address to,
        uint256 tokenId
    ) external nonReentrant onlyImplementation {
        token.safeTransferFrom(from, to, tokenId);
    }

    function safeTransferERC1155From(
        IERC1155 token,
        address from,
        address to,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external nonReentrant onlyImplementation {
        token.safeTransferFrom(from, to, id, value, data);
    }

    function safeTransferETH(address to, uint256 amount) external nonReentrant onlyImplementation {
        (bool success, bytes memory data) = to.call{ value: amount }('');
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            'ExchangeGovernedProxy::safeTransferETH: failed to transfer ETH'
        );
    }

    function receiveETH() external payable {}

    function emitMatch(
        bytes32 leftHash,
        bytes32 rightHash,
        address leftMaker,
        address rightMaker,
        uint256 newLeftFill,
        uint256 newRightFill
    ) external onlyImplementation {
        emit Match(leftHash, rightHash, leftMaker, rightMaker, newLeftFill, newRightFill);
    }

    function emitCancelOrder(bytes32 hash) external onlyImplementation {
        emit CancelOrder(hash);
    }

    function emitTransfer(
        bytes4 assetClass,
        address from,
        address to,
        bytes calldata assetData,
        uint256 assetValue,
        bytes4 transferDirection,
        bytes4 transferType
    ) external onlyImplementation {
        emit Transfer(assetClass, from, to, assetData, assetValue, transferDirection, transferType);
    }

    receive() external payable {}
}

File 2 of 14 : IERC1967.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1967.sol)

pragma solidity ^0.8.20;

/**
 * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
 */
interface IERC1967 {
    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Emitted when the beacon is changed.
     */
    event BeaconUpgraded(address indexed beacon);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.20;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeacon {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {UpgradeableBeacon} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (proxy/ERC1967/ERC1967Proxy.sol)

pragma solidity ^0.8.20;

import {Proxy} from "../Proxy.sol";
import {ERC1967Utils} from "./ERC1967Utils.sol";

/**
 * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an
 * implementation address that can be changed. This address is stored in storage in the location specified by
 * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967], so that it doesn't conflict with the storage layout of the
 * implementation behind the proxy.
 */
contract ERC1967Proxy is Proxy {
    /**
     * @dev Initializes the upgradeable proxy with an initial implementation specified by `implementation`.
     *
     * If `_data` is nonempty, it's used as data in a delegate call to `implementation`. This will typically be an
     * encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.
     *
     * Requirements:
     *
     * - If `data` is empty, `msg.value` must be zero.
     */
    constructor(address implementation, bytes memory _data) payable {
        ERC1967Utils.upgradeToAndCall(implementation, _data);
    }

    /**
     * @dev Returns the current implementation address.
     *
     * TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using
     * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
     * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`
     */
    function _implementation() internal view virtual override returns (address) {
        return ERC1967Utils.getImplementation();
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (proxy/ERC1967/ERC1967Utils.sol)

pragma solidity ^0.8.21;

import {IBeacon} from "../beacon/IBeacon.sol";
import {IERC1967} from "../../interfaces/IERC1967.sol";
import {Address} from "../../utils/Address.sol";
import {StorageSlot} from "../../utils/StorageSlot.sol";

/**
 * @dev This library provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.
 */
library ERC1967Utils {
    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev The `implementation` of the proxy is invalid.
     */
    error ERC1967InvalidImplementation(address implementation);

    /**
     * @dev The `admin` of the proxy is invalid.
     */
    error ERC1967InvalidAdmin(address admin);

    /**
     * @dev The `beacon` of the proxy is invalid.
     */
    error ERC1967InvalidBeacon(address beacon);

    /**
     * @dev An upgrade function sees `msg.value > 0` that may be lost.
     */
    error ERC1967NonPayable();

    /**
     * @dev Returns the current implementation address.
     */
    function getImplementation() internal view returns (address) {
        return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the ERC-1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        if (newImplementation.code.length == 0) {
            revert ERC1967InvalidImplementation(newImplementation);
        }
        StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Performs implementation upgrade with additional setup call if data is nonempty.
     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
     * to avoid stuck value in the contract.
     *
     * Emits an {IERC1967-Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) internal {
        _setImplementation(newImplementation);
        emit IERC1967.Upgraded(newImplementation);

        if (data.length > 0) {
            Address.functionDelegateCall(newImplementation, data);
        } else {
            _checkNonPayable();
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Returns the current admin.
     *
     * TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using
     * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
     */
    function getAdmin() internal view returns (address) {
        return StorageSlot.getAddressSlot(ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the ERC-1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        if (newAdmin == address(0)) {
            revert ERC1967InvalidAdmin(address(0));
        }
        StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {IERC1967-AdminChanged} event.
     */
    function changeAdmin(address newAdmin) internal {
        emit IERC1967.AdminChanged(getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Returns the current beacon.
     */
    function getBeacon() internal view returns (address) {
        return StorageSlot.getAddressSlot(BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the ERC-1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        if (newBeacon.code.length == 0) {
            revert ERC1967InvalidBeacon(newBeacon);
        }

        StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;

        address beaconImplementation = IBeacon(newBeacon).implementation();
        if (beaconImplementation.code.length == 0) {
            revert ERC1967InvalidImplementation(beaconImplementation);
        }
    }

    /**
     * @dev Change the beacon and trigger a setup call if data is nonempty.
     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
     * to avoid stuck value in the contract.
     *
     * Emits an {IERC1967-BeaconUpgraded} event.
     *
     * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since
     * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for
     * efficiency.
     */
    function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {
        _setBeacon(newBeacon);
        emit IERC1967.BeaconUpgraded(newBeacon);

        if (data.length > 0) {
            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
        } else {
            _checkNonPayable();
        }
    }

    /**
     * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract
     * if an upgrade doesn't perform an initialization call.
     */
    function _checkNonPayable() private {
        if (msg.value > 0) {
            revert ERC1967NonPayable();
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/Proxy.sol)

pragma solidity ^0.8.20;

/**
 * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
 * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
 * be specified by overriding the virtual {_implementation} function.
 *
 * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
 * different contract through the {_delegate} function.
 *
 * The success and return data of the delegated call will be returned back to the caller of the proxy.
 */
abstract contract Proxy {
    /**
     * @dev Delegates the current call to `implementation`.
     *
     * This function does not return to its internal call site, it will return directly to the external caller.
     */
    function _delegate(address implementation) internal virtual {
        assembly {
            // Copy msg.data. We take full control of memory in this inline assembly
            // block because it will not return to Solidity code. We overwrite the
            // Solidity scratch pad at memory position 0.
            calldatacopy(0, 0, calldatasize())

            // Call the implementation.
            // out and outsize are 0 because we don't know the size yet.
            let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)

            // Copy the returned data.
            returndatacopy(0, 0, returndatasize())

            switch result
            // delegatecall returns 0 on error.
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }

    /**
     * @dev This is a virtual function that should be overridden so it returns the address to which the fallback
     * function and {_fallback} should delegate.
     */
    function _implementation() internal view virtual returns (address);

    /**
     * @dev Delegates the current call to the address returned by `_implementation()`.
     *
     * This function does not return to its internal call site, it will return directly to the external caller.
     */
    function _fallback() internal virtual {
        _delegate(_implementation());
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
     * function in the contract matches the call data.
     */
    fallback() external payable virtual {
        _fallback();
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC-1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[ERC].
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` amount of tokens of type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the value of tokens of token type `id` owned by `account`.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(
        address[] calldata accounts,
        uint256[] calldata ids
    ) external view returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the zero address.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`.
     *
     * WARNING: This function can potentially allow a reentrancy attack when transferring tokens
     * to an untrusted contract, when invoking {onERC1155Received} on the receiver.
     * Ensure to follow the checks-effects-interactions pattern and consider employing
     * reentrancy guards when interacting with untrusted contracts.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `value` amount.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * WARNING: This function can potentially allow a reentrancy attack when transferring tokens
     * to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.
     * Ensure to follow the checks-effects-interactions pattern and consider employing
     * reentrancy guards when interacting with untrusted contracts.
     *
     * Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments.
     *
     * Requirements:
     *
     * - `ids` and `values` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
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 value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` 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 value) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC-721 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 ERC-721 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 ERC-721
     * 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 address zero.
     *
     * 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);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)

pragma solidity ^0.8.20;

import {Errors} from "./Errors.sol";

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert Errors.InsufficientBalance(address(this).balance, amount);
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert Errors.FailedCall();
        }
    }

    /**
     * @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 or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {Errors.FailedCall} error.
     *
     * 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.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @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`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert Errors.InsufficientBalance(address(this).balance, value);
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

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

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case
     * of an unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {Errors.FailedCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.
     */
    function _revert(bytes memory returndata) 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
            assembly ("memory-safe") {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert Errors.FailedCall();
        }
    }
}

File 11 of 14 : Errors.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of common custom errors used in multiple contracts
 *
 * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
 * It is recommended to avoid relying on the error API for critical functionality.
 *
 * _Available since v5.1._
 */
library Errors {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error InsufficientBalance(uint256 balance, uint256 needed);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedCall();

    /**
     * @dev The deployment failed.
     */
    error FailedDeployment();

    /**
     * @dev A necessary precompile is missing.
     */
    error MissingPrecompile(address);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * 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[ERC 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);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
 * consider using {ReentrancyGuardTransient} instead.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC-1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(newImplementation.code.length > 0);
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * TIP: Consider using this library along with {SlotDerivation}.
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct Int256Slot {
        int256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        assembly ("memory-safe") {
            r.slot := slot
        }
    }

    /**
     * @dev Returns a `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        assembly ("memory-safe") {
            r.slot := slot
        }
    }

    /**
     * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        assembly ("memory-safe") {
            r.slot := slot
        }
    }

    /**
     * @dev Returns a `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        assembly ("memory-safe") {
            r.slot := slot
        }
    }

    /**
     * @dev Returns a `Int256Slot` with member `value` located at `slot`.
     */
    function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {
        assembly ("memory-safe") {
            r.slot := slot
        }
    }

    /**
     * @dev Returns a `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        assembly ("memory-safe") {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        assembly ("memory-safe") {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns a `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        assembly ("memory-safe") {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        assembly ("memory-safe") {
            r.slot := store.slot
        }
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_implementation","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[],"name":"FailedCall","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"hash","type":"bytes32"}],"name":"CancelOrder","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"leftHash","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"rightHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"leftMaker","type":"address"},{"indexed":false,"internalType":"address","name":"rightMaker","type":"address"},{"indexed":false,"internalType":"uint256","name":"newLeftFill","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newRightFill","type":"uint256"}],"name":"Match","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"bytes","name":"assetData","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"assetValue","type":"uint256"},{"indexed":false,"internalType":"bytes4","name":"transferDirection","type":"bytes4"},{"indexed":false,"internalType":"bytes4","name":"transferType","type":"bytes4"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"bytes32","name":"hash","type":"bytes32"}],"name":"emitCancelOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"leftHash","type":"bytes32"},{"internalType":"bytes32","name":"rightHash","type":"bytes32"},{"internalType":"address","name":"leftMaker","type":"address"},{"internalType":"address","name":"rightMaker","type":"address"},{"internalType":"uint256","name":"newLeftFill","type":"uint256"},{"internalType":"uint256","name":"newRightFill","type":"uint256"}],"name":"emitMatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"assetData","type":"bytes"},{"internalType":"uint256","name":"assetValue","type":"uint256"},{"internalType":"bytes4","name":"transferDirection","type":"bytes4"},{"internalType":"bytes4","name":"transferType","type":"bytes4"}],"name":"emitTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"receiveETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IERC1155","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferERC1155From","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"safeTransferERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"safeTransferERC20From","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferERC721From","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"safeTransferETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b5060405162001106380380620011068339810160408190526200003491620002a0565b818162000042828262000052565b5050600160005550620003999050565b6200005d82620000b8565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115620000aa57620000a5828262000135565b505050565b620000b4620001b2565b5050565b806001600160a01b03163b600003620000f457604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b0316846040516200015491906200037b565b600060405180830381855af49150503d806000811462000191576040519150601f19603f3d011682016040523d82523d6000602084013e62000196565b606091505b509092509050620001a9858383620001d4565b95945050505050565b3415620001d25760405163b398979f60e01b815260040160405180910390fd5b565b606082620001ed57620001e7826200023a565b62000233565b81511580156200020557506001600160a01b0384163b155b156200023057604051639996b31560e01b81526001600160a01b0385166004820152602401620000eb565b50805b9392505050565b8051156200024b5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b60005b83811015620002975781810151838201526020016200027d565b50506000910152565b60008060408385031215620002b457600080fd5b82516001600160a01b0381168114620002cc57600080fd5b60208401519092506001600160401b0380821115620002ea57600080fd5b818501915085601f830112620002ff57600080fd5b81518181111562000314576200031462000264565b604051601f8201601f19908116603f011681019083821181831017156200033f576200033f62000264565b816040528281528860208487010111156200035957600080fd5b6200036c8360208301602088016200027a565b80955050505050509250929050565b600082516200038f8184602087016200027a565b9190910192915050565b610d5d80620003a96000396000f3fe60806040526004361061008a5760003560e01c80637c4368c1116100595780637c4368c1146100fb578063962724051461011b578063b35f0a971461013b578063bcb707cf1461015b578063dca21c191461017b57610091565b80633c8bff3f1461009b5780633ecfd51e1461009957806349566099146100bb57806355a9ce13146100db57610091565b3661009157005b61009961019b565b005b3480156100a757600080fd5b506100996100b636600461091f565b6101ad565b3480156100c757600080fd5b506100996100d63660046109b9565b610270565b3480156100e757600080fd5b506100996100f6366004610a48565b61032b565b34801561010757600080fd5b50610099610116366004610aa4565b6103c9565b34801561012757600080fd5b50610099610136366004610ad0565b610508565b34801561014757600080fd5b5061009961015636600461091f565b610576565b34801561016757600080fd5b50610099610176366004610ae9565b6106ad565b34801561018757600080fd5b50610099610196366004610b47565b6107e1565b6101ab6101a6610881565b6108b9565b565b6101b56108dd565b6101bd610881565b6001600160a01b0316336001600160a01b0316146101f65760405162461bcd60e51b81526004016101ed90610bea565b60405180910390fd5b604051632142170760e11b81526001600160a01b0384811660048301528381166024830152604482018390528516906342842e0e90606401600060405180830381600087803b15801561024857600080fd5b505af115801561025c573d6000803e3d6000fd5b5050505061026a6001600055565b50505050565b6102786108dd565b610280610881565b6001600160a01b0316336001600160a01b0316146102b05760405162461bcd60e51b81526004016101ed90610bea565b604051637921219560e11b81526001600160a01b0388169063f242432a906102e690899089908990899089908990600401610c7b565b600060405180830381600087803b15801561030057600080fd5b505af1158015610314573d6000803e3d6000fd5b505050506103226001600055565b50505050505050565b610333610881565b6001600160a01b0316336001600160a01b0316146103635760405162461bcd60e51b81526004016101ed90610bea565b60408051878152602081018790526001600160a01b0386811682840152851660608201526080810184905260a0810183905290517f6bd3176da6f0aab285937ad5ead5f53b9036f403cfad62f77e4e0f80b5a7e18d9181900360c00190a1505050505050565b6103d16108dd565b6103d9610881565b6001600160a01b0316336001600160a01b0316146104095760405162461bcd60e51b81526004016101ed90610bea565b600080836001600160a01b03168360405160006040518083038185875af1925050503d8060008114610457576040519150601f19603f3d011682016040523d82523d6000602084013e61045c565b606091505b50915091508180156104865750805115806104865750808060200190518101906104869190610cc2565b6104f85760405162461bcd60e51b815260206004820152603e60248201527f45786368616e6765476f7665726e656450726f78793a3a736166655472616e7360448201527f6665724554483a206661696c656420746f207472616e7366657220455448000060648201526084016101ed565b50506105046001600055565b5050565b610510610881565b6001600160a01b0316336001600160a01b0316146105405760405162461bcd60e51b81526004016101ed90610bea565b6040518181527f42c76c81a7cba1b9c861353909a184e20747ab960332628dabcbb5852fc5cbb59060200160405180910390a150565b61057e6108dd565b610586610881565b6001600160a01b0316336001600160a01b0316146105b65760405162461bcd60e51b81526004016101ed90610bea565b6040516323b872dd60e01b81526001600160a01b0384811660048301528381166024830152604482018390528516906323b872dd906064016020604051808303816000875af115801561060d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106319190610cc2565b6106a35760405162461bcd60e51b815260206004820152603e60248201527f45786368616e6765476f7665726e656450726f78793a2073616665207472616e60448201527f7366657246726f6d206f6620455243323020746f6b656e206661696c6564000060648201526084016101ed565b61026a6001600055565b6106b56108dd565b6106bd610881565b6001600160a01b0316336001600160a01b0316146106ed5760405162461bcd60e51b81526004016101ed90610bea565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af115801561073c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107609190610cc2565b6107d25760405162461bcd60e51b815260206004820152603a60248201527f45786368616e6765476f7665726e656450726f78793a2073616665207472616e60448201527f73666572206f6620455243323020746f6b656e206661696c656400000000000060648201526084016101ed565b6107dc6001600055565b505050565b6107e9610881565b6001600160a01b0316336001600160a01b0316146108195760405162461bcd60e51b81526004016101ed90610bea565b856001600160a01b0316876001600160a01b0316896001600160e01b0319167fc887d66c99649ddcbab3ab2a223b80f717899ca4b58f4a52f568fedfd4bace90888888888860405161086f959493929190610ceb565b60405180910390a45050505050505050565b60006108b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156108d8573d6000f35b3d6000fd5b60026000540361090057604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b6001600160a01b038116811461091c57600080fd5b50565b6000806000806080858703121561093557600080fd5b843561094081610907565b9350602085013561095081610907565b9250604085013561096081610907565b9396929550929360600135925050565b60008083601f84011261098257600080fd5b50813567ffffffffffffffff81111561099a57600080fd5b6020830191508360208285010111156109b257600080fd5b9250929050565b600080600080600080600060c0888a0312156109d457600080fd5b87356109df81610907565b965060208801356109ef81610907565b955060408801356109ff81610907565b9450606088013593506080880135925060a088013567ffffffffffffffff811115610a2957600080fd5b610a358a828b01610970565b989b979a50959850939692959293505050565b60008060008060008060c08789031215610a6157600080fd5b86359550602087013594506040870135610a7a81610907565b93506060870135610a8a81610907565b9598949750929560808101359460a0909101359350915050565b60008060408385031215610ab757600080fd5b8235610ac281610907565b946020939093013593505050565b600060208284031215610ae257600080fd5b5035919050565b600080600060608486031215610afe57600080fd5b8335610b0981610907565b92506020840135610b1981610907565b929592945050506040919091013590565b80356001600160e01b031981168114610b4257600080fd5b919050565b60008060008060008060008060e0898b031215610b6357600080fd5b610b6c89610b2a565b97506020890135610b7c81610907565b96506040890135610b8c81610907565b9550606089013567ffffffffffffffff811115610ba857600080fd5b610bb48b828c01610970565b90965094505060808901359250610bcd60a08a01610b2a565b9150610bdb60c08a01610b2a565b90509295985092959890939650565b60208082526042908201527f45786368616e6765476f7665726e656450726f78793a204f6e6c792063616c6c60408201527f732066726f6d20696d706c656d656e746174696f6e2061726520616c6c6f7765606082015261642160f01b608082015260a00190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03878116825286166020820152604081018590526060810184905260a060808201819052600090610cb69083018486610c52565b98975050505050505050565b600060208284031215610cd457600080fd5b81518015158114610ce457600080fd5b9392505050565b608081526000610cff608083018789610c52565b6020830195909552506001600160e01b0319928316604082015291166060909101529291505056fea26469706673582212209d23be33ed8d68d7eceebe41cae0a950f81552d34a62309bcb5c59b79081d13964736f6c63430008180033000000000000000000000000c83d96807940ee6af05e7f8edc9a31d5df40bcff00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x60806040526004361061008a5760003560e01c80637c4368c1116100595780637c4368c1146100fb578063962724051461011b578063b35f0a971461013b578063bcb707cf1461015b578063dca21c191461017b57610091565b80633c8bff3f1461009b5780633ecfd51e1461009957806349566099146100bb57806355a9ce13146100db57610091565b3661009157005b61009961019b565b005b3480156100a757600080fd5b506100996100b636600461091f565b6101ad565b3480156100c757600080fd5b506100996100d63660046109b9565b610270565b3480156100e757600080fd5b506100996100f6366004610a48565b61032b565b34801561010757600080fd5b50610099610116366004610aa4565b6103c9565b34801561012757600080fd5b50610099610136366004610ad0565b610508565b34801561014757600080fd5b5061009961015636600461091f565b610576565b34801561016757600080fd5b50610099610176366004610ae9565b6106ad565b34801561018757600080fd5b50610099610196366004610b47565b6107e1565b6101ab6101a6610881565b6108b9565b565b6101b56108dd565b6101bd610881565b6001600160a01b0316336001600160a01b0316146101f65760405162461bcd60e51b81526004016101ed90610bea565b60405180910390fd5b604051632142170760e11b81526001600160a01b0384811660048301528381166024830152604482018390528516906342842e0e90606401600060405180830381600087803b15801561024857600080fd5b505af115801561025c573d6000803e3d6000fd5b5050505061026a6001600055565b50505050565b6102786108dd565b610280610881565b6001600160a01b0316336001600160a01b0316146102b05760405162461bcd60e51b81526004016101ed90610bea565b604051637921219560e11b81526001600160a01b0388169063f242432a906102e690899089908990899089908990600401610c7b565b600060405180830381600087803b15801561030057600080fd5b505af1158015610314573d6000803e3d6000fd5b505050506103226001600055565b50505050505050565b610333610881565b6001600160a01b0316336001600160a01b0316146103635760405162461bcd60e51b81526004016101ed90610bea565b60408051878152602081018790526001600160a01b0386811682840152851660608201526080810184905260a0810183905290517f6bd3176da6f0aab285937ad5ead5f53b9036f403cfad62f77e4e0f80b5a7e18d9181900360c00190a1505050505050565b6103d16108dd565b6103d9610881565b6001600160a01b0316336001600160a01b0316146104095760405162461bcd60e51b81526004016101ed90610bea565b600080836001600160a01b03168360405160006040518083038185875af1925050503d8060008114610457576040519150601f19603f3d011682016040523d82523d6000602084013e61045c565b606091505b50915091508180156104865750805115806104865750808060200190518101906104869190610cc2565b6104f85760405162461bcd60e51b815260206004820152603e60248201527f45786368616e6765476f7665726e656450726f78793a3a736166655472616e7360448201527f6665724554483a206661696c656420746f207472616e7366657220455448000060648201526084016101ed565b50506105046001600055565b5050565b610510610881565b6001600160a01b0316336001600160a01b0316146105405760405162461bcd60e51b81526004016101ed90610bea565b6040518181527f42c76c81a7cba1b9c861353909a184e20747ab960332628dabcbb5852fc5cbb59060200160405180910390a150565b61057e6108dd565b610586610881565b6001600160a01b0316336001600160a01b0316146105b65760405162461bcd60e51b81526004016101ed90610bea565b6040516323b872dd60e01b81526001600160a01b0384811660048301528381166024830152604482018390528516906323b872dd906064016020604051808303816000875af115801561060d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106319190610cc2565b6106a35760405162461bcd60e51b815260206004820152603e60248201527f45786368616e6765476f7665726e656450726f78793a2073616665207472616e60448201527f7366657246726f6d206f6620455243323020746f6b656e206661696c6564000060648201526084016101ed565b61026a6001600055565b6106b56108dd565b6106bd610881565b6001600160a01b0316336001600160a01b0316146106ed5760405162461bcd60e51b81526004016101ed90610bea565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af115801561073c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107609190610cc2565b6107d25760405162461bcd60e51b815260206004820152603a60248201527f45786368616e6765476f7665726e656450726f78793a2073616665207472616e60448201527f73666572206f6620455243323020746f6b656e206661696c656400000000000060648201526084016101ed565b6107dc6001600055565b505050565b6107e9610881565b6001600160a01b0316336001600160a01b0316146108195760405162461bcd60e51b81526004016101ed90610bea565b856001600160a01b0316876001600160a01b0316896001600160e01b0319167fc887d66c99649ddcbab3ab2a223b80f717899ca4b58f4a52f568fedfd4bace90888888888860405161086f959493929190610ceb565b60405180910390a45050505050505050565b60006108b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156108d8573d6000f35b3d6000fd5b60026000540361090057604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b6001600160a01b038116811461091c57600080fd5b50565b6000806000806080858703121561093557600080fd5b843561094081610907565b9350602085013561095081610907565b9250604085013561096081610907565b9396929550929360600135925050565b60008083601f84011261098257600080fd5b50813567ffffffffffffffff81111561099a57600080fd5b6020830191508360208285010111156109b257600080fd5b9250929050565b600080600080600080600060c0888a0312156109d457600080fd5b87356109df81610907565b965060208801356109ef81610907565b955060408801356109ff81610907565b9450606088013593506080880135925060a088013567ffffffffffffffff811115610a2957600080fd5b610a358a828b01610970565b989b979a50959850939692959293505050565b60008060008060008060c08789031215610a6157600080fd5b86359550602087013594506040870135610a7a81610907565b93506060870135610a8a81610907565b9598949750929560808101359460a0909101359350915050565b60008060408385031215610ab757600080fd5b8235610ac281610907565b946020939093013593505050565b600060208284031215610ae257600080fd5b5035919050565b600080600060608486031215610afe57600080fd5b8335610b0981610907565b92506020840135610b1981610907565b929592945050506040919091013590565b80356001600160e01b031981168114610b4257600080fd5b919050565b60008060008060008060008060e0898b031215610b6357600080fd5b610b6c89610b2a565b97506020890135610b7c81610907565b96506040890135610b8c81610907565b9550606089013567ffffffffffffffff811115610ba857600080fd5b610bb48b828c01610970565b90965094505060808901359250610bcd60a08a01610b2a565b9150610bdb60c08a01610b2a565b90509295985092959890939650565b60208082526042908201527f45786368616e6765476f7665726e656450726f78793a204f6e6c792063616c6c60408201527f732066726f6d20696d706c656d656e746174696f6e2061726520616c6c6f7765606082015261642160f01b608082015260a00190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03878116825286166020820152604081018590526060810184905260a060808201819052600090610cb69083018486610c52565b98975050505050505050565b600060208284031215610cd457600080fd5b81518015158114610ce457600080fd5b9392505050565b608081526000610cff608083018789610c52565b6020830195909552506001600160e01b0319928316604082015291166060909101529291505056fea26469706673582212209d23be33ed8d68d7eceebe41cae0a950f81552d34a62309bcb5c59b79081d13964736f6c63430008180033

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

000000000000000000000000c83d96807940ee6af05e7f8edc9a31d5df40bcff00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _implementation (address): 0xc83D96807940ee6Af05E7F8EDc9a31d5df40BCfF
Arg [1] : _data (bytes): 0x

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000c83d96807940ee6af05e7f8edc9a31d5df40bcff
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.