library SafeMath {
    function tryAdd(uint256 a, uint256 b)
        internal
        pure
        returns (bool, uint256)
    {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

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

    function tryMul(uint256 a, uint256 b)
        internal
        pure
        returns (bool, uint256)
    {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

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

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

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

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

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

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

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

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

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

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}
// This is an NFT of the Zoobots, intended to clarify the terms of use for any NFT it is included with. It was originally authored in this form by H.A.J. a.k.a. LIONBRUSH and the text of the license itself is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
// This document defines the terms and conditions associated with the packaged non-fungible token ("the NFT" or "this NFT") and specifies the rights and obligations between the creating party (the "Creator") and the present owner of the NFT (the "Owner"). By assuming ownership of this token, you agree to a goodwill performance of the Owner's obligations under the terms of this document in exchange for the Creator's performance of their responsibilities and the upholding of their pledges and covenants under these same terms.
// 
// I. NON FUNGIBLE TOKEN DETAILS
// Title: Zoobots
// Creator: H.A.J. a.k.a. LIONBRUSH
// Royalty Rate: 10%
// 
// II. CREATOR PLEDGE
// I, H.A.J. a.k.a. LIONBRUSH, certify that I am the original Creator of both the NFT packaged with this document and the associated original piece of media which the token represents (the "work"). I further certify that at the dated time of this NFT's creation, I possess all necessary rights to the work to issue the associated NFT and to create the licenses and terms explained in this document. I pledge that I shall create no further NFT or materially identical cryptographic instrument representing this same work without the written consent of the present owner, and agree that the present owner of the NFT may publicly state their ownership of the NFT and my association with its creation, as well as my association with and creation of the associated work. I enter into these terms freely and willingly and pledge to uphold them to the reasonable extent of my ability. The likeness of any and all Zoobots NFTs, or derivatives thereof, are not granted as intellectual property to respective owners. All intellectual property rights will remain solely to the original creator of this art.
// 
// III. CREATOR COVENANTS
// As the Creator of this NFT and the associated work, I make the following warrants and grants and assume the associated obligations toward whomever the current owner of the packaged NFT might be, provided that they uphold the Owner Obligations and Royalties to the reasonable extent of their ability:
// I warrant that this NFT is and shall remain a unique collectible asset to the reasonable extent of my ability to ensure this outcome, and I hereby forfeit my right to create another NFT or functionally identical cryptographic instrument of this specific work without the written consent of the present owner as my means of ensuring performance of this clause.
// I warrant that I shall maintain a hyperlink back to this NFT from the primary public location of the original work to the extent of my reasonable ability to do so, provided that any such public display exists.
// I retain all rights and usage of the original work represented by this NFT.
// In addition to the rights already afforded to third parties under any form of public licensing which the work has been published under, I hereby grant a limited, worldwide, irrevocable, and non-transferable license to the present owner of this NFT for the duration of their ownership of the NFT to both privately use or print and publicly display the associated work in any single digital location which is capable of cryptographic verification of the NFT's authenticity and which continues to regularly validate such verification for the duration of the display. One (1) printed copy of the work is permitted for public display under this license. No reproduction of the original work is otherwise permitted under this license, nor does this license extend to any duplication or derivative of the NFT. No derivative or modification of the work is permitted under this license. No sale or transfer of a physical or digital reproduction of the work is permitted under this license.
// 
// IV. OWNER OBLIGATIONS AND ROYALTIES
// As the present owner of this NFT, you are entitled to publicly claim ownership of the NFT, display the associated work under the terms of the limited license, and to sell, transfer, or otherwise dispose of the NFT as you will. You have only the rights to, usage of, and ownership of the original work which are specifically granted to you by the limited license. In exchange for the Creator's upholding of the Creator Pledge and Covenants, you agree to pay a royalty rate to the Creator of a fixed percentage equivalent to the Royalty Rate listed in Section I of this document of the present cash value of any funds or assets received in exchange for the subsequent sale or transfer of this NFT.
// 
// V. DISCLAIMERS
// By assuming ownership of this NFT, you confirm that you have read and agree with the following disclaimers:
// The Creator is in no way liable or responsible to you or any third party for any losses or damages related to the ownership, possession, sale, use, or transfer of the NFT or associated work.
// The Creator is in no way liable or responsible to you or any third party for any losses or damages related to claims involving your ownership, possession, sale, use, or transfer of the NFT or associated work.
// The Creator makes no warrants or guarantees as to the present or future value of the NFT and the associated work, and you understand and willingly assume the risk that the value of the NFT is inherently volatile and may fluctuate, decline, or disappear entirely due to any number of possible factors.
// The Creator is in no way responsible to you or any third party for the technology, transfer, maintenance, storage, security, use, or condition of the NFT and the underlying networks on which it is maintained, stored, displayed, or transferred, and you accept it as your sole responsibility to secure the safety, security, and your intended use, sale, or transfer of the NFT.
function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }
/**
 * @dev Returns the integer division of two unsigned integers, reverting with custom message on
 * division by zero. The result is rounded towards zero.
 *
 * Counterpart to Solidity's `/` operator. Note: this function uses a
 * `revert` opcode (which leaves remaining gas untouched) while Solidity
 * uses an invalid opcode to revert (consuming all remaining gas).
 *
 * Requirements:
 *
 * - The divisor cannot be zero.
 */