GLMR Price: $0.092275 (-4.30%)

Contract

0x9962c0cA2218D65d9b71924157ad7251d84c1653

Overview

GLMR Balance

Moonbeam Chain LogoMoonbeam Chain LogoMoonbeam Chain Logo0 GLMR

GLMR Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Token_4op101830282025-03-26 11:38:5410 mins ago1742989134IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101768342025-03-26 1:11:3610 hrs ago1742951496IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101767792025-03-26 1:06:0610 hrs ago1742951166IN
0x9962c0cA...1d84c1653
0 GLMR0.0173261534.43523259
Token_4op101763042025-03-26 0:18:0611 hrs ago1742948286IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101761592025-03-26 0:03:2411 hrs ago1742947404IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101761492025-03-26 0:02:2411 hrs ago1742947344IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101755542025-03-25 23:02:2412 hrs ago1742943744IN
0x9962c0cA...1d84c1653
0 GLMR0.0173254334.43379302
Token_4op101752362025-03-25 22:30:1213 hrs ago1742941812IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101742892025-03-25 20:53:5414 hrs ago1742936034IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101736782025-03-25 19:51:3615 hrs ago1742932296IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101736762025-03-25 19:51:2415 hrs ago1742932284IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101735892025-03-25 19:42:3616 hrs ago1742931756IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101734532025-03-25 19:28:0616 hrs ago1742930886IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101734042025-03-25 19:23:0616 hrs ago1742930586IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101729722025-03-25 18:39:3617 hrs ago1742927976IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101728042025-03-25 18:22:3617 hrs ago1742926956IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101727942025-03-25 18:21:4217 hrs ago1742926902IN
0x9962c0cA...1d84c1653
0 GLMR0.005837734.375
Token_4op101727942025-03-25 18:21:4217 hrs ago1742926902IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101727862025-03-25 18:20:4817 hrs ago1742926848IN
0x9962c0cA...1d84c1653
0 GLMR0.005837734.375
Token_4op101727862025-03-25 18:20:4817 hrs ago1742926848IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101727852025-03-25 18:20:3617 hrs ago1742926836IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101726572025-03-25 18:07:5417 hrs ago1742926074IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101724482025-03-25 17:46:1218 hrs ago1742924772IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101718872025-03-25 16:49:2418 hrs ago1742921364IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
Token_4op101715872025-03-25 16:18:2419 hrs ago1742919504IN
0x9962c0cA...1d84c1653
0 GLMR0.0172958534.375
View all transactions

View more zero value Internal Transactions in Advanced View mode

Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x295861e5...E790c8eb2
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
WeblockNftMarketplace

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 19 : WeblockNftMarketplace.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {ContextUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import {AccessControlUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";

import {AddressUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import {SafeMathUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";

import {IERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/interfaces/IERC721Upgradeable.sol";

import {IERC2981Upgradeable, IERC165Upgradeable} from "./interfaces/IERC2981Upgradeable.sol";

import {ITransferManager} from "../transfer-manager/ITransferManager.sol";

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

import {IWeblockNftMarketplace} from "./interfaces/IWeblockNftMarketplace.sol";

contract WeblockNftMarketplace is
    IWeblockNftMarketplace,
    Initializable,
    ContextUpgradeable,
    AccessControlUpgradeable,
    OwnableUpgradeable,
    ManagerETH
{
    using AddressUpgradeable for address payable;
    using SafeMathUpgradeable for uint256;

    uint256 internal constant _BASIS_POINTS_PER_PERCENTAGE = 10000;
    bytes4 internal constant _INTERFACE_ID_ERC2981 = 0x2a55205a;
    bytes4 internal constant _INTERFACE_ID_TRANSFER_MANAGER =
        bytes4(keccak256("transferFromERC721(address,address,address,uint256)"));

    address payable public treasury;
    address public transferManager;
    address public trustedWallet;

    mapping(uint32 => bool) private externalIdsAlreadyUsed;

    function initialize(
        address payable _treasury,
        address _transferManager,
        address _trustedWallet
    ) external initializer {
        if (_treasury == address(0) || _transferManager == address(0) || _trustedWallet == address(0)) {
            revert AddressCannotBeAddressZero();
        }
        if (ITransferManager(_transferManager).supportsInterface(_INTERFACE_ID_TRANSFER_MANAGER) == false) {
            revert AddressMustImplementITransferManager();
        }
        treasury = _treasury;
        transferManager = _transferManager;
        trustedWallet = _trustedWallet;
        __Ownable_init();
        __AccessControl_init();
        _grantRole(DEFAULT_ADMIN_ROLE, _msgSender());
    }

    // External functions

    function setTreasury(address payable _treasury) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (_treasury == address(0)) {
            revert AddressCannotBeAddressZero();
        }
        treasury = _treasury;
        emit TreasuryChanged(_treasury);
    }

    function setTransferManager(address _transferManager) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (_transferManager == address(0)) {
            revert AddressCannotBeAddressZero();
        }
        if (ITransferManager(_transferManager).supportsInterface(_INTERFACE_ID_TRANSFER_MANAGER) == false) {
            revert AddressMustImplementITransferManager();
        }
        transferManager = _transferManager;
        emit TransferManagerChanged(_transferManager);
    }

    function setTrustedWallet(address _trustedWallet) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (_trustedWallet == address(0)) {
            revert AddressCannotBeAddressZero();
        }
        trustedWallet = _trustedWallet;
        emit TrustedWalletChanged(_trustedWallet);
    }

    function checkout_J2u(Order[] memory requests, bytes[] memory signature) external payable nonReentrant {
        if (requests.length != signature.length) {
            revert NumberOfArgumentsIsInvalidInCheckoutContext();
        }
        uint256 totalETHAmount;
        for (uint256 i = 0; i < requests.length; ++i) {
            checkSignature(requests[i], signature[i]);
            if (requests[i].currency == address(0)) {
                totalETHAmount = totalETHAmount.add(requests[i].amount);
            } else {
                if (requests[i].mintErc20Amount != 0) {
                    ITransferManager(transferManager).mintERC20(
                        requests[i].currency,
                        requests[i].receiver,
                        requests[i].mintErc20Amount
                    );
                }
                ITransferManager(transferManager).transferFromERC20(
                    requests[i].currency,
                    requests[i].receiver,
                    transferManager,
                    requests[i].amount
                );
            }

            _makeTransfer(requests[i]);
        }
        if (msg.value != totalETHAmount) {
            revert InvalidAmount();
        }
    }

    function crypto_n13(Order memory request, bytes memory signature) external payable nonReentrant {
        checkSignature(request, signature);
        if (msg.value != request.amount) {
            revert InvalidAmount();
        }
        request.currency = address(0);
        _makeTransfer(request);
    }

    function token_4op(Order memory request, bytes memory signature) external nonReentrant {
        checkSignature(request, signature);
        if (request.mintErc20Amount != 0) {
            ITransferManager(transferManager).mintERC20(request.currency, request.receiver, request.mintErc20Amount);
        }
        ITransferManager(transferManager).transferFromERC20(
            request.currency,
            request.receiver,
            transferManager,
            request.amount
        );
        _makeTransfer(request);
    }

    // Public functions

    function createOrderHash_jfO(Order memory request) public view returns (bytes32) {
      bytes memory encondePartial = abi.encodePacked(
          request.tokenId,
          request.amount,
          request.fee,
          request.nftContract,
          request.receiver,
          request.currency,
          request.owner,
          request.payees,
          request.shares,
          request.signatureExpiresAt,
          request.mintErc20Amount,
          request.payRoyalty,
          request.externalId
        );
        return keccak256(
            abi.encodePacked(
                encondePartial,
                address(this),
                block.chainid
            )
        );
    }

    // Private functions

    function _makeTransfer(Order memory request) private {
        if (request.payees.length != request.shares.length || request.payees.length == 0) {
            revert InvalidShares();
        }

        uint256 royaltyFeeAmount;
        uint256 amountPaid;
        uint256 totalShares;
        uint256 marketFee = _payMarket(request.amount, request.fee, request.currency);
        uint256 remainderAmount = request.amount.sub(marketFee);

        if (request.payRoyalty && request.nftContract != address(0)) {
            (, royaltyFeeAmount) = _payRoyalty(request.nftContract, request.tokenId, remainderAmount, request.currency);
            remainderAmount = remainderAmount.sub(royaltyFeeAmount);
        }

        for (uint8 i = 0; i < request.payees.length; ++i) {
            totalShares = totalShares.add(request.shares[i]);
        }

        // in this case it will only have an IF cost
        if (request.currency == address(0)) {
            for (uint8 i = 0; i < request.payees.length; ++i) {
                uint256 amountPending = remainderAmount.mul(request.shares[i]).div(totalShares);
                amountPaid = amountPaid.add(amountPending);
                _sendValueWithFallbackWithdrawWithMediumGasLimit(payable(request.payees[i]), amountPending);
            }
        } else {
            for (uint8 i = 0; i < request.payees.length; ++i) {
                uint256 amountPending = remainderAmount.mul(request.shares[i]).div(totalShares);
                amountPaid = amountPaid.add(amountPending);
                ITransferManager(transferManager).transferERC20(request.currency, request.payees[i], amountPending);
            }
        }

        if (
            (remainderAmount != amountPaid) || (remainderAmount.add(royaltyFeeAmount).add(marketFee) != request.amount)
        ) {
            revert RatesAreIncompatible();
        }

        if (request.nftContract != address(0)) {
            if (request.tokenId == 0) {
                uint256 balanceOfBeforeMint = IERC721Upgradeable(request.nftContract).balanceOf(request.receiver);
                ITransferManager(transferManager).mintERC721A(request.nftContract, request.receiver, 1);
                uint256 balanceOfAfterMint = IERC721Upgradeable(request.nftContract).balanceOf(request.receiver);
                if (balanceOfAfterMint <= balanceOfBeforeMint) {
                    revert MintFailed();
                }
            } else {
                ITransferManager(transferManager).transferFromERC721(
                    request.nftContract,
                    request.owner,
                    request.receiver,
                    request.tokenId
                );
            }
        }

        emit WeblockNftTransfered(
            request.nftContract,
            request.tokenId,
            request.owner,
            request.receiver,
            request.amount
        );


        externalIdsAlreadyUsed[request.externalId] = true;
    }

    function _payMarket(uint256 amount, uint256 fee, address currency) private returns (uint256 marketFee) {
        if (fee == 0) {
            return 0;
        }

        marketFee = amount.mul(fee) / _BASIS_POINTS_PER_PERCENTAGE;
        if (currency == address(0)) {
            _deposit(treasury, marketFee);
        } else {
            ITransferManager(transferManager).transferERC20(currency, treasury, marketFee);
        }
    }

    function _getRoyaltyInfo(
        address nftContract,
        uint256 tokenId,
        uint256 amount
    ) internal view returns (address receiver, uint256 royaltyAmount) {
        if (IERC165Upgradeable(nftContract).supportsInterface(_INTERFACE_ID_ERC2981)) {
            (receiver, royaltyAmount) = IERC2981Upgradeable(nftContract).royaltyInfo(tokenId, amount);
        }
        return (receiver, royaltyAmount);
    }

    function _payRoyalty(
        address nftContract,
        uint256 tokenId,
        uint256 amount,
        address currency
    ) private returns (address royaltyFeeRecipient, uint256 royaltyFeeAmount) {
        (royaltyFeeRecipient, royaltyFeeAmount) = _getRoyaltyInfo(nftContract, tokenId, amount);
        if (royaltyFeeRecipient == address(0) || royaltyFeeAmount == 0) {
            return (address(0), 0);
        }
        if (currency == address(0)) {
            _sendValueWithFallbackWithdrawWithMediumGasLimit(payable(royaltyFeeRecipient), royaltyFeeAmount);
        } else {
            ITransferManager(transferManager).transferERC20(currency, royaltyFeeRecipient, royaltyFeeAmount);
        }
        emit RoyaltyPayment(nftContract, tokenId, royaltyFeeRecipient, royaltyFeeAmount);
    }

    function getSignedMessageHash(bytes32 _messageHash) private pure returns (bytes32) {
        /*
        Signature is produced by signing a keccak256 hash with the following format:
        "\x19Ethereum Signed Message\n" + len(msg) + msg
        */
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", _messageHash));
    }

    function checkSignature(Order memory request, bytes memory signature) private view {
        if (request.signatureExpiresAt < block.timestamp) {
            revert SignatureExpired();
        }

        bytes32 messageHash = createOrderHash_jfO(request);
        bytes32 signedMessageHash = getSignedMessageHash(messageHash);

        if (recoverSigner(signedMessageHash, signature) != trustedWallet) {
            revert InvalidSignature();
        }

        if (externalIdsAlreadyUsed[request.externalId]) {
          revert ExternalIdAlreadyUsed();
        }
    }

    function recoverSigner(bytes32 _signedMessageHash, bytes memory _signature) private pure returns (address) {
        (bytes32 r, bytes32 s, uint8 v) = splitSignature(_signature);

        return ecrecover(_signedMessageHash, v, r, s);
    }

    function splitSignature(bytes memory sig) private pure returns (bytes32 r, bytes32 s, uint8 v) {
        require(sig.length == 65, "invalid signature length");

        assembly {
            /*
            First 32 bytes stores the length of the signature

            add(sig, 32) = pointer of sig + 32
            effectively, skips first 32 bytes of signature

            mload(p) loads next 32 bytes starting at the memory address p into memory
            */

            // first 32 bytes, after the length prefix
            r := mload(add(sig, 32))
            // second 32 bytes
            s := mload(add(sig, 64))
            // final byte (first byte of the next 32 bytes)
            v := byte(0, mload(add(sig, 96)))
        }

        // implicitly return (r, s, v)
    }
}

File 2 of 19 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 3 of 19 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 4 of 19 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 5 of 19 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
    function __AccessControl_init() internal onlyInitializing {
    }

    function __AccessControl_init_unchained() internal onlyInitializing {
    }
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

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

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        StringsUpgradeable.toHexString(account),
                        " is missing role ",
                        StringsUpgradeable.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 6 of 19 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

File 7 of 19 : SafeMathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMathUpgradeable {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 8 of 19 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)

pragma solidity ^0.8.0;

import "../token/ERC721/IERC721Upgradeable.sol";

File 9 of 19 : IERC2981Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.2;

import {IERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol";

/// @notice This is purely an extension for the Tropix platform
/// @notice Royalties on Tropix are defined at an edition level for all tokens from the same edition
interface IERC2981EditionExtensionUpgradeable {
  /// @notice Does the edition have any royalties defined
  function hasRoyalties(uint256 _editionId) external view returns (bool);

  /// @notice Get the royalty receiver - all royalties should be sent to this account if not zero address
  function getRoyaltiesReceiver(uint256 _editionId) external view returns (address);

  /// @notice Get the royalty amount - all royalties should be sent to this account if not zero address
  function getRoyaltiesAmount(uint256 _editionId) external view returns (uint256);
}

/**
 * ERC2981 standards interface for royalties
 */
interface IERC2981Upgradeable is IERC165Upgradeable, IERC2981EditionExtensionUpgradeable {
  /// ERC165 bytes to add to interface array - set in parent contract
  /// implementing this standard
  ///
  /// bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a
  /// bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a;
  /// _registerInterface(_INTERFACE_ID_ERC2981);

  /// @notice Called with the sale price to determine how much royalty
  //          is owed and to whom.
  /// @param _tokenId - the NFT asset queried for royalty information
  /// @param _value - the sale price of the NFT asset specified by _tokenId
  /// @return _receiver - address of who should be sent the royalty payment
  /// @return _royaltyAmount - the royalty payment amount for _value sale price
  function royaltyInfo(uint256 _tokenId, uint256 _value)
    external
    view
    returns (address _receiver, uint256 _royaltyAmount);
}

File 10 of 19 : ITransferManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import {IERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol";

interface ITransferManager is IERC165Upgradeable {
    /**
     * @notice Transfer ERC721 token
     * @param collection address of the collection
     * @param from address of the sender
     * @param to address of the recipient
     * @param tokenId tokenId of the token
     */
    function transferFromERC721(address collection, address from, address to, uint256 tokenId) external payable;

    /**
     * @notice Transfer ERC1155 token(s)
     * @param collection address of the collection
     * @param from address of the sender
     * @param to address of the recipient
     * @param tokenId tokenId
     * @param amount amount of tokens (1 and more for ERC1155)
     */
    function transferFromERC1155(
        address collection,
        address from,
        address to,
        uint256 tokenId,
        uint256 amount
    ) external payable;

    /**
      @notice Transfer ERC20 token
      @param currency address of the currency
      @param from address of the sender
      @param to address of the recipient
      @param amount amount of tokens
     */
    function transferFromERC20(address currency, address from, address to, uint256 amount) external payable returns (bool);

    /**
      * @notice Transfer ERC20 token
      * @param currency address of the currency
      * @param to address of the recipient
      * @param amount amount of tokens
      
     */
    function transferERC20(address currency, address to, uint256 amount) external payable returns (bool);

    /**
     * @notice has allowance to transfer ERC20 token
     * @param currency address of the currency
     * @param from address of the sender
     * @param to address of the recipient
     * @param amount amount of tokens
     */
    function hasAllowance(address currency, address from, address to, uint256 amount) external view returns (bool);

    /**
     * @notice Mint ERC721A token
     * @param collection address of the collection
     * @param owner address of the owner
     * @param quantity quantity of tokens
     */
    function mintERC721A(address collection, address owner, uint256 quantity) external payable;

    /**
     * @notice Mint ERC20 token
     * @param currency address of the contract
     * @param owner address of the owner
     * @param quantity quantity of tokens
     */
    function mintERC20(address currency, address owner, uint256 quantity) external;
}

File 11 of 19 : ManagerETH.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;


import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import {ContextUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import {AddressUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import {SafeMathUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";

contract ManagerETH is ContextUpgradeable, ReentrancyGuardUpgradeable {
    using AddressUpgradeable for address payable;
    using SafeMathUpgradeable for uint256;
    event WithdrawPending(address indexed payee, uint256 amount);

    event Withdrawal(address indexed payee, uint256 amount);

    error NoFoundArePendingWithdrawal();

    mapping(address => uint256) private _pendingWithdrawals;

    /**
     * @dev Attempt to send a payee or contract ETH with a moderate gas limit of 90k,
     * which is enough for a 5-way split.
     */
    function _sendValueWithFallbackWithdrawWithMediumGasLimit(address payable payee, uint256 amount) internal {
        _sendValueWithFallbackWithdraw(payee, amount, 210000);
    }

    /**
     * @dev Attempt to send a payee or contract ETH and if it fails store the amount owned for later withdrawal.
     */
    function _sendValueWithFallbackWithdraw(
        address payable payee,
        uint256 amount,
        uint256 gasLimit
    ) private {
        if (amount == 0) {
            return;
        }
        // Cap the gas to prevent consuming all available gas to block a tx from completing successfully
        // solhint-disable-next-line avoid-low-level-calls
        (bool success, ) = payee.call{value: amount, gas: gasLimit}("");
        if (!success) {
            // Record failed sends for a withdrawal later
            // Transfers could fail if sent to a multisig with non-trivial receiver logic
            // solhint-disable-next-line reentrancy
            _deposit(payee, amount);
        }
    }

    /**
     * @dev Stores the sent amount as credit to be withdrawn.
     * @param payee The destination address of the funds.
     */
    function _deposit(address payee, uint256 amount) internal {
        _pendingWithdrawals[payee] = _pendingWithdrawals[payee].add(amount);
        emit WithdrawPending(payee, amount);
    }

    /**
     * @dev Withdraw accumulated payments, forwarding all gas to the recipient.
     *
     * WARNING: Forwarding all gas opens the door to reentrancy vulnerabilities.
     * Make sure you trust the recipient, or are either following the
     * checks-effects-interactions pattern or using {ReentrancyGuard}.
     *
     * @param payee Whose payments will be withdrawn.
     */
    function _withdraw(address payable payee) internal {
        uint256 amount = _pendingWithdrawals[payee];
        if (amount == 0) {
            revert NoFoundArePendingWithdrawal();
        }
        _pendingWithdrawals[payee] = 0;
        payee.sendValue(amount);
        emit Withdrawal(payee, amount);
    }

    /**
     * @notice Allows a payee to manually withdraw funds which originally failed to transfer to themselves.
     */
    function withdraw() public nonReentrant {
        _withdraw(payable(_msgSender()));
    }

    /**
     * @notice Allows anyone to manually trigger a withdrawal of funds which originally failed to transfer for a user.
     * @param payee Whose payments will be withdrawn.
     */
    function withdraw(address payable payee) public nonReentrant {
        _withdraw(payee);
    }

    // Escrow

    function escrowOf(address payee) public view returns (uint256) {
        return _pendingWithdrawals[payee];
    }
}

File 12 of 19 : IWeblockNftMarketplace.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

interface IWeblockNftMarketplace {
    struct Order {
        uint256 tokenId;
        uint256 amount;
        uint256 mintErc20Amount;
        uint256 fee;
        uint256 signatureExpiresAt;
        address nftContract;
        address receiver;
        address currency;
        address owner;
        bool payRoyalty;
        address[] payees;
        uint256[] shares;
        uint32 externalId;
    }

    error InvalidAmount();

    error InvalidSignature();

    error SignatureExpired();

    error AddressCannotBeAddressZero();

    error AddressMustImplementITransferManager();

    error InvalidShares();

    error RatesAreIncompatible();

    error NumberOfArgumentsIsInvalidInCheckoutContext();

    error MintFailed();

    event WeblockNftTransfered(
        address indexed nftContract,
        uint256 indexed tokenId,
        address from,
        address to,
        uint256 amount
    );

    event RoyaltyPayment(
        address indexed nftContract,
        uint256 indexed tokenId,
        address indexed royaltyRecipient,
        uint256 amount
    );

    event TreasuryChanged(address treasury);

    event TransferManagerChanged(address transferManager);

    event TrustedWalletChanged(address transferManager);

    error ExternalIdAlreadyUsed();


}

File 13 of 19 : IAccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControlUpgradeable {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 14 of 19 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/MathUpgradeable.sol";

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = MathUpgradeable.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, MathUpgradeable.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

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

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

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

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 16 of 19 : MathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library MathUpgradeable {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}

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

pragma solidity ^0.8.0;

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

File 18 of 19 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 19 of 19 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 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 ReentrancyGuardUpgradeable is Initializable {
    // 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;

    function __ReentrancyGuard_init() internal onlyInitializing {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        _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
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // 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 This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"name":"AddressCannotBeAddressZero","type":"error"},{"inputs":[],"name":"AddressMustImplementITransferManager","type":"error"},{"inputs":[],"name":"ExternalIdAlreadyUsed","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidShares","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"MintFailed","type":"error"},{"inputs":[],"name":"NoFoundArePendingWithdrawal","type":"error"},{"inputs":[],"name":"NumberOfArgumentsIsInvalidInCheckoutContext","type":"error"},{"inputs":[],"name":"RatesAreIncompatible","type":"error"},{"inputs":[],"name":"SignatureExpired","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"royaltyRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RoyaltyPayment","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"transferManager","type":"address"}],"name":"TransferManagerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"treasury","type":"address"}],"name":"TreasuryChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"transferManager","type":"address"}],"name":"TrustedWalletChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WeblockNftTransfered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"payee","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawPending","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"payee","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"mintErc20Amount","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"signatureExpiresAt","type":"uint256"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bool","name":"payRoyalty","type":"bool"},{"internalType":"address[]","name":"payees","type":"address[]"},{"internalType":"uint256[]","name":"shares","type":"uint256[]"},{"internalType":"uint32","name":"externalId","type":"uint32"}],"internalType":"struct IWeblockNftMarketplace.Order[]","name":"requests","type":"tuple[]"},{"internalType":"bytes[]","name":"signature","type":"bytes[]"}],"name":"checkout_J2u","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"mintErc20Amount","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"signatureExpiresAt","type":"uint256"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bool","name":"payRoyalty","type":"bool"},{"internalType":"address[]","name":"payees","type":"address[]"},{"internalType":"uint256[]","name":"shares","type":"uint256[]"},{"internalType":"uint32","name":"externalId","type":"uint32"}],"internalType":"struct IWeblockNftMarketplace.Order","name":"request","type":"tuple"}],"name":"createOrderHash_jfO","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"mintErc20Amount","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"signatureExpiresAt","type":"uint256"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bool","name":"payRoyalty","type":"bool"},{"internalType":"address[]","name":"payees","type":"address[]"},{"internalType":"uint256[]","name":"shares","type":"uint256[]"},{"internalType":"uint32","name":"externalId","type":"uint32"}],"internalType":"struct IWeblockNftMarketplace.Order","name":"request","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"crypto_n13","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"payee","type":"address"}],"name":"escrowOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"_treasury","type":"address"},{"internalType":"address","name":"_transferManager","type":"address"},{"internalType":"address","name":"_trustedWallet","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_transferManager","type":"address"}],"name":"setTransferManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_trustedWallet","type":"address"}],"name":"setTrustedWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"mintErc20Amount","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"signatureExpiresAt","type":"uint256"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bool","name":"payRoyalty","type":"bool"},{"internalType":"address[]","name":"payees","type":"address[]"},{"internalType":"uint256[]","name":"shares","type":"uint256[]"},{"internalType":"uint32","name":"externalId","type":"uint32"}],"internalType":"struct IWeblockNftMarketplace.Order","name":"request","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"token_4op","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"transferManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"trustedWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"payee","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x60806040526004361061014b5760003560e01c806389a56b2f116100b6578063d50f06bf1161006f578063d50f06bf146103ad578063d547741f146103cd578063e038c3da146103ed578063eea491f414610423578063f0f4426014610436578063f2fde38b1461045657600080fd5b806389a56b2f146102fa5780638da5cb5b1461031a57806391d1485414610338578063a217fddf14610358578063abe4dd4e1461036d578063c0c53b8b1461038d57600080fd5b80633ccfd60b116101085780633ccfd60b1461023857806346ea25521461024d57806351cff8d914610285578063570d2f8f146102a557806361d027b3146102c5578063715018a6146102e557600080fd5b806301ffc9a71461015057806307054c3c146101855780630804d35c1461019a578063248a9ca3146101ba5780632f2ff15d146101f857806336568abe14610218575b600080fd5b34801561015c57600080fd5b5061017061016b36600461229d565b610476565b60405190151581526020015b60405180910390f35b6101986101933660046125fd565b6104ad565b005b3480156101a657600080fd5b506101986101b5366004612661565b610501565b3480156101c657600080fd5b506101ea6101d536600461267e565b60009081526065602052604090206001015490565b60405190815260200161017c565b34801561020457600080fd5b50610198610213366004612697565b610624565b34801561022457600080fd5b50610198610233366004612697565b61064e565b34801561024457600080fd5b506101986106cd565b34801561025957600080fd5b5060fd5461026d906001600160a01b031681565b6040516001600160a01b03909116815260200161017c565b34801561029157600080fd5b506101986102a0366004612661565b6106ea565b3480156102b157600080fd5b5060fe5461026d906001600160a01b031681565b3480156102d157600080fd5b5060fc5461026d906001600160a01b031681565b3480156102f157600080fd5b50610198610708565b34801561030657600080fd5b50610198610315366004612661565b61071a565b34801561032657600080fd5b506097546001600160a01b031661026d565b34801561034457600080fd5b50610170610353366004612697565b61079a565b34801561036457600080fd5b506101ea600081565b34801561037957600080fd5b506101ea6103883660046126c7565b6107c5565b34801561039957600080fd5b506101986103a8366004612704565b61086e565b3480156103b957600080fd5b506101986103c83660046125fd565b610aba565b3480156103d957600080fd5b506101986103e8366004612697565b610bea565b3480156103f957600080fd5b506101ea610408366004612661565b6001600160a01b0316600090815260fb602052604090205490565b6101986104313660046127cf565b610c0f565b34801561044257600080fd5b50610198610451366004612661565b610f30565b34801561046257600080fd5b50610198610471366004612661565b610fb0565b60006001600160e01b03198216637965db0b60e01b14806104a757506301ffc9a760e01b6001600160e01b03198316145b92915050565b6104b5611026565b6104bf8282611080565b816020015134146104e35760405163162908e360e11b815260040160405180910390fd5b600060e08301526104f382611188565b6104fd600160c955565b5050565b600061050c8161176b565b6001600160a01b038216610533576040516331ec2eb560e11b815260040160405180910390fd5b6040516301ffc9a760e01b81526307df81b960e41b60048201526001600160a01b038316906301ffc9a79060240160206040518083038186803b15801561057957600080fd5b505afa15801561058d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b19190612899565b6105ce57604051638dd60bd760e01b815260040160405180910390fd5b60fd80546001600160a01b0319166001600160a01b0384169081179091556040519081527ff35e95c2446b710085d942b0d41d03efe650b27039a43d0884b6a1e45d34a942906020015b60405180910390a15050565b60008281526065602052604090206001015461063f8161176b565b6106498383611775565b505050565b6001600160a01b03811633146106c35760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6104fd82826117fb565b6106d5611026565b6106de33611862565b6106e8600160c955565b565b6106f2611026565b6106fb81611862565b610705600160c955565b50565b610710611903565b6106e8600061195d565b60006107258161176b565b6001600160a01b03821661074c576040516331ec2eb560e11b815260040160405180910390fd5b60fe80546001600160a01b0319166001600160a01b0384169081179091556040519081527f6dbac900e9344d445407c6cf0f836767d9a53960974f671f801549f9813c352790602001610618565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000808260000151836020015184606001518560a001518660c001518760e001518861010001518961014001518a61016001518b608001518c604001518d61012001518e610180015160405160200161082a9d9c9b9a999897969594939291906128e9565b6040516020818303038152906040529050803046604051602001610850939291906129ee565b60405160208183030381529060405280519060200120915050919050565b600054610100900460ff161580801561088e5750600054600160ff909116105b806108a85750303b1580156108a8575060005460ff166001145b61090b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016106ba565b6000805460ff19166001179055801561092e576000805461ff0019166101001790555b6001600160a01b038416158061094b57506001600160a01b038316155b8061095d57506001600160a01b038216155b1561097b576040516331ec2eb560e11b815260040160405180910390fd5b6040516301ffc9a760e01b81526307df81b960e41b60048201526001600160a01b038416906301ffc9a79060240160206040518083038186803b1580156109c157600080fd5b505afa1580156109d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f99190612899565b610a1657604051638dd60bd760e01b815260040160405180910390fd5b60fc80546001600160a01b038087166001600160a01b03199283161790925560fd805486841690831617905560fe805492851692909116919091179055610a5b6119af565b610a636119de565b610a6e600033611775565b8015610ab4576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b610ac2611026565b610acc8282611080565b604082015115610b4a5760fd5460e083015160c084015160408086015190516308f80fd160e31b81526001600160a01b03909416936347c07e8893610b179390929091600401612a2d565b600060405180830381600087803b158015610b3157600080fd5b505af1158015610b45573d6000803e3d6000fd5b505050505b60fd5460e083015160c0840151602085015160405163dd71105d60e01b81526001600160a01b039094169363dd71105d93610b8e9390929091869190600401612a51565b602060405180830381600087803b158015610ba857600080fd5b505af1158015610bbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be09190612899565b506104f382611188565b600082815260656020526040902060010154610c058161176b565b61064983836117fb565b610c17611026565b8051825114610c39576040516339b98b9760e21b815260040160405180910390fd5b6000805b8351811015610f0457610c82848281518110610c5b57610c5b612a7b565b6020026020010151848381518110610c7557610c75612a7b565b6020026020010151611080565b60006001600160a01b0316848281518110610c9f57610c9f612a7b565b602002602001015160e001516001600160a01b03161415610cf157610cea848281518110610ccf57610ccf612a7b565b60200260200101516020015183611a0590919063ffffffff16565b9150610ed2565b838181518110610d0357610d03612a7b565b602002602001015160400151600014610dd85760fd5484516001600160a01b03909116906347c07e8890869084908110610d3f57610d3f612a7b565b602002602001015160e00151868481518110610d5d57610d5d612a7b565b602002602001015160c00151878581518110610d7b57610d7b612a7b565b6020026020010151604001516040518463ffffffff1660e01b8152600401610da593929190612a2d565b600060405180830381600087803b158015610dbf57600080fd5b505af1158015610dd3573d6000803e3d6000fd5b505050505b60fd5484516001600160a01b039091169063dd71105d90869084908110610e0157610e01612a7b565b602002602001015160e00151868481518110610e1f57610e1f612a7b565b602002602001015160c0015160fd60009054906101000a90046001600160a01b0316888681518110610e5357610e53612a7b565b6020026020010151602001516040518563ffffffff1660e01b8152600401610e7e9493929190612a51565b602060405180830381600087803b158015610e9857600080fd5b505af1158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed09190612899565b505b610ef4848281518110610ee757610ee7612a7b565b6020026020010151611188565b610efd81612aa7565b9050610c3d565b50803414610f255760405163162908e360e11b815260040160405180910390fd5b506104fd600160c955565b6000610f3b8161176b565b6001600160a01b038216610f62576040516331ec2eb560e11b815260040160405180910390fd5b60fc80546001600160a01b0319166001600160a01b0384169081179091556040519081527fc714d22a2f08b695f81e7c707058db484aa5b4d6b4c9fd64beb10fe85832f60890602001610618565b610fb8611903565b6001600160a01b03811661101d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106ba565b6107058161195d565b600260c95414156110795760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106ba565b600260c955565b42826080015110156110a557604051630819bdcd60e01b815260040160405180910390fd5b60006110b0836107c5565b9050600061110b826040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b60fe549091506001600160a01b03166111248285611a18565b6001600160a01b03161461114b57604051638baa579f60e01b815260040160405180910390fd5b61018084015163ffffffff16600090815260ff60208190526040909120541615610ab45760405163fe0414d160e01b815260040160405180910390fd5b80610160015151816101400151511415806111a7575061014081015151155b156111c557604051636edcc52360e01b815260040160405180910390fd5b6000806000806111e2856020015186606001518760e00151611a97565b905060006111fd828760200151611b7b90919063ffffffff16565b9050856101200151801561121d575060a08601516001600160a01b031615155b1561124b5761123a8660a001518760000151838960e00151611b87565b955061124890508186611b7b565b90505b60005b866101400151518160ff1610156112a5576112938761016001518260ff168151811061127c5761127c612a7b565b602002602001015185611a0590919063ffffffff16565b935061129e81612ac2565b905061124e565b5060e08601516001600160a01b031661135c5760005b866101400151518160ff16101561135657600061130c856113068a61016001518560ff16815181106112ef576112ef612a7b565b602002602001015186611cbb90919063ffffffff16565b90611cc7565b90506113188682611a05565b95506113458861014001518360ff168151811061133757611337612a7b565b602002602001015182611cd3565b5061134f81612ac2565b90506112bb565b50611466565b60005b866101400151518160ff161015611464576000611393856113068a61016001518560ff16815181106112ef576112ef612a7b565b905061139f8682611a05565b60fd5460e08a01516101408b015180519399506001600160a01b0390921692639db5dbe4929060ff87169081106113d8576113d8612a7b565b6020026020010151846040518463ffffffff1660e01b81526004016113ff93929190612a2d565b602060405180830381600087803b15801561141957600080fd5b505af115801561142d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114519190612899565b50508061145d90612ac2565b905061135f565b505b838114158061148c57506020860151611489836114838489611a05565b90611a05565b14155b156114aa57604051633b26019b60e01b815260040160405180910390fd5b60a08601516001600160a01b0316156116e357855161166a5760a086015160c08701516040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a082319060240160206040518083038186803b15801561151357600080fd5b505afa158015611527573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154b9190612ae2565b60fd5460a089015160c08a01516040516308afaa9b60e11b81529394506001600160a01b039092169263115f55369261158a9291600190600401612a2d565b600060405180830381600087803b1580156115a457600080fd5b505af11580156115b8573d6000803e3d6000fd5b50505060a088015160c08901516040516370a0823160e01b81526001600160a01b039182166004820152600093509116906370a082319060240160206040518083038186803b15801561160a57600080fd5b505afa15801561161e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116429190612ae2565b90508181116116635760405162ec6f7b60e31b815260040160405180910390fd5b50506116e3565b60fd5460a087015161010088015160c089015189516040516307df81b960e41b81526001600160a01b0390951694637df81b90946116b094909390929091600401612a51565b600060405180830381600087803b1580156116ca57600080fd5b505af11580156116de573d6000803e3d6000fd5b505050505b85600001518660a001516001600160a01b03167fa9ce3b45867ce478703782dbbe871ffb3a878f6b9ff2775138079f452b3447f48861010001518960c001518a6020015160405161173693929190612a2d565b60405180910390a35050506101809092015163ffffffff16600090815260ff60205260409020805460ff191660011790555050565b6107058133611ce1565b61177f828261079a565b6104fd5760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556117b73390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611805828261079a565b156104fd5760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b038116600090815260fb602052604090205480611899576040516304f676fb60e21b815260040160405180910390fd5b6001600160a01b038216600081815260fb60205260408120556118bc9082611d3a565b816001600160a01b03167f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65826040516118f791815260200190565b60405180910390a25050565b6097546001600160a01b031633146106e85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106ba565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166119d65760405162461bcd60e51b81526004016106ba90612afb565b6106e8611e53565b600054610100900460ff166106e85760405162461bcd60e51b81526004016106ba90612afb565b6000611a118284612b46565b9392505050565b600080600080611a2785611e83565b6040805160008152602081018083528b905260ff8316918101919091526060810184905260808101839052929550909350915060019060a0016020604051602081039080840390855afa158015611a82573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b600082611aa657506000611a11565b612710611ab38585611cbb565b611abd9190612b5e565b90506001600160a01b038216611ae85760fc54611ae3906001600160a01b031682611ef7565b611a11565b60fd5460fc5460405163276d76f960e21b81526001600160a01b0392831692639db5dbe492611b21928792909116908690600401612a2d565b602060405180830381600087803b158015611b3b57600080fd5b505af1158015611b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b739190612899565b509392505050565b6000611a118284612b80565b600080611b95868686611f69565b90925090506001600160a01b0382161580611bae575080155b15611bbe57506000905080611cb2565b6001600160a01b038316611bdb57611bd68282611cd3565b611c63565b60fd5460405163276d76f960e21b81526001600160a01b0390911690639db5dbe490611c0f90869086908690600401612a2d565b602060405180830381600087803b158015611c2957600080fd5b505af1158015611c3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c619190612899565b505b816001600160a01b031685876001600160a01b03167fff2e45a3ef00a9f7ac5964f5c99b4076de5ac15411f355f6163e1f9bb5f2c9a984604051611ca991815260200190565b60405180910390a45b94509492505050565b6000611a118284612b97565b6000611a118284612b5e565b6104fd82826203345061207d565b611ceb828261079a565b6104fd57611cf8816120ef565b611d03836020612101565b604051602001611d14929190612bb6565b60408051601f198184030181529082905262461bcd60e51b82526106ba91600401612c2b565b80471015611d8a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016106ba565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611dd7576040519150601f19603f3d011682016040523d82523d6000602084013e611ddc565b606091505b50509050806106495760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016106ba565b600054610100900460ff16611e7a5760405162461bcd60e51b81526004016106ba90612afb565b6106e83361195d565b60008060008351604114611ed95760405162461bcd60e51b815260206004820152601860248201527f696e76616c6964207369676e6174757265206c656e677468000000000000000060448201526064016106ba565b50505060208101516040820151606090920151909260009190911a90565b6001600160a01b038216600090815260fb6020526040902054611f1a9082611a05565b6001600160a01b038316600081815260fb6020526040908190209290925590517f9a92c3472ba0d2d183e38c3801bae5d41d693c2803377eae8b0f94683862253e906118f79084815260200190565b6040516301ffc9a760e01b815263152a902d60e11b600482015260009081906001600160a01b038616906301ffc9a79060240160206040518083038186803b158015611fb457600080fd5b505afa158015611fc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fec9190612899565b156120755760405163152a902d60e11b815260048101859052602481018490526001600160a01b03861690632a55205a90604401604080518083038186803b15801561203757600080fd5b505afa15801561204b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061206f9190612c5e565b90925090505b935093915050565b8161208757505050565b6000836001600160a01b0316838390604051600060405180830381858888f193505050503d80600081146120d7576040519150601f19603f3d011682016040523d82523d6000602084013e6120dc565b606091505b5050905080610ab457610ab48484611ef7565b60606104a76001600160a01b03831660145b60606000612110836002612b97565b61211b906002612b46565b67ffffffffffffffff811115612133576121336122c7565b6040519080825280601f01601f19166020018201604052801561215d576020820181803683370190505b509050600360fc1b8160008151811061217857612178612a7b565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106121a7576121a7612a7b565b60200101906001600160f81b031916908160001a90535060006121cb846002612b97565b6121d6906001612b46565b90505b600181111561224e576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061220a5761220a612a7b565b1a60f81b82828151811061222057612220612a7b565b60200101906001600160f81b031916908160001a90535060049490941c9361224781612c8c565b90506121d9565b508315611a115760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106ba565b6000602082840312156122af57600080fd5b81356001600160e01b031981168114611a1157600080fd5b634e487b7160e01b600052604160045260246000fd5b6040516101a0810167ffffffffffffffff81118282101715612301576123016122c7565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715612330576123306122c7565b604052919050565b6001600160a01b038116811461070557600080fd5b803561235881612338565b919050565b801515811461070557600080fd5b80356123588161235d565b600067ffffffffffffffff821115612390576123906122c7565b5060051b60200190565b600082601f8301126123ab57600080fd5b813560206123c06123bb83612376565b612307565b82815260059290921b840181019181810190868411156123df57600080fd5b8286015b848110156124035780356123f681612338565b83529183019183016123e3565b509695505050505050565b600082601f83011261241f57600080fd5b8135602061242f6123bb83612376565b82815260059290921b8401810191818101908684111561244e57600080fd5b8286015b848110156124035780358352918301918301612452565b803563ffffffff8116811461235857600080fd5b60006101a0828403121561249057600080fd5b6124986122dd565b905081358152602082013560208201526040820135604082015260608201356060820152608082013560808201526124d260a0830161234d565b60a08201526124e360c0830161234d565b60c08201526124f460e0830161234d565b60e082015261010061250781840161234d565b9082015261012061251983820161236b565b908201526101408281013567ffffffffffffffff8082111561253a57600080fd5b6125468683870161239a565b8385015261016092508285013591508082111561256257600080fd5b5061256f8582860161240e565b828401525050610180612583818401612469565b9082015292915050565b600082601f83011261259e57600080fd5b813567ffffffffffffffff8111156125b8576125b86122c7565b6125cb601f8201601f1916602001612307565b8181528460208386010111156125e057600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561261057600080fd5b823567ffffffffffffffff8082111561262857600080fd5b6126348683870161247d565b9350602085013591508082111561264a57600080fd5b506126578582860161258d565b9150509250929050565b60006020828403121561267357600080fd5b8135611a1181612338565b60006020828403121561269057600080fd5b5035919050565b600080604083850312156126aa57600080fd5b8235915060208301356126bc81612338565b809150509250929050565b6000602082840312156126d957600080fd5b813567ffffffffffffffff8111156126f057600080fd5b6126fc8482850161247d565b949350505050565b60008060006060848603121561271957600080fd5b833561272481612338565b9250602084013561273481612338565b9150604084013561274481612338565b809150509250925092565b600082601f83011261276057600080fd5b813560206127706123bb83612376565b82815260059290921b8401810191818101908684111561278f57600080fd5b8286015b8481101561240357803567ffffffffffffffff8111156127b35760008081fd5b6127c18986838b010161258d565b845250918301918301612793565b600080604083850312156127e257600080fd5b823567ffffffffffffffff808211156127fa57600080fd5b818501915085601f83011261280e57600080fd5b8135602061281e6123bb83612376565b82815260059290921b8401810191818101908984111561283d57600080fd5b8286015b84811015612875578035868111156128595760008081fd5b6128678c86838b010161247d565b845250918301918301612841565b509650508601359250508082111561288c57600080fd5b506126578582860161274f565b6000602082840312156128ab57600080fd5b8151611a118161235d565b60008151602080840160005b838110156128de578151875295820195908201906001016128c2565b509495945050505050565b8d8152600060208e818401528d60408401526bffffffffffffffffffffffff19808e60601b166060850152808d60601b166074850152808c60601b166088850152808b60601b16609c8501525060b083018951828b0160005b828110156129675781516001600160a01b031684529284019290840190600101612942565b505050612974818a6128b6565b9050878152868282015261298f6040820187151560f81b9052565b6129a8604182018660e01b6001600160e01b0319169052565b60458101925050509e9d5050505050505050505050505050565b60005b838110156129dd5781810151838201526020016129c5565b83811115610ab45750506000910152565b60008451612a008184602089016129c2565b60609490941b6bffffffffffffffffffffffff191691909301908152601481019190915260340192915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b039485168152928416602084015292166040820152606081019190915260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415612abb57612abb612a91565b5060010190565b600060ff821660ff811415612ad957612ad9612a91565b60010192915050565b600060208284031215612af457600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008219821115612b5957612b59612a91565b500190565b600082612b7b57634e487b7160e01b600052601260045260246000fd5b500490565b600082821015612b9257612b92612a91565b500390565b6000816000190483118215151615612bb157612bb1612a91565b500290565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612bee8160178501602088016129c2565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612c1f8160288401602088016129c2565b01602801949350505050565b6020815260008251806020840152612c4a8160408501602087016129c2565b601f01601f19169190910160400192915050565b60008060408385031215612c7157600080fd5b8251612c7c81612338565b6020939093015192949293505050565b600081612c9b57612c9b612a91565b50600019019056fea2646970667358221220ed6324ca96b0ddc54896400db29eaec1d5438be07fe4d7c192d100460feeb10064736f6c63430008090033

Block Transaction Gas Used Reward
view all blocks collator

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

Validator Index Block Amount
View All Withdrawals

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