Contract 0xECA137CEa757DC499430eEAD875041D9F62A464d

Txn Hash Method
Block
From
To
Value [Txn Fee]
0xdfed0be401fd72e0b25ab52665026c20435723650bf48c1e38ba867454bb56d10x60a06040274840432023-03-15 20:23:5615 days 3 hrs ago0x8406a51a0e1b5f52ff61226773e6328e5da5d964 IN  Create: BunyRaffleNft0 AVAX0.07272422525
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BunyRaffleNft

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU GPLv3 license

Contract Source Code (Solidity Standard Json-Input format)

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

File 2 of 21 : IERC721EnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../token/ERC721/extensions/IERC721EnumerableUpgradeable.sol";

File 3 of 21 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

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

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

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

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

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

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

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

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

File 4 of 21 : ERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721Upgradeable.sol";
import "./IERC721ReceiverUpgradeable.sol";
import "./extensions/IERC721MetadataUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/StringsUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
    using AddressUpgradeable for address;
    using StringsUpgradeable for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {
        __ERC721_init_unchained(name_, symbol_);
    }

    function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
        _name = name_;
        _symbol = symbol_;
    }

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: address zero is not a valid owner");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: invalid token ID");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        _requireMinted(tokenId);

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721Upgradeable.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not token owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");
        _safeTransfer(from, to, tokenId, data);
    }

    /**
     * @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.
     *
     * `data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        address owner = ERC721Upgradeable.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);

        _afterTokenTransfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721Upgradeable.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);

        _afterTokenTransfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits an {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                return retval == IERC721ReceiverUpgradeable.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}

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

File 5 of 21 : IERC721ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721ReceiverUpgradeable {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * 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 21 : ERC721EnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../ERC721Upgradeable.sol";
import "./IERC721EnumerableUpgradeable.sol";
import "../../../proxy/utils/Initializable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721EnumerableUpgradeable {
    function __ERC721Enumerable_init() internal onlyInitializing {
    }

    function __ERC721Enumerable_init_unchained() internal onlyInitializing {
    }
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

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

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Upgradeable.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721EnumerableUpgradeable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual override {
        super._beforeTokenTransfer(from, to, tokenId);

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721Upgradeable.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721Upgradeable.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }

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

File 8 of 21 : IERC721EnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721EnumerableUpgradeable is IERC721Upgradeable {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

File 9 of 21 : IERC721MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721MetadataUpgradeable is IERC721Upgradeable {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 10 of 21 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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 11 of 21 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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

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

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

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

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

File 12 of 21 : CountersUpgradeable.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 CountersUpgradeable {
    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 13 of 21 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    bytes16 private constant _HEX_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) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @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] = _HEX_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 14 of 21 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

pragma solidity ^0.8.0;

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

File 16 of 21 : base64.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0;

/// @title Base64
/// @author Brecht Devos - <[email protected]>
/// @notice Provides functions for encoding/decoding base64
library Base64 {
    string internal constant TABLE_ENCODE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
    bytes  internal constant TABLE_DECODE = hex"0000000000000000000000000000000000000000000000000000000000000000"
                                            hex"00000000000000000000003e0000003f3435363738393a3b3c3d000000000000"
                                            hex"00000102030405060708090a0b0c0d0e0f101112131415161718190000000000"
                                            hex"001a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132330000000000";

    function encode(bytes memory data) internal pure returns (string memory) {
        if (data.length == 0) return '';

        // load the table into memory
        string memory table = TABLE_ENCODE;

        // multiply by 4/3 rounded up
        uint256 encodedLen = 4 * ((data.length + 2) / 3);

        // add some extra buffer at the end required for the writing
        string memory result = new string(encodedLen + 32);

        assembly {
            // set the actual output length
            mstore(result, encodedLen)

            // prepare the lookup table
            let tablePtr := add(table, 1)

            // input ptr
            let dataPtr := data
            let endPtr := add(dataPtr, mload(data))

            // result ptr, jump over length
            let resultPtr := add(result, 32)

            // run over the input, 3 bytes at a time
            for {} lt(dataPtr, endPtr) {}
            {
                // read 3 bytes
                dataPtr := add(dataPtr, 3)
                let input := mload(dataPtr)

                // write 4 characters
                mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))
                resultPtr := add(resultPtr, 1)
                mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))
                resultPtr := add(resultPtr, 1)
                mstore8(resultPtr, mload(add(tablePtr, and(shr( 6, input), 0x3F))))
                resultPtr := add(resultPtr, 1)
                mstore8(resultPtr, mload(add(tablePtr, and(        input,  0x3F))))
                resultPtr := add(resultPtr, 1)
            }

            // padding with '='
            switch mod(mload(data), 3)
            case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) }
            case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) }
        }

        return result;
    }

    function decode(string memory _data) internal pure returns (bytes memory) {
        bytes memory data = bytes(_data);

        if (data.length == 0) return new bytes(0);
        require(data.length % 4 == 0, "invalid base64 decoder input");

        // load the table into memory
        bytes memory table = TABLE_DECODE;

        // every 4 characters represent 3 bytes
        uint256 decodedLen = (data.length / 4) * 3;

        // add some extra buffer at the end required for the writing
        bytes memory result = new bytes(decodedLen + 32);

        assembly {
            // padding with '='
            let lastBytes := mload(add(data, mload(data)))
            if eq(and(lastBytes, 0xFF), 0x3d) {
                decodedLen := sub(decodedLen, 1)
                if eq(and(lastBytes, 0xFFFF), 0x3d3d) {
                    decodedLen := sub(decodedLen, 1)
                }
            }

            // set the actual output length
            mstore(result, decodedLen)

            // prepare the lookup table
            let tablePtr := add(table, 1)

            // input ptr
            let dataPtr := data
            let endPtr := add(dataPtr, mload(data))

            // result ptr, jump over length
            let resultPtr := add(result, 32)

            // run over the input, 4 characters at a time
            for {} lt(dataPtr, endPtr) {}
            {
               // read 4 characters
               dataPtr := add(dataPtr, 4)
               let input := mload(dataPtr)

               // write 3 bytes
               let output := add(
                   add(
                       shl(18, and(mload(add(tablePtr, and(shr(24, input), 0xFF))), 0xFF)),
                       shl(12, and(mload(add(tablePtr, and(shr(16, input), 0xFF))), 0xFF))),
                   add(
                       shl( 6, and(mload(add(tablePtr, and(shr( 8, input), 0xFF))), 0xFF)),
                               and(mload(add(tablePtr, and(        input , 0xFF))), 0xFF)
                    )
                )
                mstore(resultPtr, shl(232, output))
                resultPtr := add(resultPtr, 3)
            }
        }

        return result;
    }
}

File 17 of 21 : BunyRaffleNft.sol
//bunyNFt

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.11;

import { ERC721Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import {ERC721EnumerableUpgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol";
import {  IERC721EnumerableUpgradeable } from "@openzeppelin/contracts-upgradeable/interfaces/IERC721EnumerableUpgradeable.sol";
import {  IERC721Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";

import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import { CountersUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";
import { AddressUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import { SharedNFTLogic } from "./SharedNFTLogic.sol";
import { IEditionSingleMintable } from "./IEditionSingleMintable.sol";
import "./SlothVDF.sol";

contract BunyRaffleNft is ERC721Upgradeable, IEditionSingleMintable,  OwnableUpgradeable {
  using CountersUpgradeable for CountersUpgradeable.Counter;
  SharedNFTLogic private immutable sharedNFTLogic;
  CountersUpgradeable.Counter private atEditionId;
  event Rafflestarted(address minter, uint256 startTime);
  event Editionsold(uint256 price, address owner, uint256 EntryCount, uint256 entryTime);
  event WinnerPicked(address winner, uint256 winningNumber, uint256 prize);
  string public description;
  string public animationUrl;
  string public imageUrl;
  uint256 public editionSize;
  uint256 public salePrice;
  uint256 public minPlayers;
  uint256 public maxTokens;
  bool public active = false;
  bool public winnerSelected = false;
  bool public isComplete = false;
  bool public isProof = false;
  bool public prizeClaimed = false;
  uint256 public startTime;
  uint256 public endTime;
  uint256 public EntryCount = 0;
  uint256 public prime = 0;
  uint256 public iterations = 0;
  uint256 private nonce = 0;
  uint256 public randomNumber = 0;
  uint256 public winningNumber = 0;
  address payable public Winner;
  address payable public bunyBank;
  Entry[] private entry;
  RaffleWinner[] public raffleWinner;
 	uint256[] public nftTokenIds;
  mapping(address => bool) public mintedTokens;
  mapping(address => bool) public allowedMinters;
  mapping(address => uint256) public seed;
  mapping(address => bool) public isPlayer;


  struct Entry {
    address player;
    uint256 EntryNumber;
    uint256 entryTime;
  }

  struct RaffleWinner {
    address payable winner;
    uint256 winningTokenId;
  }



  constructor( SharedNFTLogic _sharedNFTLogic)  {
    sharedNFTLogic = _sharedNFTLogic;
      
       }

  function initialize(
    address _owner,
    string memory _name,
    string memory _symbol,
    string memory _description,
    //string memory _animationUrl,
    string memory _imageUrl,
    uint256 _editionSize,
    uint256 _salePrice,
    uint256 _minPlayers,
    address payable _bunyBank,
    uint256 _maxTokens,
    uint256 _prime,
    uint256 _iterations

  ) public initializer {
    __ERC721_init(_name, _symbol);
    __Ownable_init();
    // Set ownership to original sender of contract call
    transferOwnership(_owner);
    description = _description;
    //animationUrl = _animationUrl;
    imageUrl = _imageUrl;
    editionSize = _editionSize;
    salePrice = _salePrice;
    minPlayers = _minPlayers;
    bunyBank = _bunyBank;
    maxTokens = _maxTokens;
    prime = _prime;
    iterations = _iterations;
    atEditionId.increment();
  }

  /// @dev returns the number of minted tokens within the edition
   function totalSupply() public view returns (uint256) {
     return atEditionId.current() - 1;
    }

     
 // return balance in wei
    function getBalance() public view returns(uint){
        return address(this).balance;
    }

    // return prize balance
     function getPrize() external view returns (uint256) {
        uint256 balance = address(this).balance;
        return balance * 9 / 10; //90%
    }


  function purchase() external payable returns (uint256) {
    require(balanceOf(msg.sender) < maxTokens, "You have reached the maximum tokens allowed per address");
    require(active, "Raffle has not started. Owner must setApprovedMinter");
    require(msg.value == salePrice, "No soup for you!");
    address[] memory toMint = new address[](1);
    toMint[0] = msg.sender;
    mintedTokens[msg.sender] = true;
    nonce ++;
    createSeed();
    EntryCount ++;
    isPlayer[msg.sender] = true;
    nftTokenIds.push(EntryCount);
    uint256 entryTime = block.timestamp;
    Entry memory x = Entry(msg.sender, EntryCount, entryTime);
    entry.push(x);
      if (EntryCount == editionSize) {
            isComplete = true;
            active = false;
        }
    emit Editionsold(salePrice, msg.sender, EntryCount, entryTime);
    return _mintEditions(toMint);
  }


    function createSeed() internal returns(uint256) {
      nonce ++;
      seed[msg.sender] = uint256(keccak256(abi.encodePacked(msg.sender, EntryCount, block.timestamp, blockhash(block.number - 1))));            
      
    }
 
    function prove(uint256 proof) external  {
      nonce ++;
   // see if the proof is valid for the seed associated with the address
      require(SlothVDF.verify(proof, seed[msg.sender], prime, iterations), "Invalid proof");
   // use the proof as a provable random number
          randomNumber = proof;
            if (randomNumber > 0) {
           isProof = true;
        }
    }

function getOwner(uint _id) public view returns (address) {
    return ownerOf(_id);
  }


function pickWinner() public returns (uint256) {
  require(randomNumber > 0, "Generate provable random number first");
  require(isPlayer[msg.sender], "User is not a active player. Only a registered ticket holder can start drawing");
  nonce ++;
  winningNumber = uint256(keccak256(abi.encodePacked(block.number, randomNumber, blockhash(block.number - 1)))) % totalSupply();
  address winner = getOwner(winningNumber);
  uint256 prize = address(this).balance * 90 / 100;
  Winner = payable(winner);
  emit WinnerPicked(Winner, winningNumber, prize);
  winnerSelected = true;
  active = false;
  RaffleWinner memory x = RaffleWinner(Winner, winningNumber);
  raffleWinner.push(x);
  Winner.transfer(prize);
  withdrawBuny();
  endTime = block.timestamp;
  return winningNumber;
}

//failsafe?
    function claimPrize(uint256 _winningNumber) public {
    address payable tokenOwner = payable(ownerOf(_winningNumber));
    require(msg.sender == tokenOwner, "Only the owner of this token can withdraw the balance");
    require(winnerSelected, "The contract has no balance to withdraw");
    uint256 balance = address(this).balance * 90/100;
    (bool success, ) = tokenOwner.call{value: balance}("");
    prizeClaimed = true;
    withdrawBuny();
    require(success, "Withdrawal failed");
  }


  function _isAllowedToMint() internal view returns (bool) {
    if (owner() == msg.sender) {
      return true;
    }
    if (allowedMinters[address(0x0)]) {
      return true;
    }
    return allowedMinters[msg.sender];
  }

  function mintEdition(address to) external override returns (uint256) {
    require(_isAllowedToMint(), "Needs to be an allowed minter");
    address[] memory toMint = new address[](1);
    toMint[0] = to;
    return _mintEditions(toMint);
  }

  function mintEditions(address[] memory recipients) external override returns (uint256) {
    require(_isAllowedToMint(), "Needs to be an allowed minter");
    return _mintEditions(recipients);
  }

  function owner() public view override(OwnableUpgradeable, IEditionSingleMintable) returns (address) {
    return super.owner();
  }

  // helper function starts raffle once setApprovedMinter. 
  function enableRaffle() public onlyOwner {
      active = true;
    }

    
     function readAllEntries() public view  returns (Entry[] memory) {
    Entry[] memory result = new Entry[](EntryCount);
    for (uint256 i = 0; i < EntryCount; i++) {
      result[i] = entry[i];
    }
    return result;
  }
  
  // set contract address as Approved minter
  // set active state to false
  // log and emit current time
  function setApprovedMinter(address minter, bool allowed) public onlyOwner {
    allowedMinters[minter] = allowed;
    enableRaffle();
    startTime = block.timestamp;
    emit Rafflestarted(minter, startTime);
  }

  


  /// Returns the number of editions allowed to mint (max_uint256 when open edition)
  function numberCanMint() public view override returns (uint256) {
    // Return max int if open edition
    if (editionSize == 0) {
      return type(uint256).max;
    }
    // atEditionId is one-indexed hence the need to remove one here
    return editionSize + 1 - atEditionId.current();
  }

  /**
      @dev Private function to mint als without any access checks.
           Called by the public edition minting functions.
     */
  function _mintEditions(address[] memory recipients) internal returns (uint256) {
    uint256 startAt = atEditionId.current();
    uint256 endAt = startAt + recipients.length - 1;
    require(editionSize == 0 || endAt <= editionSize, "Sold out");
    while (atEditionId.current() <= endAt) {
      _mint(recipients[atEditionId.current() - startAt], atEditionId.current());
      atEditionId.increment();
    }
    return atEditionId.current();
  }

 
   
    function withdrawBuny() internal {
        uint256 amount = address(this).balance * 10 / 100;
        require(isComplete, "Raffle sale must be complete before withdraw function is enabled");
        require(amount > 0, "Contract A has no balance to withdraw");

        bunyBank.transfer(amount);
    }


  function tokenURI(uint256 tokenId) public view override returns (string memory) {
    require(_exists(tokenId), "No token");

    return sharedNFTLogic.createMetadataEdition(name(), description, imageUrl, animationUrl, tokenId, editionSize);
  }


     function supportsInterface(
        bytes4 interfaceId
    ) public view virtual override( ERC721Upgradeable) returns (bool) {
        return super.supportsInterface(interfaceId);
    }



}

File 18 of 21 : IEditionSingleMintable.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.6;

interface IEditionSingleMintable {
  function mintEdition(address to) external returns (uint256);

  function mintEditions(address[] memory to) external returns (uint256);

  function numberCanMint() external view returns (uint256);

  function owner() external view returns (address);
}

File 19 of 21 : IPublicSharedMetadata.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.6;

/// Shared public library for on-chain NFT functions
interface IPublicSharedMetadata {
  /// @param unencoded bytes to base64-encode
  function base64Encode(bytes memory unencoded) external pure returns (string memory);

  /// Encodes the argument json bytes into base64-data uri format
  /// @param json Raw json to base64 and turn into a data-uri
  function encodeMetadataJSON(bytes memory json) external pure returns (string memory);

  /// Proxy to openzeppelin's toString function
  /// @param value number to return as a string
  function numberToString(uint256 value) external pure returns (string memory);
}

File 20 of 21 : SharedNFTLogic.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.7;

import { StringsUpgradeable } from '@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol';
import { Base64 } from 'base64-sol/base64.sol';
import { IPublicSharedMetadata } from './IPublicSharedMetadata.sol';

/// Shared NFT logic for rendering metadata associated with editions
/// @dev Can safely be used for generic base64Encode and numberToString functions
contract SharedNFTLogic is IPublicSharedMetadata {
  /// @param unencoded bytes to base64-encode
  function base64Encode(bytes memory unencoded) public pure override returns (string memory) {
    return Base64.encode(unencoded);
  }

  /// Proxy to openzeppelin's toString function
  /// @param value number to return as a string
  function numberToString(uint256 value) public pure override returns (string memory) {
    return StringsUpgradeable.toString(value);
  }

  /// Generate edition metadata from storage information as base64-json blob
  /// Combines the media data and metadata
  /// @param name Name of NFT in metadata
  /// @param description Description of NFT in metadata
  /// @param imageUrl URL of image to render for edition
  /// @param animationUrl URL of animation to render for edition
  /// @param tokenOfEdition Token ID for specific token
  /// @param editionSize Size of entire edition to show
  function createMetadataEdition(
    string memory name,
    string memory description,
    string memory imageUrl,
    string memory animationUrl,
    uint256 tokenOfEdition,
    uint256 editionSize
  ) external pure returns (string memory) {
    string memory _tokenMediaData = tokenMediaData(imageUrl, animationUrl, tokenOfEdition);
    bytes memory json = createMetadataJSON(name, description, _tokenMediaData, tokenOfEdition, editionSize);
    return encodeMetadataJSON(json);
  }

  /// Function to create the metadata json string for the nft edition
  /// @param name Name of NFT in metadata
  /// @param description Description of NFT in metadata
  /// @param mediaData Data for media to include in json object
  /// @param tokenOfEdition Token ID for specific token
  /// @param editionSize Size of entire edition to show
  function createMetadataJSON(
    string memory name,
    string memory description,
    string memory mediaData,
    uint256 tokenOfEdition,
    uint256 editionSize
  ) public pure returns (bytes memory) {
    bytes memory editionSizeText;
    if (editionSize > 0) {
      editionSizeText = abi.encodePacked('/', numberToString(editionSize));
    }
    return
      abi.encodePacked(
        '{"name": "',
        name,
        ' ',
        numberToString(tokenOfEdition),
        editionSizeText,
        '", "',
        'description": "',
        description,
        '", "',
        mediaData,
        'properties": {"number": ',
        numberToString(tokenOfEdition),
        ', "name": "',
        name,
        '"}}'
      );
  }

  /// Encodes the argument json bytes into base64-data uri format
  /// @param json Raw json to base64 and turn into a data-uri
  function encodeMetadataJSON(bytes memory json) public pure override returns (string memory) {
    return string(abi.encodePacked('data:application/json;base64,', base64Encode(json)));
  }

  /// Generates edition metadata from storage information as base64-json blob
  /// Combines the media data and metadata
  /// @param imageUrl URL of image to render for edition
  /// @param animationUrl URL of animation to render for edition
  function tokenMediaData(string memory imageUrl, string memory animationUrl, uint256 tokenOfEdition) public pure returns (string memory) {
    bool hasImage = bytes(imageUrl).length > 0;
    bool hasAnimation = bytes(animationUrl).length > 0;
    if (hasImage && hasAnimation) {
      return
        string(
          abi.encodePacked(
            'image": "',
            imageUrl,
            '?id=',
            numberToString(tokenOfEdition),
            '", "animation_url": "',
            animationUrl,
            '?id=',
            numberToString(tokenOfEdition),
            '", "'
          )
        );
    }
    if (hasImage) {
      return string(abi.encodePacked('image": "', imageUrl, '?id=', numberToString(tokenOfEdition), '", "'));
    }
    if (hasAnimation) {
      return string(abi.encodePacked('animation_url": "', animationUrl, '?id=', numberToString(tokenOfEdition), '", "'));
    }

    return '';
  }
}

File 21 of 21 : SlothVDF.sol
// SPDX-License-Identifier: MIT
// https://eprint.iacr.org/2015/366.pdf
 
pragma solidity ^0.8.11;
 
library SlothVDF {
 
    /// @dev pow(base, exponent, modulus)
    /// @param base base
    /// @param exponent exponent
    /// @param modulus modulus
    function bexmod(
        uint256 base,
        uint256 exponent,
        uint256 modulus
    ) internal pure returns (uint256) {
        uint256 _result = 1;
        uint256 _base = base;
        for (; exponent > 0; exponent >>= 1) {
            if (exponent & 1 == 1) {
                _result = mulmod(_result, _base, modulus);
            }
 
            _base = mulmod(_base, _base, modulus);
        }
        return _result;
    }
 
    /// @dev compute sloth starting from seed, over prime, for iterations
    /// @param _seed seed
    /// @param _prime prime
    /// @param _iterations number of iterations
    /// @return sloth result
    function compute(
        uint256 _seed,
        uint256 _prime,
        uint256 _iterations
    ) internal pure returns (uint256) {
        uint256 _exponent = (_prime + 1) >> 2;
        _seed %= _prime;
        for (uint256 i; i < _iterations; ++i) {
            _seed = bexmod(_seed, _exponent, _prime);
        }
        return _seed;
    }
     
    /// @dev verify sloth result proof, starting from seed, over prime, for iterations
    /// @param _proof result
    /// @param _seed seed
    /// @param _prime prime
    /// @param _iterations number of iterations
    /// @return true if y is a quadratic residue modulo p
    function verify(
        uint256 _proof,
        uint256 _seed,
        uint256 _prime,
        uint256 _iterations
    ) internal pure returns (bool) {
        for (uint256 i; i < _iterations; ++i) {
            _proof = mulmod(_proof, _proof, _prime);
        }
        _seed %= _prime;
        if (_seed == _proof) return true;
        if (_prime - _seed == _proof) return true;
        return false;
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"contract SharedNFTLogic","name":"_sharedNFTLogic","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"EntryCount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"entryTime","type":"uint256"}],"name":"Editionsold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"}],"name":"Rafflestarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"winner","type":"address"},{"indexed":false,"internalType":"uint256","name":"winningNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"prize","type":"uint256"}],"name":"WinnerPicked","type":"event"},{"inputs":[],"name":"EntryCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"Winner","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"active","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allowedMinters","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"animationUrl","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bunyBank","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_winningNumber","type":"uint256"}],"name":"claimPrize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"description","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"editionSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableRaffle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"imageUrl","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_description","type":"string"},{"internalType":"string","name":"_imageUrl","type":"string"},{"internalType":"uint256","name":"_editionSize","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"},{"internalType":"uint256","name":"_minPlayers","type":"uint256"},{"internalType":"address payable","name":"_bunyBank","type":"address"},{"internalType":"uint256","name":"_maxTokens","type":"uint256"},{"internalType":"uint256","name":"_prime","type":"uint256"},{"internalType":"uint256","name":"_iterations","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isComplete","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isPlayer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isProof","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"iterations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPlayers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mintEdition","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"}],"name":"mintEditions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"mintedTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nftTokenIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numberCanMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pickWinner","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"prime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"proof","type":"uint256"}],"name":"prove","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"purchase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"raffleWinner","outputs":[{"internalType":"address payable","name":"winner","type":"address"},{"internalType":"uint256","name":"winningTokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"readAllEntries","outputs":[{"components":[{"internalType":"address","name":"player","type":"address"},{"internalType":"uint256","name":"EntryNumber","type":"uint256"},{"internalType":"uint256","name":"entryTime","type":"uint256"}],"internalType":"struct BunyRaffleNft.Entry[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"salePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"seed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"bool","name":"allowed","type":"bool"}],"name":"setApprovedMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"winnerSelected","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"winningNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60a060405260d1805464ffffffffff19169055600060d481905560d581905560d681905560d781905560d881905560d9553480156200003d57600080fd5b506040516200341738038062003417833981016040819052620000609162000072565b6001600160a01b0316608052620000a4565b6000602082840312156200008557600080fd5b81516001600160a01b03811681146200009d57600080fd5b9392505050565b608051613357620000c06000396000611ac301526133576000f3fe6080604052600436106103815760003560e01c806370a08231116101d1578063b2fa1c9e11610102578063d1b84c19116100a0578063f18aceda1161006f578063f18aceda146109f2578063f2fde38b14610a07578063f4ed0f4614610a27578063f51f96dd14610a3d57600080fd5b8063d1b84c191461097b578063d70981541461099c578063e8315742146109bc578063e985e9c5146109d257600080fd5b8063c41a360a116100dc578063c41a360a1461090f578063c7ee005e1461092f578063c87b56dd14610945578063ccbac9f51461096557600080fd5b8063b2fa1c9e146108ba578063b88d4fde146108da578063c34f6b0d146108fa57600080fd5b80639042bbf31161016f578063a22cb46511610149578063a22cb46514610845578063a66ff0af14610865578063aba8315014610885578063b2b98ed21461089a57600080fd5b80639042bbf3146107f857806395d89b411461081a578063a1ea842f1461082f57600080fd5b80637284e416116101ab5780637284e4161461079957806378e97925146107ae5780638d382812146107c45780638da5cb5b146107e357600080fd5b806370a0823114610734578063715018a6146107545780637241dfa01461076957600080fd5b806323b872dd116102b65780634358d2be116102545780635dfd7a57116102235780635dfd7a57146106ad5780636352211e146106cd57806364c19175146106ed57806364edfbf01461072c57600080fd5b80634358d2be1461064a5780634664611e1461066057806348ed4535146106765780635d495aea1461069857600080fd5b80633197cbb6116102905780633197cbb6146105cf578063397b5b24146105e5578063423afa66146105fa57806342842e0e1461062a57600080fd5b806323b872dd146105795780632770c8951461059957806329ec16dd146105af57600080fd5b806309d94448116103235780630f6a9349116102fd5780630f6a93491461051157806312065fe01461053157806318160ddd1461054457806322d544a31461055957600080fd5b806309d94448146104bc5780630b65b6e7146104dc5780630e2cbc3d146104f157600080fd5b806306fdde031161035f57806306fdde0314610410578063081812fc14610432578063095ea7b31461046a57806309c95e101461048c57600080fd5b806301ffc9a71461038657806302fb0c5e146103bb578063063c67b7146103d5575b600080fd5b34801561039257600080fd5b506103a66103a1366004612940565b610a53565b60405190151581526020015b60405180910390f35b3480156103c757600080fd5b5060d1546103a69060ff1681565b3480156103e157600080fd5b506104026103f0366004612982565b60e16020526000908152604090205481565b6040519081526020016103b2565b34801561041c57600080fd5b50610425610a64565b6040516103b291906129ef565b34801561043e57600080fd5b5061045261044d366004612a02565b610af6565b6040516001600160a01b0390911681526020016103b2565b34801561047657600080fd5b5061048a610485366004612a1b565b610b1d565b005b34801561049857600080fd5b506103a66104a7366004612982565b60e26020526000908152604090205460ff1681565b3480156104c857600080fd5b5060db54610452906001600160a01b031681565b3480156104e857600080fd5b50610402610c37565b3480156104fd57600080fd5b5061048a61050c366004612b14565b610c6a565b34801561051d57600080fd5b5061040261052c366004612c3a565b610df6565b34801561053d57600080fd5b5047610402565b34801561055057600080fd5b50610402610e55565b34801561056557600080fd5b50610402610574366004612a02565b610e62565b34801561058557600080fd5b5061048a610594366004612cec565b610e83565b3480156105a557600080fd5b5061040260cf5481565b3480156105bb57600080fd5b5061048a6105ca366004612d2d565b610eb4565b3480156105db57600080fd5b5061040260d35481565b3480156105f157600080fd5b50610425610f35565b34801561060657600080fd5b506103a6610615366004612982565b60e06020526000908152604090205460ff1681565b34801561063657600080fd5b5061048a610645366004612cec565b610fc3565b34801561065657600080fd5b5061040260d65481565b34801561066c57600080fd5b5061040260d95481565b34801561068257600080fd5b5061068b610fde565b6040516103b29190612d6b565b3480156106a457600080fd5b506104026110f9565b3480156106b957600080fd5b5061048a6106c8366004612a02565b6113e6565b3480156106d957600080fd5b506104526106e8366004612a02565b61147c565b3480156106f957600080fd5b5061070d610708366004612a02565b6114dc565b604080516001600160a01b0390931683526020830191909152016103b2565b610402611514565b34801561074057600080fd5b5061040261074f366004612982565b61186a565b34801561076057600080fd5b5061048a6118f0565b34801561077557600080fd5b506103a6610784366004612982565b60df6020526000908152604090205460ff1681565b3480156107a557600080fd5b50610425611904565b3480156107ba57600080fd5b5061040260d25481565b3480156107d057600080fd5b5060d1546103a690610100900460ff1681565b3480156107ef57600080fd5b50610452611911565b34801561080457600080fd5b5060d1546103a690640100000000900460ff1681565b34801561082657600080fd5b50610425611925565b34801561083b57600080fd5b5061040260d45481565b34801561085157600080fd5b5061048a610860366004612d2d565b611934565b34801561087157600080fd5b50610402610880366004612982565b611943565b34801561089157600080fd5b506104256119ff565b3480156108a657600080fd5b5060da54610452906001600160a01b031681565b3480156108c657600080fd5b5060d1546103a69062010000900460ff1681565b3480156108e657600080fd5b5061048a6108f5366004612dcd565b611a0c565b34801561090657600080fd5b50610402611a44565b34801561091b57600080fd5b5061045261092a366004612a02565b611a64565b34801561093b57600080fd5b5061040260d55481565b34801561095157600080fd5b50610425610960366004612a02565b611a6f565b34801561097157600080fd5b5061040260d85481565b34801561098757600080fd5b5060d1546103a6906301000000900460ff1681565b3480156109a857600080fd5b5061048a6109b7366004612a02565b611b68565b3480156109c857600080fd5b5061040260d05481565b3480156109de57600080fd5b506103a66109ed366004612e4d565b611d21565b3480156109fe57600080fd5b5061048a611d4f565b348015610a1357600080fd5b5061048a610a22366004612982565b611d66565b348015610a3357600080fd5b5061040260cd5481565b348015610a4957600080fd5b5061040260ce5481565b6000610a5e82611ddc565b92915050565b606060658054610a7390612e7b565b80601f0160208091040260200160405190810160405280929190818152602001828054610a9f90612e7b565b8015610aec5780601f10610ac157610100808354040283529160200191610aec565b820191906000526020600020905b815481529060010190602001808311610acf57829003601f168201915b5050505050905090565b6000610b0182611e2c565b506000908152606960205260409020546001600160a01b031690565b6000610b288261147c565b9050806001600160a01b0316836001600160a01b031603610b9a5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610bb65750610bb68133611d21565b610c285760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610b91565b610c328383611e8b565b505050565b600060cd54600003610c4a575060001990565b60c95460cd54610c5b906001612ec5565b610c659190612ed8565b905090565b600054610100900460ff1615808015610c8a5750600054600160ff909116105b80610ca45750303b158015610ca4575060005460ff166001145b610d075760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610b91565b6000805460ff191660011790558015610d2a576000805461ff0019166101001790555b610d348c8c611ef9565b610d3c611f2a565b610d458d611d66565b60ca610d518b82612f39565b5060cc610d5e8a82612f39565b5060cd88905560ce87905560cf86905560db80546001600160a01b0319166001600160a01b03871617905560d084905560d583905560d682905560c9805460010190558015610de7576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050505050505050565b6000610e00611f59565b610e4c5760405162461bcd60e51b815260206004820152601d60248201527f4e6565647320746f20626520616e20616c6c6f776564206d696e7465720000006044820152606401610b91565b610a5e82611fc8565b60006001610c5b60c95490565b60de8181548110610e7257600080fd5b600091825260209091200154905081565b610e8d33826120a9565b610ea95760405162461bcd60e51b8152600401610b9190612ff9565b610c32838383612107565b610ebc6122a3565b6001600160a01b038216600090815260e060205260409020805460ff1916821515179055610ee8611d4f565b4260d2819055604080516001600160a01b038516815260208101929092527f7618c8e7673fd316d308182b29784aad6b915e32612c6b9d67f50ef4e1b7d6e4910160405180910390a15050565b60cb8054610f4290612e7b565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6e90612e7b565b8015610fbb5780601f10610f9057610100808354040283529160200191610fbb565b820191906000526020600020905b815481529060010190602001808311610f9e57829003601f168201915b505050505081565b610c3283838360405180602001604052806000815250611a0c565b6060600060d45467ffffffffffffffff811115610ffd57610ffd612a47565b60405190808252806020026020018201604052801561105b57816020015b611048604051806060016040528060006001600160a01b0316815260200160008152602001600081525090565b81526020019060019003908161101b5790505b50905060005b60d4548110156110f35760dc818154811061107e5761107e613047565b600091825260209182902060408051606081018252600390930290910180546001600160a01b031683526001810154938301939093526002909201549181019190915282518390839081106110d5576110d5613047565b602002602001018190525080806110eb9061305d565b915050611061565b50919050565b60008060d8541161115a5760405162461bcd60e51b815260206004820152602560248201527f47656e65726174652070726f7661626c652072616e646f6d206e756d62657220604482015264199a5c9cdd60da1b6064820152608401610b91565b33600090815260e2602052604090205460ff166111f65760405162461bcd60e51b815260206004820152604e60248201527f55736572206973206e6f7420612061637469766520706c617965722e204f6e6c60448201527f7920612072656769737465726564207469636b657420686f6c6465722063616e60648201526d2073746172742064726177696e6760901b608482015260a401610b91565b60d780549060006112068361305d565b9190505550611213610e55565b60d8544390611223600183612ed8565b6040805160208101949094528301919091524060608201526080016040516020818303038152906040528051906020012060001c611261919061308c565b60d981905560009061127290611a64565b90506000606461128347605a6130a0565b61128d91906130bf565b60da80546001600160a01b0319166001600160a01b03851690811790915560d95460408051928352602083019190915281018290529091507f7e57d825a2478cc8123a008d7d1e20c0f6e8cbca89a7bc100c9b05ecb3698deb9060600160405180910390a160d1805461ffff191661010017905560408051808201825260da80546001600160a01b03908116835260d9546020840190815260dd80546001810182556000918252855160029091027fac507b9f8bf86ad8bb770f71cd2b1992902ae0314d93fc0f2bb011d70e796226810180549286166001600160a01b03199093169290921790915591517fac507b9f8bf86ad8bb770f71cd2b1992902ae0314d93fc0f2bb011d70e79622790920191909155915493519293169184156108fc0291859190818181858888f193505050501580156113cf573d6000803e3d6000fd5b506113d8612302565b50504260d355505060d95490565b60d780549060006113f68361305d565b909155505033600090815260e1602052604090205460d55460d65461141e9284929091612436565b61145a5760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b210383937b7b360991b6044820152606401610b91565b60d881905580156114795760d1805463ff000000191663010000001790555b50565b6000818152606760205260408120546001600160a01b031680610a5e5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610b91565b60dd81815481106114ec57600080fd5b6000918252602090912060029091020180546001909101546001600160a01b03909116915082565b600060d0546115223361186a565b106115955760405162461bcd60e51b815260206004820152603760248201527f596f752068617665207265616368656420746865206d6178696d756d20746f6b60448201527f656e7320616c6c6f7765642070657220616464726573730000000000000000006064820152608401610b91565b60d15460ff166116045760405162461bcd60e51b815260206004820152603460248201527f526166666c6520686173206e6f7420737461727465642e204f776e6572206d7560448201527339ba1039b2ba20b8383937bb32b226b4b73a32b960611b6064820152608401610b91565b60ce5434146116485760405162461bcd60e51b815260206004820152601060248201526f4e6f20736f757020666f7220796f752160801b6044820152606401610b91565b60408051600180825281830190925260009160208083019080368337019050509050338160008151811061167e5761167e613047565b6001600160a01b0390921660209283029190910182015233600090815260df90915260408120805460ff1916600117905560d78054916116bd8361305d565b91905055506116ca6124a4565b5060d480549060006116db8361305d565b909155505033600081815260e2602090815260408083208054600160ff19909116811790915560d4805460de80548085019091557ffae8130c0619f84b4b44f01b84806f04e82e536d70e05f2356977fa318aecc1a0181905583516060810185529687529386019384524292860183815260dc8054938401815590955285517f3162b0988d4210bff484413ed451d170a03887272177efc0b7d000f10abe9edf600390930292830180546001600160a01b0319166001600160a01b0390921691909117905592517f3162b0988d4210bff484413ed451d170a03887272177efc0b7d000f10abe9ee082015592517f3162b0988d4210bff484413ed451d170a03887272177efc0b7d000f10abe9ee19093019290925560cd5490549192910361180f5760d1805462ff00ff1916620100001790555b60ce5460d45460408051928352336020840152820152606081018390527f5c05e149773613d59c93e2584c4cbc9ca960d58add53b646b126f27a345eaeab9060800160405180910390a161186283611fc8565b935050505090565b60006001600160a01b0382166118d45760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610b91565b506001600160a01b031660009081526068602052604090205490565b6118f86122a3565b6119026000612527565b565b60ca8054610f4290612e7b565b6000610c656097546001600160a01b031690565b606060668054610a7390612e7b565b61193f338383612579565b5050565b600061194d611f59565b6119995760405162461bcd60e51b815260206004820152601d60248201527f4e6565647320746f20626520616e20616c6c6f776564206d696e7465720000006044820152606401610b91565b6040805160018082528183019092526000916020808301908036833701905050905082816000815181106119cf576119cf613047565b60200260200101906001600160a01b031690816001600160a01b0316815250506119f881611fc8565b9392505050565b60cc8054610f4290612e7b565b611a1633836120a9565b611a325760405162461bcd60e51b8152600401610b9190612ff9565b611a3e84848484612647565b50505050565b600047600a611a548260096130a0565b611a5e91906130bf565b91505090565b6000610a5e8261147c565b6000818152606760205260409020546060906001600160a01b0316611ac15760405162461bcd60e51b81526020600482015260086024820152672737903a37b5b2b760c11b6044820152606401610b91565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663df30dba0611af8610a64565b60ca60cc60cb8760cd546040518763ffffffff1660e01b8152600401611b2396959493929190613150565b600060405180830381865afa158015611b40573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a5e91908101906131b3565b6000611b738261147c565b9050336001600160a01b03821614611beb5760405162461bcd60e51b815260206004820152603560248201527f4f6e6c7920746865206f776e6572206f66207468697320746f6b656e2063616e604482015274207769746864726177207468652062616c616e636560581b6064820152608401610b91565b60d154610100900460ff16611c525760405162461bcd60e51b815260206004820152602760248201527f54686520636f6e747261637420686173206e6f2062616c616e636520746f20776044820152666974686472617760c81b6064820152608401610b91565b60006064611c6147605a6130a0565b611c6b91906130bf565b90506000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611cba576040519150601f19603f3d011682016040523d82523d6000602084013e611cbf565b606091505b505060d1805464ff0000000019166401000000001790559050611ce0612302565b80611a3e5760405162461bcd60e51b815260206004820152601160248201527015da5d1a191c985dd85b0819985a5b1959607a1b6044820152606401610b91565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b611d576122a3565b60d1805460ff19166001179055565b611d6e6122a3565b6001600160a01b038116611dd35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b91565b61147981612527565b60006001600160e01b031982166380ac58cd60e01b1480611e0d57506001600160e01b03198216635b5e139f60e01b145b80610a5e57506301ffc9a760e01b6001600160e01b0319831614610a5e565b6000818152606760205260409020546001600160a01b03166114795760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610b91565b600081815260696020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611ec08261147c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600054610100900460ff16611f205760405162461bcd60e51b8152600401610b919061322a565b61193f828261267a565b600054610100900460ff16611f515760405162461bcd60e51b8152600401610b919061322a565b6119026126ba565b600033611f64611911565b6001600160a01b031603611f785750600190565b6000805260e06020527f88c7c6e2e6608585cc594f384e2acdf8215a4a261b6a00df05fe03af932e95775460ff1615611fb15750600190565b5033600090815260e0602052604090205460ff1690565b600080611fd460c95490565b905060006001845183611fe79190612ec5565b611ff19190612ed8565b905060cd5460001480612006575060cd548111155b61203d5760405162461bcd60e51b815260206004820152600860248201526714dbdb19081bdd5d60c21b6044820152606401610b91565b8061204760c95490565b1161209d5761208a848361205a60c95490565b6120649190612ed8565b8151811061207457612074613047565b602002602001015161208560c95490565b6126ea565b61209860c980546001019055565b61203d565b60c9545b949350505050565b6000806120b58361147c565b9050806001600160a01b0316846001600160a01b031614806120dc57506120dc8185611d21565b806120a15750836001600160a01b03166120f584610af6565b6001600160a01b031614949350505050565b826001600160a01b031661211a8261147c565b6001600160a01b03161461217e5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610b91565b6001600160a01b0382166121e05760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610b91565b6121eb600082611e8b565b6001600160a01b0383166000908152606860205260408120805460019290612214908490612ed8565b90915550506001600160a01b0382166000908152606860205260408120805460019290612242908490612ec5565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b336122ac611911565b6001600160a01b0316146119025760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b91565b6000606461231147600a6130a0565b61231b91906130bf565b60d15490915062010000900460ff1661239e576040805162461bcd60e51b81526020600482015260248101919091527f526166666c652073616c65206d75737420626520636f6d706c6574652062656660448201527f6f72652077697468647261772066756e6374696f6e20697320656e61626c65646064820152608401610b91565b600081116123fc5760405162461bcd60e51b815260206004820152602560248201527f436f6e7472616374204120686173206e6f2062616c616e636520746f20776974604482015264686472617760d81b6064820152608401610b91565b60db546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561193f573d6000803e3d6000fd5b6000805b8281101561246557838061245057612450613076565b868709955061245e8161305d565b905061243a565b50612470838561308c565b9350848403612481575060016120a1565b8461248c8585612ed8565b03612499575060016120a1565b506000949350505050565b60d78054600091826124b58361305d565b909155505060d4543390426124cb600143612ed8565b60405160609490941b6bffffffffffffffffffffffff191660208501526034840192909252605483015240607482015260940160408051601f19818403018152918152815160209283012033600090815260e190935291205590565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036125da5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b91565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612652848484612107565b61265e8484848461282c565b611a3e5760405162461bcd60e51b8152600401610b9190613275565b600054610100900460ff166126a15760405162461bcd60e51b8152600401610b919061322a565b60656126ad8382612f39565b506066610c328282612f39565b600054610100900460ff166126e15760405162461bcd60e51b8152600401610b919061322a565b61190233612527565b6001600160a01b0382166127405760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b91565b6000818152606760205260409020546001600160a01b0316156127a55760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b91565b6001600160a01b03821660009081526068602052604081208054600192906127ce908490612ec5565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b0384163b1561292257604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906128709033908990889088906004016132c7565b6020604051808303816000875af19250505080156128ab575060408051601f3d908101601f191682019092526128a891810190613304565b60015b612908573d8080156128d9576040519150601f19603f3d011682016040523d82523d6000602084013e6128de565b606091505b5080516000036129005760405162461bcd60e51b8152600401610b9190613275565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506120a1565b5060016120a1565b6001600160e01b03198116811461147957600080fd5b60006020828403121561295257600080fd5b81356119f88161292a565b6001600160a01b038116811461147957600080fd5b803561297d8161295d565b919050565b60006020828403121561299457600080fd5b81356119f88161295d565b60005b838110156129ba5781810151838201526020016129a2565b50506000910152565b600081518084526129db81602086016020860161299f565b601f01601f19169290920160200192915050565b6020815260006119f860208301846129c3565b600060208284031215612a1457600080fd5b5035919050565b60008060408385031215612a2e57600080fd5b8235612a398161295d565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612a8657612a86612a47565b604052919050565b600067ffffffffffffffff821115612aa857612aa8612a47565b50601f01601f191660200190565b6000612ac9612ac484612a8e565b612a5d565b9050828152838383011115612add57600080fd5b828260208301376000602084830101529392505050565b600082601f830112612b0557600080fd5b6119f883833560208501612ab6565b6000806000806000806000806000806000806101808d8f031215612b3757600080fd5b612b408d612972565b9b5067ffffffffffffffff60208e01351115612b5b57600080fd5b612b6b8e60208f01358f01612af4565b9a5067ffffffffffffffff60408e01351115612b8657600080fd5b612b968e60408f01358f01612af4565b995067ffffffffffffffff60608e01351115612bb157600080fd5b612bc18e60608f01358f01612af4565b985067ffffffffffffffff60808e01351115612bdc57600080fd5b612bec8e60808f01358f01612af4565b975060a08d0135965060c08d0135955060e08d01359450612c106101008e01612972565b93506101208d013592506101408d013591506101608d013590509295989b509295989b509295989b565b60006020808385031215612c4d57600080fd5b823567ffffffffffffffff80821115612c6557600080fd5b818501915085601f830112612c7957600080fd5b813581811115612c8b57612c8b612a47565b8060051b9150612c9c848301612a5d565b8181529183018401918481019088841115612cb657600080fd5b938501935b83851015612ce05784359250612cd08361295d565b8282529385019390850190612cbb565b98975050505050505050565b600080600060608486031215612d0157600080fd5b8335612d0c8161295d565b92506020840135612d1c8161295d565b929592945050506040919091013590565b60008060408385031215612d4057600080fd5b8235612d4b8161295d565b915060208301358015158114612d6057600080fd5b809150509250929050565b602080825282518282018190526000919060409081850190868401855b82811015612dc057815180516001600160a01b0316855286810151878601528501518585015260609093019290850190600101612d88565b5091979650505050505050565b60008060008060808587031215612de357600080fd5b8435612dee8161295d565b93506020850135612dfe8161295d565b925060408501359150606085013567ffffffffffffffff811115612e2157600080fd5b8501601f81018713612e3257600080fd5b612e4187823560208401612ab6565b91505092959194509250565b60008060408385031215612e6057600080fd5b8235612e6b8161295d565b91506020830135612d608161295d565b600181811c90821680612e8f57607f821691505b6020821081036110f357634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610a5e57610a5e612eaf565b81810381811115610a5e57610a5e612eaf565b601f821115610c3257600081815260208120601f850160051c81016020861015612f125750805b601f850160051c820191505b81811015612f3157828155600101612f1e565b505050505050565b815167ffffffffffffffff811115612f5357612f53612a47565b612f6781612f618454612e7b565b84612eeb565b602080601f831160018114612f9c5760008415612f845750858301515b600019600386901b1c1916600185901b178555612f31565b600085815260208120601f198616915b82811015612fcb57888601518255948401946001909101908401612fac565b5085821015612fe95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b60006001820161306f5761306f612eaf565b5060010190565b634e487b7160e01b600052601260045260246000fd5b60008261309b5761309b613076565b500690565b60008160001904831182151516156130ba576130ba612eaf565b500290565b6000826130ce576130ce613076565b500490565b600081546130e081612e7b565b8085526020600183811680156130fd576001811461311757613145565b60ff1985168884015283151560051b880183019550613145565b866000528260002060005b8581101561313d5781548a8201860152908301908401613122565b890184019650505b505050505092915050565b60c08152600061316360c08301896129c3565b828103602084015261317581896130d3565b9050828103604084015261318981886130d3565b9050828103606084015261319d81876130d3565b6080840195909552505060a00152949350505050565b6000602082840312156131c557600080fd5b815167ffffffffffffffff8111156131dc57600080fd5b8201601f810184136131ed57600080fd5b80516131fb612ac482612a8e565b81815285602083850101111561321057600080fd5b61322182602083016020860161299f565b95945050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906132fa908301846129c3565b9695505050505050565b60006020828403121561331657600080fd5b81516119f88161292a56fea2646970667358221220c46f099f3eb03c59fb82de756ada42a98f12236765be7da5db78895f7a75d1f764736f6c634300081000330000000000000000000000005807574c534393dfd4094386b30c89fa2104baf2

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

0000000000000000000000005807574c534393dfd4094386b30c89fa2104baf2

-----Decoded View---------------
Arg [0] : _sharedNFTLogic (address): 0x5807574c534393dfd4094386b30c89fa2104baf2

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000005807574c534393dfd4094386b30c89fa2104baf2


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.