ETH Price: $3,386.94 (+1.25%)

Token

Checks (CHECKS)
 

Overview

Max Total Supply

4,989 CHECKS

Holders

1,540

Market

Volume (24H)

2.6216 ETH

Min Price (24H)

$884.67 @ 0.261200 ETH

Max Price (24H)

$7,078.70 @ 2.090000 ETH
Filtered by Token Holder
stupidass.eth
Balance
0 CHECKS
0x10c0be5f67833e7d98bf438fc165d2d97e93f45c
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

This artwork may or may not be notable.

# Exchange Pair Price  24H Volume % Volume
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
Checks

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
No with 200 runs

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

import "./interfaces/IChecks.sol";
import "./interfaces/IChecksEdition.sol";
import "./libraries/ChecksArt.sol";
import "./libraries/ChecksMetadata.sol";
import "./libraries/Utilities.sol";
import "./standards/CHECKS721.sol";

/**
✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓  ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓          ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
✓✓✓✓✓✓✓✓✓                      ✓✓✓✓✓✓✓✓✓
✓✓✓✓✓✓✓✓                        ✓✓✓✓✓✓✓✓
✓✓✓✓✓✓✓✓                ✓✓       ✓✓✓✓✓✓✓
✓✓✓✓✓                 ✓✓✓          ✓✓✓✓✓
✓✓✓✓                 ✓✓✓            ✓✓✓✓
✓✓✓✓✓          ✓✓  ✓✓✓             ✓✓✓✓✓
✓✓✓✓✓✓✓          ✓✓✓             ✓✓✓✓✓✓✓
✓✓✓✓✓✓✓✓                        ✓✓✓✓✓✓✓✓
✓✓✓✓✓✓✓✓✓                      ✓✓✓✓✓✓✓✓✓
✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓          ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓  ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
@title  Checks
@author VisualizeValue
@notice This artwork is notable.
*/
contract Checks is IChecks, CHECKS721 {

    /// @notice The VV Checks Edition contract.
    IChecksEdition public editionChecks;

    /// @dev We use this database for persistent storage.
    Checks checks;

    /// @dev Initializes the Checks Originals contract and links the Edition contract.
    constructor() {
        editionChecks = IChecksEdition(0x34eEBEE6942d8Def3c125458D1a86e0A897fd6f9);
        checks.day0 = uint32(block.timestamp);
        checks.epoch = 1;
    }

    /// @notice Migrate Checks Editions to Checks Originals by burning the Editions.
    ///         Requires the Approval of this contract on the Edition contract.
    /// @param tokenIds The Edition token IDs you want to migrate.
    /// @param recipient The address to receive the tokens.
    function mint(uint256[] calldata tokenIds, address recipient) external {
        uint256 count = tokenIds.length;

        // Initialize new epoch / resolve previous epoch.
        resolveEpochIfNecessary();

        // Burn the Editions for the given tokenIds & mint the Originals.
        for (uint256 i; i < count;) {
            uint256 id = tokenIds[i];
            address owner = editionChecks.ownerOf(id);

            // Check whether we're allowed to migrate this Edition.
            if (
                owner != msg.sender &&
                (! editionChecks.isApprovedForAll(owner, msg.sender)) &&
                editionChecks.getApproved(id) != msg.sender
            ) { revert NotAllowed(); }

            // Burn the Edition.
            editionChecks.burn(id);

            // Initialize our Check.
            StoredCheck storage check = checks.all[id];
            check.day = Utilities.day(checks.day0, block.timestamp);
            check.epoch = uint32(checks.epoch);
            check.seed = uint16(id);
            check.divisorIndex = 0;

            // Mint the original.
            // If we're minting to a vault, transfer it there.
            if (msg.sender != recipient) {
                _safeMintVia(recipient, msg.sender, id);
            } else {
                _safeMint(msg.sender, id);
            }

            unchecked { ++i; }
        }

        // Keep track of how many checks have been minted.
        unchecked { checks.minted += uint32(count); }
    }

    /// @notice Get a specific check with its genome settings.
    /// @param tokenId The token ID to fetch.
    function getCheck(uint256 tokenId) external view returns (Check memory check) {
        return ChecksArt.getCheck(tokenId, checks);
    }

    /// @notice Sacrifice a token to transfer its visual representation to another token.
    /// @param tokenId The token ID transfer the art into.
    /// @param burnId The token ID to sacrifice.
    function inItForTheArt(uint256 tokenId, uint256 burnId) external {
        _sacrifice(tokenId, burnId);

        unchecked { ++checks.burned; }
    }

    /// @notice Sacrifice multiple tokens to transfer their visual to other tokens.
    /// @param tokenIds The token IDs to transfer the art into.
    /// @param burnIds The token IDs to sacrifice.
    function inItForTheArts(uint256[] calldata tokenIds, uint256[] calldata burnIds) external {
        uint256 pairs = _multiTokenOperation(tokenIds, burnIds);

        for (uint256 i; i < pairs;) {
            _sacrifice(tokenIds[i], burnIds[i]);

            unchecked { ++i; }
        }

        unchecked { checks.burned += uint32(pairs); }
    }

    /// @notice Composite one token into another. This mixes the visual and reduces the number of checks.
    /// @param tokenId The token ID to keep alive. Its visual will change.
    /// @param burnId The token ID to composite into the tokenId.
    /// @param swap Swap the visuals before compositing.
    function composite(uint256 tokenId, uint256 burnId, bool swap) external {
        // Allow swapping the visuals before executing the composite.
        if (swap) {
            StoredCheck memory toKeep = checks.all[tokenId];

            checks.all[tokenId] = checks.all[burnId];
            checks.all[burnId] = toKeep;
        }

        _composite(tokenId, burnId);

        unchecked { ++checks.burned; }
    }

    /// @notice Composite multiple tokens. This mixes the visuals and checks in remaining tokens.
    /// @param tokenIds The token IDs to keep alive. Their art will change.
    /// @param burnIds The token IDs to composite.
    function compositeMany(uint256[] calldata tokenIds, uint256[] calldata burnIds) external {
        uint256 pairs = _multiTokenOperation(tokenIds, burnIds);

        for (uint256 i; i < pairs;) {
            _composite(tokenIds[i], burnIds[i]);

            unchecked { ++i; }
        }

        unchecked { checks.burned += uint32(pairs); }
    }

    /// @notice Sacrifice 64 single-check tokens to form a black check.
    /// @param tokenIds The token IDs to burn for the black check.
    /// @dev The check at index 0 survives.
    function infinity(uint256[] calldata tokenIds) external {
        uint256 count = tokenIds.length;

        // Make sure we're allowed to mint the black check.
        if (count != 64) {
            revert InvalidTokenCount();
        }
        for (uint256 i; i < count;) {
            uint256 id = tokenIds[i];
            if (checks.all[id].divisorIndex != 6) {
                revert BlackCheck__InvalidCheck();
            }
            if (!_isApprovedOrOwner(msg.sender, id)) {
                revert NotAllowed();
            }

            unchecked { ++i; }
        }

        // Complete final composite.
        uint256 blackCheckId = tokenIds[0];
        StoredCheck storage check = checks.all[blackCheckId];
        check.day = Utilities.day(checks.day0, block.timestamp);
        check.divisorIndex = 7;

        // Burn all 63 other Checks.
        for (uint i = 1; i < count;) {
            _burn(tokenIds[i]);

            unchecked { ++i; }
        }
        unchecked { checks.burned += 63; }

        // When one is released from the prison of self, that is indeed freedom.
        // For the most great prison is the prison of self.
        emit Infinity(blackCheckId, tokenIds[1:]);
        emit MetadataUpdate(blackCheckId);
    }

    /// @notice Burn a check. Note: This burn does not composite or swap tokens.
    /// @param tokenId The token ID to burn.
    /// @dev A common purpose burn method.
    function burn(uint256 tokenId) external {
        if (! _isApprovedOrOwner(msg.sender, tokenId)) {
            revert NotAllowed();
        }

        // Perform the burn.
        _burn(tokenId);

        // Keep track of supply.
        unchecked { ++checks.burned; }
    }

    /// @notice Initializes and closes epochs.
    /// @dev Based on the commit-reveal scheme proposed by MouseDev.
    function resolveEpochIfNecessary() public {
        Epoch storage currentEpoch = checks.epochs[checks.epoch];

        if (
            // If epoch has not been committed,
            currentEpoch.committed == false ||
            // Or the reveal commitment timed out.
            (currentEpoch.revealed == false && currentEpoch.revealBlock < block.number - 256)
        ) {
            // This means the epoch has not been committed, OR the epoch was committed but has expired.
            // Set committed to true, and record the reveal block:
            currentEpoch.revealBlock = uint64(block.number + 50);
            currentEpoch.committed = true;

        } else if (block.number > currentEpoch.revealBlock) {
            // Epoch has been committed and is within range to be revealed.
            // Set its randomness to the target block hash.
            currentEpoch.randomness = uint128(uint256(keccak256(
                abi.encodePacked(
                    blockhash(currentEpoch.revealBlock),
                    block.difficulty
                ))) % (2 ** 128 - 1)
            );
            currentEpoch.revealed = true;

            // Notify DAPPs about the new epoch.
            emit NewEpoch(checks.epoch, currentEpoch.revealBlock);

            // Initialize the next epoch
            checks.epoch++;
            resolveEpochIfNecessary();
        }
    }

    /// @notice The identifier of the current epoch
    function getEpoch() view public returns(uint256) {
        return checks.epoch;
    }

    /// @notice Get the data for a given epoch
    /// @param index The identifier of the epoch to fetch
    function getEpochData(uint256 index) view public returns(Epoch memory) {
        return checks.epochs[index];
    }

    /// @notice Simulate a composite.
    /// @param tokenId The token to render.
    /// @param burnId The token to composite.
    function simulateComposite(uint256 tokenId, uint256 burnId) public view returns (Check memory check) {
        _requireMinted(tokenId);
        _requireMinted(burnId);

        // We want to simulate for the next divisor check count.
        uint8 index = checks.all[tokenId].divisorIndex;
        uint8 nextDivisor = index + 1;
        check = ChecksArt.getCheck(tokenId, nextDivisor, checks);

        // Simulate composite tree
        check.stored.composites[index] = uint16(burnId);

        // Simulate visual composite in stored data if we have many checks
        if (index < 5) {
            (uint8 gradient, uint8 colorBand) = _compositeGenes(tokenId, burnId);
            check.stored.colorBands[index] = colorBand;
            check.stored.gradients[index] = gradient;
        }

        // Simulate composite in memory data
        check.composite = !check.isRoot && index < 7 ? check.stored.composites[index] : 0;
        check.colorBand = ChecksArt.colorBandIndex(check, nextDivisor);
        check.gradient = ChecksArt.gradientIndex(check, nextDivisor);
    }

    /// @notice Render the SVG for a simulated composite.
    /// @param tokenId The token to render.
    /// @param burnId The token to composite.
    function simulateCompositeSVG(uint256 tokenId, uint256 burnId) external view returns (string memory) {
        return string(ChecksArt.generateSVG(simulateComposite(tokenId, burnId), checks));
    }

    /// @notice Get the colors of all checks in a given token.
    /// @param tokenId The token ID to get colors for.
    /// @dev Consider using the ChecksArt and EightyColors Libraries
    ///      in combination with the getCheck function to resolve this yourself.
    function colors(uint256 tokenId) external view returns (string[] memory, uint256[] memory)
    {
        return ChecksArt.colors(ChecksArt.getCheck(tokenId, checks), checks);
    }

    /// @notice Render the SVG for a given token.
    /// @param tokenId The token to render.
    /// @dev Consider using the ChecksArt Library directly.
    function svg(uint256 tokenId) external view returns (string memory) {
        return string(ChecksArt.generateSVG(ChecksArt.getCheck(tokenId, checks), checks));
    }

    /// @notice Get the metadata for a given token.
    /// @param tokenId The token to render.
    /// @dev Consider using the ChecksMetadata Library directly.
    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        _requireMinted(tokenId);

        return ChecksMetadata.tokenURI(tokenId, checks);
    }

    /// @notice Returns how many tokens this contract manages.
    function totalSupply() public view returns (uint256) {
        return checks.minted - checks.burned;
    }

    /// @dev Sacrifice one token to transfer its art to another.
    /// @param tokenId The token ID to keep.
    /// @param burnId The token ID to burn.
    function _sacrifice(uint256 tokenId, uint256 burnId) internal {
        (,StoredCheck storage toBurn,) = _tokenOperation(tokenId, burnId);

        // Copy over static genome settings
        checks.all[tokenId] = toBurn;

        // Update the birth date for this token.
        checks.all[tokenId].day = Utilities.day(checks.day0, block.timestamp);

        // Perform the burn.
        _burn(burnId);

        // Notify DAPPs about the Sacrifice.
        emit Sacrifice(burnId, tokenId);
        emit MetadataUpdate(tokenId);
    }

    /// @dev Composite one token into to another and burn it.
    /// @param tokenId The token ID to keep. Its art and check-count will change.
    /// @param burnId The token ID to burn in the process.
    function _composite(uint256 tokenId, uint256 burnId) internal {
        (
            StoredCheck storage toKeep,,
            uint8 divisorIndex
        ) = _tokenOperation(tokenId, burnId);

        uint8 nextDivisor = divisorIndex + 1;

        // We only need to breed band + gradient up until 4-Checks.
        if (divisorIndex < 5) {
            (uint8 gradient, uint8 colorBand) = _compositeGenes(tokenId, burnId);

            toKeep.colorBands[divisorIndex] = colorBand;
            toKeep.gradients[divisorIndex] = gradient;
        }

        // Composite our check
        toKeep.day = Utilities.day(checks.day0, block.timestamp);
        toKeep.composites[divisorIndex] = uint16(burnId);
        toKeep.divisorIndex = nextDivisor;

        // Perform the burn.
        _burn(burnId);

        // Notify DAPPs about the Composite.
        emit Composite(tokenId, burnId, ChecksArt.DIVISORS()[toKeep.divisorIndex]);
        emit MetadataUpdate(tokenId);
    }

    /// @dev Composite the gradient and colorBand settings.
    /// @param tokenId The token ID to keep.
    /// @param burnId The token ID to burn.
    function _compositeGenes (uint256 tokenId, uint256 burnId) internal view
        returns (uint8 gradient, uint8 colorBand)
    {
        Check memory keeper = ChecksArt.getCheck(tokenId, checks);
        Check memory burner = ChecksArt.getCheck(burnId, checks);

        // Pseudorandom gene manipulation.
        uint256 randomizer = uint256(keccak256(abi.encodePacked(keeper.seed, burner.seed)));

        // If at least one token has a gradient, we force it in ~20% of cases.
        gradient = Utilities.random(randomizer, 100) > 80
            ? randomizer % 2 == 0
                ? Utilities.minGt0(keeper.gradient, burner.gradient)
                : Utilities.max(keeper.gradient, burner.gradient)
            : Utilities.min(keeper.gradient, burner.gradient);

        // We breed the lower end average color band when breeding.
        colorBand = Utilities.avg(keeper.colorBand, burner.colorBand);
    }

    /// @dev Make sure this is a valid request to composite/switch with multiple tokens.
    /// @param tokenIds The token IDs to keep.
    /// @param burnIds The token IDs to burn.
    function _multiTokenOperation(uint256[] calldata tokenIds, uint256[] calldata burnIds)
        internal pure returns (uint256 pairs)
    {
        pairs = tokenIds.length;
        if (pairs != burnIds.length) {
            revert InvalidTokenCount();
        }
    }

    /// @dev Make sure this is a valid request to composite/switch a token pair.
    /// @param tokenId The token ID to keep.
    /// @param burnId The token ID to burn.
    function _tokenOperation(uint256 tokenId, uint256 burnId)
        internal view returns (
            StoredCheck storage toKeep,
            StoredCheck storage toBurn,
            uint8 divisorIndex
        )
    {
        toKeep = checks.all[tokenId];
        toBurn = checks.all[burnId];
        divisorIndex = toKeep.divisorIndex;

        if (
            ! _isApprovedOrOwner(msg.sender, tokenId) ||
            ! _isApprovedOrOwner(msg.sender, burnId) ||
            divisorIndex != toBurn.divisorIndex ||
            tokenId == burnId ||
            divisorIndex > 5
        ) {
            revert NotAllowed();
        }
    }
}

File 2 of 19 : 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 3 of 19 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 4 of 19 : 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 5 of 19 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

/**
 * @dev Provides a set of functions to operate with Base64 strings.
 *
 * _Available since v4.5._
 */
library Base64 {
    /**
     * @dev Base64 Encoding/Decoding Table
     */
    string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

    /**
     * @dev Converts a `bytes` to its Bytes64 `string` representation.
     */
    function encode(bytes memory data) internal pure returns (string memory) {
        /**
         * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence
         * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol
         */
        if (data.length == 0) return "";

        // Loads the table into memory
        string memory table = _TABLE;

        // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter
        // and split into 4 numbers of 6 bits.
        // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up
        // - `data.length + 2`  -> Round up
        // - `/ 3`              -> Number of 3-bytes chunks
        // - `4 *`              -> 4 characters for each chunk
        string memory result = new string(4 * ((data.length + 2) / 3));

        /// @solidity memory-safe-assembly
        assembly {
            // Prepare the lookup table (skip the first "length" byte)
            let tablePtr := add(table, 1)

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

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

            } {
                // Advance 3 bytes
                dataPtr := add(dataPtr, 3)
                let input := mload(dataPtr)

                // To write each character, shift the 3 bytes (18 bits) chunk
                // 4 times in blocks of 6 bits for each character (18, 12, 6, 0)
                // and apply logical AND with 0x3F which is the number of
                // the previous character in the ASCII table prior to the Base64 Table
                // The result is then added to the table to get the character to write,
                // and finally write it in the result pointer but with a left shift
                // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits

                mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance
            }

            // When data `bytes` is not exactly 3 bytes long
            // it is padded with `=` characters at the end
            switch mod(mload(data), 3)
            case 1 {
                mstore8(sub(resultPtr, 1), 0x3d)
                mstore8(sub(resultPtr, 2), 0x3d)
            }
            case 2 {
                mstore8(sub(resultPtr, 1), 0x3d)
            }
        }

        return result;
    }
}

File 7 of 19 : 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 8 of 19 : 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 9 of 19 : 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 10 of 19 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./math/Math.sol";

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

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

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

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

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

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

interface IChecks {

    struct StoredCheck {
        uint16[6] composites;  // The tokenIds that were composited into this one
        uint8[5] colorBands;  // The length of the used color band in percent
        uint8[5] gradients;  // Gradient settings for each generation
        uint8 divisorIndex; // Easy access to next / previous divisor
        uint32 epoch;      // Each check is revealed in an epoch
        uint16 seed;      // A unique identifyer to enable swapping
        uint24 day;      // The days since token was created
    }

    struct Check {
        StoredCheck stored;    // We carry over the check from storage
        bool isRevealed;      // Whether the check is revealed
        uint256 seed;        // The instantiated seed for pseudo-randomisation

        uint8 checksCount;    // How many checks this token has
        bool hasManyChecks;  // Whether the check has many checks
        uint16 composite;   // The parent tokenId that was composited into this one
        bool isRoot;       // Whether it has no parents (80 checks)

        uint8 colorBand;    // 100%, 50%, 25%, 12.5%, 6.25%, 5%, 1.25%
        uint8 gradient;    // Linearly through the colorBand [1, 2, 3]
        uint8 direction;  // Animation direction
        uint8 speed;     // Animation speed
    }

    struct Epoch {
        uint128 randomness;    // The source of randomness for tokens from this epoch
        uint64 revealBlock;   // The block at which this epoch was / is revealed
        bool committed;      // Whether the epoch has been instantiated
        bool revealed;      // Whether the epoch has been revealed
    }

    struct Checks {
        mapping(uint256 => StoredCheck) all; // All checks
        uint32 minted;  // The number of checks editions that have been migrated
        uint32 burned;  // The number of tokens that have been burned
        uint32 day0;    // Marks the start of this journey

        mapping(uint256 => Epoch) epochs; // All epochs
        uint256 epoch;  // The current epoch index
    }

    event Sacrifice(
        uint256 indexed burnedId,
        uint256 indexed tokenId
    );

    event Composite(
        uint256 indexed tokenId,
        uint256 indexed burnedId,
        uint8 indexed checks
    );

    event Infinity(
        uint256 indexed tokenId,
        uint256[] indexed burnedIds
    );

    event NewEpoch(
        uint256 indexed epoch,
        uint64 indexed revealBlock
    );

    error NotAllowed();
    error InvalidTokenCount();
    error BlackCheck__InvalidCheck();

}

File 13 of 19 : IChecksEdition.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

interface IChecksEdition {
    /// @dev Burns `tokenId`. See {ERC721-_burn}.
    function burn(uint256 tokenId) external;

    /// @dev Returns the owner of the `tokenId` token.
    function ownerOf(uint256 tokenId) external view returns (address owner);

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

    /// @dev Returns the approved operator of a specific token.
    function getApproved(uint256 tokenId) external view returns (address operator);

    /// @dev Error when burning unapproved tokens.
    error TransferCallerNotOwnerNorApproved();
}

File 14 of 19 : IERC4906.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/CHECKS721.sol)

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/// @title EIP-721 Metadata Update Extension
interface IERC4906 is IERC165, IERC721 {
    /// @dev This event emits when the metadata of a token is changed.
    /// Third-party platforms such as NFT marketplaces can listen to
    /// the event and auto-update the tokens in their apps.
    event MetadataUpdate(uint256 _tokenId);
}

File 15 of 19 : ChecksArt.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "./EightyColors.sol";
import "../interfaces/IChecks.sol";
import "./Utilities.sol";

/**

 /////////   VV CHECKS   /////////
 //                             //
 //                             //
 //                             //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //                             //
 //                             //
 //                             //
 /////   DONT TRUST, CHECK   /////

@title  ChecksArt
@author VisualizeValue
@notice Renders the Checks visuals.
*/
library ChecksArt {

    /// @dev The path for a 20x20 px check based on a 36x36 px frame.
    string public constant CHECKS_PATH = 'M21.36 9.886A3.933 3.933 0 0 0 18 8c-1.423 0-2.67.755-3.36 1.887a3.935 3.935 0 0 0-4.753 4.753A3.933 3.933 0 0 0 8 18c0 1.423.755 2.669 1.886 3.36a3.935 3.935 0 0 0 4.753 4.753 3.933 3.933 0 0 0 4.863 1.59 3.953 3.953 0 0 0 1.858-1.589 3.935 3.935 0 0 0 4.753-4.754A3.933 3.933 0 0 0 28 18a3.933 3.933 0 0 0-1.887-3.36 3.934 3.934 0 0 0-1.042-3.711 3.934 3.934 0 0 0-3.71-1.043Zm-3.958 11.713 4.562-6.844c.566-.846-.751-1.724-1.316-.878l-4.026 6.043-1.371-1.368c-.717-.722-1.836.396-1.116 1.116l2.17 2.15a.788.788 0 0 0 1.097-.22Z';

    /// @dev The semiperfect divisors of the 80 checks.
    function DIVISORS() public pure returns (uint8[8] memory) {
        return [ 80, 40, 20, 10, 5, 4, 1, 0 ];
    }

    /// @dev The different color band sizes that we use for the art.
    function COLOR_BANDS() public pure returns (uint8[7] memory) {
        return [ 80, 60, 40, 20, 10, 5, 1 ];
    }

    /// @dev The gradient increment steps.
    function GRADIENTS() public pure returns (uint8[7] memory) {
        return [ 0, 1, 2, 5, 8, 9, 10 ];
    }

    /// @dev Load a check from storage and fill its current state settings.
    /// @param tokenId The id of the check to fetch.
    /// @param checks The DB containing all checks.
    function getCheck(
        uint256 tokenId, IChecks.Checks storage checks
    ) public view returns (IChecks.Check memory check) {
        IChecks.StoredCheck memory stored = checks.all[tokenId];

        return getCheck(tokenId, stored.divisorIndex, checks);
    }

    /// @dev Load a check from storage and fill its current state settings.
    /// @param tokenId The id of the check to fetch.
    /// @param divisorIndex The divisorindex to get.
    /// @param checks The DB containing all checks.
    function getCheck(
        uint256 tokenId, uint8 divisorIndex, IChecks.Checks storage checks
    ) public view returns (IChecks.Check memory check) {
        IChecks.StoredCheck memory stored = checks.all[tokenId];
        stored.divisorIndex = divisorIndex; // Override in case we're fetching specific state.
        check.stored = stored;

        // Set up the source of randomness + seed for this Check.
        uint128 randomness = checks.epochs[stored.epoch].randomness;
        check.seed = (uint256(keccak256(abi.encodePacked(randomness, stored.seed))) % type(uint128).max);

        // Helpers
        check.isRoot = divisorIndex == 0;
        check.isRevealed = randomness > 0;
        check.hasManyChecks = divisorIndex < 6;
        check.composite = !check.isRoot && divisorIndex < 7 ? stored.composites[divisorIndex - 1] : 0;

        // Token properties
        check.colorBand = colorBandIndex(check, divisorIndex);
        check.gradient = gradientIndex(check, divisorIndex);
        check.checksCount = DIVISORS()[divisorIndex];
        check.speed = uint8(2**(check.seed % 3));
        check.direction = uint8(check.seed % 2);
    }

    /// @dev Query the gradient of a given check at a certain check count.
    /// @param check The check we want to get the gradient for.
    /// @param divisorIndex The check divisor in question.
    function gradientIndex(IChecks.Check memory check, uint8 divisorIndex) public pure returns (uint8) {
        uint256 n = Utilities.random(check.seed, 'gradient', 100);

        return divisorIndex == 0
            ? n < 20 ? uint8(1 + (n % 6)) : 0
            : divisorIndex < 6
                ? check.stored.gradients[divisorIndex - 1]
                : 0;
    }

    /// @dev Query the color band of a given check at a certain check count.
    /// @param check The check we want to get the color band for.
    /// @param divisorIndex The check divisor in question.
    function colorBandIndex(IChecks.Check memory check, uint8 divisorIndex) public pure returns (uint8) {
        uint256 n = Utilities.random(check.seed, 'band', 120);

        return divisorIndex == 0
            ?   ( n > 80 ? 0
                : n > 40 ? 1
                : n > 20 ? 2
                : n > 10 ? 3
                : n >  4 ? 4
                : n >  1 ? 5
                : 6 )
            : divisorIndex < 6
                ? check.stored.colorBands[divisorIndex - 1]
                : 6;
    }

    /// @dev Generate indexes for the color slots of check parents (up to the EightyColors.COLORS themselves).
    /// @param divisorIndex The current divisorIndex to query.
    /// @param check The current check to investigate.
    /// @param checks The DB containing all checks.
    function colorIndexes(
        uint8 divisorIndex, IChecks.Check memory check, IChecks.Checks storage checks
    )
        public view returns (uint256[] memory)
    {
        uint8[8] memory divisors = DIVISORS();
        uint256 checksCount = divisors[divisorIndex];
        uint256 seed = check.seed;
        uint8 colorBand = COLOR_BANDS()[colorBandIndex(check, divisorIndex)];
        uint8 gradient = GRADIENTS()[gradientIndex(check, divisorIndex)];

        // If we're a composited check, we choose colors only based on
        // the slots available in our parents. Otherwise,
        // we choose based on our available spectrum.
        uint256 possibleColorChoices = divisorIndex > 0
            ? divisors[divisorIndex - 1] * 2
            : 80;

        // We initialize our index and select the first color
        uint256[] memory indexes = new uint256[](checksCount);
        indexes[0] = Utilities.random(seed, possibleColorChoices);

        // If we have more than one check, continue selecting colors
        if (check.hasManyChecks) {
            if (gradient > 0) {
                // If we're a gradient check, we select based on the color band looping around
                // the 80 possible colors
                for (uint256 i = 1; i < checksCount;) {
                    indexes[i] = (indexes[0] + (i * gradient * colorBand / checksCount) % colorBand) % 80;
                    unchecked { ++i; }
                }
            } else if (divisorIndex == 0) {
                // If we select initial non gradient colors, we just take random ones
                // available in our color band
                for (uint256 i = 1; i < checksCount;) {
                    indexes[i] = (indexes[0] + Utilities.random(seed + i, colorBand)) % 80;
                    unchecked { ++i; }
                }
            } else {
                // If we have parent checks, we select our colors from their set
                for (uint256 i = 1; i < checksCount;) {
                    indexes[i] = Utilities.random(seed + i, possibleColorChoices);
                    unchecked { ++i; }
                }
            }
        }

        // We resolve our color indexes through our parent tree until we reach the root checks
        if (divisorIndex > 0) {
            uint8 previousDivisor = divisorIndex - 1;

            // We already have our current check, but need the our parent state color indices
            uint256[] memory parentIndexes = colorIndexes(previousDivisor, check, checks);

            // We also need to fetch the colors of the check that was composited into us
            IChecks.Check memory composited = getCheck(check.composite, checks);
            uint256[] memory compositedIndexes = colorIndexes(previousDivisor, composited, checks);

            // Replace random indices with parent / root color indices
            uint8 count = divisors[previousDivisor];

            // We always select the first color from our parent
            uint256 initialBranchIndex = indexes[0] % count;
            indexes[0] = indexes[0] < count
                ? parentIndexes[initialBranchIndex]
                : compositedIndexes[initialBranchIndex];

            // If we don't have a gradient, we continue resolving from our parent for the remaining checks
            if (gradient == 0) {
                for (uint256 i; i < checksCount;) {
                    uint256 branchIndex = indexes[i] % count;
                    indexes[i] = indexes[i] < count
                        ? parentIndexes[branchIndex]
                        : compositedIndexes[branchIndex];

                    unchecked { ++i; }
                }
            // If we have a gradient we base the remaining colors off our initial selection
            } else {
                for (uint256 i = 1; i < checksCount;) {
                    indexes[i] = (indexes[0] + (i * gradient * colorBand / checksCount) % colorBand) % 80;

                    unchecked { ++i; }
                }
            }
        }

        return indexes;
    }

    /// @dev Fetch all colors of a given Check.
    /// @param check The check to get colors for.
    /// @param checks The DB containing all checks.
    function colors(
        IChecks.Check memory check, IChecks.Checks storage checks
    ) public view returns (string[] memory, uint256[] memory) {
        // A fully composited check has no color.
        if (check.stored.divisorIndex == 7) {
            string[] memory zeroColors = new string[](1);
            uint256[] memory zeroIndexes = new uint256[](1);
            zeroColors[0] = '000';
            zeroIndexes[0] = 999;
            return (zeroColors, zeroIndexes);
        }

        // An unrevealed check is all gray.
        if (! check.isRevealed) {
            string[] memory preRevealColors = new string[](1);
            uint256[] memory preRevealIndexes = new uint256[](1);
            preRevealColors[0] = '424242';
            preRevealIndexes[0] = 0;
            return (preRevealColors, preRevealIndexes);
        }

        // Fetch the indices on the original color mapping.
        uint256[] memory indexes = colorIndexes(check.stored.divisorIndex, check, checks);

        // Map over to get the colors.
        string[] memory checkColors = new string[](indexes.length);
        string[80] memory allColors = EightyColors.COLORS();

        // Always set the first color.
        checkColors[0] = allColors[indexes[0]];

        // Resolve each additional check color via their index in EightyColors.COLORS.
        for (uint256 i = 1; i < indexes.length; i++) {
            checkColors[i] = allColors[indexes[i]];
        }

        return (checkColors, indexes);
    }

    /// @dev Get the number of checks we should display per row.
    /// @param checks The number of checks in the piece.
    function perRow(uint8 checks) public pure returns (uint8) {
        return checks == 80
            ? 8
            : checks >= 20
                ? 4
                : checks == 10 || checks == 4
                    ? 2
                    : 1;
    }

    /// @dev Get the X-offset for positioning checks horizontally.
    /// @param checks The number of checks in the piece.
    function rowX(uint8 checks) public pure returns (uint16) {
        return checks <= 1
            ? 286
            : checks == 5
                ? 304
                : checks == 10 || checks == 4
                    ? 268
                    : 196;
    }

    /// @dev Get the Y-offset for positioning checks vertically.
    /// @param checks The number of checks in the piece.
    function rowY(uint8 checks) public pure returns (uint16) {
        return checks > 4
            ? 160
            : checks == 4
                ? 268
                : checks > 1
                    ? 304
                    : 286;
    }

    /// @dev Get the animation SVG snipped for an individual check of a piece.
    /// @param data The data object containing rendering settings.
    /// @param offset The index position of the check in question.
    /// @param allColors All available colors.
    function fillAnimation(
        CheckRenderData memory data,
        uint256 offset,
        string[80] memory allColors
    ) public pure returns (bytes memory)
    {
        // We only pick 20 colors from our gradient to reduce execution time.
        uint8 count = 20;

        bytes memory values;

        // Reverse loop through our color gradient.
        if (data.check.direction == 0) {
            for (uint256 i = offset + 80; i > offset;) {
                values = abi.encodePacked(values, '#', allColors[i % 80], ';');
                unchecked { i-=4; }
            }
        // Forward loop through our color gradient.
        } else {
            for (uint256 i = offset; i < offset + 80;) {
                values = abi.encodePacked(values, '#', allColors[i % 80], ';');
                unchecked { i+=4; }
            }
        }

        // Add initial color as last one for smooth animations.
        values = abi.encodePacked(values, '#', allColors[offset]);

        // Render the SVG snipped for the animation
        return abi.encodePacked(
            '<animate ',
                'attributeName="fill" values="',values,'" ',
                'dur="',Utilities.uint2str(count * 2 / data.check.speed),'s" begin="animation.begin" ',
                'repeatCount="indefinite" ',
            '/>'
        );
    }

    /// @dev Generate the SVG code for all checks in a given token.
    /// @param data The data object containing rendering settings.
    function generateChecks(CheckRenderData memory data) public pure returns (bytes memory) {
        bytes memory checksBytes;
        string[80] memory allColors = EightyColors.COLORS();

        uint8 checksCount = data.count;
        for (uint8 i; i < checksCount; i++) {
            // Compute row settings.
            data.indexInRow = i % data.perRow;
            data.isNewRow = data.indexInRow == 0 && i > 0;

            // Compute offsets.
            if (data.isNewRow) data.rowY += data.spaceY;
            if (data.isNewRow && data.indent) {
                if (i == 0) {
                    data.rowX += data.spaceX / 2;
                }

                if (i % (data.perRow * 2) == 0) {
                    data.rowX -= data.spaceX / 2;
                } else {
                    data.rowX += data.spaceX / 2;
                }
            }
            string memory translateX = Utilities.uint2str(data.rowX + data.indexInRow * data.spaceX);
            string memory translateY = Utilities.uint2str(data.rowY);
            string memory color = data.check.isRevealed ? data.colors[i] : data.colors[0];

            // Render the current check.
            checksBytes = abi.encodePacked(checksBytes, abi.encodePacked(
                '<g transform="translate(', translateX, ', ', translateY, ') scale(', data.scale, ')">',
                    '<use href="#check" fill="#', color, '">',
                        (data.check.isRevealed && !data.isBlack)
                            ? fillAnimation(data, data.colorIndexes[i], allColors)
                            : bytes(''),
                    '</use>'
                '</g>'
            ));
        }

        return checksBytes;
    }

    /// @dev Collect relevant rendering data for easy access across functions.
    /// @param check Our current check loaded from storage.
    /// @param checks The DB containing all checks.
    function collectRenderData(
        IChecks.Check memory check, IChecks.Checks storage checks
    ) public view returns (CheckRenderData memory data) {
        // Carry through base settings.
        data.check = check;
        data.isBlack = check.stored.divisorIndex == 7;
        data.count = data.isBlack ? 1 : DIVISORS()[check.stored.divisorIndex];

        // Compute colors and indexes.
        (string[] memory colors_, uint256[] memory colorIndexes_) = colors(check, checks);
        data.gridColor = data.isBlack ? '#F2F2F2' : '#191919';
        data.canvasColor = data.isBlack ? '#FFF' : '#111';
        data.colorIndexes = colorIndexes_;
        data.colors = colors_;

        // Compute positioning data.
        data.scale = data.count > 20 ? '1' : data.count > 1 ? '2' : '3';
        data.spaceX = data.count == 80 ? 36 : 72;
        data.spaceY = data.count > 20 ? 36 : 72;
        data.perRow = perRow(data.count);
        data.indent = data.count == 40;
        data.rowX = rowX(data.count);
        data.rowY = rowY(data.count);
    }

    /// @dev Generate the SVG code for rows in the 8x10 Checks grid.
    function generateGridRow() public pure returns (bytes memory) {
        bytes memory row;
        for (uint256 i; i < 8; i++) {
            row = abi.encodePacked(
                row,
                '<use href="#square" x="', Utilities.uint2str(196 + i*36), '" y="160"/>'
            );
        }
        return row;
    }

    /// @dev Generate the SVG code for the entire 8x10 Checks grid.
    function generateGrid() public pure returns (bytes memory) {
        bytes memory grid;
        for (uint256 i; i < 10; i++) {
            grid = abi.encodePacked(
                grid,
                '<use href="#row" y="', Utilities.uint2str(i*36), '"/>'
            );
        }

        return abi.encodePacked('<g id="grid" x="196" y="160">', grid, '</g>');
    }

    /// @dev Generate the complete SVG code for a given Check.
    /// @param check The check to render.
    /// @param checks The DB containing all checks.
    function generateSVG(
        IChecks.Check memory check, IChecks.Checks storage checks
    ) public view returns (bytes memory) {
        CheckRenderData memory data = collectRenderData(check, checks);

        return abi.encodePacked(
            '<svg ',
                'viewBox="0 0 680 680" ',
                'fill="none" xmlns="http://www.w3.org/2000/svg" ',
                'style="width:100%;background:black;"',
            '>',
                '<defs>',
                    '<path id="check" fill-rule="evenodd" d="', CHECKS_PATH, '"></path>',
                    '<rect id="square" width="36" height="36" stroke="', data.gridColor, '"></rect>',
                    '<g id="row">', generateGridRow(), '</g>'
                '</defs>',
                '<rect width="680" height="680" fill="black"/>',
                '<rect x="188" y="152" width="304" height="376" fill="', data.canvasColor, '"/>',
                generateGrid(),
                generateChecks(data),
                '<rect width="680" height="680" fill="transparent">',
                    '<animate ',
                        'attributeName="width" ',
                        'from="680" ',
                        'to="0" ',
                        'dur="0.2s" ',
                        'begin="click" ',
                        'fill="freeze" ',
                        'id="animation"',
                    '/>',
                '</rect>',
            '</svg>'
        );
    }
}

/// @dev Bag holding all data relevant for rendering.
struct CheckRenderData {
    IChecks.Check check;
    uint256[] colorIndexes;
    string[] colors;
    string canvasColor;
    string gridColor;
    string duration;
    string scale;
    uint32 seed;
    uint16 rowX;
    uint16 rowY;
    uint8 count;
    uint8 spaceX;
    uint8 spaceY;
    uint8 perRow;
    uint8 indexInRow;
    uint8 isIndented;
    bool isNewRow;
    bool isBlack;
    bool indent;
}

File 16 of 19 : ChecksMetadata.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/utils/Base64.sol";

import "./ChecksArt.sol";
import "../interfaces/IChecks.sol";
import "./Utilities.sol";

/**

✓✓✓✓✓✓✓  ✓✓✓✓✓✓✓✓    ✓✓✓✓✓✓    ✓✓✓✓✓✓✓✓   ✓✓✓✓✓✓✓     ✓✓
✓✓       ✓✓     ✓✓  ✓✓    ✓✓   ✓✓    ✓✓  ✓✓     ✓✓  ✓✓✓✓
✓✓       ✓✓     ✓✓  ✓✓             ✓✓           ✓✓    ✓✓
✓✓✓✓✓✓   ✓✓✓✓✓✓✓✓   ✓✓            ✓✓      ✓✓✓✓✓✓✓     ✓✓
✓✓       ✓✓   ✓✓    ✓✓           ✓✓      ✓✓           ✓✓
✓✓       ✓✓    ✓✓   ✓✓    ✓✓     ✓✓      ✓✓           ✓✓
✓✓✓✓✓✓✓  ✓✓     ✓✓   ✓✓✓✓✓✓      ✓✓      ✓✓✓✓✓✓✓✓✓   ✓✓✓✓

@title  ChecksMetadata
@author VisualizeValue
@notice Renders ERC721 compatible metadata for Checks.
*/
library ChecksMetadata {

    /// @dev Render the JSON Metadata for a given Checks token.
    /// @param tokenId The id of the token to render.
    /// @param checks The DB containing all checks.
    function tokenURI(
        uint256 tokenId, IChecks.Checks storage checks
    ) public view returns (string memory) {
        IChecks.Check memory check = ChecksArt.getCheck(tokenId, checks);

        bytes memory svg = ChecksArt.generateSVG(check, checks);

        bytes memory metadata = abi.encodePacked(
            '{',
                '"name": "Checks ', Utilities.uint2str(tokenId), '",',
                '"description": "This artwork may or may not be notable.",',
                '"image": ',
                    '"data:image/svg+xml;base64,',
                    Base64.encode(svg),
                    '",',
                '"animation_url": ',
                    '"data:text/html;base64,',
                    Base64.encode(generateHTML(tokenId, svg)),
                    '",',
                '"attributes": [', attributes(check), ']',
            '}'
        );

        return string(
            abi.encodePacked(
                "data:application/json;base64,",
                Base64.encode(metadata)
            )
        );
    }

    /// @dev Render the JSON atributes for a given Checks token.
    /// @param check The check to render.
    function attributes(IChecks.Check memory check) public pure returns (bytes memory) {
        bool showVisualAttributes = check.isRevealed && check.hasManyChecks;
        bool showAnimationAttributes = check.isRevealed && check.checksCount > 0;

        return abi.encodePacked(
            showVisualAttributes
                ? trait('Color Band', colorBand(ChecksArt.colorBandIndex(check, check.stored.divisorIndex)), ',')
                : '',
            showVisualAttributes
                ? trait('Gradient', gradients(ChecksArt.gradientIndex(check, check.stored.divisorIndex)), ',')
                : '',
            showAnimationAttributes
                ? trait('Speed', check.speed == 4 ? '2x' : check.speed == 2 ? '1x' : '0.5x', ',')
                : '',
            showAnimationAttributes
                ? trait('Shift', check.direction == 0 ? 'IR' : 'UV', ',')
                : '',
            check.isRevealed == false
                ? trait('Revealed', 'No', ',')
                : '',
            trait('Checks', Utilities.uint2str(check.checksCount), ','),
            trait('Day', Utilities.uint2str(check.stored.day), '')
        );
    }

    /// @dev Get the names for different gradients. Compare ChecksArt.GRADIENTS.
    /// @param gradientIndex The index of the gradient.
    function gradients(uint8 gradientIndex) public pure returns (string memory) {
        return [
            'None', 'Linear', 'Double Linear', 'Reflected', 'Double Angled', 'Angled', 'Linear Z'
        ][gradientIndex];
    }

    /// @dev Get the percentage values for different color bands. Compare ChecksArt.COLOR_BANDS.
    /// @param bandIndex The index of the color band.
    function colorBand(uint8 bandIndex) public pure returns (string memory) {
        return [
            'Eighty', 'Sixty', 'Forty', 'Twenty', 'Ten', 'Five', 'One'
        ][bandIndex];
    }

    /// @dev Generate the SVG snipped for a single attribute.
    /// @param traitType The `trait_type` for this trait.
    /// @param traitValue The `value` for this trait.
    /// @param append Helper to append a comma.
    function trait(
        string memory traitType, string memory traitValue, string memory append
    ) public pure returns (string memory) {
        return string(abi.encodePacked(
            '{',
                '"trait_type": "', traitType, '",'
                '"value": "', traitValue, '"'
            '}',
            append
        ));
    }

    /// @dev Generate the HTML for the animation_url in the metadata.
    /// @param tokenId The id of the token to generate the embed for.
    /// @param svg The rendered SVG code to embed in the HTML.
    function generateHTML(uint256 tokenId, bytes memory svg) public pure returns (bytes memory) {
        return abi.encodePacked(
            '<!DOCTYPE html>',
            '<html lang="en">',
            '<head>',
                '<meta charset="UTF-8">',
                '<meta http-equiv="X-UA-Compatible" content="IE=edge">',
                '<meta name="viewport" content="width=device-width, initial-scale=1.0">',
                '<title>Check #', Utilities.uint2str(tokenId), '</title>',
                '<style>',
                    'html,',
                    'body {',
                        'margin: 0;',
                        'background: #EFEFEF;',
                        'overflow: hidden;',
                    '}',
                    'svg {',
                        'max-width: 100vw;',
                        'max-height: 100vh;',
                    '}',
                '</style>',
            '</head>',
            '<body>',
                svg,
            '</body>',
            '</html>'
        );
    }

}

File 17 of 19 : EightyColors.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/**

 /////////////////////////////////
 //                             //
 //                             //
 //                             //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //       ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓       //
 //                             //
 //                             //
 //                             //
 /////////////////////////////////

@title  EightyColors
@author VisualizeValue
@notice The eighty colors of Checks.
*/
library EightyColors {

    /// @dev Theese are sorted in a gradient.
    function COLORS() public pure returns (string[80] memory) {
        return [
            'E84AA9',
            'F2399D',
            'DB2F96',
            'E73E85',
            'FF7F8E',
            'FA5B67',
            'E8424E',
            'D5332F',
            'C23532',
            'F2281C',
            'D41515',
            '9D262F',
            'DE3237',
            'DA3321',
            'EA3A2D',
            'EB4429',
            'EC7368',
            'FF8079',
            'FF9193',
            'EA5B33',
            'D05C35',
            'ED7C30',
            'EF9933',
            'EF8C37',
            'F18930',
            'F09837',
            'F9A45C',
            'F2A43A',
            'F2A840',
            'F2A93C',
            'FFB340',
            'F2B341',
            'FAD064',
            'F7CA57',
            'F6CB45',
            'FFAB00',
            'F4C44A',
            'FCDE5B',
            'F9DA4D',
            'F9DA4A',
            'FAE272',
            'F9DB49',
            'FAE663',
            'FBEA5B',
            'A7CA45',
            'B5F13B',
            '94E337',
            '63C23C',
            '86E48E',
            '77E39F',
            '5FCD8C',
            '83F1AE',
            '9DEFBF',
            '2E9D9A',
            '3EB8A1',
            '5FC9BF',
            '77D3DE',
            '6AD1DE',
            '5ABAD3',
            '4291A8',
            '33758D',
            '45B2D3',
            '81D1EC',
            'A7DDF9',
            '9AD9FB',
            'A4C8EE',
            '60B1F4',
            '2480BD',
            '4576D0',
            '3263D0',
            '2E4985',
            '25438C',
            '525EAA',
            '3D43B3',
            '322F92',
            '4A2387',
            '371471',
            '3B088C',
            '6C31D7',
            '9741DA'
        ];
    }

}

File 18 of 19 : Utilities.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

library Utilities {
    /// @dev Zero-index based pseudorandom number based on one input and max bound
    function random(uint256 input, uint256 _max) internal pure returns (uint256) {
        return (uint256(keccak256(abi.encodePacked(input))) % _max);
    }

    /// @dev Zero-index based salted pseudorandom number based on two inputs and max bound
    function random(uint256 input, string memory salt, uint256 _max) internal pure returns (uint256) {
        return (uint256(keccak256(abi.encodePacked(input, salt))) % _max);
    }

    /// @dev Convert an integer to a string
    function uint2str(uint256 _i) internal pure returns (string memory _uintAsString) {
        if (_i == 0) {
            return "0";
        }
        uint256 j = _i;
        uint256 len;
        while (j != 0) {
            ++len;
            j /= 10;
        }
        bytes memory bstr = new bytes(len);
        uint256 k = len;
        while (_i != 0) {
            k = k - 1;
            uint8 temp = (48 + uint8(_i - (_i / 10) * 10));
            bytes1 b1 = bytes1(temp);
            bstr[k] = b1;
            _i /= 10;
        }
        return string(bstr);
    }

    /// @dev Get the smallest non zero number
    function minGt0(uint8 one, uint8 two) internal pure returns (uint8) {
        return one > two
            ? two > 0
                ? two
                : one
            : one;
    }

    /// @dev Get the smaller number
    function min(uint8 one, uint8 two) internal pure returns (uint8) {
        return one < two ? one : two;
    }

    /// @dev Get the larger number
    function max(uint8 one, uint8 two) internal pure returns (uint8) {
        return one > two ? one : two;
    }

    /// @dev Get the average between two numbers
    function avg(uint8 one, uint8 two) internal pure returns (uint8 result) {
        unchecked {
            result = (one >> 1) + (two >> 1) + (one & two & 1);
        }
    }

    /// @dev Get the days since another date (input is seconds)
    function day(uint256 from, uint256 to) internal pure returns (uint24) {
        return uint24((to - from) / 24 hours + 1);
    }
}

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

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "../interfaces/IERC4906.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 CHECKS721 is Context, ERC165, IERC721, IERC721Metadata, IERC4906 {
    error ERC721__InvalidApproval();
    error ERC721__InvalidOwner();
    error ERC721__InvalidToken();
    error ERC721__NotAllowed();
    error ERC721__TokenExists();
    error ERC721__TransferToNonReceiver();
    error ERC721__TransferToZero();

    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() {
        _name = "Checks";
        _symbol = "CHECKS";
    }

    /**
     * @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) {
        if (owner == address(0)) {
            revert ERC721__InvalidOwner();
        }
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        if (owner == address(0)) {
            revert ERC721__InvalidToken();
        }
        return owner;
    }

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

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

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

        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = CHECKS721.ownerOf(tokenId);

        if (
            to == owner ||
            (
                _msgSender() != owner &&
                !isApprovedForAll(owner, _msgSender())
            )
        ) {
            revert ERC721__InvalidApproval();
        }

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        if (!_isApprovedOrOwner(_msgSender(), tokenId)) {
            revert ERC721__NotAllowed();
        }

        _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 {
        if (!_isApprovedOrOwner(_msgSender(), tokenId)) {
            revert ERC721__NotAllowed();
        }
        _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);
        if (!_checkOnERC721Received(from, to, tokenId, data)) {
            revert ERC721__TransferToNonReceiver();
        }
    }

    /**
     * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @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 _ownerOf(tokenId) != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        address owner = CHECKS721.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);
        if (!_checkOnERC721Received(address(0), to, tokenId, data)) {
            revert ERC721__TransferToNonReceiver();
        }
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to` after an inital transfer to `via`.
     *
     * 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 _safeMintVia(address to, address via, uint256 tokenId) internal virtual {
        _safeMintVia(to, via, 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 _safeMintVia(
        address to,
        address via,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _mintVia(to, via, tokenId);
        if (!_checkOnERC721Received(address(0), to, tokenId, data)) {
            revert ERC721__TransferToNonReceiver();
        }
    }

    /**
     * @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 {
        _mintState(to, tokenId);

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

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

    /**
     * @dev Mints `tokenId` and transfers it to `to` after a transfer to `via`
     *
     * 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 _mintVia(address to, address via, uint256 tokenId) internal virtual {
        _mintState(to, tokenId);

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

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

    /**
     * @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.
     */
    function _mintState(address to, uint256 tokenId) internal virtual {
        if (to == address(0)) {
            revert ERC721__TransferToZero();
        }
        if (_exists(tokenId)) {
            revert ERC721__TokenExists();
        }

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

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        if (_exists(tokenId)) {
            revert ERC721__TokenExists();
        }

        unchecked {
            // Will not overflow unless all 2**256 token ids are minted to the same owner.
            // Given that tokens are minted one by one, it is impossible in practice that
            // this ever happens. Might change if we allow batch minting.
            // The ERC fails to describe this case.
            _balances[to] += 1;
        }

        _owners[tokenId] = to;
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = CHECKS721.ownerOf(tokenId);

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

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = CHECKS721.ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        unchecked {
            // Cannot overflow, as that would require more tokens to be burned/transferred
            // out than the owner initially received through minting and transferring in.
            _balances[owner] -= 1;
        }
        delete _owners[tokenId];

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

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

    /**
     * @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 {
        if (CHECKS721.ownerOf(tokenId) != from) {
            revert ERC721__InvalidOwner();
        }
        if (to == address(0)) {
            revert ERC721__TransferToZero();
        }

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        if (CHECKS721.ownerOf(tokenId) != from) {
            revert ERC721__InvalidOwner();
        }

        // Clear approvals from the previous owner
        delete _tokenApprovals[tokenId];

        unchecked {
            // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
            // `from`'s balance is the number of token held, which is at least one before the current
            // transfer.
            // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
            // all 2**256 token ids to be minted, which in practice is impossible.
            _balances[from] -= 1;
            _balances[to] += 1;
        }
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId, 1);
    }

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

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        if (owner == operator) {
            revert ERC721__InvalidApproval();
        }
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        if (!_exists(tokenId)) {
            revert ERC721__InvalidToken();
        }
    }

    /**
     * @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__TransferToNonReceiver();
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
     * - When `from` is zero, the tokens will be minted for `to`.
     * - When `to` is zero, ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256, /* firstTokenId */
        uint256 batchSize
    ) internal virtual {
        if (batchSize > 1) {
            if (from != address(0)) {
                _balances[from] -= batchSize;
            }
            if (to != address(0)) {
                _balances[to] += batchSize;
            }
        }
    }

    /**
     * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
     * - When `from` is zero, the tokens were minted for `to`.
     * - When `to` is zero, ``from``'s tokens were burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual {}
}

Settings
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {
    "contracts/libraries/ChecksArt.sol": {
      "ChecksArt": "0x3bcbf1480879bff8435b1534c70b4a5182fb2466"
    },
    "contracts/libraries/ChecksMetadata.sol": {
      "ChecksMetadata": "0x4924c4f2b2514557488a78df410369094b719dac"
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BlackCheck__InvalidCheck","type":"error"},{"inputs":[],"name":"ERC721__InvalidApproval","type":"error"},{"inputs":[],"name":"ERC721__InvalidOwner","type":"error"},{"inputs":[],"name":"ERC721__InvalidToken","type":"error"},{"inputs":[],"name":"ERC721__NotAllowed","type":"error"},{"inputs":[],"name":"ERC721__TokenExists","type":"error"},{"inputs":[],"name":"ERC721__TransferToNonReceiver","type":"error"},{"inputs":[],"name":"ERC721__TransferToZero","type":"error"},{"inputs":[],"name":"InvalidTokenCount","type":"error"},{"inputs":[],"name":"NotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"burnedId","type":"uint256"},{"indexed":true,"internalType":"uint8","name":"checks","type":"uint8"}],"name":"Composite","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256[]","name":"burnedIds","type":"uint256[]"}],"name":"Infinity","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":true,"internalType":"uint64","name":"revealBlock","type":"uint64"}],"name":"NewEpoch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"burnedId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Sacrifice","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":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"colors","outputs":[{"internalType":"string[]","name":"","type":"string[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"burnId","type":"uint256"},{"internalType":"bool","name":"swap","type":"bool"}],"name":"composite","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"burnIds","type":"uint256[]"}],"name":"compositeMany","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"editionChecks","outputs":[{"internalType":"contract IChecksEdition","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getCheck","outputs":[{"components":[{"components":[{"internalType":"uint16[6]","name":"composites","type":"uint16[6]"},{"internalType":"uint8[5]","name":"colorBands","type":"uint8[5]"},{"internalType":"uint8[5]","name":"gradients","type":"uint8[5]"},{"internalType":"uint8","name":"divisorIndex","type":"uint8"},{"internalType":"uint32","name":"epoch","type":"uint32"},{"internalType":"uint16","name":"seed","type":"uint16"},{"internalType":"uint24","name":"day","type":"uint24"}],"internalType":"struct IChecks.StoredCheck","name":"stored","type":"tuple"},{"internalType":"bool","name":"isRevealed","type":"bool"},{"internalType":"uint256","name":"seed","type":"uint256"},{"internalType":"uint8","name":"checksCount","type":"uint8"},{"internalType":"bool","name":"hasManyChecks","type":"bool"},{"internalType":"uint16","name":"composite","type":"uint16"},{"internalType":"bool","name":"isRoot","type":"bool"},{"internalType":"uint8","name":"colorBand","type":"uint8"},{"internalType":"uint8","name":"gradient","type":"uint8"},{"internalType":"uint8","name":"direction","type":"uint8"},{"internalType":"uint8","name":"speed","type":"uint8"}],"internalType":"struct IChecks.Check","name":"check","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getEpochData","outputs":[{"components":[{"internalType":"uint128","name":"randomness","type":"uint128"},{"internalType":"uint64","name":"revealBlock","type":"uint64"},{"internalType":"bool","name":"committed","type":"bool"},{"internalType":"bool","name":"revealed","type":"bool"}],"internalType":"struct IChecks.Epoch","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"burnId","type":"uint256"}],"name":"inItForTheArt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"burnIds","type":"uint256[]"}],"name":"inItForTheArts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"infinity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address","name":"recipient","type":"address"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"resolveEpochIfNecessary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"burnId","type":"uint256"}],"name":"simulateComposite","outputs":[{"components":[{"components":[{"internalType":"uint16[6]","name":"composites","type":"uint16[6]"},{"internalType":"uint8[5]","name":"colorBands","type":"uint8[5]"},{"internalType":"uint8[5]","name":"gradients","type":"uint8[5]"},{"internalType":"uint8","name":"divisorIndex","type":"uint8"},{"internalType":"uint32","name":"epoch","type":"uint32"},{"internalType":"uint16","name":"seed","type":"uint16"},{"internalType":"uint24","name":"day","type":"uint24"}],"internalType":"struct IChecks.StoredCheck","name":"stored","type":"tuple"},{"internalType":"bool","name":"isRevealed","type":"bool"},{"internalType":"uint256","name":"seed","type":"uint256"},{"internalType":"uint8","name":"checksCount","type":"uint8"},{"internalType":"bool","name":"hasManyChecks","type":"bool"},{"internalType":"uint16","name":"composite","type":"uint16"},{"internalType":"bool","name":"isRoot","type":"bool"},{"internalType":"uint8","name":"colorBand","type":"uint8"},{"internalType":"uint8","name":"gradient","type":"uint8"},{"internalType":"uint8","name":"direction","type":"uint8"},{"internalType":"uint8","name":"speed","type":"uint8"}],"internalType":"struct IChecks.Check","name":"check","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"burnId","type":"uint256"}],"name":"simulateCompositeSVG","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"svg","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506040518060400160405280600681526020017f436865636b73000000000000000000000000000000000000000000000000000081525060009081620000589190620003a4565b506040518060400160405280600681526020017f434845434b530000000000000000000000000000000000000000000000000000815250600190816200009f9190620003a4565b507334eebee6942d8def3c125458d1a86e0a897fd6f9600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555042600760010160086101000a81548163ffffffff021916908363ffffffff16021790555060016007600301819055506200048b565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620001ac57607f821691505b602082108103620001c257620001c162000164565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026200022c7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620001ed565b620002388683620001ed565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620002856200027f620002798462000250565b6200025a565b62000250565b9050919050565b6000819050919050565b620002a18362000264565b620002b9620002b0826200028c565b848454620001fa565b825550505050565b600090565b620002d0620002c1565b620002dd81848462000296565b505050565b5b818110156200030557620002f9600082620002c6565b600181019050620002e3565b5050565b601f82111562000354576200031e81620001c8565b6200032984620001dd565b8101602085101562000339578190505b620003516200034885620001dd565b830182620002e2565b50505b505050565b600082821c905092915050565b6000620003796000198460080262000359565b1980831691505092915050565b600062000394838362000366565b9150826002028217905092915050565b620003af826200012a565b67ffffffffffffffff811115620003cb57620003ca62000135565b5b620003d7825462000193565b620003e482828562000309565b600060209050601f8311600181146200041c576000841562000407578287015190505b62000413858262000386565b86555062000483565b601f1984166200042c86620001c8565b60005b8281101562000456578489015182556001820191506020850194506020810190506200042f565b8683101562000476578489015162000472601f89168262000366565b8355505b6001600288020188555050505b505050505050565b615f9a806200049b6000396000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c80636352211e116101045780639db797f0116100a2578063c87b56dd11610071578063c87b56dd14610578578063e8b69127146105a8578063e985e9c5146105c4578063ec9da8af146105f4576101da565b80639db797f0146104df578063a22cb4651461050f578063b88d4fde1461052b578063bd11f69d14610547576101da565b8063859e7d32116100de578063859e7d32146104435780638e46d95a1461047357806395d89b41146104915780639b21151c146104af576101da565b80636352211e146103c557806370a08231146103f5578063757991a814610425576101da565b8063239ffa681161017c57806344b285db1161014b57806344b285db1461034157806350f11805146103715780635427c7911461038d5780635c5b69a9146103a9576101da565b8063239ffa68146102e357806323b872dd146102ed57806342842e0e1461030957806342966c6814610325576101da565b8063081812fc116101b8578063081812fc1461025d578063095ea7b31461028d57806318160ddd146102a957806321205226146102c7576101da565b806301ffc9a7146101df57806302a6429d1461020f57806306fdde031461023f575b600080fd5b6101f960048036038101906101f49190613f42565b610610565b6040516102069190613f8a565b60405180910390f35b61022960048036038101906102249190613fdb565b6106f2565b60405161023691906140ab565b60405180910390f35b610247610785565b60405161025491906140ab565b60405180910390f35b610277600480360381019061027291906140cd565b610817565b604051610284919061413b565b60405180910390f35b6102a760048036038101906102a29190614182565b61085d565b005b6102b1610937565b6040516102be91906141d1565b60405180910390f35b6102e160048036038101906102dc9190613fdb565b61097a565b005b6102eb6109c1565b005b610307600480360381019061030291906141ec565b610c19565b005b610323600480360381019061031e91906141ec565b610c70565b005b61033f600480360381019061033a91906140cd565b610c90565b005b61035b600480360381019061035691906140cd565b610d15565b60405161036891906140ab565b60405180910390f35b61038b600480360381019061038691906142a4565b610e19565b005b6103a760048036038101906103a29190614351565b610ebc565b005b6103c360048036038101906103be91906143a4565b61132a565b005b6103df60048036038101906103da91906140cd565b6117d1565b6040516103ec919061413b565b60405180910390f35b61040f600480360381019061040a9190614404565b61184e565b60405161041c91906141d1565b60405180910390f35b61042d6118fc565b60405161043a91906141d1565b60405180910390f35b61045d600480360381019061045891906140cd565b611909565b60405161046a91906144e3565b60405180910390f35b61047b6119eb565b604051610488919061455d565b60405180910390f35b610499611a11565b6040516104a691906140ab565b60405180910390f35b6104c960048036038101906104c49190613fdb565b611aa3565b6040516104d691906148b1565b60405180910390f35b6104f960048036038101906104f491906140cd565b611da1565b60405161050691906148b1565b60405180910390f35b610529600480360381019061052491906148cd565b611e2c565b005b61054560048036038101906105409190614a3d565b611e42565b005b610561600480360381019061055c91906140cd565b611e9b565b60405161056f929190614c7b565b60405180910390f35b610592600480360381019061058d91906140cd565b611fa2565b60405161059f91906140ab565b60405180910390f35b6105c260048036038101906105bd9190614cb2565b612034565b005b6105de60048036038101906105d99190614cff565b6122f6565b6040516105eb9190613f8a565b60405180910390f35b61060e600480360381019061060991906142a4565b61238a565b005b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106db57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806106eb57506106ea8261242d565b5b9050919050565b6060733bcbf1480879bff8435b1534c70b4a5182fb2466638cfea61c6107188585611aa3565b60076040518363ffffffff1660e01b8152600401610737929190615010565b600060405180830381865af4158015610754573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061077d91906150ab565b905092915050565b60606000805461079490615123565b80601f01602080910402602001604051908101604052809291908181526020018280546107c090615123565b801561080d5780601f106107e25761010080835404028352916020019161080d565b820191906000526020600020905b8154815290600101906020018083116107f057829003601f168201915b5050505050905090565b600061082282612497565b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610868826117d1565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806108f157508073ffffffffffffffffffffffffffffffffffffffff166108be6124d9565b73ffffffffffffffffffffffffffffffffffffffff16141580156108f057506108ee816108e96124d9565b6122f6565b155b5b15610928576040517f2c39ec4e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61093283836124e1565b505050565b6000600760010160049054906101000a900463ffffffff16600760010160009054906101000a900463ffffffff1661096f9190615183565b63ffffffff16905090565b610984828261259a565b6007600101600481819054906101000a900463ffffffff1660010191906101000a81548163ffffffff021916908363ffffffff1602179055505050565b60006007600201600060076003015481526020019081526020016000209050600015158160000160189054906101000a900460ff1615151480610a535750600015158160000160199054906101000a900460ff161515148015610a52575061010043610a2d91906151bb565b8160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff16105b5b15610ab157603243610a6591906151ef565b8160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060018160000160186101000a81548160ff021916908315150217905550610c16565b8060000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff16431115610c15576fffffffffffffffffffffffffffffffff8160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff164044604051602001610b2292919061526f565b6040516020818303038152906040528051906020012060001c610b4591906152ca565b8160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060018160000160196101000a81548160ff0219169083151502179055508060000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff166007600301547f78611aecfda8d341359c248df527c95aef93d446c92bb928b2a81b7abcb1d8d960405160405180910390a360076003016000815480929190610c07906152fb565b9190505550610c146109c1565b5b5b50565b610c2a610c246124d9565b826127a0565b610c60576040517feaf3884400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c6b838383612835565b505050565b610c8b83838360405180602001604052806000815250611e42565b505050565b610c9a33826127a0565b610cd0576040517f3d693ada00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610cd981612b13565b6007600101600481819054906101000a900463ffffffff1660010191906101000a81548163ffffffff021916908363ffffffff16021790555050565b6060733bcbf1480879bff8435b1534c70b4a5182fb2466638cfea61c733bcbf1480879bff8435b1534c70b4a5182fb246663ba44e5078560076040518363ffffffff1660e01b8152600401610d6b929190615352565b6103c060405180830381865af4158015610d89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dad9190615789565b60076040518363ffffffff1660e01b8152600401610dcc929190615010565b600060405180830381865af4158015610de9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610e1291906150ab565b9050919050565b6000610e2785858585612c61565b905060005b81811015610e7b57610e70868683818110610e4a57610e496157b7565b5b90506020020135858584818110610e6457610e636157b7565b5b90506020020135612cad565b806001019050610e2c565b5080600760010160048282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff1602179055505050505050565b80156112e2576000600760000160008581526020019081526020016000206040518060e001604052908160008201600680602002604051908101604052809291908260068015610f49576020028201916000905b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411610f105790505b5050505050815260200160018201600580602002604051908101604052809291908260058015610fb4576020028201916000905b82829054906101000a900460ff1660ff1681526020019060010190602082600001049283019260010382029150808411610f7d5790505b505050505081526020016002820160058060200260405190810160405280929190826005801561101f576020028201916000905b82829054906101000a900460ff1660ff1681526020019060010190602082600001049283019260010382029150808411610fe85790505b505050505081526020016003820160009054906101000a900460ff1660ff1660ff1681526020016003820160019054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016003820160059054906101000a900461ffff1661ffff1661ffff1681526020016003820160079054906101000a900462ffffff1662ffffff1662ffffff16815250509050600760000160008481526020019081526020016000206007600001600086815260200190815260200160002060008201816000019060066110f2929190613b86565b506001820181600101906005611109929190613bd1565b506002820181600201906005611120929190613bd1565b506003820160009054906101000a900460ff168160030160006101000a81548160ff021916908360ff1602179055506003820160019054906101000a900463ffffffff168160030160016101000a81548163ffffffff021916908363ffffffff1602179055506003820160059054906101000a900461ffff168160030160056101000a81548161ffff021916908361ffff1602179055506003820160079054906101000a900462ffffff168160030160076101000a81548162ffffff021916908362ffffff160217905550905050806007600001600085815260200190815260200160002060008201518160000190600661121c929190613c1c565b50602082015181600101906005611234929190613cb9565b5060408201518160020190600561124c929190613cb9565b5060608201518160030160006101000a81548160ff021916908360ff16021790555060808201518160030160016101000a81548163ffffffff021916908363ffffffff16021790555060a08201518160030160056101000a81548161ffff021916908361ffff16021790555060c08201518160030160076101000a81548162ffffff021916908362ffffff160217905550905050505b6112ec8383612cad565b6007600101600481819054906101000a900463ffffffff1660010191906101000a81548163ffffffff021916908363ffffffff160217905550505050565b600083839050905061133a6109c1565b60005b8181101561179157600085858381811061135a576113596157b7565b5b9050602002013590506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004016113c091906141d1565b602060405180830381865afa1580156113dd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140191906157fb565b90503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141580156114da5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e985e9c582336040518363ffffffff1660e01b8152600401611497929190615828565b602060405180830381865afa1580156114b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d89190615851565b155b80156115ad57503373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663081812fc846040518263ffffffff1660e01b815260040161155391906141d1565b602060405180830381865afa158015611570573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159491906157fb565b73ffffffffffffffffffffffffffffffffffffffff1614155b156115e4576040517f3d693ada00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166342966c68836040518263ffffffff1660e01b815260040161163f91906141d1565b600060405180830381600087803b15801561165957600080fd5b505af115801561166d573d6000803e3d6000fd5b5050505060006007600001600084815260200190815260200160002090506116b0600760010160089054906101000a900463ffffffff1663ffffffff1642612f16565b8160030160076101000a81548162ffffff021916908362ffffff1602179055506007600301548160030160016101000a81548163ffffffff021916908363ffffffff160217905550828160030160056101000a81548161ffff021916908361ffff16021790555060008160030160006101000a81548160ff021916908360ff1602179055508573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461177857611773863385612f46565b611783565b6117823384612f66565b5b83600101935050505061133d565b5080600760010160008282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff16021790555050505050565b6000806117dd83612f84565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611845576040517f0397bc7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036118b5576040517fb8f91ff300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600760030154905090565b611911613d53565b600760020160008381526020019081526020016000206040518060800160405290816000820160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020016000820160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160189054906101000a900460ff161515151581526020016000820160199054906101000a900460ff1615151515815250509050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060018054611a2090615123565b80601f0160208091040260200160405190810160405280929190818152602001828054611a4c90615123565b8015611a995780601f10611a6e57610100808354040283529160200191611a99565b820191906000526020600020905b815481529060010190602001808311611a7c57829003601f168201915b5050505050905090565b611aab613d9b565b611ab483612497565b611abd82612497565b60006007600001600085815260200190815260200160002060030160009054906101000a900460ff1690506000600182611af7919061587e565b9050733bcbf1480879bff8435b1534c70b4a5182fb24666390d50171868360076040518463ffffffff1660e01b8152600401611b35939291906158c2565b6103c060405180830381865af4158015611b53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b779190615789565b9250838360000151600001518360ff1660068110611b9857611b976157b7565b5b602002019061ffff16908161ffff168152505060058260ff161015611c2b57600080611bc48787612fc1565b91509150808560000151602001518560ff1660058110611be757611be66157b7565b5b602002019060ff16908160ff1681525050818560000151604001518560ff1660058110611c1757611c166157b7565b5b602002019060ff16908160ff168152505050505b8260c00151158015611c40575060078260ff16105b611c4b576000611c6f565b8260000151600001518260ff1660068110611c6957611c686157b7565b5b60200201515b8360a0019061ffff16908161ffff1681525050733bcbf1480879bff8435b1534c70b4a5182fb246663993e246f84836040518363ffffffff1660e01b8152600401611cbb9291906158f9565b602060405180830381865af4158015611cd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cfc9190615924565b8360e0019060ff16908160ff1681525050733bcbf1480879bff8435b1534c70b4a5182fb246663980cd34384836040518363ffffffff1660e01b8152600401611d469291906158f9565b602060405180830381865af4158015611d63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d879190615924565b83610100019060ff16908160ff1681525050505092915050565b611da9613d9b565b733bcbf1480879bff8435b1534c70b4a5182fb246663ba44e5078360076040518363ffffffff1660e01b8152600401611de3929190615352565b6103c060405180830381865af4158015611e01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e259190615789565b9050919050565b611e3e611e376124d9565b838361318a565b5050565b611e53611e4d6124d9565b836127a0565b611e89576040517feaf3884400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e95848484846132ed565b50505050565b606080733bcbf1480879bff8435b1534c70b4a5182fb246663ae2a8861733bcbf1480879bff8435b1534c70b4a5182fb246663ba44e5078660076040518363ffffffff1660e01b8152600401611ef2929190615352565b6103c060405180830381865af4158015611f10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f349190615789565b60076040518363ffffffff1660e01b8152600401611f53929190615010565b600060405180830381865af4158015611f70573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611f999190615b96565b91509150915091565b6060611fad82612497565b734924c4f2b2514557488a78df410369094b719dac63d05c212c8360076040518363ffffffff1660e01b8152600401611fe7929190615352565b600060405180830381865af4158015612004573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061202d9190615c0e565b9050919050565b600082829050905060408114612076576040517fe778681d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8181101561214e576000848483818110612096576120956157b7565b5b90506020020135905060066007600001600083815260200190815260200160002060030160009054906101000a900460ff1660ff1614612102576040517f42775e9d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61210c33826127a0565b612142576040517f3d693ada00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600101915050612079565b50600083836000818110612165576121646157b7565b5b90506020020135905060006007600001600083815260200190815260200160002090506121ad600760010160089054906101000a900463ffffffff1663ffffffff1642612f16565b8160030160076101000a81548162ffffff021916908362ffffff16021790555060078160030160006101000a81548160ff021916908360ff1602179055506000600190505b838110156122275761221c8686838181106122105761220f6157b7565b5b90506020020135612b13565b8060010190506121f2565b50603f600760010160048282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff1602179055508484600190809261227593929190615c61565b604051612283929190615d11565b6040518091039020827f8487c13f40adf819be704c2686b8eaf22250a17df721323aea90991ea470d70060405160405180910390a37ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7826040516122e791906141d1565b60405180910390a15050505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600061239885858585612c61565b905060005b818110156123ec576123e18686838181106123bb576123ba6157b7565b5b905060200201358585848181106123d5576123d46157b7565b5b9050602002013561259a565b80600101905061239d565b5080600760010160048282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff1602179055505050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6124a081613340565b6124d6576040517f0397bc7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16612554836117d1565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006125a68383613381565b50915050806007600001600085815260200190815260200160002060008201816000019060066125d7929190613b86565b5060018201816001019060056125ee929190613bd1565b506002820181600201906005612605929190613bd1565b506003820160009054906101000a900460ff168160030160006101000a81548160ff021916908360ff1602179055506003820160019054906101000a900463ffffffff168160030160016101000a81548163ffffffff021916908363ffffffff1602179055506003820160059054906101000a900461ffff168160030160056101000a81548161ffff021916908361ffff1602179055506003820160079054906101000a900462ffffff168160030160076101000a81548162ffffff021916908362ffffff1602179055509050506126f8600760010160089054906101000a900463ffffffff1663ffffffff1642612f16565b6007600001600085815260200190815260200160002060030160076101000a81548162ffffff021916908362ffffff16021790555061273682612b13565b82827f2b437d4aa9e3060a2b27689497c04db7c378ca296b51df4ffaea18fa6f56881a60405160405180910390a37ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce78360405161279391906141d1565b60405180910390a1505050565b6000806127ac836117d1565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806127ee57506127ed81856122f6565b5b8061282c57508373ffffffffffffffffffffffffffffffffffffffff1661281484610817565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16612855826117d1565b73ffffffffffffffffffffffffffffffffffffffff16146128a2576040517fb8f91ff300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612908576040517f6474b5a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612915838383600161345f565b8273ffffffffffffffffffffffffffffffffffffffff16612935826117d1565b73ffffffffffffffffffffffffffffffffffffffff1614612982576040517fb8f91ff300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612b0e8383836001613585565b505050565b6000612b1e826117d1565b9050612b2e81600084600161345f565b612b37826117d1565b90506004600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506002600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905581600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612c5d816000846001613585565b5050565b6000848490509050828290508114612ca5576040517fe778681d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b949350505050565b600080612cba8484613381565b92505091506000600182612cce919061587e565b905060058260ff161015612d6457600080612ce98787612fc1565b9150915080856001018560ff1660058110612d0757612d066157b7565b5b602091828204019190066101000a81548160ff021916908360ff16021790555081856002018560ff1660058110612d4157612d406157b7565b5b602091828204019190066101000a81548160ff021916908360ff16021790555050505b612d89600760010160089054906101000a900463ffffffff1663ffffffff1642612f16565b8360030160076101000a81548162ffffff021916908362ffffff16021790555083836000018360ff1660068110612dc357612dc26157b7565b5b601091828204019190066002026101000a81548161ffff021916908361ffff160217905550808360030160006101000a81548160ff021916908360ff160217905550612e0e84612b13565b733bcbf1480879bff8435b1534c70b4a5182fb24666353bfca206040518163ffffffff1660e01b815260040161010060405180830381865af4158015612e58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7c9190615ddb565b8360030160009054906101000a900460ff1660ff1660088110612ea257612ea16157b7565b5b602002015160ff1684867f905feedea1eda3a8be0478a0f07f90de1ac162b88dfb7cc30cb5d2d57323f0af60405160405180910390a47ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce785604051612f0791906141d1565b60405180910390a15050505050565b60006001620151808484612f2a91906151bb565b612f349190615e09565b612f3e91906151ef565b905092915050565b612f618383836040518060200160405280600081525061358b565b505050565b612f808282604051806020016040528060008152506135df565b5050565b60006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000806000733bcbf1480879bff8435b1534c70b4a5182fb246663ba44e5078660076040518363ffffffff1660e01b8152600401613000929190615352565b6103c060405180830381865af415801561301e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130429190615789565b90506000733bcbf1480879bff8435b1534c70b4a5182fb246663ba44e5078660076040518363ffffffff1660e01b8152600401613080929190615352565b6103c060405180830381865af415801561309e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130c29190615789565b90506000826040015182604001516040516020016130e1929190615e3a565b6040516020818303038152906040528051906020012060001c90506050613109826064613631565b1161312757613122836101000151836101000151613670565b61316a565b600060028261313691906152ca565b146131545761314f83610100015183610100015161368f565b613169565b6131688361010001518361010001516136ae565b5b5b945061317e8360e001518360e001516136df565b93505050509250929050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036131ef576040517f2c39ec4e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516132e09190613f8a565b60405180910390a3505050565b6132f8848484612835565b61330484848484613701565b61333a576040517f91ec2e4700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b60008073ffffffffffffffffffffffffffffffffffffffff1661336283612f84565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60008060006007600001600086815260200190815260200160002092506007600001600085815260200190815260200160002091508260030160009054906101000a900460ff1690506133d433866127a0565b15806133e757506133e533856127a0565b155b8061340957508160030160009054906101000a900460ff1660ff168160ff1614155b8061341357508385145b80613421575060058160ff16115b15613458576040517f3d693ada00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b9250925092565b600181111561357f57600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146134f35780600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546134eb91906151bb565b925050819055505b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461357e5780600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461357691906151ef565b925050819055505b5b50505050565b50505050565b61359684848461387f565b6135a36000858484613701565b6135d9576040517f91ec2e4700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b6135e98383613953565b6135f66000848484613701565b61362c576040517f91ec2e4700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b600081836040516020016136459190615e66565b6040516020818303038152906040528051906020012060001c61366891906152ca565b905092915050565b60008160ff168360ff16106136855781613687565b825b905092915050565b60008160ff168360ff16116136a457816136a6565b825b905092915050565b60008160ff168360ff16116136c357826136d7565b60008260ff16116136d457826136d6565b815b5b905092915050565b600060018284161660018360ff16901c60018560ff16901c0101905092915050565b60006137228473ffffffffffffffffffffffffffffffffffffffff166139cb565b15613872578373ffffffffffffffffffffffffffffffffffffffff1663150b7a0261374b6124d9565b8786866040518563ffffffff1660e01b815260040161376d9493929190615ed6565b6020604051808303816000875af19250505080156137a957506040513d601f19601f820116820180604052508101906137a69190615f37565b60015b613822573d80600081146137d9576040519150601f19603f3d011682016040523d82523d6000602084013e6137de565b606091505b50600081510361381a576040517f91ec2e4700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050613877565b600190505b949350505050565b61388983826139ee565b808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4808373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461394e600084836001613585565b505050565b61395d82826139ee565b808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46139c7600083836001613585565b5050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603613a54576040517f6474b5a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613a5d81613340565b15613a94576040517f5a5ab17e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613aa260008383600161345f565b613aab81613340565b15613ae2576040517f5a5ab17e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b826006600f01601090048101928215613bc05791600f016010900482015b82811115613bbf578254825591600101919060010190613ba4565b5b509050613bcd9190613e14565b5090565b826005601f01602090048101928215613c0b5791601f016020900482015b82811115613c0a578254825591600101919060010190613bef565b5b509050613c189190613e14565b5090565b826006600f01601090048101928215613ca85791602002820160005b83821115613c7857835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302613c38565b8015613ca65782816101000a81549061ffff0219169055600201602081600101049283019260010302613c78565b505b509050613cb59190613e14565b5090565b826005601f01602090048101928215613d425791602002820160005b83821115613d1357835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302613cd5565b8015613d405782816101000a81549060ff0219169055600101602081600001049283019260010302613d13565b505b509050613d4f9190613e14565b5090565b604051806080016040528060006fffffffffffffffffffffffffffffffff168152602001600067ffffffffffffffff1681526020016000151581526020016000151581525090565b604051806101600160405280613daf613e31565b815260200160001515815260200160008152602001600060ff168152602001600015158152602001600061ffff168152602001600015158152602001600060ff168152602001600060ff168152602001600060ff168152602001600060ff1681525090565b5b80821115613e2d576000816000905550600101613e15565b5090565b6040518060e00160405280613e44613e92565b8152602001613e51613eb4565b8152602001613e5e613eb4565b8152602001600060ff168152602001600063ffffffff168152602001600061ffff168152602001600062ffffff1681525090565b6040518060c00160405280600690602082028036833780820191505090505090565b6040518060a00160405280600590602082028036833780820191505090505090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613f1f81613eea565b8114613f2a57600080fd5b50565b600081359050613f3c81613f16565b92915050565b600060208284031215613f5857613f57613ee0565b5b6000613f6684828501613f2d565b91505092915050565b60008115159050919050565b613f8481613f6f565b82525050565b6000602082019050613f9f6000830184613f7b565b92915050565b6000819050919050565b613fb881613fa5565b8114613fc357600080fd5b50565b600081359050613fd581613faf565b92915050565b60008060408385031215613ff257613ff1613ee0565b5b600061400085828601613fc6565b925050602061401185828601613fc6565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561405557808201518184015260208101905061403a565b60008484015250505050565b6000601f19601f8301169050919050565b600061407d8261401b565b6140878185614026565b9350614097818560208601614037565b6140a081614061565b840191505092915050565b600060208201905081810360008301526140c58184614072565b905092915050565b6000602082840312156140e3576140e2613ee0565b5b60006140f184828501613fc6565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000614125826140fa565b9050919050565b6141358161411a565b82525050565b6000602082019050614150600083018461412c565b92915050565b61415f8161411a565b811461416a57600080fd5b50565b60008135905061417c81614156565b92915050565b6000806040838503121561419957614198613ee0565b5b60006141a78582860161416d565b92505060206141b885828601613fc6565b9150509250929050565b6141cb81613fa5565b82525050565b60006020820190506141e660008301846141c2565b92915050565b60008060006060848603121561420557614204613ee0565b5b60006142138682870161416d565b93505060206142248682870161416d565b925050604061423586828701613fc6565b9150509250925092565b600080fd5b600080fd5b600080fd5b60008083601f8401126142645761426361423f565b5b8235905067ffffffffffffffff81111561428157614280614244565b5b60208301915083602082028301111561429d5761429c614249565b5b9250929050565b600080600080604085870312156142be576142bd613ee0565b5b600085013567ffffffffffffffff8111156142dc576142db613ee5565b5b6142e88782880161424e565b9450945050602085013567ffffffffffffffff81111561430b5761430a613ee5565b5b6143178782880161424e565b925092505092959194509250565b61432e81613f6f565b811461433957600080fd5b50565b60008135905061434b81614325565b92915050565b60008060006060848603121561436a57614369613ee0565b5b600061437886828701613fc6565b935050602061438986828701613fc6565b925050604061439a8682870161433c565b9150509250925092565b6000806000604084860312156143bd576143bc613ee0565b5b600084013567ffffffffffffffff8111156143db576143da613ee5565b5b6143e78682870161424e565b935093505060206143fa8682870161416d565b9150509250925092565b60006020828403121561441a57614419613ee0565b5b60006144288482850161416d565b91505092915050565b60006fffffffffffffffffffffffffffffffff82169050919050565b61445681614431565b82525050565b600067ffffffffffffffff82169050919050565b6144798161445c565b82525050565b61448881613f6f565b82525050565b6080820160008201516144a4600085018261444d565b5060208201516144b76020850182614470565b5060408201516144ca604085018261447f565b5060608201516144dd606085018261447f565b50505050565b60006080820190506144f8600083018461448e565b92915050565b6000819050919050565b600061452361451e614519846140fa565b6144fe565b6140fa565b9050919050565b600061453582614508565b9050919050565b60006145478261452a565b9050919050565b6145578161453c565b82525050565b6000602082019050614572600083018461454e565b92915050565b600060069050919050565b600081905092915050565b6000819050919050565b600061ffff82169050919050565b6145af81614598565b82525050565b60006145c183836145a6565b60208301905092915050565b6000602082019050919050565b6145e381614578565b6145ed8184614583565b92506145f88261458e565b8060005b8381101561462957815161461087826145b5565b965061461b836145cd565b9250506001810190506145fc565b505050505050565b600060059050919050565b600081905092915050565b6000819050919050565b600060ff82169050919050565b61466781614651565b82525050565b6000614679838361465e565b60208301905092915050565b6000602082019050919050565b61469b81614631565b6146a5818461463c565b92506146b082614647565b8060005b838110156146e15781516146c8878261466d565b96506146d383614685565b9250506001810190506146b4565b505050505050565b600063ffffffff82169050919050565b614702816146e9565b82525050565b600062ffffff82169050919050565b61472081614708565b82525050565b6102808201600082015161473d60008501826145da565b50602082015161475060c0850182614692565b506040820151614764610160850182614692565b50606082015161477861020085018261465e565b50608082015161478c6102208501826146f9565b5060a08201516147a06102408501826145a6565b5060c08201516147b4610260850182614717565b50505050565b6147c381613fa5565b82525050565b6103c0820160008201516147e06000850182614726565b5060208201516147f461028085018261447f565b5060408201516148086102a08501826147ba565b50606082015161481c6102c085018261465e565b5060808201516148306102e085018261447f565b5060a08201516148446103008501826145a6565b5060c082015161485861032085018261447f565b5060e082015161486c61034085018261465e565b5061010082015161488161036085018261465e565b5061012082015161489661038085018261465e565b506101408201516148ab6103a085018261465e565b50505050565b60006103c0820190506148c760008301846147c9565b92915050565b600080604083850312156148e4576148e3613ee0565b5b60006148f28582860161416d565b92505060206149038582860161433c565b9150509250929050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61494a82614061565b810181811067ffffffffffffffff8211171561496957614968614912565b5b80604052505050565b600061497c613ed6565b90506149888282614941565b919050565b600067ffffffffffffffff8211156149a8576149a7614912565b5b6149b182614061565b9050602081019050919050565b82818337600083830152505050565b60006149e06149db8461498d565b614972565b9050828152602081018484840111156149fc576149fb61490d565b5b614a078482856149be565b509392505050565b600082601f830112614a2457614a2361423f565b5b8135614a348482602086016149cd565b91505092915050565b60008060008060808587031215614a5757614a56613ee0565b5b6000614a658782880161416d565b9450506020614a768782880161416d565b9350506040614a8787828801613fc6565b925050606085013567ffffffffffffffff811115614aa857614aa7613ee5565b5b614ab487828801614a0f565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600082825260208201905092915050565b6000614b088261401b565b614b128185614aec565b9350614b22818560208601614037565b614b2b81614061565b840191505092915050565b6000614b428383614afd565b905092915050565b6000602082019050919050565b6000614b6282614ac0565b614b6c8185614acb565b935083602082028501614b7e85614adc565b8060005b85811015614bba5784840389528151614b9b8582614b36565b9450614ba683614b4a565b925060208a01995050600181019050614b82565b50829750879550505050505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000614c0483836147ba565b60208301905092915050565b6000602082019050919050565b6000614c2882614bcc565b614c328185614bd7565b9350614c3d83614be8565b8060005b83811015614c6e578151614c558882614bf8565b9750614c6083614c10565b925050600181019050614c41565b5085935050505092915050565b60006040820190508181036000830152614c958185614b57565b90508181036020830152614ca98184614c1d565b90509392505050565b60008060208385031215614cc957614cc8613ee0565b5b600083013567ffffffffffffffff811115614ce757614ce6613ee5565b5b614cf38582860161424e565b92509250509250929050565b60008060408385031215614d1657614d15613ee0565b5b6000614d248582860161416d565b9250506020614d358582860161416d565b9150509250929050565b600081905092915050565b614d5381614598565b82525050565b6000614d658383614d4a565b60208301905092915050565b614d7a81614578565b614d848184614d3f565b9250614d8f8261458e565b8060005b83811015614dc0578151614da78782614d59565b9650614db2836145cd565b925050600181019050614d93565b505050505050565b600081905092915050565b614ddc81614651565b82525050565b6000614dee8383614dd3565b60208301905092915050565b614e0381614631565b614e0d8184614dc8565b9250614e1882614647565b8060005b83811015614e49578151614e308782614de2565b9650614e3b83614685565b925050600181019050614e1c565b505050505050565b614e5a816146e9565b82525050565b614e6981614708565b82525050565b61028082016000820151614e866000850182614d71565b506020820151614e9960c0850182614dfa565b506040820151614ead610160850182614dfa565b506060820151614ec1610200850182614dd3565b506080820151614ed5610220850182614e51565b5060a0820151614ee9610240850182614d4a565b5060c0820151614efd610260850182614e60565b50505050565b614f0c81613f6f565b82525050565b614f1b81613fa5565b82525050565b6103c082016000820151614f386000850182614e6f565b506020820151614f4c610280850182614f03565b506040820151614f606102a0850182614f12565b506060820151614f746102c0850182614dd3565b506080820151614f886102e0850182614f03565b5060a0820151614f9c610300850182614d4a565b5060c0820151614fb0610320850182614f03565b5060e0820151614fc4610340850182614dd3565b50610100820151614fd9610360850182614dd3565b50610120820151614fee610380850182614dd3565b506101408201516150036103a0850182614dd3565b50505050565b8082525050565b60006103e0820190506150266000830185614f21565b6150346103c0830184615009565b9392505050565b600061504e6150498461498d565b614972565b90508281526020810184848401111561506a5761506961490d565b5b615075848285614037565b509392505050565b600082601f8301126150925761509161423f565b5b81516150a284826020860161503b565b91505092915050565b6000602082840312156150c1576150c0613ee0565b5b600082015167ffffffffffffffff8111156150df576150de613ee5565b5b6150eb8482850161507d565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061513b57607f821691505b60208210810361514e5761514d6150f4565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061518e826146e9565b9150615199836146e9565b9250828203905063ffffffff8111156151b5576151b4615154565b5b92915050565b60006151c682613fa5565b91506151d183613fa5565b92508282039050818111156151e9576151e8615154565b5b92915050565b60006151fa82613fa5565b915061520583613fa5565b925082820190508082111561521d5761521c615154565b5b92915050565b6000819050919050565b6000819050919050565b61524861524382615223565b61522d565b82525050565b6000819050919050565b61526961526482613fa5565b61524e565b82525050565b600061527b8285615237565b60208201915061528b8284615258565b6020820191508190509392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006152d582613fa5565b91506152e083613fa5565b9250826152f0576152ef61529b565b5b828206905092915050565b600061530682613fa5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361533857615337615154565b5b600182019050919050565b61534c81613fa5565b82525050565b60006040820190506153676000830185615343565b6153746020830184615009565b9392505050565b600080fd5b600067ffffffffffffffff82111561539b5761539a614912565b5b602082029050919050565b6153af81614598565b81146153ba57600080fd5b50565b6000815190506153cc816153a6565b92915050565b60006153e56153e084615380565b614972565b905080602084028301858111156153ff576153fe614249565b5b835b81811015615428578061541488826153bd565b845260208401935050602081019050615401565b5050509392505050565b600082601f8301126154475761544661423f565b5b60066154548482856153d2565b91505092915050565b600067ffffffffffffffff82111561547857615477614912565b5b602082029050919050565b61548c81614651565b811461549757600080fd5b50565b6000815190506154a981615483565b92915050565b60006154c26154bd8461545d565b614972565b905080602084028301858111156154dc576154db614249565b5b835b8181101561550557806154f1888261549a565b8452602084019350506020810190506154de565b5050509392505050565b600082601f8301126155245761552361423f565b5b60056155318482856154af565b91505092915050565b615543816146e9565b811461554e57600080fd5b50565b6000815190506155608161553a565b92915050565b61556f81614708565b811461557a57600080fd5b50565b60008151905061558c81615566565b92915050565b600061028082840312156155a9576155a861537b565b5b6155b360e0614972565b905060006155c384828501615432565b60008301525060c06155d78482850161550f565b6020830152506101606155ec8482850161550f565b6040830152506102006156018482850161549a565b60608301525061022061561684828501615551565b60808301525061024061562b848285016153bd565b60a0830152506102606156408482850161557d565b60c08301525092915050565b60008151905061565b81614325565b92915050565b60008151905061567081613faf565b92915050565b60006103c0828403121561568d5761568c61537b565b5b615698610160614972565b905060006156a884828501615592565b6000830152506102806156bd8482850161564c565b6020830152506102a06156d284828501615661565b6040830152506102c06156e78482850161549a565b6060830152506102e06156fc8482850161564c565b608083015250610300615711848285016153bd565b60a0830152506103206157268482850161564c565b60c08301525061034061573b8482850161549a565b60e0830152506103606157508482850161549a565b610100830152506103806157668482850161549a565b610120830152506103a061577c8482850161549a565b6101408301525092915050565b60006103c082840312156157a05761579f613ee0565b5b60006157ae84828501615676565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000815190506157f581614156565b92915050565b60006020828403121561581157615810613ee0565b5b600061581f848285016157e6565b91505092915050565b600060408201905061583d600083018561412c565b61584a602083018461412c565b9392505050565b60006020828403121561586757615866613ee0565b5b60006158758482850161564c565b91505092915050565b600061588982614651565b915061589483614651565b9250828201905060ff8111156158ad576158ac615154565b5b92915050565b6158bc81614651565b82525050565b60006060820190506158d76000830186615343565b6158e460208301856158b3565b6158f16040830184615009565b949350505050565b60006103e08201905061590f6000830185614f21565b61591d6103c08301846158b3565b9392505050565b60006020828403121561593a57615939613ee0565b5b60006159488482850161549a565b91505092915050565b600067ffffffffffffffff82111561596c5761596b614912565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561599857615997614912565b5b6159a182614061565b9050602081019050919050565b60006159c16159bc8461597d565b614972565b9050828152602081018484840111156159dd576159dc61490d565b5b6159e8848285614037565b509392505050565b600082601f830112615a0557615a0461423f565b5b8151615a158482602086016159ae565b91505092915050565b6000615a31615a2c84615951565b614972565b90508083825260208201905060208402830185811115615a5457615a53614249565b5b835b81811015615a9b57805167ffffffffffffffff811115615a7957615a7861423f565b5b808601615a8689826159f0565b85526020850194505050602081019050615a56565b5050509392505050565b600082601f830112615aba57615ab961423f565b5b8151615aca848260208601615a1e565b91505092915050565b600067ffffffffffffffff821115615aee57615aed614912565b5b602082029050602081019050919050565b6000615b12615b0d84615ad3565b614972565b90508083825260208201905060208402830185811115615b3557615b34614249565b5b835b81811015615b5e5780615b4a8882615661565b845260208401935050602081019050615b37565b5050509392505050565b600082601f830112615b7d57615b7c61423f565b5b8151615b8d848260208601615aff565b91505092915050565b60008060408385031215615bad57615bac613ee0565b5b600083015167ffffffffffffffff811115615bcb57615bca613ee5565b5b615bd785828601615aa5565b925050602083015167ffffffffffffffff811115615bf857615bf7613ee5565b5b615c0485828601615b68565b9150509250929050565b600060208284031215615c2457615c23613ee0565b5b600082015167ffffffffffffffff811115615c4257615c41613ee5565b5b615c4e848285016159f0565b91505092915050565b600080fd5b600080fd5b60008085851115615c7557615c74615c57565b5b83861115615c8657615c85615c5c565b5b6020850283019150848603905094509492505050565b600081905092915050565b600080fd5b82818337505050565b6000615cc18385615c9c565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115615cf457615cf3615ca7565b5b602083029250615d05838584615cac565b82840190509392505050565b6000615d1e828486615cb5565b91508190509392505050565b600067ffffffffffffffff821115615d4557615d44614912565b5b602082029050919050565b6000615d63615d5e84615d2a565b614972565b90508060208402830185811115615d7d57615d7c614249565b5b835b81811015615da65780615d92888261549a565b845260208401935050602081019050615d7f565b5050509392505050565b600082601f830112615dc557615dc461423f565b5b6008615dd2848285615d50565b91505092915050565b60006101008284031215615df257615df1613ee0565b5b6000615e0084828501615db0565b91505092915050565b6000615e1482613fa5565b9150615e1f83613fa5565b925082615e2f57615e2e61529b565b5b828204905092915050565b6000615e468285615258565b602082019150615e568284615258565b6020820191508190509392505050565b6000615e728284615258565b60208201915081905092915050565b600081519050919050565b600082825260208201905092915050565b6000615ea882615e81565b615eb28185615e8c565b9350615ec2818560208601614037565b615ecb81614061565b840191505092915050565b6000608082019050615eeb600083018761412c565b615ef8602083018661412c565b615f0560408301856141c2565b8181036060830152615f178184615e9d565b905095945050505050565b600081519050615f3181613f16565b92915050565b600060208284031215615f4d57615f4c613ee0565b5b6000615f5b84828501615f22565b9150509291505056fea26469706673582212201754a436c0b93793216b3c1e456c930b4d04ac3c3951b1ff79f648cc53e0118564736f6c63430008110033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80636352211e116101045780639db797f0116100a2578063c87b56dd11610071578063c87b56dd14610578578063e8b69127146105a8578063e985e9c5146105c4578063ec9da8af146105f4576101da565b80639db797f0146104df578063a22cb4651461050f578063b88d4fde1461052b578063bd11f69d14610547576101da565b8063859e7d32116100de578063859e7d32146104435780638e46d95a1461047357806395d89b41146104915780639b21151c146104af576101da565b80636352211e146103c557806370a08231146103f5578063757991a814610425576101da565b8063239ffa681161017c57806344b285db1161014b57806344b285db1461034157806350f11805146103715780635427c7911461038d5780635c5b69a9146103a9576101da565b8063239ffa68146102e357806323b872dd146102ed57806342842e0e1461030957806342966c6814610325576101da565b8063081812fc116101b8578063081812fc1461025d578063095ea7b31461028d57806318160ddd146102a957806321205226146102c7576101da565b806301ffc9a7146101df57806302a6429d1461020f57806306fdde031461023f575b600080fd5b6101f960048036038101906101f49190613f42565b610610565b6040516102069190613f8a565b60405180910390f35b61022960048036038101906102249190613fdb565b6106f2565b60405161023691906140ab565b60405180910390f35b610247610785565b60405161025491906140ab565b60405180910390f35b610277600480360381019061027291906140cd565b610817565b604051610284919061413b565b60405180910390f35b6102a760048036038101906102a29190614182565b61085d565b005b6102b1610937565b6040516102be91906141d1565b60405180910390f35b6102e160048036038101906102dc9190613fdb565b61097a565b005b6102eb6109c1565b005b610307600480360381019061030291906141ec565b610c19565b005b610323600480360381019061031e91906141ec565b610c70565b005b61033f600480360381019061033a91906140cd565b610c90565b005b61035b600480360381019061035691906140cd565b610d15565b60405161036891906140ab565b60405180910390f35b61038b600480360381019061038691906142a4565b610e19565b005b6103a760048036038101906103a29190614351565b610ebc565b005b6103c360048036038101906103be91906143a4565b61132a565b005b6103df60048036038101906103da91906140cd565b6117d1565b6040516103ec919061413b565b60405180910390f35b61040f600480360381019061040a9190614404565b61184e565b60405161041c91906141d1565b60405180910390f35b61042d6118fc565b60405161043a91906141d1565b60405180910390f35b61045d600480360381019061045891906140cd565b611909565b60405161046a91906144e3565b60405180910390f35b61047b6119eb565b604051610488919061455d565b60405180910390f35b610499611a11565b6040516104a691906140ab565b60405180910390f35b6104c960048036038101906104c49190613fdb565b611aa3565b6040516104d691906148b1565b60405180910390f35b6104f960048036038101906104f491906140cd565b611da1565b60405161050691906148b1565b60405180910390f35b610529600480360381019061052491906148cd565b611e2c565b005b61054560048036038101906105409190614a3d565b611e42565b005b610561600480360381019061055c91906140cd565b611e9b565b60405161056f929190614c7b565b60405180910390f35b610592600480360381019061058d91906140cd565b611fa2565b60405161059f91906140ab565b60405180910390f35b6105c260048036038101906105bd9190614cb2565b612034565b005b6105de60048036038101906105d99190614cff565b6122f6565b6040516105eb9190613f8a565b60405180910390f35b61060e600480360381019061060991906142a4565b61238a565b005b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106db57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806106eb57506106ea8261242d565b5b9050919050565b6060733bcbf1480879bff8435b1534c70b4a5182fb2466638cfea61c6107188585611aa3565b60076040518363ffffffff1660e01b8152600401610737929190615010565b600060405180830381865af4158015610754573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061077d91906150ab565b905092915050565b60606000805461079490615123565b80601f01602080910402602001604051908101604052809291908181526020018280546107c090615123565b801561080d5780601f106107e25761010080835404028352916020019161080d565b820191906000526020600020905b8154815290600101906020018083116107f057829003601f168201915b5050505050905090565b600061082282612497565b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610868826117d1565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806108f157508073ffffffffffffffffffffffffffffffffffffffff166108be6124d9565b73ffffffffffffffffffffffffffffffffffffffff16141580156108f057506108ee816108e96124d9565b6122f6565b155b5b15610928576040517f2c39ec4e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61093283836124e1565b505050565b6000600760010160049054906101000a900463ffffffff16600760010160009054906101000a900463ffffffff1661096f9190615183565b63ffffffff16905090565b610984828261259a565b6007600101600481819054906101000a900463ffffffff1660010191906101000a81548163ffffffff021916908363ffffffff1602179055505050565b60006007600201600060076003015481526020019081526020016000209050600015158160000160189054906101000a900460ff1615151480610a535750600015158160000160199054906101000a900460ff161515148015610a52575061010043610a2d91906151bb565b8160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff16105b5b15610ab157603243610a6591906151ef565b8160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060018160000160186101000a81548160ff021916908315150217905550610c16565b8060000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff16431115610c15576fffffffffffffffffffffffffffffffff8160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff164044604051602001610b2292919061526f565b6040516020818303038152906040528051906020012060001c610b4591906152ca565b8160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060018160000160196101000a81548160ff0219169083151502179055508060000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff166007600301547f78611aecfda8d341359c248df527c95aef93d446c92bb928b2a81b7abcb1d8d960405160405180910390a360076003016000815480929190610c07906152fb565b9190505550610c146109c1565b5b5b50565b610c2a610c246124d9565b826127a0565b610c60576040517feaf3884400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c6b838383612835565b505050565b610c8b83838360405180602001604052806000815250611e42565b505050565b610c9a33826127a0565b610cd0576040517f3d693ada00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610cd981612b13565b6007600101600481819054906101000a900463ffffffff1660010191906101000a81548163ffffffff021916908363ffffffff16021790555050565b6060733bcbf1480879bff8435b1534c70b4a5182fb2466638cfea61c733bcbf1480879bff8435b1534c70b4a5182fb246663ba44e5078560076040518363ffffffff1660e01b8152600401610d6b929190615352565b6103c060405180830381865af4158015610d89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dad9190615789565b60076040518363ffffffff1660e01b8152600401610dcc929190615010565b600060405180830381865af4158015610de9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610e1291906150ab565b9050919050565b6000610e2785858585612c61565b905060005b81811015610e7b57610e70868683818110610e4a57610e496157b7565b5b90506020020135858584818110610e6457610e636157b7565b5b90506020020135612cad565b806001019050610e2c565b5080600760010160048282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff1602179055505050505050565b80156112e2576000600760000160008581526020019081526020016000206040518060e001604052908160008201600680602002604051908101604052809291908260068015610f49576020028201916000905b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411610f105790505b5050505050815260200160018201600580602002604051908101604052809291908260058015610fb4576020028201916000905b82829054906101000a900460ff1660ff1681526020019060010190602082600001049283019260010382029150808411610f7d5790505b505050505081526020016002820160058060200260405190810160405280929190826005801561101f576020028201916000905b82829054906101000a900460ff1660ff1681526020019060010190602082600001049283019260010382029150808411610fe85790505b505050505081526020016003820160009054906101000a900460ff1660ff1660ff1681526020016003820160019054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016003820160059054906101000a900461ffff1661ffff1661ffff1681526020016003820160079054906101000a900462ffffff1662ffffff1662ffffff16815250509050600760000160008481526020019081526020016000206007600001600086815260200190815260200160002060008201816000019060066110f2929190613b86565b506001820181600101906005611109929190613bd1565b506002820181600201906005611120929190613bd1565b506003820160009054906101000a900460ff168160030160006101000a81548160ff021916908360ff1602179055506003820160019054906101000a900463ffffffff168160030160016101000a81548163ffffffff021916908363ffffffff1602179055506003820160059054906101000a900461ffff168160030160056101000a81548161ffff021916908361ffff1602179055506003820160079054906101000a900462ffffff168160030160076101000a81548162ffffff021916908362ffffff160217905550905050806007600001600085815260200190815260200160002060008201518160000190600661121c929190613c1c565b50602082015181600101906005611234929190613cb9565b5060408201518160020190600561124c929190613cb9565b5060608201518160030160006101000a81548160ff021916908360ff16021790555060808201518160030160016101000a81548163ffffffff021916908363ffffffff16021790555060a08201518160030160056101000a81548161ffff021916908361ffff16021790555060c08201518160030160076101000a81548162ffffff021916908362ffffff160217905550905050505b6112ec8383612cad565b6007600101600481819054906101000a900463ffffffff1660010191906101000a81548163ffffffff021916908363ffffffff160217905550505050565b600083839050905061133a6109c1565b60005b8181101561179157600085858381811061135a576113596157b7565b5b9050602002013590506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004016113c091906141d1565b602060405180830381865afa1580156113dd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140191906157fb565b90503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141580156114da5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e985e9c582336040518363ffffffff1660e01b8152600401611497929190615828565b602060405180830381865afa1580156114b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d89190615851565b155b80156115ad57503373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663081812fc846040518263ffffffff1660e01b815260040161155391906141d1565b602060405180830381865afa158015611570573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159491906157fb565b73ffffffffffffffffffffffffffffffffffffffff1614155b156115e4576040517f3d693ada00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166342966c68836040518263ffffffff1660e01b815260040161163f91906141d1565b600060405180830381600087803b15801561165957600080fd5b505af115801561166d573d6000803e3d6000fd5b5050505060006007600001600084815260200190815260200160002090506116b0600760010160089054906101000a900463ffffffff1663ffffffff1642612f16565b8160030160076101000a81548162ffffff021916908362ffffff1602179055506007600301548160030160016101000a81548163ffffffff021916908363ffffffff160217905550828160030160056101000a81548161ffff021916908361ffff16021790555060008160030160006101000a81548160ff021916908360ff1602179055508573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461177857611773863385612f46565b611783565b6117823384612f66565b5b83600101935050505061133d565b5080600760010160008282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff16021790555050505050565b6000806117dd83612f84565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611845576040517f0397bc7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036118b5576040517fb8f91ff300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600760030154905090565b611911613d53565b600760020160008381526020019081526020016000206040518060800160405290816000820160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020016000820160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160189054906101000a900460ff161515151581526020016000820160199054906101000a900460ff1615151515815250509050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060018054611a2090615123565b80601f0160208091040260200160405190810160405280929190818152602001828054611a4c90615123565b8015611a995780601f10611a6e57610100808354040283529160200191611a99565b820191906000526020600020905b815481529060010190602001808311611a7c57829003601f168201915b5050505050905090565b611aab613d9b565b611ab483612497565b611abd82612497565b60006007600001600085815260200190815260200160002060030160009054906101000a900460ff1690506000600182611af7919061587e565b9050733bcbf1480879bff8435b1534c70b4a5182fb24666390d50171868360076040518463ffffffff1660e01b8152600401611b35939291906158c2565b6103c060405180830381865af4158015611b53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b779190615789565b9250838360000151600001518360ff1660068110611b9857611b976157b7565b5b602002019061ffff16908161ffff168152505060058260ff161015611c2b57600080611bc48787612fc1565b91509150808560000151602001518560ff1660058110611be757611be66157b7565b5b602002019060ff16908160ff1681525050818560000151604001518560ff1660058110611c1757611c166157b7565b5b602002019060ff16908160ff168152505050505b8260c00151158015611c40575060078260ff16105b611c4b576000611c6f565b8260000151600001518260ff1660068110611c6957611c686157b7565b5b60200201515b8360a0019061ffff16908161ffff1681525050733bcbf1480879bff8435b1534c70b4a5182fb246663993e246f84836040518363ffffffff1660e01b8152600401611cbb9291906158f9565b602060405180830381865af4158015611cd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cfc9190615924565b8360e0019060ff16908160ff1681525050733bcbf1480879bff8435b1534c70b4a5182fb246663980cd34384836040518363ffffffff1660e01b8152600401611d469291906158f9565b602060405180830381865af4158015611d63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d879190615924565b83610100019060ff16908160ff1681525050505092915050565b611da9613d9b565b733bcbf1480879bff8435b1534c70b4a5182fb246663ba44e5078360076040518363ffffffff1660e01b8152600401611de3929190615352565b6103c060405180830381865af4158015611e01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e259190615789565b9050919050565b611e3e611e376124d9565b838361318a565b5050565b611e53611e4d6124d9565b836127a0565b611e89576040517feaf3884400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e95848484846132ed565b50505050565b606080733bcbf1480879bff8435b1534c70b4a5182fb246663ae2a8861733bcbf1480879bff8435b1534c70b4a5182fb246663ba44e5078660076040518363ffffffff1660e01b8152600401611ef2929190615352565b6103c060405180830381865af4158015611f10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f349190615789565b60076040518363ffffffff1660e01b8152600401611f53929190615010565b600060405180830381865af4158015611f70573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611f999190615b96565b91509150915091565b6060611fad82612497565b734924c4f2b2514557488a78df410369094b719dac63d05c212c8360076040518363ffffffff1660e01b8152600401611fe7929190615352565b600060405180830381865af4158015612004573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061202d9190615c0e565b9050919050565b600082829050905060408114612076576040517fe778681d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8181101561214e576000848483818110612096576120956157b7565b5b90506020020135905060066007600001600083815260200190815260200160002060030160009054906101000a900460ff1660ff1614612102576040517f42775e9d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61210c33826127a0565b612142576040517f3d693ada00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600101915050612079565b50600083836000818110612165576121646157b7565b5b90506020020135905060006007600001600083815260200190815260200160002090506121ad600760010160089054906101000a900463ffffffff1663ffffffff1642612f16565b8160030160076101000a81548162ffffff021916908362ffffff16021790555060078160030160006101000a81548160ff021916908360ff1602179055506000600190505b838110156122275761221c8686838181106122105761220f6157b7565b5b90506020020135612b13565b8060010190506121f2565b50603f600760010160048282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff1602179055508484600190809261227593929190615c61565b604051612283929190615d11565b6040518091039020827f8487c13f40adf819be704c2686b8eaf22250a17df721323aea90991ea470d70060405160405180910390a37ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7826040516122e791906141d1565b60405180910390a15050505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600061239885858585612c61565b905060005b818110156123ec576123e18686838181106123bb576123ba6157b7565b5b905060200201358585848181106123d5576123d46157b7565b5b9050602002013561259a565b80600101905061239d565b5080600760010160048282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff1602179055505050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6124a081613340565b6124d6576040517f0397bc7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16612554836117d1565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006125a68383613381565b50915050806007600001600085815260200190815260200160002060008201816000019060066125d7929190613b86565b5060018201816001019060056125ee929190613bd1565b506002820181600201906005612605929190613bd1565b506003820160009054906101000a900460ff168160030160006101000a81548160ff021916908360ff1602179055506003820160019054906101000a900463ffffffff168160030160016101000a81548163ffffffff021916908363ffffffff1602179055506003820160059054906101000a900461ffff168160030160056101000a81548161ffff021916908361ffff1602179055506003820160079054906101000a900462ffffff168160030160076101000a81548162ffffff021916908362ffffff1602179055509050506126f8600760010160089054906101000a900463ffffffff1663ffffffff1642612f16565b6007600001600085815260200190815260200160002060030160076101000a81548162ffffff021916908362ffffff16021790555061273682612b13565b82827f2b437d4aa9e3060a2b27689497c04db7c378ca296b51df4ffaea18fa6f56881a60405160405180910390a37ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce78360405161279391906141d1565b60405180910390a1505050565b6000806127ac836117d1565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806127ee57506127ed81856122f6565b5b8061282c57508373ffffffffffffffffffffffffffffffffffffffff1661281484610817565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16612855826117d1565b73ffffffffffffffffffffffffffffffffffffffff16146128a2576040517fb8f91ff300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612908576040517f6474b5a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612915838383600161345f565b8273ffffffffffffffffffffffffffffffffffffffff16612935826117d1565b73ffffffffffffffffffffffffffffffffffffffff1614612982576040517fb8f91ff300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612b0e8383836001613585565b505050565b6000612b1e826117d1565b9050612b2e81600084600161345f565b612b37826117d1565b90506004600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506002600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905581600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612c5d816000846001613585565b5050565b6000848490509050828290508114612ca5576040517fe778681d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b949350505050565b600080612cba8484613381565b92505091506000600182612cce919061587e565b905060058260ff161015612d6457600080612ce98787612fc1565b9150915080856001018560ff1660058110612d0757612d066157b7565b5b602091828204019190066101000a81548160ff021916908360ff16021790555081856002018560ff1660058110612d4157612d406157b7565b5b602091828204019190066101000a81548160ff021916908360ff16021790555050505b612d89600760010160089054906101000a900463ffffffff1663ffffffff1642612f16565b8360030160076101000a81548162ffffff021916908362ffffff16021790555083836000018360ff1660068110612dc357612dc26157b7565b5b601091828204019190066002026101000a81548161ffff021916908361ffff160217905550808360030160006101000a81548160ff021916908360ff160217905550612e0e84612b13565b733bcbf1480879bff8435b1534c70b4a5182fb24666353bfca206040518163ffffffff1660e01b815260040161010060405180830381865af4158015612e58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7c9190615ddb565b8360030160009054906101000a900460ff1660ff1660088110612ea257612ea16157b7565b5b602002015160ff1684867f905feedea1eda3a8be0478a0f07f90de1ac162b88dfb7cc30cb5d2d57323f0af60405160405180910390a47ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce785604051612f0791906141d1565b60405180910390a15050505050565b60006001620151808484612f2a91906151bb565b612f349190615e09565b612f3e91906151ef565b905092915050565b612f618383836040518060200160405280600081525061358b565b505050565b612f808282604051806020016040528060008152506135df565b5050565b60006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000806000733bcbf1480879bff8435b1534c70b4a5182fb246663ba44e5078660076040518363ffffffff1660e01b8152600401613000929190615352565b6103c060405180830381865af415801561301e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130429190615789565b90506000733bcbf1480879bff8435b1534c70b4a5182fb246663ba44e5078660076040518363ffffffff1660e01b8152600401613080929190615352565b6103c060405180830381865af415801561309e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130c29190615789565b90506000826040015182604001516040516020016130e1929190615e3a565b6040516020818303038152906040528051906020012060001c90506050613109826064613631565b1161312757613122836101000151836101000151613670565b61316a565b600060028261313691906152ca565b146131545761314f83610100015183610100015161368f565b613169565b6131688361010001518361010001516136ae565b5b5b945061317e8360e001518360e001516136df565b93505050509250929050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036131ef576040517f2c39ec4e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516132e09190613f8a565b60405180910390a3505050565b6132f8848484612835565b61330484848484613701565b61333a576040517f91ec2e4700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b60008073ffffffffffffffffffffffffffffffffffffffff1661336283612f84565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60008060006007600001600086815260200190815260200160002092506007600001600085815260200190815260200160002091508260030160009054906101000a900460ff1690506133d433866127a0565b15806133e757506133e533856127a0565b155b8061340957508160030160009054906101000a900460ff1660ff168160ff1614155b8061341357508385145b80613421575060058160ff16115b15613458576040517f3d693ada00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b9250925092565b600181111561357f57600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146134f35780600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546134eb91906151bb565b925050819055505b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461357e5780600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461357691906151ef565b925050819055505b5b50505050565b50505050565b61359684848461387f565b6135a36000858484613701565b6135d9576040517f91ec2e4700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b6135e98383613953565b6135f66000848484613701565b61362c576040517f91ec2e4700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b600081836040516020016136459190615e66565b6040516020818303038152906040528051906020012060001c61366891906152ca565b905092915050565b60008160ff168360ff16106136855781613687565b825b905092915050565b60008160ff168360ff16116136a457816136a6565b825b905092915050565b60008160ff168360ff16116136c357826136d7565b60008260ff16116136d457826136d6565b815b5b905092915050565b600060018284161660018360ff16901c60018560ff16901c0101905092915050565b60006137228473ffffffffffffffffffffffffffffffffffffffff166139cb565b15613872578373ffffffffffffffffffffffffffffffffffffffff1663150b7a0261374b6124d9565b8786866040518563ffffffff1660e01b815260040161376d9493929190615ed6565b6020604051808303816000875af19250505080156137a957506040513d601f19601f820116820180604052508101906137a69190615f37565b60015b613822573d80600081146137d9576040519150601f19603f3d011682016040523d82523d6000602084013e6137de565b606091505b50600081510361381a576040517f91ec2e4700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050613877565b600190505b949350505050565b61388983826139ee565b808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4808373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461394e600084836001613585565b505050565b61395d82826139ee565b808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46139c7600083836001613585565b5050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603613a54576040517f6474b5a200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613a5d81613340565b15613a94576040517f5a5ab17e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613aa260008383600161345f565b613aab81613340565b15613ae2576040517f5a5ab17e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b826006600f01601090048101928215613bc05791600f016010900482015b82811115613bbf578254825591600101919060010190613ba4565b5b509050613bcd9190613e14565b5090565b826005601f01602090048101928215613c0b5791601f016020900482015b82811115613c0a578254825591600101919060010190613bef565b5b509050613c189190613e14565b5090565b826006600f01601090048101928215613ca85791602002820160005b83821115613c7857835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302613c38565b8015613ca65782816101000a81549061ffff0219169055600201602081600101049283019260010302613c78565b505b509050613cb59190613e14565b5090565b826005601f01602090048101928215613d425791602002820160005b83821115613d1357835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302613cd5565b8015613d405782816101000a81549060ff0219169055600101602081600001049283019260010302613d13565b505b509050613d4f9190613e14565b5090565b604051806080016040528060006fffffffffffffffffffffffffffffffff168152602001600067ffffffffffffffff1681526020016000151581526020016000151581525090565b604051806101600160405280613daf613e31565b815260200160001515815260200160008152602001600060ff168152602001600015158152602001600061ffff168152602001600015158152602001600060ff168152602001600060ff168152602001600060ff168152602001600060ff1681525090565b5b80821115613e2d576000816000905550600101613e15565b5090565b6040518060e00160405280613e44613e92565b8152602001613e51613eb4565b8152602001613e5e613eb4565b8152602001600060ff168152602001600063ffffffff168152602001600061ffff168152602001600062ffffff1681525090565b6040518060c00160405280600690602082028036833780820191505090505090565b6040518060a00160405280600590602082028036833780820191505090505090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613f1f81613eea565b8114613f2a57600080fd5b50565b600081359050613f3c81613f16565b92915050565b600060208284031215613f5857613f57613ee0565b5b6000613f6684828501613f2d565b91505092915050565b60008115159050919050565b613f8481613f6f565b82525050565b6000602082019050613f9f6000830184613f7b565b92915050565b6000819050919050565b613fb881613fa5565b8114613fc357600080fd5b50565b600081359050613fd581613faf565b92915050565b60008060408385031215613ff257613ff1613ee0565b5b600061400085828601613fc6565b925050602061401185828601613fc6565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561405557808201518184015260208101905061403a565b60008484015250505050565b6000601f19601f8301169050919050565b600061407d8261401b565b6140878185614026565b9350614097818560208601614037565b6140a081614061565b840191505092915050565b600060208201905081810360008301526140c58184614072565b905092915050565b6000602082840312156140e3576140e2613ee0565b5b60006140f184828501613fc6565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000614125826140fa565b9050919050565b6141358161411a565b82525050565b6000602082019050614150600083018461412c565b92915050565b61415f8161411a565b811461416a57600080fd5b50565b60008135905061417c81614156565b92915050565b6000806040838503121561419957614198613ee0565b5b60006141a78582860161416d565b92505060206141b885828601613fc6565b9150509250929050565b6141cb81613fa5565b82525050565b60006020820190506141e660008301846141c2565b92915050565b60008060006060848603121561420557614204613ee0565b5b60006142138682870161416d565b93505060206142248682870161416d565b925050604061423586828701613fc6565b9150509250925092565b600080fd5b600080fd5b600080fd5b60008083601f8401126142645761426361423f565b5b8235905067ffffffffffffffff81111561428157614280614244565b5b60208301915083602082028301111561429d5761429c614249565b5b9250929050565b600080600080604085870312156142be576142bd613ee0565b5b600085013567ffffffffffffffff8111156142dc576142db613ee5565b5b6142e88782880161424e565b9450945050602085013567ffffffffffffffff81111561430b5761430a613ee5565b5b6143178782880161424e565b925092505092959194509250565b61432e81613f6f565b811461433957600080fd5b50565b60008135905061434b81614325565b92915050565b60008060006060848603121561436a57614369613ee0565b5b600061437886828701613fc6565b935050602061438986828701613fc6565b925050604061439a8682870161433c565b9150509250925092565b6000806000604084860312156143bd576143bc613ee0565b5b600084013567ffffffffffffffff8111156143db576143da613ee5565b5b6143e78682870161424e565b935093505060206143fa8682870161416d565b9150509250925092565b60006020828403121561441a57614419613ee0565b5b60006144288482850161416d565b91505092915050565b60006fffffffffffffffffffffffffffffffff82169050919050565b61445681614431565b82525050565b600067ffffffffffffffff82169050919050565b6144798161445c565b82525050565b61448881613f6f565b82525050565b6080820160008201516144a4600085018261444d565b5060208201516144b76020850182614470565b5060408201516144ca604085018261447f565b5060608201516144dd606085018261447f565b50505050565b60006080820190506144f8600083018461448e565b92915050565b6000819050919050565b600061452361451e614519846140fa565b6144fe565b6140fa565b9050919050565b600061453582614508565b9050919050565b60006145478261452a565b9050919050565b6145578161453c565b82525050565b6000602082019050614572600083018461454e565b92915050565b600060069050919050565b600081905092915050565b6000819050919050565b600061ffff82169050919050565b6145af81614598565b82525050565b60006145c183836145a6565b60208301905092915050565b6000602082019050919050565b6145e381614578565b6145ed8184614583565b92506145f88261458e565b8060005b8381101561462957815161461087826145b5565b965061461b836145cd565b9250506001810190506145fc565b505050505050565b600060059050919050565b600081905092915050565b6000819050919050565b600060ff82169050919050565b61466781614651565b82525050565b6000614679838361465e565b60208301905092915050565b6000602082019050919050565b61469b81614631565b6146a5818461463c565b92506146b082614647565b8060005b838110156146e15781516146c8878261466d565b96506146d383614685565b9250506001810190506146b4565b505050505050565b600063ffffffff82169050919050565b614702816146e9565b82525050565b600062ffffff82169050919050565b61472081614708565b82525050565b6102808201600082015161473d60008501826145da565b50602082015161475060c0850182614692565b506040820151614764610160850182614692565b50606082015161477861020085018261465e565b50608082015161478c6102208501826146f9565b5060a08201516147a06102408501826145a6565b5060c08201516147b4610260850182614717565b50505050565b6147c381613fa5565b82525050565b6103c0820160008201516147e06000850182614726565b5060208201516147f461028085018261447f565b5060408201516148086102a08501826147ba565b50606082015161481c6102c085018261465e565b5060808201516148306102e085018261447f565b5060a08201516148446103008501826145a6565b5060c082015161485861032085018261447f565b5060e082015161486c61034085018261465e565b5061010082015161488161036085018261465e565b5061012082015161489661038085018261465e565b506101408201516148ab6103a085018261465e565b50505050565b60006103c0820190506148c760008301846147c9565b92915050565b600080604083850312156148e4576148e3613ee0565b5b60006148f28582860161416d565b92505060206149038582860161433c565b9150509250929050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61494a82614061565b810181811067ffffffffffffffff8211171561496957614968614912565b5b80604052505050565b600061497c613ed6565b90506149888282614941565b919050565b600067ffffffffffffffff8211156149a8576149a7614912565b5b6149b182614061565b9050602081019050919050565b82818337600083830152505050565b60006149e06149db8461498d565b614972565b9050828152602081018484840111156149fc576149fb61490d565b5b614a078482856149be565b509392505050565b600082601f830112614a2457614a2361423f565b5b8135614a348482602086016149cd565b91505092915050565b60008060008060808587031215614a5757614a56613ee0565b5b6000614a658782880161416d565b9450506020614a768782880161416d565b9350506040614a8787828801613fc6565b925050606085013567ffffffffffffffff811115614aa857614aa7613ee5565b5b614ab487828801614a0f565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600082825260208201905092915050565b6000614b088261401b565b614b128185614aec565b9350614b22818560208601614037565b614b2b81614061565b840191505092915050565b6000614b428383614afd565b905092915050565b6000602082019050919050565b6000614b6282614ac0565b614b6c8185614acb565b935083602082028501614b7e85614adc565b8060005b85811015614bba5784840389528151614b9b8582614b36565b9450614ba683614b4a565b925060208a01995050600181019050614b82565b50829750879550505050505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000614c0483836147ba565b60208301905092915050565b6000602082019050919050565b6000614c2882614bcc565b614c328185614bd7565b9350614c3d83614be8565b8060005b83811015614c6e578151614c558882614bf8565b9750614c6083614c10565b925050600181019050614c41565b5085935050505092915050565b60006040820190508181036000830152614c958185614b57565b90508181036020830152614ca98184614c1d565b90509392505050565b60008060208385031215614cc957614cc8613ee0565b5b600083013567ffffffffffffffff811115614ce757614ce6613ee5565b5b614cf38582860161424e565b92509250509250929050565b60008060408385031215614d1657614d15613ee0565b5b6000614d248582860161416d565b9250506020614d358582860161416d565b9150509250929050565b600081905092915050565b614d5381614598565b82525050565b6000614d658383614d4a565b60208301905092915050565b614d7a81614578565b614d848184614d3f565b9250614d8f8261458e565b8060005b83811015614dc0578151614da78782614d59565b9650614db2836145cd565b925050600181019050614d93565b505050505050565b600081905092915050565b614ddc81614651565b82525050565b6000614dee8383614dd3565b60208301905092915050565b614e0381614631565b614e0d8184614dc8565b9250614e1882614647565b8060005b83811015614e49578151614e308782614de2565b9650614e3b83614685565b925050600181019050614e1c565b505050505050565b614e5a816146e9565b82525050565b614e6981614708565b82525050565b61028082016000820151614e866000850182614d71565b506020820151614e9960c0850182614dfa565b506040820151614ead610160850182614dfa565b506060820151614ec1610200850182614dd3565b506080820151614ed5610220850182614e51565b5060a0820151614ee9610240850182614d4a565b5060c0820151614efd610260850182614e60565b50505050565b614f0c81613f6f565b82525050565b614f1b81613fa5565b82525050565b6103c082016000820151614f386000850182614e6f565b506020820151614f4c610280850182614f03565b506040820151614f606102a0850182614f12565b506060820151614f746102c0850182614dd3565b506080820151614f886102e0850182614f03565b5060a0820151614f9c610300850182614d4a565b5060c0820151614fb0610320850182614f03565b5060e0820151614fc4610340850182614dd3565b50610100820151614fd9610360850182614dd3565b50610120820151614fee610380850182614dd3565b506101408201516150036103a0850182614dd3565b50505050565b8082525050565b60006103e0820190506150266000830185614f21565b6150346103c0830184615009565b9392505050565b600061504e6150498461498d565b614972565b90508281526020810184848401111561506a5761506961490d565b5b615075848285614037565b509392505050565b600082601f8301126150925761509161423f565b5b81516150a284826020860161503b565b91505092915050565b6000602082840312156150c1576150c0613ee0565b5b600082015167ffffffffffffffff8111156150df576150de613ee5565b5b6150eb8482850161507d565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061513b57607f821691505b60208210810361514e5761514d6150f4565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061518e826146e9565b9150615199836146e9565b9250828203905063ffffffff8111156151b5576151b4615154565b5b92915050565b60006151c682613fa5565b91506151d183613fa5565b92508282039050818111156151e9576151e8615154565b5b92915050565b60006151fa82613fa5565b915061520583613fa5565b925082820190508082111561521d5761521c615154565b5b92915050565b6000819050919050565b6000819050919050565b61524861524382615223565b61522d565b82525050565b6000819050919050565b61526961526482613fa5565b61524e565b82525050565b600061527b8285615237565b60208201915061528b8284615258565b6020820191508190509392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006152d582613fa5565b91506152e083613fa5565b9250826152f0576152ef61529b565b5b828206905092915050565b600061530682613fa5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361533857615337615154565b5b600182019050919050565b61534c81613fa5565b82525050565b60006040820190506153676000830185615343565b6153746020830184615009565b9392505050565b600080fd5b600067ffffffffffffffff82111561539b5761539a614912565b5b602082029050919050565b6153af81614598565b81146153ba57600080fd5b50565b6000815190506153cc816153a6565b92915050565b60006153e56153e084615380565b614972565b905080602084028301858111156153ff576153fe614249565b5b835b81811015615428578061541488826153bd565b845260208401935050602081019050615401565b5050509392505050565b600082601f8301126154475761544661423f565b5b60066154548482856153d2565b91505092915050565b600067ffffffffffffffff82111561547857615477614912565b5b602082029050919050565b61548c81614651565b811461549757600080fd5b50565b6000815190506154a981615483565b92915050565b60006154c26154bd8461545d565b614972565b905080602084028301858111156154dc576154db614249565b5b835b8181101561550557806154f1888261549a565b8452602084019350506020810190506154de565b5050509392505050565b600082601f8301126155245761552361423f565b5b60056155318482856154af565b91505092915050565b615543816146e9565b811461554e57600080fd5b50565b6000815190506155608161553a565b92915050565b61556f81614708565b811461557a57600080fd5b50565b60008151905061558c81615566565b92915050565b600061028082840312156155a9576155a861537b565b5b6155b360e0614972565b905060006155c384828501615432565b60008301525060c06155d78482850161550f565b6020830152506101606155ec8482850161550f565b6040830152506102006156018482850161549a565b60608301525061022061561684828501615551565b60808301525061024061562b848285016153bd565b60a0830152506102606156408482850161557d565b60c08301525092915050565b60008151905061565b81614325565b92915050565b60008151905061567081613faf565b92915050565b60006103c0828403121561568d5761568c61537b565b5b615698610160614972565b905060006156a884828501615592565b6000830152506102806156bd8482850161564c565b6020830152506102a06156d284828501615661565b6040830152506102c06156e78482850161549a565b6060830152506102e06156fc8482850161564c565b608083015250610300615711848285016153bd565b60a0830152506103206157268482850161564c565b60c08301525061034061573b8482850161549a565b60e0830152506103606157508482850161549a565b610100830152506103806157668482850161549a565b610120830152506103a061577c8482850161549a565b6101408301525092915050565b60006103c082840312156157a05761579f613ee0565b5b60006157ae84828501615676565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000815190506157f581614156565b92915050565b60006020828403121561581157615810613ee0565b5b600061581f848285016157e6565b91505092915050565b600060408201905061583d600083018561412c565b61584a602083018461412c565b9392505050565b60006020828403121561586757615866613ee0565b5b60006158758482850161564c565b91505092915050565b600061588982614651565b915061589483614651565b9250828201905060ff8111156158ad576158ac615154565b5b92915050565b6158bc81614651565b82525050565b60006060820190506158d76000830186615343565b6158e460208301856158b3565b6158f16040830184615009565b949350505050565b60006103e08201905061590f6000830185614f21565b61591d6103c08301846158b3565b9392505050565b60006020828403121561593a57615939613ee0565b5b60006159488482850161549a565b91505092915050565b600067ffffffffffffffff82111561596c5761596b614912565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561599857615997614912565b5b6159a182614061565b9050602081019050919050565b60006159c16159bc8461597d565b614972565b9050828152602081018484840111156159dd576159dc61490d565b5b6159e8848285614037565b509392505050565b600082601f830112615a0557615a0461423f565b5b8151615a158482602086016159ae565b91505092915050565b6000615a31615a2c84615951565b614972565b90508083825260208201905060208402830185811115615a5457615a53614249565b5b835b81811015615a9b57805167ffffffffffffffff811115615a7957615a7861423f565b5b808601615a8689826159f0565b85526020850194505050602081019050615a56565b5050509392505050565b600082601f830112615aba57615ab961423f565b5b8151615aca848260208601615a1e565b91505092915050565b600067ffffffffffffffff821115615aee57615aed614912565b5b602082029050602081019050919050565b6000615b12615b0d84615ad3565b614972565b90508083825260208201905060208402830185811115615b3557615b34614249565b5b835b81811015615b5e5780615b4a8882615661565b845260208401935050602081019050615b37565b5050509392505050565b600082601f830112615b7d57615b7c61423f565b5b8151615b8d848260208601615aff565b91505092915050565b60008060408385031215615bad57615bac613ee0565b5b600083015167ffffffffffffffff811115615bcb57615bca613ee5565b5b615bd785828601615aa5565b925050602083015167ffffffffffffffff811115615bf857615bf7613ee5565b5b615c0485828601615b68565b9150509250929050565b600060208284031215615c2457615c23613ee0565b5b600082015167ffffffffffffffff811115615c4257615c41613ee5565b5b615c4e848285016159f0565b91505092915050565b600080fd5b600080fd5b60008085851115615c7557615c74615c57565b5b83861115615c8657615c85615c5c565b5b6020850283019150848603905094509492505050565b600081905092915050565b600080fd5b82818337505050565b6000615cc18385615c9c565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115615cf457615cf3615ca7565b5b602083029250615d05838584615cac565b82840190509392505050565b6000615d1e828486615cb5565b91508190509392505050565b600067ffffffffffffffff821115615d4557615d44614912565b5b602082029050919050565b6000615d63615d5e84615d2a565b614972565b90508060208402830185811115615d7d57615d7c614249565b5b835b81811015615da65780615d92888261549a565b845260208401935050602081019050615d7f565b5050509392505050565b600082601f830112615dc557615dc461423f565b5b6008615dd2848285615d50565b91505092915050565b60006101008284031215615df257615df1613ee0565b5b6000615e0084828501615db0565b91505092915050565b6000615e1482613fa5565b9150615e1f83613fa5565b925082615e2f57615e2e61529b565b5b828204905092915050565b6000615e468285615258565b602082019150615e568284615258565b6020820191508190509392505050565b6000615e728284615258565b60208201915081905092915050565b600081519050919050565b600082825260208201905092915050565b6000615ea882615e81565b615eb28185615e8c565b9350615ec2818560208601614037565b615ecb81614061565b840191505092915050565b6000608082019050615eeb600083018761412c565b615ef8602083018661412c565b615f0560408301856141c2565b8181036060830152615f178184615e9d565b905095945050505050565b600081519050615f3181613f16565b92915050565b600060208284031215615f4d57615f4c613ee0565b5b6000615f5b84828501615f22565b9150509291505056fea26469706673582212201754a436c0b93793216b3c1e456c930b4d04ac3c3951b1ff79f648cc53e0118564736f6c63430008110033

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.