ETH Price: $3,056.69 (+2.96%)
Gas: 14 Gwei

Token

KeyNFT (KNFT)
 

Overview

Max Total Supply

0 KNFT

Holders

623

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
2 KNFT
0xe6ce1bc6255fcc6598f07fab5d7c851c73c423c3
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

With each Illumina exchanged, the encrypted manifesto will be completed, character by character. Once accomplished, only the key holders are able to decrypt the entire manifesto and read all the hidden characters, which will then point the way to the unveiling of the second inception my journey.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
KeyNFT

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 27 : KeyNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import './ERC2981/ERC2981ContractWideRoyalties.sol';
import "./Erc721OperatorFilter/IOperatorFilter.sol";
import "./Merkle/MerkleProof.sol";
import "./IlluminaNFT.sol";


contract KeyNFT is ERC721, Ownable, ERC2981ContractWideRoyalties {
    using Counters for Counters.Counter;

    address public treasury;
    string private keyURI;
    string private baseURI;
    bytes32 public merkleRootHash;
    uint256 illuminasToBeCollected;
    bool private mintable = false;
    uint256 constant KEY_BASE_SUPPLY = 1375;

    IlluminaNFT illuminaNft;
    IOperatorFilter operatorFilter;

    Counters.Counter private _tokenIds;
    mapping(address => bool) _whitelistClaimed;
    mapping (address => bool) private _redeemedForKey;

    event MintToken(uint256 tokenId, address purchaser);
    event RootHashSet();
    event BatchMinted();

    constructor(address _treasury, uint256 _value, address _illuminaAddress , uint256 _illuminasToBeCollected, string memory _keyBaseURI,
    address _operatorFilter) ERC721("KeyNFT", "KNFT") {
        operatorFilter = IOperatorFilter(_operatorFilter);
        treasury = _treasury;
        _setRoyalties(_treasury, _value);
        illuminaNft = IlluminaNFT(_illuminaAddress);
        illuminasToBeCollected = _illuminasToBeCollected;
        baseURI = _keyBaseURI;
    }

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

    function setRoyalties(address recipient, uint256 value) public onlyOwner {
        _setRoyalties(recipient, value);
    }

     function setMintable(bool _mintable) external onlyOwner {
        mintable = _mintable;
    }

    function setilluminasToBeCollected(uint256 _illuminasToBeCollected) external onlyOwner {
        illuminasToBeCollected = _illuminasToBeCollected;
    }

    function getilluminasToBeCollected() public view returns (uint256) {
        return illuminasToBeCollected;
    }

    function setMerkleRootHash(bytes32 _rootHash) public onlyOwner {
        merkleRootHash = _rootHash;

        emit RootHashSet();
    }

    function contractURI() public view returns (string memory) {
        return keyURI;
    }

    function setContractURI(string memory _contractURI) external onlyOwner {
        keyURI = _contractURI;
    }

    function setBaseURI(string memory _blackSquareBaseURI) external onlyOwner {
        baseURI = _blackSquareBaseURI;
    }

    function getKeyMaxSupply () internal pure returns (uint256) {
        return KEY_BASE_SUPPLY;
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return baseURI;
    }

     function getCurrentTokenId() external view returns (uint256) {
        return _tokenIds.current();
    }

    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual override(ERC721) {
        if (
            from != address(0) &&
            to != address(0) &&
            !_mayTransfer(msg.sender, tokenId)
        ) {
            revert("ERC721OperatorFilter: illegal operator");
        }
        super._beforeTokenTransfer(from, to, tokenId);
    }

    function _mayTransfer(address operator, uint256 tokenId)
        private
        view
        returns (bool)
    {
        IOperatorFilter filter = operatorFilter;
        if (address(filter) == address(0)) return true;
        if (operator == ownerOf(tokenId)) return true;
        return filter.mayTransfer(msg.sender);
    }

    function mintAndDrop(address[] memory recipients) public onlyOwner {

        for (uint256 i = 0; i < recipients.length; i++) {
            require(_tokenIds.current() <= getKeyMaxSupply(), 'Max Amount of Keys minted');
            _tokenIds.increment();
            _mint(recipients[i], _tokenIds.current());

        }

        emit BatchMinted();
    }

    function getTokensHeldByUser(address user) public view returns (uint256[] memory) {
        uint256 balance = balanceOf(user);
        uint256[] memory tokenIds = new uint256[](balance);
        uint256[] memory emptyTokens = new uint256[](0);
        uint256 j = 0;
        for (uint256 i = 1; i <= _tokenIds.current(); i++ ) {
            address tokenOwner = ownerOf(i);

            if (tokenOwner == user) {
                tokenIds[j] = i;
                j++;
            }
        }
        if (tokenIds.length > 0) {
            return tokenIds;
        }  else {
            return emptyTokens;
        }
    }
    

    function claimToken(bytes32[] calldata _merkleProof) public {
        require(mintable == true, 'No tokens can be minted at the moment');

        require(_tokenIds.current() <= getKeyMaxSupply(), 'Max Amount of Keys minted');

        bytes32 leaf = keccak256(abi.encodePacked(_msgSender()));

        require(MerkleProof.verify(_merkleProof, merkleRootHash, leaf), 'Invalid Proof');

        _tokenIds.increment();

        require(!_whitelistClaimed[_msgSender()], 'Address already claimed');

        _mint(_msgSender(), _tokenIds.current());

        emit MintToken(_tokenIds.current(), _msgSender());

        _whitelistClaimed[_msgSender()] = true;
    }

    function getIlluScoreFromKey() public view returns (uint256) {
        uint256 balance = illuminaNft.balanceOf(_msgSender());

        return balance;
    }


    function redeemIlluminasForKey() public {

        require(!_redeemedForKey[_msgSender()], 'Illumina: Already Claimed a Key');

        require(_tokenIds.current() <= getKeyMaxSupply(), 'Max Amount of Keys minted');

        uint256 balance = illuminaNft.balanceOf(_msgSender());
        require(balance >= illuminasToBeCollected, 'Not enough Illuminas held');

        _tokenIds.increment();
        _mint(_msgSender(), _tokenIds.current());

        emit MintToken(_tokenIds.current(), _msgSender());

        illuminaNft.burnIllumina(_msgSender(), illuminasToBeCollected);

        _redeemedForKey[_msgSender()] = true;
    }
}

File 2 of 27 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.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 ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings 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.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        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: owner query for nonexistent token");
        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) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        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 = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

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

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        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: transfer caller is not 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: transfer caller is not 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) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721.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 = ERC721.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(ERC721.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 a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {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 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 IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    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 {}
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

File 4 of 27 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.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 Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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);
    }
}

File 5 of 27 : ERC2981ContractWideRoyalties.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import '@openzeppelin/contracts/utils/introspection/ERC165.sol';

import './ERC2981.sol';

/// @dev This is a contract used to add ERC2981 support to ERC721 and 1155
/// @dev This implementation has the same royalties for each and every tokens
abstract contract ERC2981ContractWideRoyalties is ERC2981 {
    RoyaltyInfo private _royalties;

    /// @dev Sets token royalties
    /// @param recipient recipient of the royalties
    /// @param value percentage (using 2 decimals - 10000 = 100, 0 = 0)
    function _setRoyalties(address recipient, uint256 value) internal {
        require(value <= 10000, 'ERC2981Royalties: Too high');
        _royalties = RoyaltyInfo(recipient, uint24(value));
    }

    /// @inheritdoc	IERC2981Royalties
    function royaltyInfo(uint256, uint256 value)
        external
        view
        override
        returns (address receiver, uint256 royaltyAmount)
    {
        RoyaltyInfo memory royalties = _royalties;
        receiver = royalties.recipient;
        royaltyAmount = (value * royalties.amount) / 10000;
    }
}

File 6 of 27 : IOperatorFilter.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

interface IOperatorFilter {
    function mayTransfer(address operator) external view returns (bool);
}

File 7 of 27 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.7;

/**
 * @dev These functions deal with verification of Merkle Trees proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            bytes32 proofElement = proof[i];
            if (computedHash <= proofElement) {
                // Hash(current computed hash + current element of the proof)
                computedHash = _efficientHash(computedHash, proofElement);
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = _efficientHash(proofElement, computedHash);
            }
        }
        return computedHash;
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 8 of 27 : IlluminaNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import './ERC2981/ERC2981ContractWideRoyalties.sol';
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "./Erc721OperatorFilter/IOperatorFilter.sol";
import "./BlackSquareNFT.sol";

contract IlluminaNFT is ERC721, Ownable, ERC2981ContractWideRoyalties, VRFConsumerBaseV2 {
    VRFCoordinatorV2Interface COORDINATOR;
    using Counters for Counters.Counter;

    uint256 public s_requestId;
    uint256 private min;
    uint256 private max;
    uint256 private illuminaFactor;
    uint256 private editionEditCounter = 0;
    uint256 private randomIlluDate = 0;
    uint256 private illuminasSold = 0;
    uint256 public releaseCounter = 1;
    uint256 constant THRESHOLD = 25;
    uint256 constant ILLUMINA_BASE_SUPPLY = 20000;
    uint256 constant ILLUMINA_REGULAR_PRICE = 225;
    uint256 constant ILLUMINA_MIN_PRICE = 30;

    uint16 requestConfirmations = 3;
    uint32 numWords =  1;
    uint32 callbackGasLimit = 100000;
    uint64 s_subscriptionId;

    bytes32 keyHash = 0x79d3d8832d904592c0bf9818b621522c988bb8b0c05cdc3b15aea1b6e8db0c15;
    address vrfCoordinator = 0x2Ca8E0C643bDe4C2E08ab1fA0da3401AdAD7734D;
    address private treasury;

    string private illuminaURI;
    string private baseURI;

    bool private mintable = true;
    bool public getRandomnessFromOracles;


    OBYToken obyToken;
    BlackSquareNFT blackSquare;
    IOperatorFilter operatorFilter;
    Counters.Counter private _tokenIds;

    mapping(uint256 => uint256) private _nextEditionIlluminationDate;
    mapping(uint256 => string) private _tokenURIs;
    mapping(address => bool) private _eligibles;
    mapping(uint256 => bool) private _burnedTokens;

    event MintToken(uint256 tokenId, address purchaser);
    event BatchMinted();

    constructor(address tokenAddress, address _blackSquareAddress, address _treasury, 
    uint256 _royaltyValue, uint64 _subscriptionId, string memory _illuminaBaseURI,
    uint256 _minTime, uint256 _maxTime, uint256 _illuminaFactor, bool _getRandomnessFromOracles, address _operatorFilter) VRFConsumerBaseV2(vrfCoordinator) ERC721("Illumina", "Ill") {
        COORDINATOR = VRFCoordinatorV2Interface(vrfCoordinator);
        obyToken = OBYToken(tokenAddress);
        blackSquare = BlackSquareNFT(_blackSquareAddress);
        operatorFilter = IOperatorFilter(_operatorFilter);
        treasury = _treasury;
        s_subscriptionId = _subscriptionId;
        baseURI = _illuminaBaseURI;
        min = _minTime;
        max = _maxTime;
        illuminaFactor = _illuminaFactor;
        getRandomnessFromOracles = _getRandomnessFromOracles;
        _setRoyalties(_treasury, _royaltyValue);
    }

     modifier onlyEligible() {
        require(owner() == _msgSender() || _eligibles[_msgSender()] == true, "IlluminaNFT: caller is not eligible");
        _;
    }

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

    function setEligibles(address _eligible) public onlyOwner {
        _eligibles[_eligible] = true;
    }

    function setRandomnessFromOracles(bool _getRandomnessFromOracles) public onlyOwner {
        getRandomnessFromOracles = _getRandomnessFromOracles;
    }

    function setRoyalties(address recipient, uint256 value) external onlyOwner {
        _setRoyalties(recipient, value);
    }

    function setKeyHash(bytes32 _keyHash) external onlyOwner {
        keyHash = _keyHash;
    }

    function setMin(uint8 _min) external onlyOwner {
        min = _min;
    }

    function setMax(uint8 _max) external onlyOwner {
        max = _max;
    }

    function setSubscriptionId(uint64 _s_subscriptionId) external onlyOwner {
        s_subscriptionId = _s_subscriptionId;
    }

    function setMintable(bool _mintable) external onlyOwner {
        mintable = _mintable;
    }

    function setContractURI(string memory _contractURI) external onlyOwner {
        illuminaURI = _contractURI;
    }

    function setBaseURI(string memory _illuminaBaseURI) external onlyOwner {
        baseURI = _illuminaBaseURI;
    }

    function setTokenIpfsHash(uint256 tokenId, string memory ipfsHash) external onlyOwner {
        _tokenURIs[tokenId] = ipfsHash;
    }

    function getIlluminaMaxSupply () internal pure returns (uint256) {
        return ILLUMINA_BASE_SUPPLY;
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return baseURI;
    }

    function contractURI() public view returns (string memory) {
        return illuminaURI;
    }

    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        string memory illuminaBaseURI = _baseURI();
        string memory tokenURIHash = _tokenURIs[tokenId];
        return bytes(illuminaBaseURI).length > 0 ? string(abi.encodePacked(illuminaBaseURI, tokenURIHash)) : "";
    }

    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual override(ERC721) {
        if (
            from != address(0) &&
            to != address(0) &&
            !_mayTransfer(msg.sender, tokenId)
        ) {
            revert("ERC721OperatorFilter: illegal operator");
        }
        super._beforeTokenTransfer(from, to, tokenId);
    }

    function _mayTransfer(address operator, uint256 tokenId)
        private
        view
        returns (bool)
    {
        IOperatorFilter filter = operatorFilter;
        if (address(filter) == address(0)) return true;
        if (operator == ownerOf(tokenId)) return true;
        return filter.mayTransfer(msg.sender);
    }

    function _requestRandomWords() internal  {
    s_requestId = COORDINATOR.requestRandomWords(
        keyHash,
        s_subscriptionId,
        requestConfirmations,
        callbackGasLimit,
        numWords
        );
    }

    function fulfillRandomWords(
        uint256,
        uint256[] memory randomWords
    ) internal override {
        require(randomWords.length > 0, 'OracleContract: No Number delivered');
        uint256 illuminationDate = randomWords[0] % (max - min + 1) + min;

        _nextEditionIlluminationDate[editionEditCounter] = illuminationDate;

        randomIlluDate = illuminationDate;
    }

    function getTokensHeldByUser(address user) public view returns (uint256[] memory) {
        uint256 balance = balanceOf(user);
        uint256[] memory emptyTokens = new uint256[](0);
        uint256[] memory tokenIds = new uint256[](balance);
        uint256 j = 0;
        for (uint256 i = 1; i <= _tokenIds.current(); i++ ) {
            if (!_burnedTokens[i]) {
                address tokenOwner = ownerOf(i);

                if (tokenOwner == user) {
                    tokenIds[j] = i;
                    j++;
                }
            }
        }
        if (tokenIds.length > 0) {
            return tokenIds;
        }  else {
            return emptyTokens;
        }
    }

    function buyTokenForOBY(string memory ipfsHash, uint256 tokenId) public {
        require(mintable == true, 'No tokens can be minted at the moment');

        require(_tokenIds.current() <= getIlluminaMaxSupply(), 'Max Amount of Illuminas minted');

        require(tokenId == getNextTokenId(), 'Trying to mint Token with incorrect Metadata');

        require(blackSquare.getAvailableIlluminaCount() > _tokenIds.current(), 'IlluminaNFT, max mintable number reached');

        (uint256 pricePerToken, ,) = getIlluminaPrice();

        bool ok1 = obyToken.checkBalances(pricePerToken, _msgSender());
        require(ok1, 'IlluminaNFT, insufficient balances');

        _tokenIds.increment();

        require(!_exists(_tokenIds.current()), "IlluminaNFT: Token already exists");

        _mint(_msgSender(), _tokenIds.current());

        emit MintToken(_tokenIds.current(), _msgSender());

        _tokenURIs[_tokenIds.current()] = ipfsHash;

        illuminasSold++;

        obyToken.burnToken(pricePerToken, _msgSender());

        if (_tokenIds.current() == THRESHOLD || (_tokenIds.current() > THRESHOLD && _tokenIds.current() % THRESHOLD == 0)) {
            editionEditCounter++;

            if (getRandomnessFromOracles == true) {
                _requestRandomWords();
            } else {
                uint256 illuminationDate = uint256(keccak256("wow")) % (max - min + 1) + min;
                _nextEditionIlluminationDate[editionEditCounter] = illuminationDate;

                randomIlluDate = illuminationDate;
            }
        }
    }

    function checkForEditableEditions () view external returns (uint256, uint256) {
        uint256 editionId = blackSquare.getFirstEditionToSetIlluminationDate();

        require(editionId != 0, 'No Edition Found to be edited!');

        uint256 illuDate = 0;
        uint256 index;

        for (uint256 i = 0; i <= editionEditCounter; i++) {
            if (_nextEditionIlluminationDate[i] > 0) {
                illuDate = _nextEditionIlluminationDate[i];
                index = i;
                break;
            }
        }

        return (illuDate, index);
    }


    function handleEditEdition (uint256 _illuDate, uint256 _index) external onlyOwner {

        uint256 editionId = blackSquare.getFirstEditionToSetIlluminationDate();

        if (_illuDate > 0) {
            uint256 newIlluminationDate = block.timestamp + _illuDate;
            blackSquare.editEdition(editionId, newIlluminationDate);

            releaseCounter ++;

            delete _nextEditionIlluminationDate[_index];

            randomIlluDate = 0;
        }
    }

    function getRandomNumberFromContract() external view returns (uint256) {
        return randomIlluDate;
    }

    function getIlluminaPrice() public view returns (uint256, uint256, uint256) {
        uint256 availableIllumina = blackSquare.getAvailableIlluminaCount();

        uint256 vacantIllumina = availableIllumina - illuminasSold;

        if (ILLUMINA_REGULAR_PRICE > (vacantIllumina / illuminaFactor)) {
            uint256 residualPrice = ILLUMINA_REGULAR_PRICE - ( vacantIllumina / illuminaFactor );

            if (residualPrice > ILLUMINA_MIN_PRICE) {
                return (residualPrice, availableIllumina, vacantIllumina);
            }
        }

        return (ILLUMINA_MIN_PRICE, availableIllumina, vacantIllumina);
    }

    function getNextTokenId() public view returns (uint256) {
        if (blackSquare.getAvailableIlluminaCount() == 0) {
            return 0;
        } else {
            return _tokenIds.current() + 1;
        }
    }

    function burnIllumina(address user, uint256 _burnThreshold) public onlyEligible {
        uint256[] memory tokenIds = getTokensHeldByUser(user);

        for (uint256 i = 0; i < tokenIds.length; i++ ) {
            if (i < _burnThreshold) {
                uint256 tokenId = tokenIds[i];

                super._burn(tokenId);

                _burnedTokens[tokenId] = true;
            }
        }
    }
}

File 9 of 27 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be 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 10 of 27 : IERC721Receiver.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 IERC721Receiver {
    /**
     * @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 11 of 27 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @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 12 of 27 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 13 of 27 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @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 Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

File 14 of 27 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @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);
    }
}

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

pragma solidity ^0.8.0;

import "./IERC165.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 ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

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

pragma solidity ^0.8.0;

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

File 17 of 27 : ERC2981.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import '@openzeppelin/contracts/utils/introspection/ERC165.sol';

import './IERC2981Royalties.sol';

/// @dev This is a contract used to add ERC2981 support to ERC721 and 1155
abstract contract ERC2981 is ERC165, IERC2981Royalties {
    struct RoyaltyInfo {
        address recipient;
        uint24 amount;
    }

    /// @inheritdoc	ERC165
    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override
        returns (bool)
    {
        return
            interfaceId == type(IERC2981Royalties).interfaceId ||
            super.supportsInterface(interfaceId);
    }
}

File 18 of 27 : IERC2981Royalties.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

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

File 19 of 27 : VRFCoordinatorV2Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface VRFCoordinatorV2Interface {
  /**
   * @notice Get configuration relevant for making requests
   * @return minimumRequestConfirmations global min for request confirmations
   * @return maxGasLimit global max for request gas limit
   * @return s_provingKeyHashes list of registered key hashes
   */
  function getRequestConfig()
    external
    view
    returns (
      uint16,
      uint32,
      bytes32[] memory
    );

  /**
   * @notice Request a set of random words.
   * @param keyHash - Corresponds to a particular oracle job which uses
   * that key for generating the VRF proof. Different keyHash's have different gas price
   * ceilings, so you can select a specific one to bound your maximum per request cost.
   * @param subId  - The ID of the VRF subscription. Must be funded
   * with the minimum subscription balance required for the selected keyHash.
   * @param minimumRequestConfirmations - How many blocks you'd like the
   * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS
   * for why you may want to request more. The acceptable range is
   * [minimumRequestBlockConfirmations, 200].
   * @param callbackGasLimit - How much gas you'd like to receive in your
   * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords
   * may be slightly less than this amount because of gas used calling the function
   * (argument decoding etc.), so you may need to request slightly more than you expect
   * to have inside fulfillRandomWords. The acceptable range is
   * [0, maxGasLimit]
   * @param numWords - The number of uint256 random values you'd like to receive
   * in your fulfillRandomWords callback. Note these numbers are expanded in a
   * secure way by the VRFCoordinator from a single random value supplied by the oracle.
   * @return requestId - A unique identifier of the request. Can be used to match
   * a request to a response in fulfillRandomWords.
   */
  function requestRandomWords(
    bytes32 keyHash,
    uint64 subId,
    uint16 minimumRequestConfirmations,
    uint32 callbackGasLimit,
    uint32 numWords
  ) external returns (uint256 requestId);

  /**
   * @notice Create a VRF subscription.
   * @return subId - A unique subscription id.
   * @dev You can manage the consumer set dynamically with addConsumer/removeConsumer.
   * @dev Note to fund the subscription, use transferAndCall. For example
   * @dev  LINKTOKEN.transferAndCall(
   * @dev    address(COORDINATOR),
   * @dev    amount,
   * @dev    abi.encode(subId));
   */
  function createSubscription() external returns (uint64 subId);

  /**
   * @notice Get a VRF subscription.
   * @param subId - ID of the subscription
   * @return balance - LINK balance of the subscription in juels.
   * @return reqCount - number of requests for this subscription, determines fee tier.
   * @return owner - owner of the subscription.
   * @return consumers - list of consumer address which are able to use this subscription.
   */
  function getSubscription(uint64 subId)
    external
    view
    returns (
      uint96 balance,
      uint64 reqCount,
      address owner,
      address[] memory consumers
    );

  /**
   * @notice Request subscription owner transfer.
   * @param subId - ID of the subscription
   * @param newOwner - proposed new owner of the subscription
   */
  function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external;

  /**
   * @notice Request subscription owner transfer.
   * @param subId - ID of the subscription
   * @dev will revert if original owner of subId has
   * not requested that msg.sender become the new owner.
   */
  function acceptSubscriptionOwnerTransfer(uint64 subId) external;

  /**
   * @notice Add a consumer to a VRF subscription.
   * @param subId - ID of the subscription
   * @param consumer - New consumer which can use the subscription
   */
  function addConsumer(uint64 subId, address consumer) external;

  /**
   * @notice Remove a consumer from a VRF subscription.
   * @param subId - ID of the subscription
   * @param consumer - Consumer to remove from the subscription
   */
  function removeConsumer(uint64 subId, address consumer) external;

  /**
   * @notice Cancel a subscription
   * @param subId - ID of the subscription
   * @param to - Where to send the remaining LINK to
   */
  function cancelSubscription(uint64 subId, address to) external;
}

File 20 of 27 : VRFConsumerBaseV2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/** ****************************************************************************
 * @notice Interface for contracts using VRF randomness
 * *****************************************************************************
 * @dev PURPOSE
 *
 * @dev Reggie the Random Oracle (not his real job) wants to provide randomness
 * @dev to Vera the verifier in such a way that Vera can be sure he's not
 * @dev making his output up to suit himself. Reggie provides Vera a public key
 * @dev to which he knows the secret key. Each time Vera provides a seed to
 * @dev Reggie, he gives back a value which is computed completely
 * @dev deterministically from the seed and the secret key.
 *
 * @dev Reggie provides a proof by which Vera can verify that the output was
 * @dev correctly computed once Reggie tells it to her, but without that proof,
 * @dev the output is indistinguishable to her from a uniform random sample
 * @dev from the output space.
 *
 * @dev The purpose of this contract is to make it easy for unrelated contracts
 * @dev to talk to Vera the verifier about the work Reggie is doing, to provide
 * @dev simple access to a verifiable source of randomness. It ensures 2 things:
 * @dev 1. The fulfillment came from the VRFCoordinator
 * @dev 2. The consumer contract implements fulfillRandomWords.
 * *****************************************************************************
 * @dev USAGE
 *
 * @dev Calling contracts must inherit from VRFConsumerBase, and can
 * @dev initialize VRFConsumerBase's attributes in their constructor as
 * @dev shown:
 *
 * @dev   contract VRFConsumer {
 * @dev     constructor(<other arguments>, address _vrfCoordinator, address _link)
 * @dev       VRFConsumerBase(_vrfCoordinator) public {
 * @dev         <initialization with other arguments goes here>
 * @dev       }
 * @dev   }
 *
 * @dev The oracle will have given you an ID for the VRF keypair they have
 * @dev committed to (let's call it keyHash). Create subscription, fund it
 * @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface
 * @dev subscription management functions).
 * @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations,
 * @dev callbackGasLimit, numWords),
 * @dev see (VRFCoordinatorInterface for a description of the arguments).
 *
 * @dev Once the VRFCoordinator has received and validated the oracle's response
 * @dev to your request, it will call your contract's fulfillRandomWords method.
 *
 * @dev The randomness argument to fulfillRandomWords is a set of random words
 * @dev generated from your requestId and the blockHash of the request.
 *
 * @dev If your contract could have concurrent requests open, you can use the
 * @dev requestId returned from requestRandomWords to track which response is associated
 * @dev with which randomness request.
 * @dev See "SECURITY CONSIDERATIONS" for principles to keep in mind,
 * @dev if your contract could have multiple requests in flight simultaneously.
 *
 * @dev Colliding `requestId`s are cryptographically impossible as long as seeds
 * @dev differ.
 *
 * *****************************************************************************
 * @dev SECURITY CONSIDERATIONS
 *
 * @dev A method with the ability to call your fulfillRandomness method directly
 * @dev could spoof a VRF response with any random value, so it's critical that
 * @dev it cannot be directly called by anything other than this base contract
 * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method).
 *
 * @dev For your users to trust that your contract's random behavior is free
 * @dev from malicious interference, it's best if you can write it so that all
 * @dev behaviors implied by a VRF response are executed *during* your
 * @dev fulfillRandomness method. If your contract must store the response (or
 * @dev anything derived from it) and use it later, you must ensure that any
 * @dev user-significant behavior which depends on that stored value cannot be
 * @dev manipulated by a subsequent VRF request.
 *
 * @dev Similarly, both miners and the VRF oracle itself have some influence
 * @dev over the order in which VRF responses appear on the blockchain, so if
 * @dev your contract could have multiple VRF requests in flight simultaneously,
 * @dev you must ensure that the order in which the VRF responses arrive cannot
 * @dev be used to manipulate your contract's user-significant behavior.
 *
 * @dev Since the block hash of the block which contains the requestRandomness
 * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful
 * @dev miner could, in principle, fork the blockchain to evict the block
 * @dev containing the request, forcing the request to be included in a
 * @dev different block with a different hash, and therefore a different input
 * @dev to the VRF. However, such an attack would incur a substantial economic
 * @dev cost. This cost scales with the number of blocks the VRF oracle waits
 * @dev until it calls responds to a request. It is for this reason that
 * @dev that you can signal to an oracle you'd like them to wait longer before
 * @dev responding to the request (however this is not enforced in the contract
 * @dev and so remains effective only in the case of unmodified oracle software).
 */
abstract contract VRFConsumerBaseV2 {
  error OnlyCoordinatorCanFulfill(address have, address want);
  address private immutable vrfCoordinator;

  /**
   * @param _vrfCoordinator address of VRFCoordinator contract
   */
  constructor(address _vrfCoordinator) {
    vrfCoordinator = _vrfCoordinator;
  }

  /**
   * @notice fulfillRandomness handles the VRF response. Your contract must
   * @notice implement it. See "SECURITY CONSIDERATIONS" above for important
   * @notice principles to keep in mind when implementing your fulfillRandomness
   * @notice method.
   *
   * @dev VRFConsumerBaseV2 expects its subcontracts to have a method with this
   * @dev signature, and will call it once it has verified the proof
   * @dev associated with the randomness. (It is triggered via a call to
   * @dev rawFulfillRandomness, below.)
   *
   * @param requestId The Id initially returned by requestRandomness
   * @param randomWords the VRF output expanded to the requested number of words
   */
  function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual;

  // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
  // proof. rawFulfillRandomness then calls fulfillRandomness, after validating
  // the origin of the call
  function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external {
    if (msg.sender != vrfCoordinator) {
      revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator);
    }
    fulfillRandomWords(requestId, randomWords);
  }
}

File 21 of 27 : BlackSquareNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import './ERC2981/ERC2981ContractWideRoyalties.sol';
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./Erc721OperatorFilter/IOperatorFilter.sol";
import "./OBYToken.sol";


contract BlackSquareNFT is ERC721, Ownable, ERC2981ContractWideRoyalties {
    using Strings for uint256;
    using Counters for Counters.Counter;

    uint256 private rewardPerCycle;
    uint256 public totalCycleCount = 0;
    uint256 constant THRESHOLD = 25;
    uint256 constant TOKENS_PER_EDITION = 25;
    uint256 constant MAX_NUMBER_EDITIONS = 58;

    address private treasury;

    string public openSeaContractURI;
    string public baseURI;

    OBYToken obyToken;
    IOperatorFilter operatorFilter;
    Counters.Counter private _editionIds;
    Counters.Counter private _tokenIds;

   struct Edition {
        uint256[TOKENS_PER_EDITION] tokens;
        uint256 illuminationTimeStamp;
        uint256 lastUpdateTimestamp;
        uint256 cycle;
        uint256 id;
        string editionThumbnail;
        string illumination;
    }

    struct OwnerReward {
        uint256 rewardPaid;
        uint256 rewardStored;
    }

    struct CreateEditionStruct {
        uint256[TOKENS_PER_EDITION] tokens;
        uint256 illuminationMoment;
        string editionThumbnail;
        string illumination;
    }

    mapping(uint256 => mapping(uint256 => OwnerReward)) private _ownersReward;
    mapping(address => bool) private _eligibles;
    mapping(uint256 => Edition) private _editions;
    mapping(uint256 => uint256) private _editionOfToken;
    mapping(address => uint256) private _totalRewardsClaimed;

    event RewardWithdrawn(uint256 amount, address sender);
    event EditionCreated(uint256 editionId);


    constructor(address obyAddress, address _treasury, uint256 _royaltyValue, string memory _openSeaContractURI, string memory _blackSquareBaseURI,
    uint256 _rewardPerCycle, address _operatorFilter) ERC721("BlackSquare", "B2") {
        obyToken = OBYToken(obyAddress);
        operatorFilter = IOperatorFilter(_operatorFilter);
        treasury = _treasury;
        openSeaContractURI = _openSeaContractURI;
        baseURI = _blackSquareBaseURI;
        rewardPerCycle = _rewardPerCycle;
        _setRoyalties(_treasury, _royaltyValue);
    }

    modifier onlyEligible() {
        require(owner() == _msgSender() || _eligibles[_msgSender()] == true, "BlackSquareNFT: caller is not eligible");
        _;
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return baseURI;
    }

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

    function setContractURI(string memory _contractURI) external onlyOwner {
        openSeaContractURI = _contractURI;
    }

    function setBaseURI(string memory _blackSquareBaseURI) external onlyOwner {
        baseURI = _blackSquareBaseURI;
    }


    function setRewardPerCycle(uint256 _rewardPerCycle) external onlyOwner {
        rewardPerCycle = _rewardPerCycle;
    }

    function setRoyalties(address recipient, uint256 value) external onlyOwner {
        _setRoyalties(recipient, value);
    }

    function setEligibles(address _eligible) external onlyOwner  {
        _eligibles[_eligible] = true;

        
    }

    function contractURI() public view returns (string memory) {
        return openSeaContractURI;
    }

    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual override(ERC721) {
        if (
            from != address(0) &&
            to != address(0) &&
            !_mayTransfer(msg.sender, tokenId)
        ) {
            revert("ERC721OperatorFilter: illegal operator");
        }
        super._beforeTokenTransfer(from, to, tokenId);
    }

    function _mayTransfer(address operator, uint256 tokenId)
        private
        view
        returns (bool)
    {
        IOperatorFilter filter = operatorFilter;
        if (address(filter) == address(0)) return true;
        if (operator == ownerOf(tokenId)) return true;
        return filter.mayTransfer(msg.sender);
    }

    function getEditions() public view returns (Edition[] memory) {
        Edition[] memory editions = new Edition[](_editionIds.current() + 1);

        for (uint256 editionCounter = 1; editionCounter <= _editionIds.current(); editionCounter++){
            editions[editionCounter] = _editions[editionCounter];
        }
        return editions;
    }

    function deleteEdition (uint256 editionId) public onlyOwner {
        delete _editions[editionId];
    }

    function createEdition(CreateEditionStruct memory _createEditionStruct) public onlyOwner  {
        _editionIds.increment();
        uint256 editionId = _editionIds.current();
        

        for (uint256 i = 0; i < _createEditionStruct.tokens.length; i++) {
            _editionOfToken[_createEditionStruct.tokens[i]] = _editionIds.current();
        }

        _editions[editionId].tokens = _createEditionStruct.tokens;
        _editions[editionId].illuminationTimeStamp = _createEditionStruct.illuminationMoment;
        _editions[editionId].lastUpdateTimestamp = block.timestamp;
        _editions[editionId].cycle = 1;
        _editions[editionId].id = editionId;
        _editions[editionId].editionThumbnail = _createEditionStruct.editionThumbnail;
        _editions[editionId].illumination = _createEditionStruct.illumination;

        emit EditionCreated(editionId);
    }


    function getCurrentTokenId() external view returns (uint256) {
        return _tokenIds.current();
    }

    function getRewardInOBY () public view returns (uint256, uint256) {
        uint256[] memory tokens = getTokensHeldByUser(_msgSender());

        require(tokens.length > 0, 'NO BlackSquares held');
        uint256 availableReward = 0;

        uint256 paidReward = _totalRewardsClaimed[_msgSender()];

        for (uint256 i = 0; i < tokens.length; i++) {
            (uint256 rewardPertoken, ,) = _getAvailableRewardInOby(tokens[i]);
            availableReward += rewardPertoken;
            
        }
        return (availableReward, paidReward);
    }

    function claimRewardInOBY () public returns (uint256) {
        uint256[] memory tokens = getTokensHeldByUser(_msgSender());

        require(tokens.length > 0, 'NO BlackSquares held');
        uint256 availableReward = 0;

        for (uint256 i = 0; i < tokens.length; i++) {
            (uint256 rewardPertoken, uint256 cycle, uint256 rewardStoredPrev) = _getAvailableRewardInOby(tokens[i]);
            availableReward += rewardPertoken;

            uint256 tokenId = tokens[i];

            uint256 previousCycle = cycle > 1 ? cycle - 1 : 1;
            uint256 rewardPaid = rewardPertoken - rewardStoredPrev;

            _ownersReward[tokenId][cycle].rewardPaid += rewardPaid;

            _totalRewardsClaimed[_msgSender()] += rewardPertoken;
            _ownersReward[tokenId][cycle].rewardStored = 0;
            if (cycle > 1) {
                _ownersReward[tokenId][previousCycle].rewardStored = 0;
            }
        }

        require(availableReward > 0, 'No OBY available to mint');

        if (availableReward > 0) {
            obyToken.mint(_msgSender(), availableReward);
        }

        emit RewardWithdrawn(availableReward, _msgSender());
        
        return availableReward;
    }

    function getTokensHeldByUser(address user) public view returns (uint256[] memory) {
        uint256 balance = balanceOf(user);
        uint256[] memory emptyTokens = new uint256[](0);
        uint256[] memory tokenIds = new uint256[](balance);
        uint256 j = 0;

        for (uint256 i = 1; i <= _tokenIds.current(); i++ ) {
            address tokenOwner = ownerOf(i);

            if (tokenOwner == user) {
                tokenIds[j] = i;
                j++;
            }
        }
        if (tokenIds.length > 0) {
            return tokenIds;
        }  else {
            return emptyTokens;
        }
    }

    function mintAndDrop(address[] memory recipients, CreateEditionStruct[] memory _createEditionStruct) public onlyOwner {
        uint256 editionCount = 0;

        if(_editionIds.current() <= MAX_NUMBER_EDITIONS) {
            for (uint256 i = 0; i < recipients.length; i++) {
                _tokenIds.increment();
                uint256 currentTokenId = _tokenIds.current();

                unchecked {
                    _mint(recipients[i], currentTokenId);

                    if (currentTokenId == 25 || currentTokenId > 25 && currentTokenId % 25 ==  0) {
                        createEdition(_createEditionStruct[editionCount]);
                        editionCount++;
                    }
                }
            }
        }
    }

    function editEdition(uint256 _editionId, uint256 _illuminationTimeStamp) public onlyEligible returns (uint256) {
        updateStoredReward(_editionId);

        _editions[_editionId].illuminationTimeStamp = _illuminationTimeStamp;
        _editions[_editionId].lastUpdateTimestamp = block.timestamp;
        _editions[_editionId].cycle += 1;

        totalCycleCount ++;

        return _editionId;
    }

    function updateStoredReward(uint256 editionId) public onlyEligible  {
        uint256 editionCycle = _editions[editionId].cycle;
        for (uint256 tokenId = 0; tokenId < _editions[editionId].tokens.length; tokenId++ ) {
            uint256 currentToken = _editions[editionId].tokens[tokenId];

            // Normal update where cycle is > 1, Up to the normal rewardPerPeriod was paid out & There is a stored reward >= 0
            if (_ownersReward[currentToken][editionCycle].rewardPaid <= (rewardPerCycle / 10000) && editionCycle > 1 && _ownersReward[currentToken][editionCycle - 1].rewardStored >= 0) {
                _ownersReward[currentToken][editionCycle].rewardStored =  (rewardPerCycle / 10000) -  _ownersReward[currentToken][editionCycle].rewardPaid + _ownersReward[currentToken][editionCycle - 1].rewardStored;

            // We are in Cycle one, so there is no previously stored reward. Now everything gets stored which is a positive amount or 0
            } else if (_ownersReward[currentToken][editionCycle].rewardPaid <= (rewardPerCycle / 10000) && editionCycle == 1) {
                _ownersReward[currentToken][editionCycle].rewardStored = (rewardPerCycle / 10000) -  _ownersReward[currentToken][editionCycle].rewardPaid;

            // In case due to some rounding errors etc. RewardPaid > Reward, Only Stored Reward is carried over if Cycle > 1 and Stored Reward is bigger than 0
            } else if (_ownersReward[currentToken][editionCycle].rewardPaid > (rewardPerCycle / 10000) && editionCycle > 1 && _ownersReward[currentToken][editionCycle - 1].rewardStored > 0) {
                _ownersReward[currentToken][editionCycle].rewardStored = _ownersReward[currentToken][editionCycle - 1].rewardStored;

            // Handle the Edge Cases
            } else {
                _ownersReward[currentToken][editionCycle].rewardStored = 0;
            }
            
        }
        
    }

    function getFirstEditionToSetIlluminationDate() public view returns (uint256) {
        for (uint256 editionCounter = 1; editionCounter <= _editionIds.current(); editionCounter++){
            if (_editions[editionCounter].illuminationTimeStamp < block.timestamp) {
                return editionCounter;
            }
        }
        return 0;
    }

    function getAvailableIlluminaCount() public view returns (uint256) {
        uint256 availableIlluminas = totalCycleCount * THRESHOLD;
        for (uint256 editionCounter = 1; editionCounter <= _editionIds.current(); editionCounter++){
            if (_editions[editionCounter].illuminationTimeStamp < block.timestamp) {
                availableIlluminas += THRESHOLD;
            }
        }
        return availableIlluminas;
    }

    function setIlluminationTimeStamp(uint256 _editionId, uint256 _illuminationTimeStamp) public onlyOwner {
        _editions[_editionId].illuminationTimeStamp = _illuminationTimeStamp;
    }

     function _getAvailableRewardInOby(uint256 tokenId) internal view returns (uint256, uint256, uint256) {
        uint256 editionId = _editionOfToken[tokenId];

        require(editionId != 0, 'Token Not associated with any Edition');

        uint256 illuminationTimeStamp = _editions[editionId].illuminationTimeStamp;
        uint256 cycle = _editions[editionId].cycle;
        uint256 previousCycle = cycle > 1 ? cycle - 1 : 1;
        uint256 lastUpdateTimestamp = _editions[editionId].lastUpdateTimestamp;

        uint256 rewardPaid = _ownersReward[tokenId][cycle].rewardPaid > 0 ? _ownersReward[tokenId][cycle].rewardPaid : 0;
        uint256 rewardStoredPrev = cycle > 1 ? _ownersReward[tokenId][previousCycle].rewardStored : 0;

        // We are in the normal distribution Cycle
        if (lastUpdateTimestamp < illuminationTimeStamp && block.timestamp < illuminationTimeStamp && block.timestamp > lastUpdateTimestamp) {
            uint256 rewardPerSecond = rewardPerCycle / (illuminationTimeStamp - lastUpdateTimestamp);

            uint256 rewardPayableFromCycle = (((rewardPerSecond) * ((block.timestamp) - lastUpdateTimestamp)) / 10000) - rewardPaid;

            uint256 returnableAmount = rewardPayableFromCycle >= 1 ? rewardPayableFromCycle + rewardStoredPrev : rewardStoredPrev;

            return (returnableAmount, cycle, rewardStoredPrev);
        // We are outside the normal cycle, during time of Illumina sale
        } else if (lastUpdateTimestamp < illuminationTimeStamp && block.timestamp > illuminationTimeStamp && block.timestamp > lastUpdateTimestamp) {

            uint256 returnableAmount = rewardStoredPrev + (rewardPerCycle / 10000) - rewardPaid;
            return (returnableAmount, cycle, rewardStoredPrev);
        // Handle all edge cases
        } else {
            return (rewardStoredPrev, cycle, rewardStoredPrev);
        }
    }
}

File 22 of 27 : OBYToken.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";


contract OBYToken is ERC20, Ownable {
    mapping(address => bool) private _eligibles;

    event Destruction(uint256 amount);

    constructor() ERC20("OBYToken", "OBY") {}

    modifier onlyEligible() {
        require(owner() == _msgSender() || _eligibles[msg.sender], "OBYToken: caller is not eligible");
        _;
    }

    function setEligibles(address _eligible) public onlyOwner {
        _eligibles[_eligible] = true;
    }

    function mint(address account, uint256 amount) external onlyEligible {
        uint256 sendAmount = amount * (10**18);
        _mint(account, sendAmount);
    }

    function checkBalances(uint256 tokenPrice, address account) external onlyEligible view returns (bool) {
        if (balanceOf(account) >= tokenPrice) {
            return true;
        }
        return false;
    }

    function burnToken(uint256 amount, address account) external onlyEligible {
        uint256 sendAmount = amount * (10**18);
        _burn(account, sendAmount);

        emit Destruction(amount);
    }

    function getEligibles(address account) public view onlyEligible returns (bool) {
        require (account != address(0), "OBYToken: address must not be empty");
        return _eligibles[account];
    }
}

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

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

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

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
        }
        _balances[to] += amount;

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens 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 amount
    ) 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, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 24 of 27 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

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

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

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

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

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

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

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

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

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

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

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

        _revokeRole(role, account);
    }

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 26 of 27 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"address","name":"_illuminaAddress","type":"address"},{"internalType":"uint256","name":"_illuminasToBeCollected","type":"uint256"},{"internalType":"string","name":"_keyBaseURI","type":"string"},{"internalType":"address","name":"_operatorFilter","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":[],"name":"BatchMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"purchaser","type":"address"}],"name":"MintToken","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":[],"name":"RootHashSet","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"},{"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":[{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"claimToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"getCurrentTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getIlluScoreFromKey","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getTokensHeldByUser","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getilluminasToBeCollected","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"merkleRootHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"}],"name":"mintAndDrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"redeemIlluminasForKey","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","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":"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":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_blackSquareBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_contractURI","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_rootHash","type":"bytes32"}],"name":"setMerkleRootHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_mintable","type":"bool"}],"name":"setMintable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setRoyalties","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_illuminasToBeCollected","type":"uint256"}],"name":"setilluminasToBeCollected","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"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":[{"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":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60806040526000600d60006101000a81548160ff0219169083151502179055503480156200002c57600080fd5b50604051620053d2380380620053d283398181016040528101906200005291906200052a565b6040518060400160405280600681526020017f4b65794e465400000000000000000000000000000000000000000000000000008152506040518060400160405280600481526020017f4b4e4654000000000000000000000000000000000000000000000000000000008152508160009080519060200190620000d6929190620003ce565b508060019080519060200190620000ef929190620003ce565b50505062000112620001066200021360201b60201c565b6200021b60201b60201c565b80600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555085600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001a68686620002e160201b60201c565b83600d60016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600c8190555081600a908051906020019062000206929190620003ce565b505050505050506200085e565b600033905090565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b61271081111562000329576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000320906200060c565b60405180910390fd5b60405180604001604052808373ffffffffffffffffffffffffffffffffffffffff1681526020018262ffffff16815250600760008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548162ffffff021916908362ffffff1602179055509050505050565b828054620003dc9062000712565b90600052602060002090601f0160209004810192826200040057600085556200044c565b82601f106200041b57805160ff19168380011785556200044c565b828001600101855582156200044c579182015b828111156200044b5782518255916020019190600101906200042e565b5b5090506200045b91906200045f565b5090565b5b808211156200047a57600081600090555060010162000460565b5090565b6000620004956200048f8462000657565b6200062e565b905082815260208101848484011115620004b457620004b3620007e1565b5b620004c1848285620006dc565b509392505050565b600081519050620004da816200082a565b92915050565b600082601f830112620004f857620004f7620007dc565b5b81516200050a8482602086016200047e565b91505092915050565b600081519050620005248162000844565b92915050565b60008060008060008060c087890312156200054a5762000549620007eb565b5b60006200055a89828a01620004c9565b96505060206200056d89828a0162000513565b95505060406200058089828a01620004c9565b94505060606200059389828a0162000513565b935050608087015167ffffffffffffffff811115620005b757620005b6620007e6565b5b620005c589828a01620004e0565b92505060a0620005d889828a01620004c9565b9150509295509295509295565b6000620005f4601a836200068d565b9150620006018262000801565b602082019050919050565b600060208201905081810360008301526200062781620005e5565b9050919050565b60006200063a6200064d565b905062000648828262000748565b919050565b6000604051905090565b600067ffffffffffffffff821115620006755762000674620007ad565b5b6200068082620007f0565b9050602081019050919050565b600082825260208201905092915050565b6000620006ab82620006b2565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015620006fc578082015181840152602081019050620006df565b838111156200070c576000848401525b50505050565b600060028204905060018216806200072b57607f821691505b602082108114156200074257620007416200077e565b5b50919050565b6200075382620007f0565b810181811067ffffffffffffffff82111715620007755762000774620007ad565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332393831526f79616c746965733a20546f6f2068696768000000000000600082015250565b62000835816200069e565b81146200084157600080fd5b50565b6200084f81620006d2565b81146200085b57600080fd5b50565b614b64806200086e6000396000f3fe608060405234801561001057600080fd5b50600436106101fb5760003560e01c806370a082311161011a578063a22cb465116100ad578063ddb6dfc41161007c578063ddb6dfc414610585578063e2e99b76146105a3578063e8a3d485146105c1578063e985e9c5146105df578063f2fde38b1461060f576101fb565b8063a22cb46514610501578063b88d4fde1461051d578063b8d1f26614610539578063c87b56dd14610555576101fb565b80638da5cb5b116100e95780638da5cb5b1461048d578063938e3d7b146104ab57806395d89b41146104c75780639ba411b1146104e5576101fb565b806370a0823114610407578063715018a6146104375780637b9659eb146104415780638c7ea24b14610471576101fb565b8063285d70d411610192578063561892361161016157806356189236146103915780635f03072f146103af57806361d027b3146103b95780636352211e146103d7576101fb565b8063285d70d41461030c5780632a55205a1461032857806342842e0e1461035957806355f804b314610375576101fb565b806310f8d602116101ce57806310f8d6021461029a5780631794ae82146102b65780631ef60fc8146102d257806323b872dd146102f0576101fb565b806301ffc9a71461020057806306fdde0314610230578063081812fc1461024e578063095ea7b31461027e575b600080fd5b61021a60048036038101906102159190613516565b61062b565b6040516102279190613c07565b60405180910390f35b61023861063d565b6040516102459190613c3d565b60405180910390f35b610268600480360381019061026391906135b9565b6106cf565b6040516102759190613b55565b60405180910390f35b610298600480360381019061029391906133b9565b610754565b005b6102b460048036038101906102af9190613442565b61086c565b005b6102d060048036038101906102cb91906135b9565b610b39565b005b6102da610bbf565b6040516102e79190613f5f565b60405180910390f35b61030a600480360381019061030591906132a3565b610c7d565b005b6103266004803603810190610321919061348f565b610cdd565b005b610342600480360381019061033d9190613613565b610d76565b604051610350929190613bbc565b60405180910390f35b610373600480360381019061036e91906132a3565b610e36565b005b61038f600480360381019061038a9190613570565b610e56565b005b610399610eec565b6040516103a69190613f5f565b60405180910390f35b6103b7610efd565b005b6103c1611246565b6040516103ce9190613b55565b60405180910390f35b6103f160048036038101906103ec91906135b9565b61126c565b6040516103fe9190613b55565b60405180910390f35b610421600480360381019061041c9190613236565b61131e565b60405161042e9190613f5f565b60405180910390f35b61043f6113d6565b005b61045b60048036038101906104569190613236565b61145e565b6040516104689190613be5565b60405180910390f35b61048b600480360381019061048691906133b9565b6115c7565b005b610495611651565b6040516104a29190613b55565b60405180910390f35b6104c560048036038101906104c09190613570565b61167b565b005b6104cf611711565b6040516104dc9190613c3d565b60405180910390f35b6104ff60048036038101906104fa91906134e9565b6117a3565b005b61051b60048036038101906105169190613379565b611855565b005b610537600480360381019061053291906132f6565b61186b565b005b610553600480360381019061054e91906133f9565b6118cd565b005b61056f600480360381019061056a91906135b9565b611a22565b60405161057c9190613c3d565b60405180910390f35b61058d611ac9565b60405161059a9190613c22565b60405180910390f35b6105ab611acf565b6040516105b89190613f5f565b60405180910390f35b6105c9611ad9565b6040516105d69190613c3d565b60405180910390f35b6105f960048036038101906105f49190613263565b611b6b565b6040516106069190613c07565b60405180910390f35b61062960048036038101906106249190613236565b611bff565b005b600061063682611cf7565b9050919050565b60606000805461064c906142a7565b80601f0160208091040260200160405190810160405280929190818152602001828054610678906142a7565b80156106c55780601f1061069a576101008083540402835291602001916106c5565b820191906000526020600020905b8154815290600101906020018083116106a857829003601f168201915b5050505050905090565b60006106da82611d71565b610719576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161071090613e1f565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600061075f8261126c565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c790613ebf565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166107ef611ddd565b73ffffffffffffffffffffffffffffffffffffffff16148061081e575061081d81610818611ddd565b611b6b565b5b61085d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085490613d9f565b60405180910390fd5b6108678383611de5565b505050565b60011515600d60009054906101000a900460ff161515146108c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b990613e5f565b60405180910390fd5b6108ca611e9e565b6108d4600f611ea8565b1115610915576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161090c90613f3f565b60405180910390fd5b600061091f611ddd565b60405160200161092f9190613b16565b604051602081830303815290604052805190602001209050610995838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050600b5483611eb6565b6109d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109cb90613eff565b60405180910390fd5b6109de600f611ecd565b601060006109ea611ddd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6990613e7f565b60405180910390fd5b610a8c610a7d611ddd565b610a87600f611ea8565b611ee3565b7f817fb43eae8b3e4767bb96622a5c74f5e68f4400210abce47c47564bd7590005610ab7600f611ea8565b610abf611ddd565b604051610acd929190613f7a565b60405180910390a1600160106000610ae3611ddd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505050565b610b41611ddd565b73ffffffffffffffffffffffffffffffffffffffff16610b5f611651565b73ffffffffffffffffffffffffffffffffffffffff1614610bb5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bac90613e3f565b60405180910390fd5b80600c8190555050565b600080600d60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231610c08611ddd565b6040518263ffffffff1660e01b8152600401610c249190613b55565b60206040518083038186803b158015610c3c57600080fd5b505afa158015610c50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7491906135e6565b90508091505090565b610c8e610c88611ddd565b826120bd565b610ccd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc490613edf565b60405180910390fd5b610cd883838361219b565b505050565b610ce5611ddd565b73ffffffffffffffffffffffffffffffffffffffff16610d03611651565b73ffffffffffffffffffffffffffffffffffffffff1614610d59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5090613e3f565b60405180910390fd5b80600d60006101000a81548160ff02191690831515021790555050565b600080600060076040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900462ffffff1662ffffff1662ffffff1681525050905080600001519250612710816020015162ffffff1685610e229190614159565b610e2c9190614128565b9150509250929050565b610e518383836040518060200160405280600081525061186b565b505050565b610e5e611ddd565b73ffffffffffffffffffffffffffffffffffffffff16610e7c611651565b73ffffffffffffffffffffffffffffffffffffffff1614610ed2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec990613e3f565b60405180910390fd5b80600a9080519060200190610ee8929190612f17565b5050565b6000610ef8600f611ea8565b905090565b60116000610f09611ddd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610f91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8890613cff565b60405180910390fd5b610f99611e9e565b610fa3600f611ea8565b1115610fe4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fdb90613f3f565b60405180910390fd5b6000600d60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a0823161102c611ddd565b6040518263ffffffff1660e01b81526004016110489190613b55565b60206040518083038186803b15801561106057600080fd5b505afa158015611074573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109891906135e6565b9050600c548110156110df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d690613d1f565b60405180910390fd5b6110e9600f611ecd565b6111036110f4611ddd565b6110fe600f611ea8565b611ee3565b7f817fb43eae8b3e4767bb96622a5c74f5e68f4400210abce47c47564bd759000561112e600f611ea8565b611136611ddd565b604051611144929190613f7a565b60405180910390a1600d60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306ff54d3611192611ddd565b600c546040518363ffffffff1660e01b81526004016111b2929190613bbc565b600060405180830381600087803b1580156111cc57600080fd5b505af11580156111e0573d6000803e3d6000fd5b505050506001601160006111f2611ddd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611315576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130c90613ddf565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561138f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138690613dbf565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6113de611ddd565b73ffffffffffffffffffffffffffffffffffffffff166113fc611651565b73ffffffffffffffffffffffffffffffffffffffff1614611452576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144990613e3f565b60405180910390fd5b61145c6000612402565b565b6060600061146b8361131e565b905060008167ffffffffffffffff81111561148957611488614464565b5b6040519080825280602002602001820160405280156114b75781602001602082028036833780820191505090505b50905060008067ffffffffffffffff8111156114d6576114d5614464565b5b6040519080825280602002602001820160405280156115045781602001602082028036833780820191505090505b509050600080600190505b611519600f611ea8565b81116115a357600061152a8261126c565b90508773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561158f578185848151811061157457611573614435565b5b602002602001018181525050828061158b9061430a565b9350505b50808061159b9061430a565b91505061150f565b506000835111156115ba57829450505050506115c2565b819450505050505b919050565b6115cf611ddd565b73ffffffffffffffffffffffffffffffffffffffff166115ed611651565b73ffffffffffffffffffffffffffffffffffffffff1614611643576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163a90613e3f565b60405180910390fd5b61164d82826124c8565b5050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611683611ddd565b73ffffffffffffffffffffffffffffffffffffffff166116a1611651565b73ffffffffffffffffffffffffffffffffffffffff16146116f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ee90613e3f565b60405180910390fd5b806009908051906020019061170d929190612f17565b5050565b606060018054611720906142a7565b80601f016020809104026020016040519081016040528092919081815260200182805461174c906142a7565b80156117995780601f1061176e57610100808354040283529160200191611799565b820191906000526020600020905b81548152906001019060200180831161177c57829003601f168201915b5050505050905090565b6117ab611ddd565b73ffffffffffffffffffffffffffffffffffffffff166117c9611651565b73ffffffffffffffffffffffffffffffffffffffff161461181f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181690613e3f565b60405180910390fd5b80600b819055507f3a36442702ae54c3298a680b5b422eb4fd2290c3992849692b6bbfcfb30cf76f60405160405180910390a150565b611867611860611ddd565b83836125b2565b5050565b61187c611876611ddd565b836120bd565b6118bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b290613edf565b60405180910390fd5b6118c78484848461271f565b50505050565b6118d5611ddd565b73ffffffffffffffffffffffffffffffffffffffff166118f3611651565b73ffffffffffffffffffffffffffffffffffffffff1614611949576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194090613e3f565b60405180910390fd5b60005b81518110156119f25761195d611e9e565b611967600f611ea8565b11156119a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199f90613f3f565b60405180910390fd5b6119b2600f611ecd565b6119df8282815181106119c8576119c7614435565b5b60200260200101516119da600f611ea8565b611ee3565b80806119ea9061430a565b91505061194c565b507f5a31340f0d75691fca7c6ab36bdd3ece0f99ebc1e7aea94477e8a27ac8c44b6360405160405180910390a150565b6060611a2d82611d71565b611a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6390613e9f565b60405180910390fd5b6000611a7661277b565b90506000815111611a965760405180602001604052806000815250611ac1565b80611aa08461280d565b604051602001611ab1929190613b31565b6040516020818303038152906040525b915050919050565b600b5481565b6000600c54905090565b606060098054611ae8906142a7565b80601f0160208091040260200160405190810160405280929190818152602001828054611b14906142a7565b8015611b615780601f10611b3657610100808354040283529160200191611b61565b820191906000526020600020905b815481529060010190602001808311611b4457829003601f168201915b5050505050905090565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611c07611ddd565b73ffffffffffffffffffffffffffffffffffffffff16611c25611651565b73ffffffffffffffffffffffffffffffffffffffff1614611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7290613e3f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611ceb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce290613c9f565b60405180910390fd5b611cf481612402565b50565b60007f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611d6a5750611d698261296e565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16611e588361126c565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061055f905090565b600081600001549050919050565b600082611ec38584612a50565b1490509392505050565b6001816000016000828254019250508190555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f4a90613dff565b60405180910390fd5b611f5c81611d71565b15611f9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f9390613cdf565b60405180910390fd5b611fa860008383612ac5565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611ff891906140d2565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46120b960008383612b92565b5050565b60006120c882611d71565b612107576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120fe90613d7f565b60405180910390fd5b60006121128361126c565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061215457506121538185611b6b565b5b8061219257508373ffffffffffffffffffffffffffffffffffffffff1661217a846106cf565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166121bb8261126c565b73ffffffffffffffffffffffffffffffffffffffff1614612211576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161220890613cbf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612281576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227890613d3f565b60405180910390fd5b61228c838383612ac5565b612297600082611de5565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546122e791906141b3565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461233e91906140d2565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46123fd838383612b92565b505050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b61271081111561250d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250490613c5f565b60405180910390fd5b60405180604001604052808373ffffffffffffffffffffffffffffffffffffffff1681526020018262ffffff16815250600760008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548162ffffff021916908362ffffff1602179055509050505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612621576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161261890613d5f565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516127129190613c07565b60405180910390a3505050565b61272a84848461219b565b61273684848484612b97565b612775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276c90613c7f565b60405180910390fd5b50505050565b6060600a805461278a906142a7565b80601f01602080910402602001604051908101604052809291908181526020018280546127b6906142a7565b80156128035780601f106127d857610100808354040283529160200191612803565b820191906000526020600020905b8154815290600101906020018083116127e657829003601f168201915b5050505050905090565b60606000821415612855576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612969565b600082905060005b600082146128875780806128709061430a565b915050600a826128809190614128565b915061285d565b60008167ffffffffffffffff8111156128a3576128a2614464565b5b6040519080825280601f01601f1916602001820160405280156128d55781602001600182028036833780820191505090505b5090505b60008514612962576001826128ee91906141b3565b9150600a856128fd9190614377565b603061290991906140d2565b60f81b81838151811061291f5761291e614435565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8561295b9190614128565b94506128d9565b8093505050505b919050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480612a3957507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80612a495750612a4882612d2e565b5b9050919050565b60008082905060005b8451811015612aba576000858281518110612a7757612a76614435565b5b60200260200101519050808311612a9957612a928382612d98565b9250612aa6565b612aa38184612d98565b92505b508080612ab29061430a565b915050612a59565b508091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015612b2f5750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015612b425750612b403382612daf565b155b15612b82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b7990613f1f565b60405180910390fd5b612b8d838383612eef565b505050565b505050565b6000612bb88473ffffffffffffffffffffffffffffffffffffffff16612ef4565b15612d21578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612be1611ddd565b8786866040518563ffffffff1660e01b8152600401612c039493929190613b70565b602060405180830381600087803b158015612c1d57600080fd5b505af1925050508015612c4e57506040513d601f19601f82011682018060405250810190612c4b9190613543565b60015b612cd1573d8060008114612c7e576040519150601f19603f3d011682016040523d82523d6000602084013e612c83565b606091505b50600081511415612cc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cc090613c7f565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612d26565b600190505b949350505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600082600052816020526040600020905092915050565b600080600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612e16576001915050612ee9565b612e1f8361126c565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612e5c576001915050612ee9565b8073ffffffffffffffffffffffffffffffffffffffff1663192c596e336040518263ffffffff1660e01b8152600401612e959190613b55565b60206040518083038186803b158015612ead57600080fd5b505afa158015612ec1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ee591906134bc565b9150505b92915050565b505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b828054612f23906142a7565b90600052602060002090601f016020900481019282612f455760008555612f8c565b82601f10612f5e57805160ff1916838001178555612f8c565b82800160010185558215612f8c579182015b82811115612f8b578251825591602001919060010190612f70565b5b509050612f999190612f9d565b5090565b5b80821115612fb6576000816000905550600101612f9e565b5090565b6000612fcd612fc884613fc8565b613fa3565b90508083825260208201905082856020860282011115612ff057612fef61449d565b5b60005b85811015613020578161300688826130ae565b845260208401935060208301925050600181019050612ff3565b5050509392505050565b600061303d61303884613ff4565b613fa3565b905082815260208101848484011115613059576130586144a2565b5b613064848285614265565b509392505050565b600061307f61307a84614025565b613fa3565b90508281526020810184848401111561309b5761309a6144a2565b5b6130a6848285614265565b509392505050565b6000813590506130bd81614abb565b92915050565b600082601f8301126130d8576130d7614498565b5b81356130e8848260208601612fba565b91505092915050565b60008083601f84011261310757613106614498565b5b8235905067ffffffffffffffff81111561312457613123614493565b5b6020830191508360208202830111156131405761313f61449d565b5b9250929050565b60008135905061315681614ad2565b92915050565b60008151905061316b81614ad2565b92915050565b60008135905061318081614ae9565b92915050565b60008135905061319581614b00565b92915050565b6000815190506131aa81614b00565b92915050565b600082601f8301126131c5576131c4614498565b5b81356131d584826020860161302a565b91505092915050565b600082601f8301126131f3576131f2614498565b5b813561320384826020860161306c565b91505092915050565b60008135905061321b81614b17565b92915050565b60008151905061323081614b17565b92915050565b60006020828403121561324c5761324b6144ac565b5b600061325a848285016130ae565b91505092915050565b6000806040838503121561327a576132796144ac565b5b6000613288858286016130ae565b9250506020613299858286016130ae565b9150509250929050565b6000806000606084860312156132bc576132bb6144ac565b5b60006132ca868287016130ae565b93505060206132db868287016130ae565b92505060406132ec8682870161320c565b9150509250925092565b600080600080608085870312156133105761330f6144ac565b5b600061331e878288016130ae565b945050602061332f878288016130ae565b93505060406133408782880161320c565b925050606085013567ffffffffffffffff811115613361576133606144a7565b5b61336d878288016131b0565b91505092959194509250565b600080604083850312156133905761338f6144ac565b5b600061339e858286016130ae565b92505060206133af85828601613147565b9150509250929050565b600080604083850312156133d0576133cf6144ac565b5b60006133de858286016130ae565b92505060206133ef8582860161320c565b9150509250929050565b60006020828403121561340f5761340e6144ac565b5b600082013567ffffffffffffffff81111561342d5761342c6144a7565b5b613439848285016130c3565b91505092915050565b60008060208385031215613459576134586144ac565b5b600083013567ffffffffffffffff811115613477576134766144a7565b5b613483858286016130f1565b92509250509250929050565b6000602082840312156134a5576134a46144ac565b5b60006134b384828501613147565b91505092915050565b6000602082840312156134d2576134d16144ac565b5b60006134e08482850161315c565b91505092915050565b6000602082840312156134ff576134fe6144ac565b5b600061350d84828501613171565b91505092915050565b60006020828403121561352c5761352b6144ac565b5b600061353a84828501613186565b91505092915050565b600060208284031215613559576135586144ac565b5b60006135678482850161319b565b91505092915050565b600060208284031215613586576135856144ac565b5b600082013567ffffffffffffffff8111156135a4576135a36144a7565b5b6135b0848285016131de565b91505092915050565b6000602082840312156135cf576135ce6144ac565b5b60006135dd8482850161320c565b91505092915050565b6000602082840312156135fc576135fb6144ac565b5b600061360a84828501613221565b91505092915050565b6000806040838503121561362a576136296144ac565b5b60006136388582860161320c565b92505060206136498582860161320c565b9150509250929050565b600061365f8383613af8565b60208301905092915050565b613674816141e7565b82525050565b61368b613686826141e7565b614353565b82525050565b600061369c82614066565b6136a68185614094565b93506136b183614056565b8060005b838110156136e25781516136c98882613653565b97506136d483614087565b9250506001810190506136b5565b5085935050505092915050565b6136f8816141f9565b82525050565b61370781614205565b82525050565b600061371882614071565b61372281856140a5565b9350613732818560208601614274565b61373b816144b1565b840191505092915050565b60006137518261407c565b61375b81856140b6565b935061376b818560208601614274565b613774816144b1565b840191505092915050565b600061378a8261407c565b61379481856140c7565b93506137a4818560208601614274565b80840191505092915050565b60006137bd601a836140b6565b91506137c8826144cf565b602082019050919050565b60006137e06032836140b6565b91506137eb826144f8565b604082019050919050565b60006138036026836140b6565b915061380e82614547565b604082019050919050565b60006138266025836140b6565b915061383182614596565b604082019050919050565b6000613849601c836140b6565b9150613854826145e5565b602082019050919050565b600061386c601f836140b6565b91506138778261460e565b602082019050919050565b600061388f6019836140b6565b915061389a82614637565b602082019050919050565b60006138b26024836140b6565b91506138bd82614660565b604082019050919050565b60006138d56019836140b6565b91506138e0826146af565b602082019050919050565b60006138f8602c836140b6565b9150613903826146d8565b604082019050919050565b600061391b6038836140b6565b915061392682614727565b604082019050919050565b600061393e602a836140b6565b915061394982614776565b604082019050919050565b60006139616029836140b6565b915061396c826147c5565b604082019050919050565b60006139846020836140b6565b915061398f82614814565b602082019050919050565b60006139a7602c836140b6565b91506139b28261483d565b604082019050919050565b60006139ca6020836140b6565b91506139d58261488c565b602082019050919050565b60006139ed6025836140b6565b91506139f8826148b5565b604082019050919050565b6000613a106017836140b6565b9150613a1b82614904565b602082019050919050565b6000613a33602f836140b6565b9150613a3e8261492d565b604082019050919050565b6000613a566021836140b6565b9150613a618261497c565b604082019050919050565b6000613a796031836140b6565b9150613a84826149cb565b604082019050919050565b6000613a9c600d836140b6565b9150613aa782614a1a565b602082019050919050565b6000613abf6026836140b6565b9150613aca82614a43565b604082019050919050565b6000613ae26019836140b6565b9150613aed82614a92565b602082019050919050565b613b018161425b565b82525050565b613b108161425b565b82525050565b6000613b22828461367a565b60148201915081905092915050565b6000613b3d828561377f565b9150613b49828461377f565b91508190509392505050565b6000602082019050613b6a600083018461366b565b92915050565b6000608082019050613b85600083018761366b565b613b92602083018661366b565b613b9f6040830185613b07565b8181036060830152613bb1818461370d565b905095945050505050565b6000604082019050613bd1600083018561366b565b613bde6020830184613b07565b9392505050565b60006020820190508181036000830152613bff8184613691565b905092915050565b6000602082019050613c1c60008301846136ef565b92915050565b6000602082019050613c3760008301846136fe565b92915050565b60006020820190508181036000830152613c578184613746565b905092915050565b60006020820190508181036000830152613c78816137b0565b9050919050565b60006020820190508181036000830152613c98816137d3565b9050919050565b60006020820190508181036000830152613cb8816137f6565b9050919050565b60006020820190508181036000830152613cd881613819565b9050919050565b60006020820190508181036000830152613cf88161383c565b9050919050565b60006020820190508181036000830152613d188161385f565b9050919050565b60006020820190508181036000830152613d3881613882565b9050919050565b60006020820190508181036000830152613d58816138a5565b9050919050565b60006020820190508181036000830152613d78816138c8565b9050919050565b60006020820190508181036000830152613d98816138eb565b9050919050565b60006020820190508181036000830152613db88161390e565b9050919050565b60006020820190508181036000830152613dd881613931565b9050919050565b60006020820190508181036000830152613df881613954565b9050919050565b60006020820190508181036000830152613e1881613977565b9050919050565b60006020820190508181036000830152613e388161399a565b9050919050565b60006020820190508181036000830152613e58816139bd565b9050919050565b60006020820190508181036000830152613e78816139e0565b9050919050565b60006020820190508181036000830152613e9881613a03565b9050919050565b60006020820190508181036000830152613eb881613a26565b9050919050565b60006020820190508181036000830152613ed881613a49565b9050919050565b60006020820190508181036000830152613ef881613a6c565b9050919050565b60006020820190508181036000830152613f1881613a8f565b9050919050565b60006020820190508181036000830152613f3881613ab2565b9050919050565b60006020820190508181036000830152613f5881613ad5565b9050919050565b6000602082019050613f746000830184613b07565b92915050565b6000604082019050613f8f6000830185613b07565b613f9c602083018461366b565b9392505050565b6000613fad613fbe565b9050613fb982826142d9565b919050565b6000604051905090565b600067ffffffffffffffff821115613fe357613fe2614464565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561400f5761400e614464565b5b614018826144b1565b9050602081019050919050565b600067ffffffffffffffff8211156140405761403f614464565b5b614049826144b1565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006140dd8261425b565b91506140e88361425b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561411d5761411c6143a8565b5b828201905092915050565b60006141338261425b565b915061413e8361425b565b92508261414e5761414d6143d7565b5b828204905092915050565b60006141648261425b565b915061416f8361425b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156141a8576141a76143a8565b5b828202905092915050565b60006141be8261425b565b91506141c98361425b565b9250828210156141dc576141db6143a8565b5b828203905092915050565b60006141f28261423b565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015614292578082015181840152602081019050614277565b838111156142a1576000848401525b50505050565b600060028204905060018216806142bf57607f821691505b602082108114156142d3576142d2614406565b5b50919050565b6142e2826144b1565b810181811067ffffffffffffffff8211171561430157614300614464565b5b80604052505050565b60006143158261425b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614348576143476143a8565b5b600182019050919050565b600061435e82614365565b9050919050565b6000614370826144c2565b9050919050565b60006143828261425b565b915061438d8361425b565b92508261439d5761439c6143d7565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f45524332393831526f79616c746965733a20546f6f2068696768000000000000600082015250565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f496c6c756d696e613a20416c726561647920436c61696d65642061204b657900600082015250565b7f4e6f7420656e6f75676820496c6c756d696e61732068656c6400000000000000600082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4e6f20746f6b656e732063616e206265206d696e74656420617420746865206d60008201527f6f6d656e74000000000000000000000000000000000000000000000000000000602082015250565b7f4164647265737320616c726561647920636c61696d6564000000000000000000600082015250565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f496e76616c69642050726f6f6600000000000000000000000000000000000000600082015250565b7f4552433732314f70657261746f7246696c7465723a20696c6c6567616c206f7060008201527f657261746f720000000000000000000000000000000000000000000000000000602082015250565b7f4d617820416d6f756e74206f66204b657973206d696e74656400000000000000600082015250565b614ac4816141e7565b8114614acf57600080fd5b50565b614adb816141f9565b8114614ae657600080fd5b50565b614af281614205565b8114614afd57600080fd5b50565b614b098161420f565b8114614b1457600080fd5b50565b614b208161425b565b8114614b2b57600080fd5b5056fea2646970667358221220bf2113f9777a59d718e65aecec156a2a37468149a89170116a1b821fdb036a2064736f6c6343000807003300000000000000000000000024bfc3d97b27a3e4c1807c7462896ace7b4803fd00000000000000000000000000000000000000000000000000000000000003e800000000000000000000000024525c4ea88aae26ccfb94c8e9dde1609be2d81c000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000008c01f22acb041d49d9590095ecc2fa0489bc2e23000000000000000000000000000000000000000000000000000000000000005b68747470733a2f2f68636976656c616d72696d697a616b2e6d7970696e6174612e636c6f75642f697066732f516d59387166464e62627769664b566f7264555a7a6f65656470474a6e324557547966427354344d5a63696155512f0000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c806370a082311161011a578063a22cb465116100ad578063ddb6dfc41161007c578063ddb6dfc414610585578063e2e99b76146105a3578063e8a3d485146105c1578063e985e9c5146105df578063f2fde38b1461060f576101fb565b8063a22cb46514610501578063b88d4fde1461051d578063b8d1f26614610539578063c87b56dd14610555576101fb565b80638da5cb5b116100e95780638da5cb5b1461048d578063938e3d7b146104ab57806395d89b41146104c75780639ba411b1146104e5576101fb565b806370a0823114610407578063715018a6146104375780637b9659eb146104415780638c7ea24b14610471576101fb565b8063285d70d411610192578063561892361161016157806356189236146103915780635f03072f146103af57806361d027b3146103b95780636352211e146103d7576101fb565b8063285d70d41461030c5780632a55205a1461032857806342842e0e1461035957806355f804b314610375576101fb565b806310f8d602116101ce57806310f8d6021461029a5780631794ae82146102b65780631ef60fc8146102d257806323b872dd146102f0576101fb565b806301ffc9a71461020057806306fdde0314610230578063081812fc1461024e578063095ea7b31461027e575b600080fd5b61021a60048036038101906102159190613516565b61062b565b6040516102279190613c07565b60405180910390f35b61023861063d565b6040516102459190613c3d565b60405180910390f35b610268600480360381019061026391906135b9565b6106cf565b6040516102759190613b55565b60405180910390f35b610298600480360381019061029391906133b9565b610754565b005b6102b460048036038101906102af9190613442565b61086c565b005b6102d060048036038101906102cb91906135b9565b610b39565b005b6102da610bbf565b6040516102e79190613f5f565b60405180910390f35b61030a600480360381019061030591906132a3565b610c7d565b005b6103266004803603810190610321919061348f565b610cdd565b005b610342600480360381019061033d9190613613565b610d76565b604051610350929190613bbc565b60405180910390f35b610373600480360381019061036e91906132a3565b610e36565b005b61038f600480360381019061038a9190613570565b610e56565b005b610399610eec565b6040516103a69190613f5f565b60405180910390f35b6103b7610efd565b005b6103c1611246565b6040516103ce9190613b55565b60405180910390f35b6103f160048036038101906103ec91906135b9565b61126c565b6040516103fe9190613b55565b60405180910390f35b610421600480360381019061041c9190613236565b61131e565b60405161042e9190613f5f565b60405180910390f35b61043f6113d6565b005b61045b60048036038101906104569190613236565b61145e565b6040516104689190613be5565b60405180910390f35b61048b600480360381019061048691906133b9565b6115c7565b005b610495611651565b6040516104a29190613b55565b60405180910390f35b6104c560048036038101906104c09190613570565b61167b565b005b6104cf611711565b6040516104dc9190613c3d565b60405180910390f35b6104ff60048036038101906104fa91906134e9565b6117a3565b005b61051b60048036038101906105169190613379565b611855565b005b610537600480360381019061053291906132f6565b61186b565b005b610553600480360381019061054e91906133f9565b6118cd565b005b61056f600480360381019061056a91906135b9565b611a22565b60405161057c9190613c3d565b60405180910390f35b61058d611ac9565b60405161059a9190613c22565b60405180910390f35b6105ab611acf565b6040516105b89190613f5f565b60405180910390f35b6105c9611ad9565b6040516105d69190613c3d565b60405180910390f35b6105f960048036038101906105f49190613263565b611b6b565b6040516106069190613c07565b60405180910390f35b61062960048036038101906106249190613236565b611bff565b005b600061063682611cf7565b9050919050565b60606000805461064c906142a7565b80601f0160208091040260200160405190810160405280929190818152602001828054610678906142a7565b80156106c55780601f1061069a576101008083540402835291602001916106c5565b820191906000526020600020905b8154815290600101906020018083116106a857829003601f168201915b5050505050905090565b60006106da82611d71565b610719576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161071090613e1f565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600061075f8261126c565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c790613ebf565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166107ef611ddd565b73ffffffffffffffffffffffffffffffffffffffff16148061081e575061081d81610818611ddd565b611b6b565b5b61085d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085490613d9f565b60405180910390fd5b6108678383611de5565b505050565b60011515600d60009054906101000a900460ff161515146108c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b990613e5f565b60405180910390fd5b6108ca611e9e565b6108d4600f611ea8565b1115610915576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161090c90613f3f565b60405180910390fd5b600061091f611ddd565b60405160200161092f9190613b16565b604051602081830303815290604052805190602001209050610995838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050600b5483611eb6565b6109d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109cb90613eff565b60405180910390fd5b6109de600f611ecd565b601060006109ea611ddd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6990613e7f565b60405180910390fd5b610a8c610a7d611ddd565b610a87600f611ea8565b611ee3565b7f817fb43eae8b3e4767bb96622a5c74f5e68f4400210abce47c47564bd7590005610ab7600f611ea8565b610abf611ddd565b604051610acd929190613f7a565b60405180910390a1600160106000610ae3611ddd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505050565b610b41611ddd565b73ffffffffffffffffffffffffffffffffffffffff16610b5f611651565b73ffffffffffffffffffffffffffffffffffffffff1614610bb5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bac90613e3f565b60405180910390fd5b80600c8190555050565b600080600d60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231610c08611ddd565b6040518263ffffffff1660e01b8152600401610c249190613b55565b60206040518083038186803b158015610c3c57600080fd5b505afa158015610c50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7491906135e6565b90508091505090565b610c8e610c88611ddd565b826120bd565b610ccd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc490613edf565b60405180910390fd5b610cd883838361219b565b505050565b610ce5611ddd565b73ffffffffffffffffffffffffffffffffffffffff16610d03611651565b73ffffffffffffffffffffffffffffffffffffffff1614610d59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5090613e3f565b60405180910390fd5b80600d60006101000a81548160ff02191690831515021790555050565b600080600060076040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900462ffffff1662ffffff1662ffffff1681525050905080600001519250612710816020015162ffffff1685610e229190614159565b610e2c9190614128565b9150509250929050565b610e518383836040518060200160405280600081525061186b565b505050565b610e5e611ddd565b73ffffffffffffffffffffffffffffffffffffffff16610e7c611651565b73ffffffffffffffffffffffffffffffffffffffff1614610ed2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec990613e3f565b60405180910390fd5b80600a9080519060200190610ee8929190612f17565b5050565b6000610ef8600f611ea8565b905090565b60116000610f09611ddd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610f91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8890613cff565b60405180910390fd5b610f99611e9e565b610fa3600f611ea8565b1115610fe4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fdb90613f3f565b60405180910390fd5b6000600d60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a0823161102c611ddd565b6040518263ffffffff1660e01b81526004016110489190613b55565b60206040518083038186803b15801561106057600080fd5b505afa158015611074573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109891906135e6565b9050600c548110156110df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d690613d1f565b60405180910390fd5b6110e9600f611ecd565b6111036110f4611ddd565b6110fe600f611ea8565b611ee3565b7f817fb43eae8b3e4767bb96622a5c74f5e68f4400210abce47c47564bd759000561112e600f611ea8565b611136611ddd565b604051611144929190613f7a565b60405180910390a1600d60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306ff54d3611192611ddd565b600c546040518363ffffffff1660e01b81526004016111b2929190613bbc565b600060405180830381600087803b1580156111cc57600080fd5b505af11580156111e0573d6000803e3d6000fd5b505050506001601160006111f2611ddd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611315576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130c90613ddf565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561138f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138690613dbf565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6113de611ddd565b73ffffffffffffffffffffffffffffffffffffffff166113fc611651565b73ffffffffffffffffffffffffffffffffffffffff1614611452576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144990613e3f565b60405180910390fd5b61145c6000612402565b565b6060600061146b8361131e565b905060008167ffffffffffffffff81111561148957611488614464565b5b6040519080825280602002602001820160405280156114b75781602001602082028036833780820191505090505b50905060008067ffffffffffffffff8111156114d6576114d5614464565b5b6040519080825280602002602001820160405280156115045781602001602082028036833780820191505090505b509050600080600190505b611519600f611ea8565b81116115a357600061152a8261126c565b90508773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561158f578185848151811061157457611573614435565b5b602002602001018181525050828061158b9061430a565b9350505b50808061159b9061430a565b91505061150f565b506000835111156115ba57829450505050506115c2565b819450505050505b919050565b6115cf611ddd565b73ffffffffffffffffffffffffffffffffffffffff166115ed611651565b73ffffffffffffffffffffffffffffffffffffffff1614611643576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163a90613e3f565b60405180910390fd5b61164d82826124c8565b5050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611683611ddd565b73ffffffffffffffffffffffffffffffffffffffff166116a1611651565b73ffffffffffffffffffffffffffffffffffffffff16146116f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ee90613e3f565b60405180910390fd5b806009908051906020019061170d929190612f17565b5050565b606060018054611720906142a7565b80601f016020809104026020016040519081016040528092919081815260200182805461174c906142a7565b80156117995780601f1061176e57610100808354040283529160200191611799565b820191906000526020600020905b81548152906001019060200180831161177c57829003601f168201915b5050505050905090565b6117ab611ddd565b73ffffffffffffffffffffffffffffffffffffffff166117c9611651565b73ffffffffffffffffffffffffffffffffffffffff161461181f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181690613e3f565b60405180910390fd5b80600b819055507f3a36442702ae54c3298a680b5b422eb4fd2290c3992849692b6bbfcfb30cf76f60405160405180910390a150565b611867611860611ddd565b83836125b2565b5050565b61187c611876611ddd565b836120bd565b6118bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b290613edf565b60405180910390fd5b6118c78484848461271f565b50505050565b6118d5611ddd565b73ffffffffffffffffffffffffffffffffffffffff166118f3611651565b73ffffffffffffffffffffffffffffffffffffffff1614611949576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194090613e3f565b60405180910390fd5b60005b81518110156119f25761195d611e9e565b611967600f611ea8565b11156119a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199f90613f3f565b60405180910390fd5b6119b2600f611ecd565b6119df8282815181106119c8576119c7614435565b5b60200260200101516119da600f611ea8565b611ee3565b80806119ea9061430a565b91505061194c565b507f5a31340f0d75691fca7c6ab36bdd3ece0f99ebc1e7aea94477e8a27ac8c44b6360405160405180910390a150565b6060611a2d82611d71565b611a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6390613e9f565b60405180910390fd5b6000611a7661277b565b90506000815111611a965760405180602001604052806000815250611ac1565b80611aa08461280d565b604051602001611ab1929190613b31565b6040516020818303038152906040525b915050919050565b600b5481565b6000600c54905090565b606060098054611ae8906142a7565b80601f0160208091040260200160405190810160405280929190818152602001828054611b14906142a7565b8015611b615780601f10611b3657610100808354040283529160200191611b61565b820191906000526020600020905b815481529060010190602001808311611b4457829003601f168201915b5050505050905090565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611c07611ddd565b73ffffffffffffffffffffffffffffffffffffffff16611c25611651565b73ffffffffffffffffffffffffffffffffffffffff1614611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7290613e3f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611ceb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce290613c9f565b60405180910390fd5b611cf481612402565b50565b60007f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611d6a5750611d698261296e565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16611e588361126c565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061055f905090565b600081600001549050919050565b600082611ec38584612a50565b1490509392505050565b6001816000016000828254019250508190555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f4a90613dff565b60405180910390fd5b611f5c81611d71565b15611f9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f9390613cdf565b60405180910390fd5b611fa860008383612ac5565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611ff891906140d2565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46120b960008383612b92565b5050565b60006120c882611d71565b612107576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120fe90613d7f565b60405180910390fd5b60006121128361126c565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061215457506121538185611b6b565b5b8061219257508373ffffffffffffffffffffffffffffffffffffffff1661217a846106cf565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166121bb8261126c565b73ffffffffffffffffffffffffffffffffffffffff1614612211576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161220890613cbf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612281576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227890613d3f565b60405180910390fd5b61228c838383612ac5565b612297600082611de5565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546122e791906141b3565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461233e91906140d2565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46123fd838383612b92565b505050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b61271081111561250d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250490613c5f565b60405180910390fd5b60405180604001604052808373ffffffffffffffffffffffffffffffffffffffff1681526020018262ffffff16815250600760008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548162ffffff021916908362ffffff1602179055509050505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612621576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161261890613d5f565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516127129190613c07565b60405180910390a3505050565b61272a84848461219b565b61273684848484612b97565b612775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276c90613c7f565b60405180910390fd5b50505050565b6060600a805461278a906142a7565b80601f01602080910402602001604051908101604052809291908181526020018280546127b6906142a7565b80156128035780601f106127d857610100808354040283529160200191612803565b820191906000526020600020905b8154815290600101906020018083116127e657829003601f168201915b5050505050905090565b60606000821415612855576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612969565b600082905060005b600082146128875780806128709061430a565b915050600a826128809190614128565b915061285d565b60008167ffffffffffffffff8111156128a3576128a2614464565b5b6040519080825280601f01601f1916602001820160405280156128d55781602001600182028036833780820191505090505b5090505b60008514612962576001826128ee91906141b3565b9150600a856128fd9190614377565b603061290991906140d2565b60f81b81838151811061291f5761291e614435565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8561295b9190614128565b94506128d9565b8093505050505b919050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480612a3957507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80612a495750612a4882612d2e565b5b9050919050565b60008082905060005b8451811015612aba576000858281518110612a7757612a76614435565b5b60200260200101519050808311612a9957612a928382612d98565b9250612aa6565b612aa38184612d98565b92505b508080612ab29061430a565b915050612a59565b508091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015612b2f5750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015612b425750612b403382612daf565b155b15612b82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b7990613f1f565b60405180910390fd5b612b8d838383612eef565b505050565b505050565b6000612bb88473ffffffffffffffffffffffffffffffffffffffff16612ef4565b15612d21578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612be1611ddd565b8786866040518563ffffffff1660e01b8152600401612c039493929190613b70565b602060405180830381600087803b158015612c1d57600080fd5b505af1925050508015612c4e57506040513d601f19601f82011682018060405250810190612c4b9190613543565b60015b612cd1573d8060008114612c7e576040519150601f19603f3d011682016040523d82523d6000602084013e612c83565b606091505b50600081511415612cc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cc090613c7f565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612d26565b600190505b949350505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600082600052816020526040600020905092915050565b600080600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612e16576001915050612ee9565b612e1f8361126c565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612e5c576001915050612ee9565b8073ffffffffffffffffffffffffffffffffffffffff1663192c596e336040518263ffffffff1660e01b8152600401612e959190613b55565b60206040518083038186803b158015612ead57600080fd5b505afa158015612ec1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ee591906134bc565b9150505b92915050565b505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b828054612f23906142a7565b90600052602060002090601f016020900481019282612f455760008555612f8c565b82601f10612f5e57805160ff1916838001178555612f8c565b82800160010185558215612f8c579182015b82811115612f8b578251825591602001919060010190612f70565b5b509050612f999190612f9d565b5090565b5b80821115612fb6576000816000905550600101612f9e565b5090565b6000612fcd612fc884613fc8565b613fa3565b90508083825260208201905082856020860282011115612ff057612fef61449d565b5b60005b85811015613020578161300688826130ae565b845260208401935060208301925050600181019050612ff3565b5050509392505050565b600061303d61303884613ff4565b613fa3565b905082815260208101848484011115613059576130586144a2565b5b613064848285614265565b509392505050565b600061307f61307a84614025565b613fa3565b90508281526020810184848401111561309b5761309a6144a2565b5b6130a6848285614265565b509392505050565b6000813590506130bd81614abb565b92915050565b600082601f8301126130d8576130d7614498565b5b81356130e8848260208601612fba565b91505092915050565b60008083601f84011261310757613106614498565b5b8235905067ffffffffffffffff81111561312457613123614493565b5b6020830191508360208202830111156131405761313f61449d565b5b9250929050565b60008135905061315681614ad2565b92915050565b60008151905061316b81614ad2565b92915050565b60008135905061318081614ae9565b92915050565b60008135905061319581614b00565b92915050565b6000815190506131aa81614b00565b92915050565b600082601f8301126131c5576131c4614498565b5b81356131d584826020860161302a565b91505092915050565b600082601f8301126131f3576131f2614498565b5b813561320384826020860161306c565b91505092915050565b60008135905061321b81614b17565b92915050565b60008151905061323081614b17565b92915050565b60006020828403121561324c5761324b6144ac565b5b600061325a848285016130ae565b91505092915050565b6000806040838503121561327a576132796144ac565b5b6000613288858286016130ae565b9250506020613299858286016130ae565b9150509250929050565b6000806000606084860312156132bc576132bb6144ac565b5b60006132ca868287016130ae565b93505060206132db868287016130ae565b92505060406132ec8682870161320c565b9150509250925092565b600080600080608085870312156133105761330f6144ac565b5b600061331e878288016130ae565b945050602061332f878288016130ae565b93505060406133408782880161320c565b925050606085013567ffffffffffffffff811115613361576133606144a7565b5b61336d878288016131b0565b91505092959194509250565b600080604083850312156133905761338f6144ac565b5b600061339e858286016130ae565b92505060206133af85828601613147565b9150509250929050565b600080604083850312156133d0576133cf6144ac565b5b60006133de858286016130ae565b92505060206133ef8582860161320c565b9150509250929050565b60006020828403121561340f5761340e6144ac565b5b600082013567ffffffffffffffff81111561342d5761342c6144a7565b5b613439848285016130c3565b91505092915050565b60008060208385031215613459576134586144ac565b5b600083013567ffffffffffffffff811115613477576134766144a7565b5b613483858286016130f1565b92509250509250929050565b6000602082840312156134a5576134a46144ac565b5b60006134b384828501613147565b91505092915050565b6000602082840312156134d2576134d16144ac565b5b60006134e08482850161315c565b91505092915050565b6000602082840312156134ff576134fe6144ac565b5b600061350d84828501613171565b91505092915050565b60006020828403121561352c5761352b6144ac565b5b600061353a84828501613186565b91505092915050565b600060208284031215613559576135586144ac565b5b60006135678482850161319b565b91505092915050565b600060208284031215613586576135856144ac565b5b600082013567ffffffffffffffff8111156135a4576135a36144a7565b5b6135b0848285016131de565b91505092915050565b6000602082840312156135cf576135ce6144ac565b5b60006135dd8482850161320c565b91505092915050565b6000602082840312156135fc576135fb6144ac565b5b600061360a84828501613221565b91505092915050565b6000806040838503121561362a576136296144ac565b5b60006136388582860161320c565b92505060206136498582860161320c565b9150509250929050565b600061365f8383613af8565b60208301905092915050565b613674816141e7565b82525050565b61368b613686826141e7565b614353565b82525050565b600061369c82614066565b6136a68185614094565b93506136b183614056565b8060005b838110156136e25781516136c98882613653565b97506136d483614087565b9250506001810190506136b5565b5085935050505092915050565b6136f8816141f9565b82525050565b61370781614205565b82525050565b600061371882614071565b61372281856140a5565b9350613732818560208601614274565b61373b816144b1565b840191505092915050565b60006137518261407c565b61375b81856140b6565b935061376b818560208601614274565b613774816144b1565b840191505092915050565b600061378a8261407c565b61379481856140c7565b93506137a4818560208601614274565b80840191505092915050565b60006137bd601a836140b6565b91506137c8826144cf565b602082019050919050565b60006137e06032836140b6565b91506137eb826144f8565b604082019050919050565b60006138036026836140b6565b915061380e82614547565b604082019050919050565b60006138266025836140b6565b915061383182614596565b604082019050919050565b6000613849601c836140b6565b9150613854826145e5565b602082019050919050565b600061386c601f836140b6565b91506138778261460e565b602082019050919050565b600061388f6019836140b6565b915061389a82614637565b602082019050919050565b60006138b26024836140b6565b91506138bd82614660565b604082019050919050565b60006138d56019836140b6565b91506138e0826146af565b602082019050919050565b60006138f8602c836140b6565b9150613903826146d8565b604082019050919050565b600061391b6038836140b6565b915061392682614727565b604082019050919050565b600061393e602a836140b6565b915061394982614776565b604082019050919050565b60006139616029836140b6565b915061396c826147c5565b604082019050919050565b60006139846020836140b6565b915061398f82614814565b602082019050919050565b60006139a7602c836140b6565b91506139b28261483d565b604082019050919050565b60006139ca6020836140b6565b91506139d58261488c565b602082019050919050565b60006139ed6025836140b6565b91506139f8826148b5565b604082019050919050565b6000613a106017836140b6565b9150613a1b82614904565b602082019050919050565b6000613a33602f836140b6565b9150613a3e8261492d565b604082019050919050565b6000613a566021836140b6565b9150613a618261497c565b604082019050919050565b6000613a796031836140b6565b9150613a84826149cb565b604082019050919050565b6000613a9c600d836140b6565b9150613aa782614a1a565b602082019050919050565b6000613abf6026836140b6565b9150613aca82614a43565b604082019050919050565b6000613ae26019836140b6565b9150613aed82614a92565b602082019050919050565b613b018161425b565b82525050565b613b108161425b565b82525050565b6000613b22828461367a565b60148201915081905092915050565b6000613b3d828561377f565b9150613b49828461377f565b91508190509392505050565b6000602082019050613b6a600083018461366b565b92915050565b6000608082019050613b85600083018761366b565b613b92602083018661366b565b613b9f6040830185613b07565b8181036060830152613bb1818461370d565b905095945050505050565b6000604082019050613bd1600083018561366b565b613bde6020830184613b07565b9392505050565b60006020820190508181036000830152613bff8184613691565b905092915050565b6000602082019050613c1c60008301846136ef565b92915050565b6000602082019050613c3760008301846136fe565b92915050565b60006020820190508181036000830152613c578184613746565b905092915050565b60006020820190508181036000830152613c78816137b0565b9050919050565b60006020820190508181036000830152613c98816137d3565b9050919050565b60006020820190508181036000830152613cb8816137f6565b9050919050565b60006020820190508181036000830152613cd881613819565b9050919050565b60006020820190508181036000830152613cf88161383c565b9050919050565b60006020820190508181036000830152613d188161385f565b9050919050565b60006020820190508181036000830152613d3881613882565b9050919050565b60006020820190508181036000830152613d58816138a5565b9050919050565b60006020820190508181036000830152613d78816138c8565b9050919050565b60006020820190508181036000830152613d98816138eb565b9050919050565b60006020820190508181036000830152613db88161390e565b9050919050565b60006020820190508181036000830152613dd881613931565b9050919050565b60006020820190508181036000830152613df881613954565b9050919050565b60006020820190508181036000830152613e1881613977565b9050919050565b60006020820190508181036000830152613e388161399a565b9050919050565b60006020820190508181036000830152613e58816139bd565b9050919050565b60006020820190508181036000830152613e78816139e0565b9050919050565b60006020820190508181036000830152613e9881613a03565b9050919050565b60006020820190508181036000830152613eb881613a26565b9050919050565b60006020820190508181036000830152613ed881613a49565b9050919050565b60006020820190508181036000830152613ef881613a6c565b9050919050565b60006020820190508181036000830152613f1881613a8f565b9050919050565b60006020820190508181036000830152613f3881613ab2565b9050919050565b60006020820190508181036000830152613f5881613ad5565b9050919050565b6000602082019050613f746000830184613b07565b92915050565b6000604082019050613f8f6000830185613b07565b613f9c602083018461366b565b9392505050565b6000613fad613fbe565b9050613fb982826142d9565b919050565b6000604051905090565b600067ffffffffffffffff821115613fe357613fe2614464565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561400f5761400e614464565b5b614018826144b1565b9050602081019050919050565b600067ffffffffffffffff8211156140405761403f614464565b5b614049826144b1565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006140dd8261425b565b91506140e88361425b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561411d5761411c6143a8565b5b828201905092915050565b60006141338261425b565b915061413e8361425b565b92508261414e5761414d6143d7565b5b828204905092915050565b60006141648261425b565b915061416f8361425b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156141a8576141a76143a8565b5b828202905092915050565b60006141be8261425b565b91506141c98361425b565b9250828210156141dc576141db6143a8565b5b828203905092915050565b60006141f28261423b565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015614292578082015181840152602081019050614277565b838111156142a1576000848401525b50505050565b600060028204905060018216806142bf57607f821691505b602082108114156142d3576142d2614406565b5b50919050565b6142e2826144b1565b810181811067ffffffffffffffff8211171561430157614300614464565b5b80604052505050565b60006143158261425b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614348576143476143a8565b5b600182019050919050565b600061435e82614365565b9050919050565b6000614370826144c2565b9050919050565b60006143828261425b565b915061438d8361425b565b92508261439d5761439c6143d7565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f45524332393831526f79616c746965733a20546f6f2068696768000000000000600082015250565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f496c6c756d696e613a20416c726561647920436c61696d65642061204b657900600082015250565b7f4e6f7420656e6f75676820496c6c756d696e61732068656c6400000000000000600082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4e6f20746f6b656e732063616e206265206d696e74656420617420746865206d60008201527f6f6d656e74000000000000000000000000000000000000000000000000000000602082015250565b7f4164647265737320616c726561647920636c61696d6564000000000000000000600082015250565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f496e76616c69642050726f6f6600000000000000000000000000000000000000600082015250565b7f4552433732314f70657261746f7246696c7465723a20696c6c6567616c206f7060008201527f657261746f720000000000000000000000000000000000000000000000000000602082015250565b7f4d617820416d6f756e74206f66204b657973206d696e74656400000000000000600082015250565b614ac4816141e7565b8114614acf57600080fd5b50565b614adb816141f9565b8114614ae657600080fd5b50565b614af281614205565b8114614afd57600080fd5b50565b614b098161420f565b8114614b1457600080fd5b50565b614b208161425b565b8114614b2b57600080fd5b5056fea2646970667358221220bf2113f9777a59d718e65aecec156a2a37468149a89170116a1b821fdb036a2064736f6c63430008070033

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

00000000000000000000000024bfc3d97b27a3e4c1807c7462896ace7b4803fd00000000000000000000000000000000000000000000000000000000000003e800000000000000000000000024525c4ea88aae26ccfb94c8e9dde1609be2d81c000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000008c01f22acb041d49d9590095ecc2fa0489bc2e23000000000000000000000000000000000000000000000000000000000000005b68747470733a2f2f68636976656c616d72696d697a616b2e6d7970696e6174612e636c6f75642f697066732f516d59387166464e62627769664b566f7264555a7a6f65656470474a6e324557547966427354344d5a63696155512f0000000000

-----Decoded View---------------
Arg [0] : _treasury (address): 0x24bFc3D97B27a3e4C1807C7462896acE7B4803fd
Arg [1] : _value (uint256): 1000
Arg [2] : _illuminaAddress (address): 0x24525C4eA88aaE26CcFb94C8e9DdE1609BE2d81c
Arg [3] : _illuminasToBeCollected (uint256): 64
Arg [4] : _keyBaseURI (string): https://hcivelamrimizak.mypinata.cloud/ipfs/QmY8qfFNbbwifKVordUZzoeedpGJn2EWTyfBsT4MZciaUQ/
Arg [5] : _operatorFilter (address): 0x8C01f22aCB041D49d9590095ecC2Fa0489Bc2E23

-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 00000000000000000000000024bfc3d97b27a3e4c1807c7462896ace7b4803fd
Arg [1] : 00000000000000000000000000000000000000000000000000000000000003e8
Arg [2] : 00000000000000000000000024525c4ea88aae26ccfb94c8e9dde1609be2d81c
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [4] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [5] : 0000000000000000000000008c01f22acb041d49d9590095ecc2fa0489bc2e23
Arg [6] : 000000000000000000000000000000000000000000000000000000000000005b
Arg [7] : 68747470733a2f2f68636976656c616d72696d697a616b2e6d7970696e617461
Arg [8] : 2e636c6f75642f697066732f516d59387166464e62627769664b566f7264555a
Arg [9] : 7a6f65656470474a6e324557547966427354344d5a63696155512f0000000000


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.