ETH Price: $3,465.50 (+5.67%)
Gas: 5 Gwei

Contract

0x0D24Be08cb6927391519FFDeEDBDd45ac755127C
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
BUY168762032023-03-21 13:06:35482 days ago1679403995IN
0x0D24Be08...ac755127C
0 ETH0.0050939935.05893486
BUY168761292023-03-21 12:51:35482 days ago1679403095IN
0x0D24Be08...ac755127C
0 ETH0.0031624523.65654588
BUY168688292023-03-20 12:16:59483 days ago1679314619IN
0x0D24Be08...ac755127C
0 ETH0.0019254814.68019679
BUY168636142023-03-19 18:43:47484 days ago1679251427IN
0x0D24Be08...ac755127C
0 ETH0.002511620.56112095
BUY168635412023-03-19 18:28:59484 days ago1679250539IN
0x0D24Be08...ac755127C
0 ETH0.0030179520.95028826
BUY168367032023-03-15 23:58:35488 days ago1678924715IN
0x0D24Be08...ac755127C
0 ETH0.0035989223.51287125
BUY168366772023-03-15 23:53:23488 days ago1678924403IN
0x0D24Be08...ac755127C
0 ETH0.0066114923.52227155
BUY168302522023-03-15 2:10:47488 days ago1678846247IN
0x0D24Be08...ac755127C
0 ETH0.0031732226.65385189
BUY168200732023-03-13 15:51:35490 days ago1678722695IN
0x0D24Be08...ac755127C
0 ETH0.0127978159.72165153
BUY168200512023-03-13 15:46:59490 days ago1678722419IN
0x0D24Be08...ac755127C
0 ETH0.0127477659.49478679
BUY168122222023-03-12 13:24:35491 days ago1678627475IN
0x0D24Be08...ac755127C
0 ETH0.0084274417.37824644
BUY168113732023-03-12 10:32:47491 days ago1678617167IN
0x0D24Be08...ac755127C
0 ETH0.0023602717.9696262
BUY168105172023-03-12 7:39:59491 days ago1678606799IN
0x0D24Be08...ac755127C
0 ETH0.0025415818.71512007
BUY167874242023-03-09 1:35:47494 days ago1678325747IN
0x0D24Be08...ac755127C
0 ETH0.00526324.51137091
BUY167811812023-03-08 4:31:59495 days ago1678249919IN
0x0D24Be08...ac755127C
0 ETH0.002515520.03622628
BUY167404692023-03-02 11:04:47501 days ago1677755087IN
0x0D24Be08...ac755127C
0 ETH0.0020432917.88289196
BUY167343072023-03-01 14:17:11502 days ago1677680231IN
0x0D24Be08...ac755127C
0 ETH0.0032278127.36484071
BUY167197962023-02-27 13:22:23504 days ago1677504143IN
0x0D24Be08...ac755127C
0 ETH0.0026826420.20273513
BUY167191362023-02-27 11:08:35504 days ago1677496115IN
0x0D24Be08...ac755127C
0 ETH0.0023139617.61703971
BUY167084072023-02-25 22:58:47506 days ago1677365927IN
0x0D24Be08...ac755127C
0 ETH0.0029412319.53207669
BUY166909362023-02-23 11:55:59508 days ago1677153359IN
0x0D24Be08...ac755127C
0 ETH0.0118380431.05222814
BUY166693962023-02-20 11:15:59511 days ago1676891759IN
0x0D24Be08...ac755127C
0 ETH0.003166821.45738127
BUY166484312023-02-17 12:28:11514 days ago1676636891IN
0x0D24Be08...ac755127C
0 ETH0.0024192422.10405374
BUY166462652023-02-17 5:09:11514 days ago1676610551IN
0x0D24Be08...ac755127C
0 ETH0.0029783526.06920115
BUY166462572023-02-17 5:07:35514 days ago1676610455IN
0x0D24Be08...ac755127C
0 ETH0.0036337124.62099946
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
GiraffeMarketPlace

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 11 : GiraffeMarketPlace.sol
// SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract GiraffeMarketPlace{
    address public owner;
    address public marketManager;
    address payable public marketWallet;
    bool public saleOpen;
    mapping(IERC20 => bool) public acceptableCoins ;
    using Counters for Counters.Counter;
    Counters.Counter private _unlistIds;
    mapping(uint256 => unListNFT) unlistedNFTs;
    using SafeERC20 for address;
     using ECDSA for bytes32;
    constructor(){
        owner = payable(msg.sender);
    }

    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }

    struct unListNFT{
        IERC721 _collectionId;
        uint256 _tokenId;
        address _seller;
        uint256 _unlistTime;
    }



    function BUY(IERC721[] memory _collectionIds, uint256[] memory _tokenIds, address[] memory _sellerAddresses ,IERC20 _coinId, uint256[] memory _prices ,uint256 _totalPrice, uint256 _tax,string[] memory messages, bytes[] memory signatures) public payable {
        require(saleOpen == true,"Sale Off");
        require(acceptableCoins[_coinId] == true,"Coins are not accepted");
        require(_coinId.balanceOf(msg.sender) >= _totalPrice+_tax,"Coin balance is not enough");
        require(_coinId.allowance(msg.sender,address(this)) >= _totalPrice+_tax,"Coin allowance is not enough" );
        _coinId.transferFrom(msg.sender, marketWallet, _tax);
        for(uint i=0; i < _collectionIds.length; i++){
            address _seller = _sellerAddresses[i];
            string memory _message = messages[i];
            bytes memory _signature = signatures[i];
            address signer = _verifySignature(_message,_signature);
            require(_seller == signer,"You are not signer");
            IERC721 _collectionId = _collectionIds[i];
            uint256 _tokenId = _tokenIds[i];
            uint256 _price = _prices[i];
            _coinId.transferFrom(msg.sender, _seller, _price);
            _collectionId.safeTransferFrom(_seller, msg.sender, _tokenId);
        }
    }

    function changeAcceptableCoin(IERC20 _coin, bool _accept) public onlyOwner{
        acceptableCoins[_coin] = _accept;
    }

    //TRANSFER
    function transferNFT(IERC721 _collectionId, address _to, uint256 _tokenId) public {
        require(_collectionId.ownerOf(_tokenId) == msg.sender,"You are not the owner");
        _collectionId.safeTransferFrom(msg.sender, _to, _tokenId);
    }

    function unlistNFT(IERC721 _collectionId, uint256 _tokenId) public {
        require(_collectionId.ownerOf(_tokenId) == msg.sender,"You are not the owner");
        _unlistIds.increment();
        uint256 unlistId = _unlistIds.current();
        uint256 _time = block.timestamp;
        unlistedNFTs[unlistId] = unListNFT(_collectionId, _tokenId, msg.sender, _time);
    }

    function toggleSale(bool _saleOpen) public onlyOwner{
             saleOpen = _saleOpen;
    }
    function changeOwner(address _newOwner) public onlyOwner{
             owner = payable(_newOwner);
    }
    
    function changeMarketWallet(address _newMarketWallet) public onlyOwner{
             marketWallet = payable(_newMarketWallet);
    }

    function changeMarketManager(address _newMarketManager) public onlyOwner{
             marketManager = payable(_newMarketManager);
    }
   

    function _verifySignature(string memory message, bytes memory signature)  internal pure  returns (address) {
       bytes32 messagehash =  keccak256(bytes(message));
        return address(messagehash.toEthSignedMessageHash().recover(signature));
    }
  
}

File 2 of 11 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 3 of 11 : Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 4 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 5 of 11 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the 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 7 of 11 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";

/**
 * @dev String operations.
 */
library Strings {
    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 = Math.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, Math.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 8 of 11 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 9 of 11 : Address.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 Address {
    /**
     * @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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(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 10 of 11 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 11 of 11 : Math.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 Math {
    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);
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"contract IERC721[]","name":"_collectionIds","type":"address[]"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"_sellerAddresses","type":"address[]"},{"internalType":"contract IERC20","name":"_coinId","type":"address"},{"internalType":"uint256[]","name":"_prices","type":"uint256[]"},{"internalType":"uint256","name":"_totalPrice","type":"uint256"},{"internalType":"uint256","name":"_tax","type":"uint256"},{"internalType":"string[]","name":"messages","type":"string[]"},{"internalType":"bytes[]","name":"signatures","type":"bytes[]"}],"name":"BUY","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"acceptableCoins","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_coin","type":"address"},{"internalType":"bool","name":"_accept","type":"bool"}],"name":"changeAcceptableCoin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newMarketManager","type":"address"}],"name":"changeMarketManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newMarketWallet","type":"address"}],"name":"changeMarketWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"changeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"marketManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"marketWallet","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"saleOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_saleOpen","type":"bool"}],"name":"toggleSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721","name":"_collectionId","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"transferNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721","name":"_collectionId","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"unlistNFT","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506125c8806100606000396000f3fe6080604052600436106100c25760003560e01c806399288dbb1161007f578063cb57dca811610059578063cb57dca81461023e578063d590bb5514610267578063e4440a8614610283578063e7d1fc0b146102ae576100c2565b806399288dbb146101c1578063a6f9dae1146101ec578063aab402e514610215576100c2565b80631717c659146100c757806341ed2c12146100f05780634eef1bee1461011b57806369e9cae1146101445780637fc27efd1461016d5780638da5cb5b14610196575b600080fd5b3480156100d357600080fd5b506100ee60048036038101906100e99190611372565b6102eb565b005b3480156100fc57600080fd5b5061010561039e565b60405161011291906113c1565b60405180910390f35b34801561012757600080fd5b50610142600480360381019061013d9190611408565b6103c4565b005b34801561015057600080fd5b5061016b600480360381019061016691906114a9565b610460565b005b34801561017957600080fd5b50610194600480360381019061018f91906114fc565b6105bb565b005b3480156101a257600080fd5b506101ab6107ca565b6040516101b891906113c1565b60405180910390f35b3480156101cd57600080fd5b506101d66107ee565b6040516101e3919061154b565b60405180910390f35b3480156101f857600080fd5b50610213600480360381019061020e9190611408565b610801565b005b34801561022157600080fd5b5061023c60048036038101906102379190611566565b61089c565b005b34801561024a57600080fd5b5061026560048036038101906102609190611408565b610911565b005b610281600480360381019061027c9190611b8a565b6109ad565b005b34801561028f57600080fd5b50610298610f21565b6040516102a59190611d1d565b60405180910390f35b3480156102ba57600080fd5b506102d560048036038101906102d09190611d38565b610f47565b6040516102e2919061154b565b60405180910390f35b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461034357600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461041c57600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004016104b09190611d74565b602060405180830381865afa1580156104cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f19190611da4565b73ffffffffffffffffffffffffffffffffffffffff1614610547576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053e90611e2e565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff166342842e0e3384846040518463ffffffff1660e01b815260040161058493929190611e4e565b600060405180830381600087803b15801561059e57600080fd5b505af11580156105b2573d6000803e3d6000fd5b50505050505050565b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b815260040161060b9190611d74565b602060405180830381865afa158015610628573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064c9190611da4565b73ffffffffffffffffffffffffffffffffffffffff16146106a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069990611e2e565b60405180910390fd5b6106ac6004610f67565b60006106b86004610f7d565b9050600042905060405180608001604052808573ffffffffffffffffffffffffffffffffffffffff1681526020018481526020013373ffffffffffffffffffffffffffffffffffffffff168152602001828152506005600084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506060820151816003015590505050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260149054906101000a900460ff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461085957600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108f457600080fd5b80600260146101000a81548160ff02191690831515021790555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461096957600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60011515600260149054906101000a900460ff16151514610a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109fa90611ed1565b60405180910390fd5b60011515600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610a96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8d90611f3d565b60405180910390fd5b8284610aa29190611f8c565b8673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401610adb91906113c1565b602060405180830381865afa158015610af8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1c9190611ff7565b1015610b5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5490612070565b60405180910390fd5b8284610b699190611f8c565b8673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401610ba4929190612090565b602060405180830381865afa158015610bc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be59190611ff7565b1015610c26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1d90612105565b60405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff166323b872dd33600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866040518463ffffffff1660e01b8152600401610c8593929190612184565b6020604051808303816000875af1158015610ca4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc891906121d0565b5060005b8951811015610f15576000888281518110610cea57610ce96121fd565b5b602002602001015190506000848381518110610d0957610d086121fd565b5b602002602001015190506000848481518110610d2857610d276121fd565b5b602002602001015190506000610d3e8383610f8b565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614610dae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da590612278565b60405180910390fd5b60008e8681518110610dc357610dc26121fd565b5b6020026020010151905060008e8781518110610de257610de16121fd565b5b6020026020010151905060008c8881518110610e0157610e006121fd565b5b602002602001015190508d73ffffffffffffffffffffffffffffffffffffffff166323b872dd3389846040518463ffffffff1660e01b8152600401610e4893929190611e4e565b6020604051808303816000875af1158015610e67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8b91906121d0565b508273ffffffffffffffffffffffffffffffffffffffff166342842e0e8833856040518463ffffffff1660e01b8152600401610ec993929190611e4e565b600060405180830381600087803b158015610ee357600080fd5b505af1158015610ef7573d6000803e3d6000fd5b50505050505050505050508080610f0d90612298565b915050610ccc565b50505050505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60036020528060005260406000206000915054906101000a900460ff1681565b6001816000016000828254019250508190555050565b600081600001549050919050565b60008083805190602001209050610fb383610fa583610fbc565b610fec90919063ffffffff16565b91505092915050565b600081604051602001610fcf9190612363565b604051602081830303815290604052805190602001209050919050565b6000806000610ffb8585611013565b9150915061100881611065565b819250505092915050565b6000806041835114156110555760008060006020860151925060408601519150606086015160001a9050611049878285856111d3565b9450945050505061105e565b60006002915091505b9250929050565b6000600481111561107957611078612389565b5b81600481111561108c5761108b612389565b5b1415611097576111d0565b600160048111156110ab576110aa612389565b5b8160048111156110be576110bd612389565b5b14156110ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f690612404565b60405180910390fd5b6002600481111561111357611112612389565b5b81600481111561112657611125612389565b5b1415611167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115e90612470565b60405180910390fd5b6003600481111561117b5761117a612389565b5b81600481111561118e5761118d612389565b5b14156111cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c690612502565b60405180910390fd5b5b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08360001c111561120e5760006003915091506112ad565b600060018787878760405160008152602001604052604051611233949392919061254d565b6020604051602081039080840390855afa158015611255573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156112a4576000600192509250506112ad565b80600092509250505b94509492505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006112f5826112ca565b9050919050565b6000611307826112ea565b9050919050565b611317816112fc565b811461132257600080fd5b50565b6000813590506113348161130e565b92915050565b60008115159050919050565b61134f8161133a565b811461135a57600080fd5b50565b60008135905061136c81611346565b92915050565b60008060408385031215611389576113886112c0565b5b600061139785828601611325565b92505060206113a88582860161135d565b9150509250929050565b6113bb816112ea565b82525050565b60006020820190506113d660008301846113b2565b92915050565b6113e5816112ea565b81146113f057600080fd5b50565b600081359050611402816113dc565b92915050565b60006020828403121561141e5761141d6112c0565b5b600061142c848285016113f3565b91505092915050565b6000611440826112ea565b9050919050565b61145081611435565b811461145b57600080fd5b50565b60008135905061146d81611447565b92915050565b6000819050919050565b61148681611473565b811461149157600080fd5b50565b6000813590506114a38161147d565b92915050565b6000806000606084860312156114c2576114c16112c0565b5b60006114d08682870161145e565b93505060206114e1868287016113f3565b92505060406114f286828701611494565b9150509250925092565b60008060408385031215611513576115126112c0565b5b60006115218582860161145e565b925050602061153285828601611494565b9150509250929050565b6115458161133a565b82525050565b6000602082019050611560600083018461153c565b92915050565b60006020828403121561157c5761157b6112c0565b5b600061158a8482850161135d565b91505092915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6115e182611598565b810181811067ffffffffffffffff82111715611600576115ff6115a9565b5b80604052505050565b60006116136112b6565b905061161f82826115d8565b919050565b600067ffffffffffffffff82111561163f5761163e6115a9565b5b602082029050602081019050919050565b600080fd5b600061166861166384611624565b611609565b9050808382526020820190506020840283018581111561168b5761168a611650565b5b835b818110156116b457806116a0888261145e565b84526020840193505060208101905061168d565b5050509392505050565b600082601f8301126116d3576116d2611593565b5b81356116e3848260208601611655565b91505092915050565b600067ffffffffffffffff821115611707576117066115a9565b5b602082029050602081019050919050565b600061172b611726846116ec565b611609565b9050808382526020820190506020840283018581111561174e5761174d611650565b5b835b8181101561177757806117638882611494565b845260208401935050602081019050611750565b5050509392505050565b600082601f83011261179657611795611593565b5b81356117a6848260208601611718565b91505092915050565b600067ffffffffffffffff8211156117ca576117c96115a9565b5b602082029050602081019050919050565b60006117ee6117e9846117af565b611609565b9050808382526020820190506020840283018581111561181157611810611650565b5b835b8181101561183a578061182688826113f3565b845260208401935050602081019050611813565b5050509392505050565b600082601f83011261185957611858611593565b5b81356118698482602086016117db565b91505092915050565b600067ffffffffffffffff82111561188d5761188c6115a9565b5b602082029050602081019050919050565b600080fd5b600067ffffffffffffffff8211156118be576118bd6115a9565b5b6118c782611598565b9050602081019050919050565b82818337600083830152505050565b60006118f66118f1846118a3565b611609565b9050828152602081018484840111156119125761191161189e565b5b61191d8482856118d4565b509392505050565b600082601f83011261193a57611939611593565b5b813561194a8482602086016118e3565b91505092915050565b600061196661196184611872565b611609565b9050808382526020820190506020840283018581111561198957611988611650565b5b835b818110156119d057803567ffffffffffffffff8111156119ae576119ad611593565b5b8086016119bb8982611925565b8552602085019450505060208101905061198b565b5050509392505050565b600082601f8301126119ef576119ee611593565b5b81356119ff848260208601611953565b91505092915050565b600067ffffffffffffffff821115611a2357611a226115a9565b5b602082029050602081019050919050565b600067ffffffffffffffff821115611a4f57611a4e6115a9565b5b611a5882611598565b9050602081019050919050565b6000611a78611a7384611a34565b611609565b905082815260208101848484011115611a9457611a9361189e565b5b611a9f8482856118d4565b509392505050565b600082601f830112611abc57611abb611593565b5b8135611acc848260208601611a65565b91505092915050565b6000611ae8611ae384611a08565b611609565b90508083825260208201905060208402830185811115611b0b57611b0a611650565b5b835b81811015611b5257803567ffffffffffffffff811115611b3057611b2f611593565b5b808601611b3d8982611aa7565b85526020850194505050602081019050611b0d565b5050509392505050565b600082601f830112611b7157611b70611593565b5b8135611b81848260208601611ad5565b91505092915050565b60008060008060008060008060006101208a8c031215611bad57611bac6112c0565b5b60008a013567ffffffffffffffff811115611bcb57611bca6112c5565b5b611bd78c828d016116be565b99505060208a013567ffffffffffffffff811115611bf857611bf76112c5565b5b611c048c828d01611781565b98505060408a013567ffffffffffffffff811115611c2557611c246112c5565b5b611c318c828d01611844565b9750506060611c428c828d01611325565b96505060808a013567ffffffffffffffff811115611c6357611c626112c5565b5b611c6f8c828d01611781565b95505060a0611c808c828d01611494565b94505060c0611c918c828d01611494565b93505060e08a013567ffffffffffffffff811115611cb257611cb16112c5565b5b611cbe8c828d016119da565b9250506101008a013567ffffffffffffffff811115611ce057611cdf6112c5565b5b611cec8c828d01611b5c565b9150509295985092959850929598565b6000611d07826112ca565b9050919050565b611d1781611cfc565b82525050565b6000602082019050611d326000830184611d0e565b92915050565b600060208284031215611d4e57611d4d6112c0565b5b6000611d5c84828501611325565b91505092915050565b611d6e81611473565b82525050565b6000602082019050611d896000830184611d65565b92915050565b600081519050611d9e816113dc565b92915050565b600060208284031215611dba57611db96112c0565b5b6000611dc884828501611d8f565b91505092915050565b600082825260208201905092915050565b7f596f7520617265206e6f7420746865206f776e65720000000000000000000000600082015250565b6000611e18601583611dd1565b9150611e2382611de2565b602082019050919050565b60006020820190508181036000830152611e4781611e0b565b9050919050565b6000606082019050611e6360008301866113b2565b611e7060208301856113b2565b611e7d6040830184611d65565b949350505050565b7f53616c65204f6666000000000000000000000000000000000000000000000000600082015250565b6000611ebb600883611dd1565b9150611ec682611e85565b602082019050919050565b60006020820190508181036000830152611eea81611eae565b9050919050565b7f436f696e7320617265206e6f7420616363657074656400000000000000000000600082015250565b6000611f27601683611dd1565b9150611f3282611ef1565b602082019050919050565b60006020820190508181036000830152611f5681611f1a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611f9782611473565b9150611fa283611473565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611fd757611fd6611f5d565b5b828201905092915050565b600081519050611ff18161147d565b92915050565b60006020828403121561200d5761200c6112c0565b5b600061201b84828501611fe2565b91505092915050565b7f436f696e2062616c616e6365206973206e6f7420656e6f756768000000000000600082015250565b600061205a601a83611dd1565b915061206582612024565b602082019050919050565b600060208201905081810360008301526120898161204d565b9050919050565b60006040820190506120a560008301856113b2565b6120b260208301846113b2565b9392505050565b7f436f696e20616c6c6f77616e6365206973206e6f7420656e6f75676800000000600082015250565b60006120ef601c83611dd1565b91506120fa826120b9565b602082019050919050565b6000602082019050818103600083015261211e816120e2565b9050919050565b6000819050919050565b600061214a612145612140846112ca565b612125565b6112ca565b9050919050565b600061215c8261212f565b9050919050565b600061216e82612151565b9050919050565b61217e81612163565b82525050565b600060608201905061219960008301866113b2565b6121a66020830185612175565b6121b36040830184611d65565b949350505050565b6000815190506121ca81611346565b92915050565b6000602082840312156121e6576121e56112c0565b5b60006121f4848285016121bb565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f596f7520617265206e6f74207369676e65720000000000000000000000000000600082015250565b6000612262601283611dd1565b915061226d8261222c565b602082019050919050565b6000602082019050818103600083015261229181612255565b9050919050565b60006122a382611473565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122d6576122d5611f5d565b5b600182019050919050565b600081905092915050565b7f19457468657265756d205369676e6564204d6573736167653a0a333200000000600082015250565b6000612322601c836122e1565b915061232d826122ec565b601c82019050919050565b6000819050919050565b6000819050919050565b61235d61235882612338565b612342565b82525050565b600061236e82612315565b915061237a828461234c565b60208201915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f45434453413a20696e76616c6964207369676e61747572650000000000000000600082015250565b60006123ee601883611dd1565b91506123f9826123b8565b602082019050919050565b6000602082019050818103600083015261241d816123e1565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e67746800600082015250565b600061245a601f83611dd1565b915061246582612424565b602082019050919050565b600060208201905081810360008301526124898161244d565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b60006124ec602283611dd1565b91506124f782612490565b604082019050919050565b6000602082019050818103600083015261251b816124df565b9050919050565b61252b81612338565b82525050565b600060ff82169050919050565b61254781612531565b82525050565b60006080820190506125626000830187612522565b61256f602083018661253e565b61257c6040830185612522565b6125896060830184612522565b9594505050505056fea2646970667358221220b6df817bc3e438ce21abc9494f9e6afd689fc382c75376328dbda05d3645a9ea64736f6c634300080a0033

Deployed Bytecode

0x6080604052600436106100c25760003560e01c806399288dbb1161007f578063cb57dca811610059578063cb57dca81461023e578063d590bb5514610267578063e4440a8614610283578063e7d1fc0b146102ae576100c2565b806399288dbb146101c1578063a6f9dae1146101ec578063aab402e514610215576100c2565b80631717c659146100c757806341ed2c12146100f05780634eef1bee1461011b57806369e9cae1146101445780637fc27efd1461016d5780638da5cb5b14610196575b600080fd5b3480156100d357600080fd5b506100ee60048036038101906100e99190611372565b6102eb565b005b3480156100fc57600080fd5b5061010561039e565b60405161011291906113c1565b60405180910390f35b34801561012757600080fd5b50610142600480360381019061013d9190611408565b6103c4565b005b34801561015057600080fd5b5061016b600480360381019061016691906114a9565b610460565b005b34801561017957600080fd5b50610194600480360381019061018f91906114fc565b6105bb565b005b3480156101a257600080fd5b506101ab6107ca565b6040516101b891906113c1565b60405180910390f35b3480156101cd57600080fd5b506101d66107ee565b6040516101e3919061154b565b60405180910390f35b3480156101f857600080fd5b50610213600480360381019061020e9190611408565b610801565b005b34801561022157600080fd5b5061023c60048036038101906102379190611566565b61089c565b005b34801561024a57600080fd5b5061026560048036038101906102609190611408565b610911565b005b610281600480360381019061027c9190611b8a565b6109ad565b005b34801561028f57600080fd5b50610298610f21565b6040516102a59190611d1d565b60405180910390f35b3480156102ba57600080fd5b506102d560048036038101906102d09190611d38565b610f47565b6040516102e2919061154b565b60405180910390f35b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461034357600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461041c57600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004016104b09190611d74565b602060405180830381865afa1580156104cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f19190611da4565b73ffffffffffffffffffffffffffffffffffffffff1614610547576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053e90611e2e565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff166342842e0e3384846040518463ffffffff1660e01b815260040161058493929190611e4e565b600060405180830381600087803b15801561059e57600080fd5b505af11580156105b2573d6000803e3d6000fd5b50505050505050565b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b815260040161060b9190611d74565b602060405180830381865afa158015610628573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064c9190611da4565b73ffffffffffffffffffffffffffffffffffffffff16146106a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069990611e2e565b60405180910390fd5b6106ac6004610f67565b60006106b86004610f7d565b9050600042905060405180608001604052808573ffffffffffffffffffffffffffffffffffffffff1681526020018481526020013373ffffffffffffffffffffffffffffffffffffffff168152602001828152506005600084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506060820151816003015590505050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260149054906101000a900460ff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461085957600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108f457600080fd5b80600260146101000a81548160ff02191690831515021790555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461096957600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60011515600260149054906101000a900460ff16151514610a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109fa90611ed1565b60405180910390fd5b60011515600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610a96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8d90611f3d565b60405180910390fd5b8284610aa29190611f8c565b8673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401610adb91906113c1565b602060405180830381865afa158015610af8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1c9190611ff7565b1015610b5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5490612070565b60405180910390fd5b8284610b699190611f8c565b8673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401610ba4929190612090565b602060405180830381865afa158015610bc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be59190611ff7565b1015610c26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1d90612105565b60405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff166323b872dd33600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866040518463ffffffff1660e01b8152600401610c8593929190612184565b6020604051808303816000875af1158015610ca4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc891906121d0565b5060005b8951811015610f15576000888281518110610cea57610ce96121fd565b5b602002602001015190506000848381518110610d0957610d086121fd565b5b602002602001015190506000848481518110610d2857610d276121fd565b5b602002602001015190506000610d3e8383610f8b565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614610dae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da590612278565b60405180910390fd5b60008e8681518110610dc357610dc26121fd565b5b6020026020010151905060008e8781518110610de257610de16121fd565b5b6020026020010151905060008c8881518110610e0157610e006121fd565b5b602002602001015190508d73ffffffffffffffffffffffffffffffffffffffff166323b872dd3389846040518463ffffffff1660e01b8152600401610e4893929190611e4e565b6020604051808303816000875af1158015610e67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8b91906121d0565b508273ffffffffffffffffffffffffffffffffffffffff166342842e0e8833856040518463ffffffff1660e01b8152600401610ec993929190611e4e565b600060405180830381600087803b158015610ee357600080fd5b505af1158015610ef7573d6000803e3d6000fd5b50505050505050505050508080610f0d90612298565b915050610ccc565b50505050505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60036020528060005260406000206000915054906101000a900460ff1681565b6001816000016000828254019250508190555050565b600081600001549050919050565b60008083805190602001209050610fb383610fa583610fbc565b610fec90919063ffffffff16565b91505092915050565b600081604051602001610fcf9190612363565b604051602081830303815290604052805190602001209050919050565b6000806000610ffb8585611013565b9150915061100881611065565b819250505092915050565b6000806041835114156110555760008060006020860151925060408601519150606086015160001a9050611049878285856111d3565b9450945050505061105e565b60006002915091505b9250929050565b6000600481111561107957611078612389565b5b81600481111561108c5761108b612389565b5b1415611097576111d0565b600160048111156110ab576110aa612389565b5b8160048111156110be576110bd612389565b5b14156110ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f690612404565b60405180910390fd5b6002600481111561111357611112612389565b5b81600481111561112657611125612389565b5b1415611167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115e90612470565b60405180910390fd5b6003600481111561117b5761117a612389565b5b81600481111561118e5761118d612389565b5b14156111cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c690612502565b60405180910390fd5b5b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08360001c111561120e5760006003915091506112ad565b600060018787878760405160008152602001604052604051611233949392919061254d565b6020604051602081039080840390855afa158015611255573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156112a4576000600192509250506112ad565b80600092509250505b94509492505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006112f5826112ca565b9050919050565b6000611307826112ea565b9050919050565b611317816112fc565b811461132257600080fd5b50565b6000813590506113348161130e565b92915050565b60008115159050919050565b61134f8161133a565b811461135a57600080fd5b50565b60008135905061136c81611346565b92915050565b60008060408385031215611389576113886112c0565b5b600061139785828601611325565b92505060206113a88582860161135d565b9150509250929050565b6113bb816112ea565b82525050565b60006020820190506113d660008301846113b2565b92915050565b6113e5816112ea565b81146113f057600080fd5b50565b600081359050611402816113dc565b92915050565b60006020828403121561141e5761141d6112c0565b5b600061142c848285016113f3565b91505092915050565b6000611440826112ea565b9050919050565b61145081611435565b811461145b57600080fd5b50565b60008135905061146d81611447565b92915050565b6000819050919050565b61148681611473565b811461149157600080fd5b50565b6000813590506114a38161147d565b92915050565b6000806000606084860312156114c2576114c16112c0565b5b60006114d08682870161145e565b93505060206114e1868287016113f3565b92505060406114f286828701611494565b9150509250925092565b60008060408385031215611513576115126112c0565b5b60006115218582860161145e565b925050602061153285828601611494565b9150509250929050565b6115458161133a565b82525050565b6000602082019050611560600083018461153c565b92915050565b60006020828403121561157c5761157b6112c0565b5b600061158a8482850161135d565b91505092915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6115e182611598565b810181811067ffffffffffffffff82111715611600576115ff6115a9565b5b80604052505050565b60006116136112b6565b905061161f82826115d8565b919050565b600067ffffffffffffffff82111561163f5761163e6115a9565b5b602082029050602081019050919050565b600080fd5b600061166861166384611624565b611609565b9050808382526020820190506020840283018581111561168b5761168a611650565b5b835b818110156116b457806116a0888261145e565b84526020840193505060208101905061168d565b5050509392505050565b600082601f8301126116d3576116d2611593565b5b81356116e3848260208601611655565b91505092915050565b600067ffffffffffffffff821115611707576117066115a9565b5b602082029050602081019050919050565b600061172b611726846116ec565b611609565b9050808382526020820190506020840283018581111561174e5761174d611650565b5b835b8181101561177757806117638882611494565b845260208401935050602081019050611750565b5050509392505050565b600082601f83011261179657611795611593565b5b81356117a6848260208601611718565b91505092915050565b600067ffffffffffffffff8211156117ca576117c96115a9565b5b602082029050602081019050919050565b60006117ee6117e9846117af565b611609565b9050808382526020820190506020840283018581111561181157611810611650565b5b835b8181101561183a578061182688826113f3565b845260208401935050602081019050611813565b5050509392505050565b600082601f83011261185957611858611593565b5b81356118698482602086016117db565b91505092915050565b600067ffffffffffffffff82111561188d5761188c6115a9565b5b602082029050602081019050919050565b600080fd5b600067ffffffffffffffff8211156118be576118bd6115a9565b5b6118c782611598565b9050602081019050919050565b82818337600083830152505050565b60006118f66118f1846118a3565b611609565b9050828152602081018484840111156119125761191161189e565b5b61191d8482856118d4565b509392505050565b600082601f83011261193a57611939611593565b5b813561194a8482602086016118e3565b91505092915050565b600061196661196184611872565b611609565b9050808382526020820190506020840283018581111561198957611988611650565b5b835b818110156119d057803567ffffffffffffffff8111156119ae576119ad611593565b5b8086016119bb8982611925565b8552602085019450505060208101905061198b565b5050509392505050565b600082601f8301126119ef576119ee611593565b5b81356119ff848260208601611953565b91505092915050565b600067ffffffffffffffff821115611a2357611a226115a9565b5b602082029050602081019050919050565b600067ffffffffffffffff821115611a4f57611a4e6115a9565b5b611a5882611598565b9050602081019050919050565b6000611a78611a7384611a34565b611609565b905082815260208101848484011115611a9457611a9361189e565b5b611a9f8482856118d4565b509392505050565b600082601f830112611abc57611abb611593565b5b8135611acc848260208601611a65565b91505092915050565b6000611ae8611ae384611a08565b611609565b90508083825260208201905060208402830185811115611b0b57611b0a611650565b5b835b81811015611b5257803567ffffffffffffffff811115611b3057611b2f611593565b5b808601611b3d8982611aa7565b85526020850194505050602081019050611b0d565b5050509392505050565b600082601f830112611b7157611b70611593565b5b8135611b81848260208601611ad5565b91505092915050565b60008060008060008060008060006101208a8c031215611bad57611bac6112c0565b5b60008a013567ffffffffffffffff811115611bcb57611bca6112c5565b5b611bd78c828d016116be565b99505060208a013567ffffffffffffffff811115611bf857611bf76112c5565b5b611c048c828d01611781565b98505060408a013567ffffffffffffffff811115611c2557611c246112c5565b5b611c318c828d01611844565b9750506060611c428c828d01611325565b96505060808a013567ffffffffffffffff811115611c6357611c626112c5565b5b611c6f8c828d01611781565b95505060a0611c808c828d01611494565b94505060c0611c918c828d01611494565b93505060e08a013567ffffffffffffffff811115611cb257611cb16112c5565b5b611cbe8c828d016119da565b9250506101008a013567ffffffffffffffff811115611ce057611cdf6112c5565b5b611cec8c828d01611b5c565b9150509295985092959850929598565b6000611d07826112ca565b9050919050565b611d1781611cfc565b82525050565b6000602082019050611d326000830184611d0e565b92915050565b600060208284031215611d4e57611d4d6112c0565b5b6000611d5c84828501611325565b91505092915050565b611d6e81611473565b82525050565b6000602082019050611d896000830184611d65565b92915050565b600081519050611d9e816113dc565b92915050565b600060208284031215611dba57611db96112c0565b5b6000611dc884828501611d8f565b91505092915050565b600082825260208201905092915050565b7f596f7520617265206e6f7420746865206f776e65720000000000000000000000600082015250565b6000611e18601583611dd1565b9150611e2382611de2565b602082019050919050565b60006020820190508181036000830152611e4781611e0b565b9050919050565b6000606082019050611e6360008301866113b2565b611e7060208301856113b2565b611e7d6040830184611d65565b949350505050565b7f53616c65204f6666000000000000000000000000000000000000000000000000600082015250565b6000611ebb600883611dd1565b9150611ec682611e85565b602082019050919050565b60006020820190508181036000830152611eea81611eae565b9050919050565b7f436f696e7320617265206e6f7420616363657074656400000000000000000000600082015250565b6000611f27601683611dd1565b9150611f3282611ef1565b602082019050919050565b60006020820190508181036000830152611f5681611f1a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611f9782611473565b9150611fa283611473565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611fd757611fd6611f5d565b5b828201905092915050565b600081519050611ff18161147d565b92915050565b60006020828403121561200d5761200c6112c0565b5b600061201b84828501611fe2565b91505092915050565b7f436f696e2062616c616e6365206973206e6f7420656e6f756768000000000000600082015250565b600061205a601a83611dd1565b915061206582612024565b602082019050919050565b600060208201905081810360008301526120898161204d565b9050919050565b60006040820190506120a560008301856113b2565b6120b260208301846113b2565b9392505050565b7f436f696e20616c6c6f77616e6365206973206e6f7420656e6f75676800000000600082015250565b60006120ef601c83611dd1565b91506120fa826120b9565b602082019050919050565b6000602082019050818103600083015261211e816120e2565b9050919050565b6000819050919050565b600061214a612145612140846112ca565b612125565b6112ca565b9050919050565b600061215c8261212f565b9050919050565b600061216e82612151565b9050919050565b61217e81612163565b82525050565b600060608201905061219960008301866113b2565b6121a66020830185612175565b6121b36040830184611d65565b949350505050565b6000815190506121ca81611346565b92915050565b6000602082840312156121e6576121e56112c0565b5b60006121f4848285016121bb565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f596f7520617265206e6f74207369676e65720000000000000000000000000000600082015250565b6000612262601283611dd1565b915061226d8261222c565b602082019050919050565b6000602082019050818103600083015261229181612255565b9050919050565b60006122a382611473565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122d6576122d5611f5d565b5b600182019050919050565b600081905092915050565b7f19457468657265756d205369676e6564204d6573736167653a0a333200000000600082015250565b6000612322601c836122e1565b915061232d826122ec565b601c82019050919050565b6000819050919050565b6000819050919050565b61235d61235882612338565b612342565b82525050565b600061236e82612315565b915061237a828461234c565b60208201915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f45434453413a20696e76616c6964207369676e61747572650000000000000000600082015250565b60006123ee601883611dd1565b91506123f9826123b8565b602082019050919050565b6000602082019050818103600083015261241d816123e1565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e67746800600082015250565b600061245a601f83611dd1565b915061246582612424565b602082019050919050565b600060208201905081810360008301526124898161244d565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b60006124ec602283611dd1565b91506124f782612490565b604082019050919050565b6000602082019050818103600083015261251b816124df565b9050919050565b61252b81612338565b82525050565b600060ff82169050919050565b61254781612531565b82525050565b60006080820190506125626000830187612522565b61256f602083018661253e565b61257c6040830185612522565b6125896060830184612522565b9594505050505056fea2646970667358221220b6df817bc3e438ce21abc9494f9e6afd689fc382c75376328dbda05d3645a9ea64736f6c634300080a0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.