Token C3ID

 

Overview [ERC-20]

Price
$0.00 @ 0.000000 Eth
Fully Diluted Market Cap
Max Total Supply:
10,000 C3ID

Holders:
161

Transfers:
-

Contract:
0xd7c13e1b6cbe4f06a40cdaeae31b1f004a73aaa00xD7C13e1B6CBE4f06a40CdAeAE31B1F004a73aAA0

Decimals:
18

Social Profiles:
Not Available, Update ?

Loading
[ Download CSV Export  ] 
Loading
[ Download CSV Export  ] 
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
C3ID

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
No with 200 runs

Other Settings:
paris EvmVersion
File 1 of 9 : C3ID.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import {DN404} from "dn404/src/DN404.sol";
import {DN404Mirror} from "dn404/src/DN404Mirror.sol";
import {Ownable} from "solady/src/auth/Ownable.sol";
import {LibString} from "solady/src/utils/LibString.sol";
import {SafeTransferLib} from "solady/src/utils/SafeTransferLib.sol";
import "./Strings.sol";

contract C3ID is DN404, Ownable {
    string private _name;
    string private _symbol;
    string private _baseURI;

    using Strings for uint256;

    string[] private race = [
        "Human",
        "Neo-Human",
        "Synth",
        "Cyborg",
        "AI Entity",
        "Android",
        "Neon",
        "Spectre"
    ];

    string[] private gender = [
        "Male",
        "Female",
        "Non-Binary",
        "Genderfluid",
        "Agender"
    ];

    string[] private skills = [
        "Encryption Savant",
        "Quantum Navigator",
        "Neuro-Engineer",
        "Combat Tactician",
        "Digital Illusionist",
        "Hacking Expertise",
        "Quantum Programming",
        "Stealth Tactics",
        "Combat Proficiency",
        "Diplomatic Negotiation"
    ];

    string[] private cybernetics = [
        "Echo Locator",
        "Thermal Regulator",
        "Datastream Diverter",
        "Memory Vault",
        "Ocular Drone",
        "Neural Accelerator",
        "Quantum Core Processor",
        "Synaptic Enhancer",
        "Retinal HUD Display",
        "Nanite Repair System",
        "Cortex Firewall",
        "Digital Camouflage Modulator",
        "Haptic Feedback Sensors",
        "Molecular Assembly Toolkit",
        "Cybernetic Respirator",
        "EMP Shielding",
        "Sonic Disruption Device",
        "Adaptive Climate Control System",
        "Kinetic Energy Harvesters",
        "Optimized Metabolism Regulator",
        "Neuro-Link Interface",
        "Photon Cloak Projector",
        "Magnetic Manipulation Coils",
        "Spectral Analysis Lenses",
        "Bionic Limb Enhancements"
    ];

    string[] private personalityTraits = [
        "Analytical",
        "Charismatic",
        "Stoic",
        "Innovative",
        "Reclusive",
        "Rebellious",
        "Empathic"
    ];

    function random(string memory input) internal pure returns (uint256) {
        return uint256(keccak256(abi.encodePacked(input)));
    }

    function pluck(uint256 tokenId, string memory keyPrefix, string[] memory sourceArray) internal pure returns (string memory) {
        uint256 rand = random(string(abi.encodePacked(keyPrefix, toString(tokenId))));
        string memory output = sourceArray[rand % sourceArray.length];
        output = string(abi.encodePacked(output));
        return output;
    }

    function getRace(uint256 tokenId) public view returns (string memory) {
        return pluck(tokenId, "RACE", race);
    }

    function getGender(uint256 tokenId) public view returns (string memory) {
        return pluck(tokenId, "GENDER", gender);
    }

    function getPersonalityTrait(uint256 tokenId) public view returns (string memory) {
        return pluck(tokenId, "PERSONALITY", personalityTraits);
    }


    function getCybernetic(uint256 tokenId, uint256 index) public view returns (string memory) {
        require(index > 0 && index <= cybernetics.length, "Index out of bounds");
        uint256 rand = random(string(abi.encodePacked("CYBERNETIC", toString(index), toString(tokenId))));
        string memory cybernetic = cybernetics[(rand % cybernetics.length)];
        return cybernetic;
    }

    function getSkill(uint256 tokenId, uint256 index) public view returns (string memory) {
        require(index > 0 && index <= skills.length, "Index out of bounds");
        uint256 rand = random(string(abi.encodePacked("SKILL", Strings.toString(index), tokenId.toString())));
        string memory skill = skills[(rand % skills.length)];
        return skill;
    }

    constructor(
        string memory name_,
        string memory symbol_,
        uint96 initialTokenSupply,
        address initialSupplyOwner
    ) {
        _initializeOwner(msg.sender);

        _name = name_;
        _symbol = symbol_;

        address mirror = address(new DN404Mirror(msg.sender));
        _initializeDN404(initialTokenSupply, initialSupplyOwner, mirror);
    }

    function name() public view override returns (string memory) {
        return _name;
    }

    function symbol() public view override returns (string memory) {
        return _symbol;
    }

    function tokenURI(uint256 tokenId) override public view returns (string memory) {
        string[17] memory parts;
        parts[0] = "<svg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='xMinYMin meet' viewBox='0 0 350 350'><style>@import url(https://fonts.googleapis.com/css2?family=Orbitron:wght@400;900);.base,.footer,.text{font-family:&quot;Orbitron&quot;,Courier,serif}.base{fill:#20c20e;font-size:20px;font-weight:900}.footer,.text{fill:#9acc95}.text{font-size:14px}.footer{font-size:8px}</style><defs><pattern id='background-img' patternUnits='userSpaceOnUse' width='100' height='100' fill='#000'><image href=\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%2342e408' fill-opacity='0.3'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3Cpath d='M6 5V0H5v5H0v1h5v94h1V6h94V5H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E\" width='100' height='100'/></pattern></defs><rect width='100%' height='100%' fill='#030f02' stroke='#42e408' stroke-width='5'/><rect width='100%' height='100%' fill='url(#background-img)' opacity='.5'/><text x='150' y='25' class='base'>C3ID</text><text x='10' y='55' class='base'>Race:</text><text x='10' y='80' class='base'>Gender:</text><text x='10' y='120' class='base'>Cybernetics:</text><text x='10' y='220' class='base'>Skills:</text><text x='10' y='295' class='base'>Personality Trait:</text><text x='10' y='340' class='footer'>X: @C3_DN404</text><text x='180' y='340' class='footer'>Cybernetic Consciousness Collective</text><text x='75' y='54' class='text'>";
        parts[1] = getRace(tokenId);
        parts[2] = "</text><text x='100' y='79' class='text'>";
        parts[3] = getGender(tokenId);
        parts[4] = "</text><text x='10' y='140' class='text'>1. ";
        parts[5] = getCybernetic(tokenId, 1);
        parts[6] = "</text><text x='10' y='160' class='text'>2. ";
        parts[7] = getCybernetic(tokenId, 2);
        parts[8] = "</text><text x='10' y='180' class='text'>3. ";
        parts[9] = getCybernetic(tokenId, 3);
        parts[10] = "</text><text x='10' y='240' class='text'>1. ";
        parts[11] = getSkill(tokenId, 1);
        parts[12] = "</text><text x='10' y='260' class='text'>2. ";
        parts[13] = getSkill(tokenId, 2);
        parts[14] = "</text><text x='10' y='315' class='text'>";
        parts[15] = getPersonalityTrait(tokenId);
        parts[16] = "</text></svg>";

        string memory output = string(abi.encodePacked(parts[0], parts[1], parts[2], parts[3], parts[4], parts[5], parts[6], parts[7], parts[8]));
        output = string(abi.encodePacked(output, parts[9], parts[10], parts[11], parts[12], parts[13], parts[14], parts[15], parts[16]));

        string memory json = Base64.encode(bytes(string(abi.encodePacked('{"name": "C3ID #', tokenId.toString(), '", "description": "C3ID is a unique digital identity within the Cybernetic Consciousness Collective, built on Base with the Divisible NFT - DN404 Standard.", "image": "data:image/svg+xml;base64,', Base64.encode(bytes(output)), '"}'))));
        output = string(abi.encodePacked('data:application/json;base64,', json));

        return output;
    }

    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);
    }

    function setBaseURI(string calldata baseURI_) public onlyOwner {
        _baseURI = baseURI_;
    }

    function withdraw() public onlyOwner {
        SafeTransferLib.safeTransferAllETH(msg.sender);
    }

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

library Base64 {
    bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

    /// @notice Encodes some bytes to the base64 representation
    function encode(bytes memory data) internal pure returns (string memory) {
        uint256 len = data.length;
        if (len == 0) return "";

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

        // Add some extra buffer at the end
        bytes memory result = new bytes(encodedLen + 32);

        bytes memory table = TABLE;

        assembly {
            let tablePtr := add(table, 1)
            let resultPtr := add(result, 32)

            for {
                let i := 0
            } lt(i, len) {

            } {
                i := add(i, 3)
                let input := and(mload(add(data, i)), 0xffffff)

                let out := mload(add(tablePtr, and(shr(18, input), 0x3F)))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(input, 0x3F))), 0xFF))
                out := shl(224, out)

                mstore(resultPtr, out)

                resultPtr := add(resultPtr, 4)
            }

            switch mod(len, 3)
            case 1 {
                mstore(sub(resultPtr, 2), shl(240, 0x3d3d))
            }
            case 2 {
                mstore(sub(resultPtr, 1), shl(248, 0x3d))
            }

            mstore(result, encodedLen)
        }

        return string(result);
    }
}

File 2 of 9 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    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 subtraction of two unsigned integers, with an overflow flag.
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     */
    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.
     */
    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.
     */
    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 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 towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (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 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

            ///////////////////////////////////////////////
            // 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.

            uint256 twos = denominator & (0 - denominator);
            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 (unsignedRoundsUp(rounding) && 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
     * towards zero.
     *
     * 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 + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * 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 + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * 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 + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * 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 256, 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 + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

File 3 of 9 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

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

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 4 of 9 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

import {Math} from "./Math.sol";
import {SignedMath} from "./SignedMath.sol";

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

    /**
     * @dev The `value` string doesn't fit in the specified `length`.
     */
    error StringsInsufficientHexLength(uint256 value, uint256 length);

    /**
     * @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), HEX_DIGITS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toStringSigned(int256 value) internal pure returns (string memory) {
        return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
    }

    /**
     * @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) {
        uint256 localValue = value;
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = HEX_DIGITS[localValue & 0xf];
            localValue >>= 4;
        }
        if (localValue != 0) {
            revert StringsInsufficientHexLength(value, length);
        }
        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);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 5 of 9 : DN404.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @title DN404
/// @notice DN404 is a hybrid ERC20 and ERC721 implementation that mints
/// and burns NFTs based on an account's ERC20 token balance.
///
/// @author vectorized.eth (@optimizoor)
/// @author Quit (@0xQuit)
/// @author Michael Amadi (@AmadiMichaels)
/// @author cygaar (@0xCygaar)
/// @author Thomas (@0xjustadev)
/// @author Harrison (@PopPunkOnChain)
///
/// @dev Note:
/// - The ERC721 data is stored in this base DN404 contract, however a
///   DN404Mirror contract ***MUST*** be deployed and linked during
///   initialization.
abstract contract DN404 {
    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                           EVENTS                           */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Emitted when `amount` tokens is transferred from `from` to `to`.
    event Transfer(address indexed from, address indexed to, uint256 amount);

    /// @dev Emitted when `amount` tokens is approved by `owner` to be used by `spender`.
    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /// @dev Emitted when `target` sets their skipNFT flag to `status`.
    event SkipNFTSet(address indexed target, bool status);

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                        CUSTOM ERRORS                       */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Thrown when attempting to double-initialize the contract.
    error DNAlreadyInitialized();

    /// @dev Thrown when attempting to transfer or burn more tokens than sender's balance.
    error InsufficientBalance();

    /// @dev Thrown when a spender attempts to transfer tokens with an insufficient allowance.
    error InsufficientAllowance();

    /// @dev Thrown when minting an amount of tokens that would overflow the max tokens.
    error TotalSupplyOverflow();

    /// @dev Thrown when the caller for a fallback NFT function is not the mirror contract.
    error SenderNotMirror();

    /// @dev Thrown when attempting to transfer tokens to the zero address.
    error TransferToZeroAddress();

    /// @dev Thrown when the mirror address provided for initialization is the zero address.
    error MirrorAddressIsZero();

    /// @dev Thrown when the link call to the mirror contract reverts.
    error LinkMirrorContractFailed();

    /// @dev Thrown when setting an NFT token approval
    /// and the caller is not the owner or an approved operator.
    error ApprovalCallerNotOwnerNorApproved();

    /// @dev Thrown when transferring an NFT
    /// and the caller is not the owner or an approved operator.
    error TransferCallerNotOwnerNorApproved();

    /// @dev Thrown when transferring an NFT and the from address is not the current owner.
    error TransferFromIncorrectOwner();

    /// @dev Thrown when checking the owner or approved address for an non-existent NFT.
    error TokenDoesNotExist();

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                         CONSTANTS                          */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Amount of token balance that is equal to one NFT.
    uint256 internal constant _WAD = 10 ** 18;

    /// @dev The maximum token ID allowed for an NFT.
    uint256 internal constant _MAX_TOKEN_ID = 0xffffffff;

    /// @dev The maximum possible token supply.
    uint256 internal constant _MAX_SUPPLY = 10 ** 18 * 0xffffffff - 1;

    /// @dev The flag to denote that the address data is initialized.
    uint8 internal constant _ADDRESS_DATA_INITIALIZED_FLAG = 1 << 0;

    /// @dev The flag to denote that the address should skip NFTs.
    uint8 internal constant _ADDRESS_DATA_SKIP_NFT_FLAG = 1 << 1;

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                          STORAGE                           */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Struct containing an address's token data and settings.
    struct AddressData {
        // Auxiliary data.
        uint88 aux;
        // Flags for `initialized` and `skipNFT`.
        uint8 flags;
        // The alias for the address. Zero means absence of an alias.
        uint32 addressAlias;
        // The number of NFT tokens.
        uint32 ownedLength;
        // The token balance in wei.
        uint96 balance;
    }

    /// @dev A uint32 map in storage.
    struct Uint32Map {
        mapping(uint256 => uint256) map;
    }

    /// @dev Struct containing the base token contract storage.
    struct DN404Storage {
        // Current number of address aliases assigned.
        uint32 numAliases;
        // Next token ID to assign for an NFT mint.
        uint32 nextTokenId;
        // Total supply of minted NFTs.
        uint32 totalNFTSupply;
        // Total supply of tokens.
        uint96 totalSupply;
        // Address of the NFT mirror contract.
        address mirrorERC721;
        // Mapping of a user alias number to their address.
        mapping(uint32 => address) aliasToAddress;
        // Mapping of user operator approvals for NFTs.
        mapping(address => mapping(address => bool)) operatorApprovals;
        // Mapping of NFT token approvals to approved operators.
        mapping(uint256 => address) tokenApprovals;
        // Mapping of user allowances for token spenders.
        mapping(address => mapping(address => uint256)) allowance;
        // Mapping of NFT token IDs owned by an address.
        mapping(address => Uint32Map) owned;
        // Even indices: owner aliases. Odd indices: owned indices.
        Uint32Map oo;
        // Mapping of user account AddressData
        mapping(address => AddressData) addressData;
    }

    /// @dev Returns a storage pointer for DN404Storage.
    function _getDN404Storage() internal pure virtual returns (DN404Storage storage $) {
        /// @solidity memory-safe-assembly
        assembly {
            // `uint72(bytes9(keccak256("DN404_STORAGE")))`.
            $.slot := 0xa20d6e21d0e5255308 // Truncate to 9 bytes to reduce bytecode size.
        }
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                         INITIALIZER                        */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Initializes the DN404 contract with an
    /// `initialTokenSupply`, `initialTokenOwner` and `mirror` NFT contract address.
    function _initializeDN404(
        uint256 initialTokenSupply,
        address initialSupplyOwner,
        address mirror
    ) internal virtual {
        DN404Storage storage $ = _getDN404Storage();

        if ($.nextTokenId != 0) revert DNAlreadyInitialized();

        if (mirror == address(0)) revert MirrorAddressIsZero();
        _linkMirrorContract(mirror);

        $.nextTokenId = 1;
        $.mirrorERC721 = mirror;

        if (initialTokenSupply > 0) {
            if (initialSupplyOwner == address(0)) revert TransferToZeroAddress();
            if (initialTokenSupply > _MAX_SUPPLY) revert TotalSupplyOverflow();

            $.totalSupply = uint96(initialTokenSupply);
            AddressData storage initialOwnerAddressData = _addressData(initialSupplyOwner);
            initialOwnerAddressData.balance = uint96(initialTokenSupply);

            emit Transfer(address(0), initialSupplyOwner, initialTokenSupply);

            _setSkipNFT(initialSupplyOwner, true);
        }
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*               METADATA FUNCTIONS TO OVERRIDE               */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the name of the token.
    function name() public view virtual returns (string memory);

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

    /// @dev Returns the Uniform Resource Identifier (URI) for token `id`.
    function tokenURI(uint256 id) public view virtual returns (string memory);

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                      ERC20 OPERATIONS                      */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the decimals places of the token. Always 18.
    function decimals() public pure returns (uint8) {
        return 18;
    }

    /// @dev Returns the amount of tokens in existence.
    function totalSupply() public view virtual returns (uint256) {
        return uint256(_getDN404Storage().totalSupply);
    }

    /// @dev Returns the amount of tokens owned by `owner`.
    function balanceOf(address owner) public view virtual returns (uint256) {
        return _getDN404Storage().addressData[owner].balance;
    }

    /// @dev Returns the amount of tokens that `spender` can spend on behalf of `owner`.
    function allowance(address owner, address spender) public view returns (uint256) {
        return _getDN404Storage().allowance[owner][spender];
    }

    /// @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
    ///
    /// Emits a {Approval} event.
    function approve(address spender, uint256 amount) public virtual returns (bool) {
        DN404Storage storage $ = _getDN404Storage();

        $.allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    /// @dev Transfer `amount` tokens from the caller to `to`.
    ///
    /// Will burn sender NFTs if balance after transfer is less than
    /// the amount required to support the current NFT balance.
    ///
    /// Will mint NFTs to `to` if the recipient's new balance supports
    /// additional NFTs ***AND*** the `to` address's skipNFT flag is
    /// set to false.
    ///
    /// Requirements:
    /// - `from` must at least have `amount`.
    ///
    /// Emits a {Transfer} event.
    function transfer(address to, uint256 amount) public virtual returns (bool) {
        _transfer(msg.sender, to, amount);
        return true;
    }

    /// @dev Transfers `amount` tokens from `from` to `to`.
    ///
    /// Note: Does not update the allowance if it is the maximum uint256 value.
    ///
    /// Will burn sender NFTs if balance after transfer is less than
    /// the amount required to support the current NFT balance.
    ///
    /// Will mint NFTs to `to` if the recipient's new balance supports
    /// additional NFTs ***AND*** the `to` address's skipNFT flag is
    /// set to false.
    ///
    /// Requirements:
    /// - `from` must at least have `amount`.
    /// - The caller must have at least `amount` of allowance to transfer the tokens of `from`.
    ///
    /// Emits a {Transfer} event.
    function transferFrom(address from, address to, uint256 amount) public virtual returns (bool) {
        DN404Storage storage $ = _getDN404Storage();

        uint256 allowed = $.allowance[from][msg.sender];

        if (allowed != type(uint256).max) {
            if (amount > allowed) revert InsufficientAllowance();
            unchecked {
                $.allowance[from][msg.sender] = allowed - amount;
            }
        }

        _transfer(from, to, amount);

        return true;
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                  INTERNAL MINT FUNCTIONS                   */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Mints `amount` tokens to `to`, increasing the total supply.
    ///
    /// Will mint NFTs to `to` if the recipient's new balance supports
    /// additional NFTs ***AND*** the `to` address's skipNFT flag is
    /// set to false.
    ///
    /// Emits a {Transfer} event.
    function _mint(address to, uint256 amount) internal virtual {
        if (to == address(0)) revert TransferToZeroAddress();

        DN404Storage storage $ = _getDN404Storage();

        AddressData storage toAddressData = _addressData(to);

        unchecked {
            uint256 currentTokenSupply = uint256($.totalSupply) + amount;
            if (amount > _MAX_SUPPLY || currentTokenSupply > _MAX_SUPPLY) {
                revert TotalSupplyOverflow();
            }
            $.totalSupply = uint96(currentTokenSupply);

            uint256 toBalance = toAddressData.balance + amount;
            toAddressData.balance = uint96(toBalance);

            if (toAddressData.flags & _ADDRESS_DATA_SKIP_NFT_FLAG == 0) {
                Uint32Map storage toOwned = $.owned[to];
                uint256 toIndex = toAddressData.ownedLength;
                uint256 toEnd = toBalance / _WAD;
                _PackedLogs memory packedLogs = _packedLogsMalloc(_zeroFloorSub(toEnd, toIndex));

                if (packedLogs.logs.length != 0) {
                    uint256 maxNFTId = $.totalSupply / _WAD;
                    uint32 toAlias = _registerAndResolveAlias(toAddressData, to);
                    uint256 id = $.nextTokenId;
                    $.totalNFTSupply += uint32(packedLogs.logs.length);
                    toAddressData.ownedLength = uint32(toEnd);
                    // Mint loop.
                    do {
                        while (_get($.oo, _ownershipIndex(id)) != 0) {
                            if (++id > maxNFTId) id = 1;
                        }
                        _set(toOwned, toIndex, uint32(id));
                        _setOwnerAliasAndOwnedIndex($.oo, id, toAlias, uint32(toIndex++));
                        _packedLogsAppend(packedLogs, to, id, 0);
                        if (++id > maxNFTId) id = 1;
                    } while (toIndex != toEnd);
                    $.nextTokenId = uint32(id);
                    _packedLogsSend(packedLogs, $.mirrorERC721);
                }
            }
        }
        emit Transfer(address(0), to, amount);
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                  INTERNAL BURN FUNCTIONS                   */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Burns `amount` tokens from `from`, reducing the total supply.
    ///
    /// Will burn sender NFTs if balance after transfer is less than
    /// the amount required to support the current NFT balance.
    ///
    /// Emits a {Transfer} event.
    function _burn(address from, uint256 amount) internal virtual {
        DN404Storage storage $ = _getDN404Storage();

        AddressData storage fromAddressData = _addressData(from);

        uint256 fromBalance = fromAddressData.balance;
        if (amount > fromBalance) revert InsufficientBalance();

        uint256 currentTokenSupply = $.totalSupply;

        unchecked {
            fromBalance -= amount;
            fromAddressData.balance = uint96(fromBalance);
            currentTokenSupply -= amount;
            $.totalSupply = uint96(currentTokenSupply);

            Uint32Map storage fromOwned = $.owned[from];
            uint256 fromIndex = fromAddressData.ownedLength;
            uint256 nftAmountToBurn = _zeroFloorSub(fromIndex, fromBalance / _WAD);

            if (nftAmountToBurn != 0) {
                $.totalNFTSupply -= uint32(nftAmountToBurn);

                _PackedLogs memory packedLogs = _packedLogsMalloc(nftAmountToBurn);

                uint256 fromEnd = fromIndex - nftAmountToBurn;
                // Burn loop.
                do {
                    uint256 id = _get(fromOwned, --fromIndex);
                    _setOwnerAliasAndOwnedIndex($.oo, id, 0, 0);
                    delete $.tokenApprovals[id];
                    _packedLogsAppend(packedLogs, from, id, 1);
                } while (fromIndex != fromEnd);

                fromAddressData.ownedLength = uint32(fromIndex);
                _packedLogsSend(packedLogs, $.mirrorERC721);
            }
        }
        emit Transfer(from, address(0), amount);
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                INTERNAL TRANSFER FUNCTIONS                 */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Moves `amount` of tokens from `from` to `to`.
    ///
    /// Will burn sender NFTs if balance after transfer is less than
    /// the amount required to support the current NFT balance.
    ///
    /// Will mint NFTs to `to` if the recipient's new balance supports
    /// additional NFTs ***AND*** the `to` address's skipNFT flag is
    /// set to false.
    ///
    /// Emits a {Transfer} event.
    function _transfer(address from, address to, uint256 amount) internal virtual {
        if (to == address(0)) revert TransferToZeroAddress();

        DN404Storage storage $ = _getDN404Storage();

        AddressData storage fromAddressData = _addressData(from);
        AddressData storage toAddressData = _addressData(to);

        _TransferTemps memory t;
        t.fromOwnedLength = fromAddressData.ownedLength;
        t.toOwnedLength = toAddressData.ownedLength;
        t.fromBalance = fromAddressData.balance;

        if (amount > t.fromBalance) revert InsufficientBalance();

        unchecked {
            t.fromBalance -= amount;
            fromAddressData.balance = uint96(t.fromBalance);
            toAddressData.balance = uint96(t.toBalance = toAddressData.balance + amount);

            t.nftAmountToBurn = _zeroFloorSub(t.fromOwnedLength, t.fromBalance / _WAD);

            if (toAddressData.flags & _ADDRESS_DATA_SKIP_NFT_FLAG == 0) {
                if (from == to) t.toOwnedLength = t.fromOwnedLength - t.nftAmountToBurn;
                t.nftAmountToMint = _zeroFloorSub(t.toBalance / _WAD, t.toOwnedLength);
            }

            _PackedLogs memory packedLogs = _packedLogsMalloc(t.nftAmountToBurn + t.nftAmountToMint);

            if (t.nftAmountToBurn != 0) {
                Uint32Map storage fromOwned = $.owned[from];
                uint256 fromIndex = t.fromOwnedLength;
                uint256 fromEnd = fromIndex - t.nftAmountToBurn;
                $.totalNFTSupply -= uint32(t.nftAmountToBurn);
                fromAddressData.ownedLength = uint32(fromEnd);
                // Burn loop.
                do {
                    uint256 id = _get(fromOwned, --fromIndex);
                    _setOwnerAliasAndOwnedIndex($.oo, id, 0, 0);
                    delete $.tokenApprovals[id];
                    _packedLogsAppend(packedLogs, from, id, 1);
                } while (fromIndex != fromEnd);
            }

            if (t.nftAmountToMint != 0) {
                Uint32Map storage toOwned = $.owned[to];
                uint256 toIndex = t.toOwnedLength;
                uint256 toEnd = toIndex + t.nftAmountToMint;
                uint32 toAlias = _registerAndResolveAlias(toAddressData, to);
                uint256 maxNFTId = $.totalSupply / _WAD;
                uint256 id = $.nextTokenId;
                $.totalNFTSupply += uint32(t.nftAmountToMint);
                toAddressData.ownedLength = uint32(toEnd);
                // Mint loop.
                do {
                    while (_get($.oo, _ownershipIndex(id)) != 0) {
                        if (++id > maxNFTId) id = 1;
                    }
                    _set(toOwned, toIndex, uint32(id));
                    _setOwnerAliasAndOwnedIndex($.oo, id, toAlias, uint32(toIndex++));
                    _packedLogsAppend(packedLogs, to, id, 0);
                    if (++id > maxNFTId) id = 1;
                } while (toIndex != toEnd);
                $.nextTokenId = uint32(id);
            }

            if (packedLogs.logs.length != 0) {
                _packedLogsSend(packedLogs, $.mirrorERC721);
            }
        }
        emit Transfer(from, to, amount);
    }

    /// @dev Transfers token `id` from `from` to `to`.
    ///
    /// Requirements:
    ///
    /// - Call must originate from the mirror contract.
    /// - Token `id` must exist.
    /// - `from` must be the owner of the token.
    /// - `to` cannot be the zero address.
    ///   `msgSender` must be the owner of the token, or be approved to manage the token.
    ///
    /// Emits a {Transfer} event.
    function _transferFromNFT(address from, address to, uint256 id, address msgSender)
        internal
        virtual
    {
        DN404Storage storage $ = _getDN404Storage();

        if (to == address(0)) revert TransferToZeroAddress();

        address owner = $.aliasToAddress[_get($.oo, _ownershipIndex(id))];

        if (from != owner) revert TransferFromIncorrectOwner();

        if (msgSender != from) {
            if (!$.operatorApprovals[from][msgSender]) {
                if (msgSender != $.tokenApprovals[id]) {
                    revert TransferCallerNotOwnerNorApproved();
                }
            }
        }

        AddressData storage fromAddressData = _addressData(from);
        AddressData storage toAddressData = _addressData(to);

        fromAddressData.balance -= uint96(_WAD);

        unchecked {
            toAddressData.balance += uint96(_WAD);

            _set($.oo, _ownershipIndex(id), _registerAndResolveAlias(toAddressData, to));
            delete $.tokenApprovals[id];

            uint256 updatedId = _get($.owned[from], --fromAddressData.ownedLength);
            _set($.owned[from], _get($.oo, _ownedIndex(id)), uint32(updatedId));

            uint256 n = toAddressData.ownedLength++;
            _set($.oo, _ownedIndex(updatedId), _get($.oo, _ownedIndex(id)));
            _set($.owned[to], n, uint32(id));
            _set($.oo, _ownedIndex(id), uint32(n));
        }

        emit Transfer(from, to, _WAD);
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                 DATA HITCHHIKING FUNCTIONS                 */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the auxiliary data for `owner`.
    /// Minting, transferring, burning the tokens of `owner` will not change the auxiliary data.
    /// Auxiliary data can be set for any address, even if it does not have any tokens.
    function _getAux(address owner) internal view virtual returns (uint88) {
        return _getDN404Storage().addressData[owner].aux;
    }

    /// @dev Set the auxiliary data for `owner` to `value`.
    /// Minting, transferring, burning the tokens of `owner` will not change the auxiliary data.
    /// Auxiliary data can be set for any address, even if it does not have any tokens.
    function _setAux(address owner, uint88 value) internal virtual {
        _getDN404Storage().addressData[owner].aux = value;
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                     SKIP NFT FUNCTIONS                     */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns true if account `a` will skip NFT minting on token mints and transfers.
    /// Returns false if account `a` will mint NFTs on token mints and transfers.
    function getSkipNFT(address a) public view virtual returns (bool) {
        AddressData storage d = _getDN404Storage().addressData[a];
        if (d.flags & _ADDRESS_DATA_INITIALIZED_FLAG == 0) return _hasCode(a);
        return d.flags & _ADDRESS_DATA_SKIP_NFT_FLAG != 0;
    }

    /// @dev Sets the caller's skipNFT flag to `skipNFT`
    ///
    /// Emits a {SkipNFTSet} event.
    function setSkipNFT(bool skipNFT) public virtual {
        _setSkipNFT(msg.sender, skipNFT);
    }

    /// @dev Internal function to set account `a` skipNFT flag to `state`
    ///
    /// Initializes account `a` AddressData if it is not currently initialized.
    ///
    /// Emits a {SkipNFTSet} event.
    function _setSkipNFT(address a, bool state) internal virtual {
        AddressData storage d = _addressData(a);
        if ((d.flags & _ADDRESS_DATA_SKIP_NFT_FLAG != 0) != state) {
            d.flags ^= _ADDRESS_DATA_SKIP_NFT_FLAG;
        }
        emit SkipNFTSet(a, state);
    }

    /// @dev Returns a storage data pointer for account `a` AddressData
    ///
    /// Initializes account `a` AddressData if it is not currently initialized.
    function _addressData(address a) internal virtual returns (AddressData storage d) {
        DN404Storage storage $ = _getDN404Storage();
        d = $.addressData[a];

        if (d.flags & _ADDRESS_DATA_INITIALIZED_FLAG == 0) {
            uint8 flags = _ADDRESS_DATA_INITIALIZED_FLAG;
            if (_hasCode(a)) flags |= _ADDRESS_DATA_SKIP_NFT_FLAG;
            d.flags = flags;
        }
    }

    /// @dev Returns the `addressAlias` of account `to`.
    ///
    /// Assigns and registers the next alias if `to` alias was not previously registered.
    function _registerAndResolveAlias(AddressData storage toAddressData, address to)
        internal
        virtual
        returns (uint32 addressAlias)
    {
        DN404Storage storage $ = _getDN404Storage();
        addressAlias = toAddressData.addressAlias;
        if (addressAlias == 0) {
            addressAlias = ++$.numAliases;
            toAddressData.addressAlias = addressAlias;
            $.aliasToAddress[addressAlias] = to;
        }
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                     MIRROR OPERATIONS                      */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the address of the mirror NFT contract.
    function mirrorERC721() public view virtual returns (address) {
        return _getDN404Storage().mirrorERC721;
    }

    /// @dev Returns the total NFT supply.
    function _totalNFTSupply() internal view virtual returns (uint256) {
        return _getDN404Storage().totalNFTSupply;
    }

    /// @dev Returns `owner` NFT balance.
    function _balanceOfNFT(address owner) internal view virtual returns (uint256) {
        return _getDN404Storage().addressData[owner].ownedLength;
    }

    /// @dev Returns the owner of token `id`.
    /// Returns the zero address instead of reverting if the token does not exist.
    function _ownerAt(uint256 id) internal view virtual returns (address) {
        DN404Storage storage $ = _getDN404Storage();
        return $.aliasToAddress[_get($.oo, _ownershipIndex(id))];
    }

    /// @dev Returns the owner of token `id`.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    function _ownerOf(uint256 id) internal view virtual returns (address) {
        if (!_exists(id)) revert TokenDoesNotExist();
        return _ownerAt(id);
    }

    /// @dev Returns if token `id` exists.
    function _exists(uint256 id) internal view virtual returns (bool) {
        return _ownerAt(id) != address(0);
    }

    /// @dev Returns the account approved to manage token `id`.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    function _getApproved(uint256 id) internal view virtual returns (address) {
        if (!_exists(id)) revert TokenDoesNotExist();
        return _getDN404Storage().tokenApprovals[id];
    }

    /// @dev Sets `spender` as the approved account to manage token `id`, using `msgSender`.
    ///
    /// Requirements:
    /// - `msgSender` must be the owner or an approved operator for the token owner.
    function _approveNFT(address spender, uint256 id, address msgSender)
        internal
        virtual
        returns (address)
    {
        DN404Storage storage $ = _getDN404Storage();

        address owner = $.aliasToAddress[_get($.oo, _ownershipIndex(id))];

        if (msgSender != owner) {
            if (!$.operatorApprovals[owner][msgSender]) {
                revert ApprovalCallerNotOwnerNorApproved();
            }
        }

        $.tokenApprovals[id] = spender;

        return owner;
    }

    /// @dev Approve or remove the `operator` as an operator for `msgSender`,
    /// without authorization checks.
    function _setApprovalForAll(address operator, bool approved, address msgSender)
        internal
        virtual
    {
        _getDN404Storage().operatorApprovals[msgSender][operator] = approved;
    }

    /// @dev Calls the mirror contract to link it to this contract.
    ///
    /// Reverts if the call to the mirror contract reverts.
    function _linkMirrorContract(address mirror) internal virtual {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, 0x0f4599e5) // `linkMirrorContract(address)`.
            mstore(0x20, caller())
            if iszero(and(eq(mload(0x00), 1), call(gas(), mirror, 0, 0x1c, 0x24, 0x00, 0x20))) {
                mstore(0x00, 0xd125259c) // `LinkMirrorContractFailed()`.
                revert(0x1c, 0x04)
            }
        }
    }

    /// @dev Fallback modifier to dispatch calls from the mirror NFT contract
    /// to internal functions in this contract.
    modifier dn404Fallback() virtual {
        DN404Storage storage $ = _getDN404Storage();

        uint256 fnSelector = _calldataload(0x00) >> 224;

        // `isApprovedForAll(address,address)`.
        if (fnSelector == 0xe985e9c5) {
            if (msg.sender != $.mirrorERC721) revert SenderNotMirror();
            if (msg.data.length < 0x44) revert();

            address owner = address(uint160(_calldataload(0x04)));
            address operator = address(uint160(_calldataload(0x24)));

            _return($.operatorApprovals[owner][operator] ? 1 : 0);
        }
        // `ownerOf(uint256)`.
        if (fnSelector == 0x6352211e) {
            if (msg.sender != $.mirrorERC721) revert SenderNotMirror();
            if (msg.data.length < 0x24) revert();

            uint256 id = _calldataload(0x04);

            _return(uint160(_ownerOf(id)));
        }
        // `transferFromNFT(address,address,uint256,address)`.
        if (fnSelector == 0xe5eb36c8) {
            if (msg.sender != $.mirrorERC721) revert SenderNotMirror();
            if (msg.data.length < 0x84) revert();

            address from = address(uint160(_calldataload(0x04)));
            address to = address(uint160(_calldataload(0x24)));
            uint256 id = _calldataload(0x44);
            address msgSender = address(uint160(_calldataload(0x64)));

            _transferFromNFT(from, to, id, msgSender);
            _return(1);
        }
        // `setApprovalForAll(address,bool,address)`.
        if (fnSelector == 0x813500fc) {
            if (msg.sender != $.mirrorERC721) revert SenderNotMirror();
            if (msg.data.length < 0x64) revert();

            address spender = address(uint160(_calldataload(0x04)));
            bool status = _calldataload(0x24) != 0;
            address msgSender = address(uint160(_calldataload(0x44)));

            _setApprovalForAll(spender, status, msgSender);
            _return(1);
        }
        // `approveNFT(address,uint256,address)`.
        if (fnSelector == 0xd10b6e0c) {
            if (msg.sender != $.mirrorERC721) revert SenderNotMirror();
            if (msg.data.length < 0x64) revert();

            address spender = address(uint160(_calldataload(0x04)));
            uint256 id = _calldataload(0x24);
            address msgSender = address(uint160(_calldataload(0x44)));

            _return(uint160(_approveNFT(spender, id, msgSender)));
        }
        // `getApproved(uint256)`.
        if (fnSelector == 0x081812fc) {
            if (msg.sender != $.mirrorERC721) revert SenderNotMirror();
            if (msg.data.length < 0x24) revert();

            uint256 id = _calldataload(0x04);

            _return(uint160(_getApproved(id)));
        }
        // `balanceOfNFT(address)`.
        if (fnSelector == 0xf5b100ea) {
            if (msg.sender != $.mirrorERC721) revert SenderNotMirror();
            if (msg.data.length < 0x24) revert();

            address owner = address(uint160(_calldataload(0x04)));

            _return(_balanceOfNFT(owner));
        }
        // `totalNFTSupply()`.
        if (fnSelector == 0xe2c79281) {
            if (msg.sender != $.mirrorERC721) revert SenderNotMirror();
            if (msg.data.length < 0x04) revert();

            _return(_totalNFTSupply());
        }
        // `implementsDN404()`.
        if (fnSelector == 0xb7a94eb8) {
            _return(1);
        }
        _;
    }

    /// @dev Fallback function for calls from mirror NFT contract.
    fallback() external payable virtual dn404Fallback {}

    receive() external payable virtual {}

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                      PRIVATE HELPERS                       */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Struct containing packed log data for `Transfer` events to be
    /// emitted by the mirror NFT contract.
    struct _PackedLogs {
        uint256[] logs;
        uint256 offset;
    }

    /// @dev Initiates memory allocation for packed logs with `n` log items.
    function _packedLogsMalloc(uint256 n) private pure returns (_PackedLogs memory p) {
        /// @solidity memory-safe-assembly
        assembly {
            let logs := add(mload(0x40), 0x40) // Offset by 2 words for `_packedLogsSend`.
            mstore(logs, n)
            let offset := add(0x20, logs)
            mstore(0x40, add(offset, shl(5, n)))
            mstore(p, logs)
            mstore(add(0x20, p), offset)
        }
    }

    /// @dev Adds a packed log item to `p` with address `a`, token `id` and burn flag `burnBit`.
    function _packedLogsAppend(_PackedLogs memory p, address a, uint256 id, uint256 burnBit)
        private
        pure
    {
        /// @solidity memory-safe-assembly
        assembly {
            let offset := mload(add(0x20, p))
            mstore(offset, or(or(shl(96, a), shl(8, id)), burnBit))
            mstore(add(0x20, p), add(offset, 0x20))
        }
    }

    /// @dev Calls the `mirror` NFT contract to emit Transfer events for packed logs `p`.
    function _packedLogsSend(_PackedLogs memory p, address mirror) private {
        /// @solidity memory-safe-assembly
        assembly {
            let logs := mload(p)
            let o := sub(logs, 0x40) // Start of calldata to send.
            mstore(o, 0x263c69d6) // `logTransfer(uint256[])`.
            mstore(add(o, 0x20), 0x20) // Offset of `logs` in the calldata to send.
            let n := add(0x44, shl(5, mload(logs))) // Length of calldata to send.
            if iszero(and(eq(mload(o), 1), call(gas(), mirror, 0, add(o, 0x1c), n, o, 0x20))) {
                revert(o, 0x00)
            }
        }
    }

    /// @dev Struct of temporary variables for transfers.
    struct _TransferTemps {
        uint256 nftAmountToBurn;
        uint256 nftAmountToMint;
        uint256 fromBalance;
        uint256 toBalance;
        uint256 fromOwnedLength;
        uint256 toOwnedLength;
    }

    /// @dev Returns if `a` has bytecode of non-zero length.
    function _hasCode(address a) private view returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := extcodesize(a) // Can handle dirty upper bits.
        }
    }

    /// @dev Returns the calldata value at `offset`.
    function _calldataload(uint256 offset) private pure returns (uint256 value) {
        /// @solidity memory-safe-assembly
        assembly {
            value := calldataload(offset)
        }
    }

    /// @dev Executes a return opcode to return `x` and end the current call frame.
    function _return(uint256 x) private pure {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, x)
            return(0x00, 0x20)
        }
    }

    /// @dev Returns `max(0, x - y)`.
    function _zeroFloorSub(uint256 x, uint256 y) private pure returns (uint256 z) {
        /// @solidity memory-safe-assembly
        assembly {
            z := mul(gt(x, y), sub(x, y))
        }
    }

    /// @dev Returns `i << 1`.
    function _ownershipIndex(uint256 i) private pure returns (uint256) {
        return i << 1;
    }

    /// @dev Returns `(i << 1) + 1`.
    function _ownedIndex(uint256 i) private pure returns (uint256) {
        unchecked {
            return (i << 1) + 1;
        }
    }

    /// @dev Returns the uint32 value at `index` in `map`.
    function _get(Uint32Map storage map, uint256 index) private view returns (uint32 result) {
        result = uint32(map.map[index >> 3] >> ((index & 7) << 5));
    }

    /// @dev Updates the uint32 value at `index` in `map`.
    function _set(Uint32Map storage map, uint256 index, uint32 value) private {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x20, map.slot)
            mstore(0x00, shr(3, index))
            let s := keccak256(0x00, 0x40) // Storage slot.
            let o := shl(5, and(index, 7)) // Storage slot offset (bits).
            let v := sload(s) // Storage slot value.
            let m := 0xffffffff // Value mask.
            sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value)))))
        }
    }

    /// @dev Sets the owner alias and the owned index together.
    function _setOwnerAliasAndOwnedIndex(
        Uint32Map storage map,
        uint256 id,
        uint32 ownership,
        uint32 ownedIndex
    ) private {
        /// @solidity memory-safe-assembly
        assembly {
            let value := or(shl(32, ownedIndex), and(0xffffffff, ownership))
            mstore(0x20, map.slot)
            mstore(0x00, shr(2, id))
            let s := keccak256(0x00, 0x40) // Storage slot.
            let o := shl(6, and(id, 3)) // Storage slot offset (bits).
            let v := sload(s) // Storage slot value.
            let m := 0xffffffffffffffff // Value mask.
            sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value)))))
        }
    }
}

File 6 of 9 : DN404Mirror.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @title DN404Mirror
/// @notice DN404Mirror provides an interface for interacting with the
/// NFT tokens in a DN404 implementation.
///
/// @author vectorized.eth (@optimizoor)
/// @author Quit (@0xQuit)
/// @author Michael Amadi (@AmadiMichaels)
/// @author cygaar (@0xCygaar)
/// @author Thomas (@0xjustadev)
/// @author Harrison (@PopPunkOnChain)
///
/// @dev Note:
/// - The ERC721 data is stored in the base DN404 contract.
contract DN404Mirror {
    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                           EVENTS                           */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Emitted when token `id` is transferred from `from` to `to`.
    event Transfer(address indexed from, address indexed to, uint256 indexed id);

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

    /// @dev Emitted when `owner` enables or disables `operator` to manage all of their tokens.
    event ApprovalForAll(address indexed owner, address indexed operator, bool isApproved);

    /// @dev `keccak256(bytes("Transfer(address,address,uint256)"))`.
    uint256 private constant _TRANSFER_EVENT_SIGNATURE =
        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    /// @dev `keccak256(bytes("Approval(address,address,uint256)"))`.
    uint256 private constant _APPROVAL_EVENT_SIGNATURE =
        0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925;

    /// @dev `keccak256(bytes("ApprovalForAll(address,address,bool)"))`.
    uint256 private constant _APPROVAL_FOR_ALL_EVENT_SIGNATURE =
        0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31;

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                        CUSTOM ERRORS                       */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Thrown when a call for an NFT function did not originate
    /// from the base DN404 contract.
    error SenderNotBase();

    /// @dev Thrown when a call for an NFT function did not originate from the deployer.
    error SenderNotDeployer();

    /// @dev Thrown when transferring an NFT to a contract address that
    /// does not implement ERC721Receiver.
    error TransferToNonERC721ReceiverImplementer();

    /// @dev Thrown when linking to the DN404 base contract and the
    /// DN404 supportsInterface check fails or the call reverts.
    error CannotLink();

    /// @dev Thrown when a linkMirrorContract call is received and the
    /// NFT mirror contract has already been linked to a DN404 base contract.
    error AlreadyLinked();

    /// @dev Thrown when retrieving the base DN404 address when a link has not
    /// been established.
    error NotLinked();

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                          STORAGE                           */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Struct contain the NFT mirror contract storage.
    struct DN404NFTStorage {
        address baseERC20;
        address deployer;
    }

    /// @dev Returns a storage pointer for DN404NFTStorage.
    function _getDN404NFTStorage() internal pure virtual returns (DN404NFTStorage storage $) {
        /// @solidity memory-safe-assembly
        assembly {
            // `uint72(bytes9(keccak256("DN404_MIRROR_STORAGE")))`.
            $.slot := 0x3602298b8c10b01230 // Truncate to 9 bytes to reduce bytecode size.
        }
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                        CONSTRUCTOR                         */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    constructor(address deployer) {
        // For non-proxies, we will store the deployer so that only the deployer can
        // link the base contract.
        _getDN404NFTStorage().deployer = deployer;
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                     ERC721 OPERATIONS                      */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the token collection name from the base DN404 contract.
    function name() public view virtual returns (string memory result) {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            mstore(0x00, 0x06fdde03) // `name()`.
            if iszero(staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x00)) {
                returndatacopy(result, 0x00, returndatasize())
                revert(result, returndatasize())
            }
            returndatacopy(0x00, 0x00, 0x20)
            returndatacopy(result, mload(0x00), 0x20)
            returndatacopy(add(result, 0x20), add(mload(0x00), 0x20), mload(result))
            mstore(0x40, add(add(result, 0x20), mload(result)))
        }
    }

    /// @dev Returns the token collection symbol from the base DN404 contract.
    function symbol() public view virtual returns (string memory result) {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            mstore(0x00, 0x95d89b41) // `symbol()`.
            if iszero(staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x00)) {
                returndatacopy(result, 0x00, returndatasize())
                revert(result, returndatasize())
            }
            returndatacopy(0x00, 0x00, 0x20)
            returndatacopy(result, mload(0x00), 0x20)
            returndatacopy(add(result, 0x20), add(mload(0x00), 0x20), mload(result))
            mstore(0x40, add(add(result, 0x20), mload(result)))
        }
    }

    /// @dev Returns the Uniform Resource Identifier (URI) for token `id` from
    /// the base DN404 contract.
    function tokenURI(uint256 id) public view virtual returns (string memory result) {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            mstore(0x20, id)
            mstore(0x00, 0xc87b56dd) // `tokenURI()`.
            if iszero(staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x00)) {
                returndatacopy(result, 0x00, returndatasize())
                revert(result, returndatasize())
            }
            returndatacopy(0x00, 0x00, 0x20)
            returndatacopy(result, mload(0x00), 0x20)
            returndatacopy(add(result, 0x20), add(mload(0x00), 0x20), mload(result))
            mstore(0x40, add(add(result, 0x20), mload(result)))
        }
    }

    /// @dev Returns the total NFT supply from the base DN404 contract.
    function totalSupply() public view virtual returns (uint256 result) {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, 0xe2c79281) // `totalNFTSupply()`.
            if iszero(
                and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x20))
            ) {
                returndatacopy(mload(0x40), 0x00, returndatasize())
                revert(mload(0x40), returndatasize())
            }
            result := mload(0x00)
        }
    }

    /// @dev Returns the number of NFT tokens owned by `owner` from the base DN404 contract.
    ///
    /// Requirements:
    /// - `owner` must not be the zero address.
    function balanceOf(address owner) public view virtual returns (uint256 result) {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x20, shr(96, shl(96, owner)))
            mstore(0x00, 0xf5b100ea) // `balanceOfNFT(address)`.
            if iszero(
                and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20))
            ) {
                returndatacopy(mload(0x40), 0x00, returndatasize())
                revert(mload(0x40), returndatasize())
            }
            result := mload(0x00)
        }
    }

    /// @dev Returns the owner of token `id` from the base DN404 contract.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    function ownerOf(uint256 id) public view virtual returns (address result) {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, 0x6352211e) // `ownerOf(uint256)`.
            mstore(0x20, id)
            if iszero(
                and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20))
            ) {
                returndatacopy(mload(0x40), 0x00, returndatasize())
                revert(mload(0x40), returndatasize())
            }
            result := shr(96, mload(0x0c))
        }
    }

    /// @dev Sets `spender` as the approved account to manage token `id` in
    /// the base DN404 contract.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    /// - The caller must be the owner of the token,
    ///   or an approved operator for the token owner.
    ///
    /// Emits an {Approval} event.
    function approve(address spender, uint256 id) public virtual {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            spender := shr(96, shl(96, spender))
            let m := mload(0x40)
            mstore(0x00, 0xd10b6e0c) // `approveNFT(address,uint256,address)`.
            mstore(0x20, spender)
            mstore(0x40, id)
            mstore(0x60, caller())
            if iszero(
                and(
                    gt(returndatasize(), 0x1f),
                    call(gas(), base, callvalue(), 0x1c, 0x64, 0x00, 0x20)
                )
            ) {
                returndatacopy(m, 0x00, returndatasize())
                revert(m, returndatasize())
            }
            mstore(0x40, m) // Restore the free memory pointer.
            mstore(0x60, 0) // Restore the zero pointer.
            // Emit the {Approval} event.
            log4(codesize(), 0x00, _APPROVAL_EVENT_SIGNATURE, shr(96, mload(0x0c)), spender, id)
        }
    }

    /// @dev Returns the account approved to manage token `id` from
    /// the base DN404 contract.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    function getApproved(uint256 id) public view virtual returns (address result) {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, 0x081812fc) // `getApproved(uint256)`.
            mstore(0x20, id)
            if iszero(
                and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20))
            ) {
                returndatacopy(mload(0x40), 0x00, returndatasize())
                revert(mload(0x40), returndatasize())
            }
            result := shr(96, mload(0x0c))
        }
    }

    /// @dev Sets whether `operator` is approved to manage the tokens of the caller in
    /// the base DN404 contract.
    ///
    /// Emits an {ApprovalForAll} event.
    function setApprovalForAll(address operator, bool approved) public virtual {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            operator := shr(96, shl(96, operator))
            let m := mload(0x40)
            mstore(0x00, 0x813500fc) // `setApprovalForAll(address,bool,address)`.
            mstore(0x20, operator)
            mstore(0x40, iszero(iszero(approved)))
            mstore(0x60, caller())
            if iszero(
                and(eq(mload(0x00), 1), call(gas(), base, callvalue(), 0x1c, 0x64, 0x00, 0x20))
            ) {
                returndatacopy(m, 0x00, returndatasize())
                revert(m, returndatasize())
            }
            // Emit the {ApprovalForAll} event.
            log3(0x40, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, caller(), operator)
            mstore(0x40, m) // Restore the free memory pointer.
            mstore(0x60, 0) // Restore the zero pointer.
        }
    }

    /// @dev Returns whether `operator` is approved to manage the tokens of `owner` from
    /// the base DN404 contract.
    function isApprovedForAll(address owner, address operator)
        public
        view
        virtual
        returns (bool result)
    {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40)
            mstore(0x40, operator)
            mstore(0x2c, shl(96, owner))
            mstore(0x0c, 0xe985e9c5000000000000000000000000) // `isApprovedForAll(address,address)`.
            if iszero(
                and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x44, 0x00, 0x20))
            ) {
                returndatacopy(m, 0x00, returndatasize())
                revert(m, returndatasize())
            }
            mstore(0x40, m) // Restore the free memory pointer.
            result := iszero(iszero(mload(0x00)))
        }
    }

    /// @dev Transfers token `id` from `from` to `to`.
    ///
    /// Requirements:
    ///
    /// - Token `id` must exist.
    /// - `from` must be the owner of the token.
    /// - `to` cannot be the zero address.
    /// - The caller must be the owner of the token, or be approved to manage the token.
    ///
    /// Emits a {Transfer} event.
    function transferFrom(address from, address to, uint256 id) public virtual {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            from := shr(96, shl(96, from))
            to := shr(96, shl(96, to))
            let m := mload(0x40)
            mstore(m, 0xe5eb36c8) // `transferFromNFT(address,address,uint256,address)`.
            mstore(add(m, 0x20), from)
            mstore(add(m, 0x40), to)
            mstore(add(m, 0x60), id)
            mstore(add(m, 0x80), caller())
            if iszero(
                and(eq(mload(m), 1), call(gas(), base, callvalue(), add(m, 0x1c), 0x84, m, 0x20))
            ) {
                returndatacopy(m, 0x00, returndatasize())
                revert(m, returndatasize())
            }
            // Emit the {Transfer} event.
            log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, from, to, id)
        }
    }

    /// @dev Equivalent to `safeTransferFrom(from, to, id, "")`.
    function safeTransferFrom(address from, address to, uint256 id) public payable virtual {
        transferFrom(from, to, id);

        if (_hasCode(to)) _checkOnERC721Received(from, to, id, "");
    }

    /// @dev Transfers token `id` from `from` to `to`.
    ///
    /// Requirements:
    ///
    /// - Token `id` must exist.
    /// - `from` must be the owner of the token.
    /// - `to` cannot be the zero address.
    /// - The caller must be the owner of the token, or be approved to manage the token.
    /// - 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 id, bytes calldata data)
        public
        virtual
    {
        transferFrom(from, to, id);

        if (_hasCode(to)) _checkOnERC721Received(from, to, id, data);
    }

    /// @dev Returns true if this contract implements the interface defined by `interfaceId`.
    /// See: https://eips.ethereum.org/EIPS/eip-165
    /// This function call must use less than 30000 gas.
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            let s := shr(224, interfaceId)
            // ERC165: 0x01ffc9a7, ERC721: 0x80ac58cd, ERC721Metadata: 0x5b5e139f.
            result := or(or(eq(s, 0x01ffc9a7), eq(s, 0x80ac58cd)), eq(s, 0x5b5e139f))
        }
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                     MIRROR OPERATIONS                      */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the address of the base DN404 contract.
    function baseERC20() public view virtual returns (address base) {
        base = _getDN404NFTStorage().baseERC20;
        if (base == address(0)) revert NotLinked();
    }

    /// @dev Fallback modifier to execute calls from the base DN404 contract.
    modifier dn404NFTFallback() virtual {
        DN404NFTStorage storage $ = _getDN404NFTStorage();

        uint256 fnSelector = _calldataload(0x00) >> 224;

        // `logTransfer(uint256[])`.
        if (fnSelector == 0x263c69d6) {
            if (msg.sender != $.baseERC20) revert SenderNotBase();
            /// @solidity memory-safe-assembly
            assembly {
                // When returndatacopy copies 1 or more out-of-bounds bytes, it reverts.
                returndatacopy(0x00, returndatasize(), lt(calldatasize(), 0x20))
                let o := add(0x24, calldataload(0x04)) // Packed logs offset.
                returndatacopy(0x00, returndatasize(), lt(calldatasize(), o))
                let end := add(o, shl(5, calldataload(sub(o, 0x20))))
                returndatacopy(0x00, returndatasize(), lt(calldatasize(), end))

                for {} iszero(eq(o, end)) { o := add(0x20, o) } {
                    let d := calldataload(o) // Entry in the packed logs.
                    let a := shr(96, d) // The address.
                    let b := and(1, d) // Whether it is a burn.
                    log4(
                        codesize(),
                        0x00,
                        _TRANSFER_EVENT_SIGNATURE,
                        mul(a, b),
                        mul(a, iszero(b)),
                        shr(168, shl(160, d))
                    )
                }
                mstore(0x00, 0x01)
                return(0x00, 0x20)
            }
        }
        // `linkMirrorContract(address)`.
        if (fnSelector == 0x0f4599e5) {
            if ($.deployer != address(0)) {
                if (address(uint160(_calldataload(0x04))) != $.deployer) {
                    revert SenderNotDeployer();
                }
            }
            if ($.baseERC20 != address(0)) revert AlreadyLinked();
            $.baseERC20 = msg.sender;
            /// @solidity memory-safe-assembly
            assembly {
                mstore(0x00, 0x01)
                return(0x00, 0x20)
            }
        }
        _;
    }

    /// @dev Fallback function for calls from base DN404 contract.
    fallback() external payable virtual dn404NFTFallback {}

    receive() external payable virtual {}

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                      PRIVATE HELPERS                       */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the calldata value at `offset`.
    function _calldataload(uint256 offset) private pure returns (uint256 value) {
        /// @solidity memory-safe-assembly
        assembly {
            value := calldataload(offset)
        }
    }

    /// @dev Returns if `a` has bytecode of non-zero length.
    function _hasCode(address a) private view returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := extcodesize(a) // Can handle dirty upper bits.
        }
    }

    /// @dev Perform a call to invoke {IERC721Receiver-onERC721Received} on `to`.
    /// Reverts if the target does not support the function correctly.
    function _checkOnERC721Received(address from, address to, uint256 id, bytes memory data)
        private
    {
        /// @solidity memory-safe-assembly
        assembly {
            // Prepare the calldata.
            let m := mload(0x40)
            let onERC721ReceivedSelector := 0x150b7a02
            mstore(m, onERC721ReceivedSelector)
            mstore(add(m, 0x20), caller()) // The `operator`, which is always `msg.sender`.
            mstore(add(m, 0x40), shr(96, shl(96, from)))
            mstore(add(m, 0x60), id)
            mstore(add(m, 0x80), 0x80)
            let n := mload(data)
            mstore(add(m, 0xa0), n)
            if n { pop(staticcall(gas(), 4, add(data, 0x20), n, add(m, 0xc0), n)) }
            // Revert if the call reverts.
            if iszero(call(gas(), to, 0, add(m, 0x1c), add(n, 0xa4), m, 0x20)) {
                if returndatasize() {
                    // Bubble up the revert if the call reverts.
                    returndatacopy(m, 0x00, returndatasize())
                    revert(m, returndatasize())
                }
            }
            // Load the returndata and compare it.
            if iszero(eq(mload(m), shl(224, onERC721ReceivedSelector))) {
                mstore(0x00, 0xd1a57ed6) // `TransferToNonERC721ReceiverImplementer()`.
                revert(0x1c, 0x04)
            }
        }
    }
}

File 7 of 9 : Ownable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @notice Simple single owner authorization mixin.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/Ownable.sol)
///
/// @dev Note:
/// This implementation does NOT auto-initialize the owner to `msg.sender`.
/// You MUST call the `_initializeOwner` in the constructor / initializer.
///
/// While the ownable portion follows
/// [EIP-173](https://eips.ethereum.org/EIPS/eip-173) for compatibility,
/// the nomenclature for the 2-step ownership handover may be unique to this codebase.
abstract contract Ownable {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                       CUSTOM ERRORS                        */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The caller is not authorized to call the function.
    error Unauthorized();

    /// @dev The `newOwner` cannot be the zero address.
    error NewOwnerIsZeroAddress();

    /// @dev The `pendingOwner` does not have a valid handover request.
    error NoHandoverRequest();

    /// @dev Cannot double-initialize.
    error AlreadyInitialized();

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                           EVENTS                           */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The ownership is transferred from `oldOwner` to `newOwner`.
    /// This event is intentionally kept the same as OpenZeppelin's Ownable to be
    /// compatible with indexers and [EIP-173](https://eips.ethereum.org/EIPS/eip-173),
    /// despite it not being as lightweight as a single argument event.
    event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);

    /// @dev An ownership handover to `pendingOwner` has been requested.
    event OwnershipHandoverRequested(address indexed pendingOwner);

    /// @dev The ownership handover to `pendingOwner` has been canceled.
    event OwnershipHandoverCanceled(address indexed pendingOwner);

    /// @dev `keccak256(bytes("OwnershipTransferred(address,address)"))`.
    uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE =
        0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0;

    /// @dev `keccak256(bytes("OwnershipHandoverRequested(address)"))`.
    uint256 private constant _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE =
        0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d;

    /// @dev `keccak256(bytes("OwnershipHandoverCanceled(address)"))`.
    uint256 private constant _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE =
        0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                          STORAGE                           */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The owner slot is given by:
    /// `bytes32(~uint256(uint32(bytes4(keccak256("_OWNER_SLOT_NOT")))))`.
    /// It is intentionally chosen to be a high value
    /// to avoid collision with lower slots.
    /// The choice of manual storage layout is to enable compatibility
    /// with both regular and upgradeable contracts.
    bytes32 internal constant _OWNER_SLOT =
        0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927;

    /// The ownership handover slot of `newOwner` is given by:
    /// ```
    ///     mstore(0x00, or(shl(96, user), _HANDOVER_SLOT_SEED))
    ///     let handoverSlot := keccak256(0x00, 0x20)
    /// ```
    /// It stores the expiry timestamp of the two-step ownership handover.
    uint256 private constant _HANDOVER_SLOT_SEED = 0x389a75e1;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                     INTERNAL FUNCTIONS                     */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Override to return true to make `_initializeOwner` prevent double-initialization.
    function _guardInitializeOwner() internal pure virtual returns (bool guard) {}

    /// @dev Initializes the owner directly without authorization guard.
    /// This function must be called upon initialization,
    /// regardless of whether the contract is upgradeable or not.
    /// This is to enable generalization to both regular and upgradeable contracts,
    /// and to save gas in case the initial owner is not the caller.
    /// For performance reasons, this function will not check if there
    /// is an existing owner.
    function _initializeOwner(address newOwner) internal virtual {
        if (_guardInitializeOwner()) {
            /// @solidity memory-safe-assembly
            assembly {
                let ownerSlot := _OWNER_SLOT
                if sload(ownerSlot) {
                    mstore(0x00, 0x0dc149f0) // `AlreadyInitialized()`.
                    revert(0x1c, 0x04)
                }
                // Clean the upper 96 bits.
                newOwner := shr(96, shl(96, newOwner))
                // Store the new value.
                sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))
                // Emit the {OwnershipTransferred} event.
                log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)
            }
        } else {
            /// @solidity memory-safe-assembly
            assembly {
                // Clean the upper 96 bits.
                newOwner := shr(96, shl(96, newOwner))
                // Store the new value.
                sstore(_OWNER_SLOT, newOwner)
                // Emit the {OwnershipTransferred} event.
                log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)
            }
        }
    }

    /// @dev Sets the owner directly without authorization guard.
    function _setOwner(address newOwner) internal virtual {
        if (_guardInitializeOwner()) {
            /// @solidity memory-safe-assembly
            assembly {
                let ownerSlot := _OWNER_SLOT
                // Clean the upper 96 bits.
                newOwner := shr(96, shl(96, newOwner))
                // Emit the {OwnershipTransferred} event.
                log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)
                // Store the new value.
                sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))
            }
        } else {
            /// @solidity memory-safe-assembly
            assembly {
                let ownerSlot := _OWNER_SLOT
                // Clean the upper 96 bits.
                newOwner := shr(96, shl(96, newOwner))
                // Emit the {OwnershipTransferred} event.
                log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)
                // Store the new value.
                sstore(ownerSlot, newOwner)
            }
        }
    }

    /// @dev Throws if the sender is not the owner.
    function _checkOwner() internal view virtual {
        /// @solidity memory-safe-assembly
        assembly {
            // If the caller is not the stored owner, revert.
            if iszero(eq(caller(), sload(_OWNER_SLOT))) {
                mstore(0x00, 0x82b42900) // `Unauthorized()`.
                revert(0x1c, 0x04)
            }
        }
    }

    /// @dev Returns how long a two-step ownership handover is valid for in seconds.
    /// Override to return a different value if needed.
    /// Made internal to conserve bytecode. Wrap it in a public function if needed.
    function _ownershipHandoverValidFor() internal view virtual returns (uint64) {
        return 48 * 3600;
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                  PUBLIC UPDATE FUNCTIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Allows the owner to transfer the ownership to `newOwner`.
    function transferOwnership(address newOwner) public payable virtual onlyOwner {
        /// @solidity memory-safe-assembly
        assembly {
            if iszero(shl(96, newOwner)) {
                mstore(0x00, 0x7448fbae) // `NewOwnerIsZeroAddress()`.
                revert(0x1c, 0x04)
            }
        }
        _setOwner(newOwner);
    }

    /// @dev Allows the owner to renounce their ownership.
    function renounceOwnership() public payable virtual onlyOwner {
        _setOwner(address(0));
    }

    /// @dev Request a two-step ownership handover to the caller.
    /// The request will automatically expire in 48 hours (172800 seconds) by default.
    function requestOwnershipHandover() public payable virtual {
        unchecked {
            uint256 expires = block.timestamp + _ownershipHandoverValidFor();
            /// @solidity memory-safe-assembly
            assembly {
                // Compute and set the handover slot to `expires`.
                mstore(0x0c, _HANDOVER_SLOT_SEED)
                mstore(0x00, caller())
                sstore(keccak256(0x0c, 0x20), expires)
                // Emit the {OwnershipHandoverRequested} event.
                log2(0, 0, _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE, caller())
            }
        }
    }

    /// @dev Cancels the two-step ownership handover to the caller, if any.
    function cancelOwnershipHandover() public payable virtual {
        /// @solidity memory-safe-assembly
        assembly {
            // Compute and set the handover slot to 0.
            mstore(0x0c, _HANDOVER_SLOT_SEED)
            mstore(0x00, caller())
            sstore(keccak256(0x0c, 0x20), 0)
            // Emit the {OwnershipHandoverCanceled} event.
            log2(0, 0, _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE, caller())
        }
    }

    /// @dev Allows the owner to complete the two-step ownership handover to `pendingOwner`.
    /// Reverts if there is no existing ownership handover requested by `pendingOwner`.
    function completeOwnershipHandover(address pendingOwner) public payable virtual onlyOwner {
        /// @solidity memory-safe-assembly
        assembly {
            // Compute and set the handover slot to 0.
            mstore(0x0c, _HANDOVER_SLOT_SEED)
            mstore(0x00, pendingOwner)
            let handoverSlot := keccak256(0x0c, 0x20)
            // If the handover does not exist, or has expired.
            if gt(timestamp(), sload(handoverSlot)) {
                mstore(0x00, 0x6f5e8818) // `NoHandoverRequest()`.
                revert(0x1c, 0x04)
            }
            // Set the handover slot to 0.
            sstore(handoverSlot, 0)
        }
        _setOwner(pendingOwner);
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   PUBLIC READ FUNCTIONS                    */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the owner of the contract.
    function owner() public view virtual returns (address result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := sload(_OWNER_SLOT)
        }
    }

    /// @dev Returns the expiry timestamp for the two-step ownership handover to `pendingOwner`.
    function ownershipHandoverExpiresAt(address pendingOwner)
        public
        view
        virtual
        returns (uint256 result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            // Compute the handover slot.
            mstore(0x0c, _HANDOVER_SLOT_SEED)
            mstore(0x00, pendingOwner)
            // Load the handover slot.
            result := sload(keccak256(0x0c, 0x20))
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                         MODIFIERS                          */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Marks a function as only callable by the owner.
    modifier onlyOwner() virtual {
        _checkOwner();
        _;
    }
}

File 8 of 9 : LibString.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @notice Library for converting numbers into strings and other string operations.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibString.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/LibString.sol)
///
/// @dev Note:
/// For performance and bytecode compactness, most of the string operations are restricted to
/// byte strings (7-bit ASCII), except where otherwise specified.
/// Usage of byte string operations on charsets with runes spanning two or more bytes
/// can lead to undefined behavior.
library LibString {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                        CUSTOM ERRORS                       */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The length of the output is too small to contain all the hex digits.
    error HexLengthInsufficient();

    /// @dev The length of the string is more than 32 bytes.
    error TooBigForSmallString();

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                         CONSTANTS                          */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The constant returned when the `search` is not found in the string.
    uint256 internal constant NOT_FOUND = type(uint256).max;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                     DECIMAL OPERATIONS                     */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the base 10 decimal representation of `value`.
    function toString(uint256 value) internal pure returns (string memory str) {
        /// @solidity memory-safe-assembly
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), but
            // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
            // We will need 1 word for the trailing zeros padding, 1 word for the length,
            // and 3 words for a maximum of 78 digits.
            str := add(mload(0x40), 0x80)
            // Update the free memory pointer to allocate.
            mstore(0x40, add(str, 0x20))
            // Zeroize the slot after the string.
            mstore(str, 0)

            // Cache the end of the memory to calculate the length later.
            let end := str

            let w := not(0) // Tsk.
            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            for { let temp := value } 1 {} {
                str := add(str, w) // `sub(str, 1)`.
                // Write the character to the pointer.
                // The ASCII index of the '0' character is 48.
                mstore8(str, add(48, mod(temp, 10)))
                // Keep dividing `temp` until zero.
                temp := div(temp, 10)
                if iszero(temp) { break }
            }

            let length := sub(end, str)
            // Move the pointer 32 bytes leftwards to make room for the length.
            str := sub(str, 0x20)
            // Store the length.
            mstore(str, length)
        }
    }

    /// @dev Returns the base 10 decimal representation of `value`.
    function toString(int256 value) internal pure returns (string memory str) {
        if (value >= 0) {
            return toString(uint256(value));
        }
        unchecked {
            str = toString(~uint256(value) + 1);
        }
        /// @solidity memory-safe-assembly
        assembly {
            // We still have some spare memory space on the left,
            // as we have allocated 3 words (96 bytes) for up to 78 digits.
            let length := mload(str) // Load the string length.
            mstore(str, 0x2d) // Store the '-' character.
            str := sub(str, 1) // Move back the string pointer by a byte.
            mstore(str, add(length, 1)) // Update the string length.
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   HEXADECIMAL OPERATIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the hexadecimal representation of `value`,
    /// left-padded to an input length of `length` bytes.
    /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte,
    /// giving a total length of `length * 2 + 2` bytes.
    /// Reverts if `length` is too small for the output to contain all the digits.
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(value, length);
        /// @solidity memory-safe-assembly
        assembly {
            let strLength := add(mload(str), 2) // Compute the length.
            mstore(str, 0x3078) // Write the "0x" prefix.
            str := sub(str, 2) // Move the pointer.
            mstore(str, strLength) // Write the length.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`,
    /// left-padded to an input length of `length` bytes.
    /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte,
    /// giving a total length of `length * 2` bytes.
    /// Reverts if `length` is too small for the output to contain all the digits.
    function toHexStringNoPrefix(uint256 value, uint256 length)
        internal
        pure
        returns (string memory str)
    {
        /// @solidity memory-safe-assembly
        assembly {
            // We need 0x20 bytes for the trailing zeros padding, `length * 2` bytes
            // for the digits, 0x02 bytes for the prefix, and 0x20 bytes for the length.
            // We add 0x20 to the total and round down to a multiple of 0x20.
            // (0x20 + 0x20 + 0x02 + 0x20) = 0x62.
            str := add(mload(0x40), and(add(shl(1, length), 0x42), not(0x1f)))
            // Allocate the memory.
            mstore(0x40, add(str, 0x20))
            // Zeroize the slot after the string.
            mstore(str, 0)

            // Cache the end to calculate the length later.
            let end := str
            // Store "0123456789abcdef" in scratch space.
            mstore(0x0f, 0x30313233343536373839616263646566)

            let start := sub(str, add(length, length))
            let w := not(1) // Tsk.
            let temp := value
            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            for {} 1 {} {
                str := add(str, w) // `sub(str, 2)`.
                mstore8(add(str, 1), mload(and(temp, 15)))
                mstore8(str, mload(and(shr(4, temp), 15)))
                temp := shr(8, temp)
                if iszero(xor(str, start)) { break }
            }

            if temp {
                mstore(0x00, 0x2194895a) // `HexLengthInsufficient()`.
                revert(0x1c, 0x04)
            }

            // Compute the string's length.
            let strLength := sub(end, str)
            // Move the pointer and write the length.
            str := sub(str, 0x20)
            mstore(str, strLength)
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte.
    /// As address are 20 bytes long, the output will left-padded to have
    /// a length of `20 * 2 + 2` bytes.
    function toHexString(uint256 value) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(value);
        /// @solidity memory-safe-assembly
        assembly {
            let strLength := add(mload(str), 2) // Compute the length.
            mstore(str, 0x3078) // Write the "0x" prefix.
            str := sub(str, 2) // Move the pointer.
            mstore(str, strLength) // Write the length.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is prefixed with "0x".
    /// The output excludes leading "0" from the `toHexString` output.
    /// `0x00: "0x0", 0x01: "0x1", 0x12: "0x12", 0x123: "0x123"`.
    function toMinimalHexString(uint256 value) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(value);
        /// @solidity memory-safe-assembly
        assembly {
            let o := eq(byte(0, mload(add(str, 0x20))), 0x30) // Whether leading zero is present.
            let strLength := add(mload(str), 2) // Compute the length.
            mstore(add(str, o), 0x3078) // Write the "0x" prefix, accounting for leading zero.
            str := sub(add(str, o), 2) // Move the pointer, accounting for leading zero.
            mstore(str, sub(strLength, o)) // Write the length, accounting for leading zero.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output excludes leading "0" from the `toHexStringNoPrefix` output.
    /// `0x00: "0", 0x01: "1", 0x12: "12", 0x123: "123"`.
    function toMinimalHexStringNoPrefix(uint256 value) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(value);
        /// @solidity memory-safe-assembly
        assembly {
            let o := eq(byte(0, mload(add(str, 0x20))), 0x30) // Whether leading zero is present.
            let strLength := mload(str) // Get the length.
            str := add(str, o) // Move the pointer, accounting for leading zero.
            mstore(str, sub(strLength, o)) // Write the length, accounting for leading zero.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is encoded using 2 hexadecimal digits per byte.
    /// As address are 20 bytes long, the output will left-padded to have
    /// a length of `20 * 2` bytes.
    function toHexStringNoPrefix(uint256 value) internal pure returns (string memory str) {
        /// @solidity memory-safe-assembly
        assembly {
            // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length,
            // 0x02 bytes for the prefix, and 0x40 bytes for the digits.
            // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x40) is 0xa0.
            str := add(mload(0x40), 0x80)
            // Allocate the memory.
            mstore(0x40, add(str, 0x20))
            // Zeroize the slot after the string.
            mstore(str, 0)

            // Cache the end to calculate the length later.
            let end := str
            // Store "0123456789abcdef" in scratch space.
            mstore(0x0f, 0x30313233343536373839616263646566)

            let w := not(1) // Tsk.
            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            for { let temp := value } 1 {} {
                str := add(str, w) // `sub(str, 2)`.
                mstore8(add(str, 1), mload(and(temp, 15)))
                mstore8(str, mload(and(shr(4, temp), 15)))
                temp := shr(8, temp)
                if iszero(temp) { break }
            }

            // Compute the string's length.
            let strLength := sub(end, str)
            // Move the pointer and write the length.
            str := sub(str, 0x20)
            mstore(str, strLength)
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is prefixed with "0x", encoded using 2 hexadecimal digits per byte,
    /// and the alphabets are capitalized conditionally according to
    /// https://eips.ethereum.org/EIPS/eip-55
    function toHexStringChecksummed(address value) internal pure returns (string memory str) {
        str = toHexString(value);
        /// @solidity memory-safe-assembly
        assembly {
            let mask := shl(6, div(not(0), 255)) // `0b010000000100000000 ...`
            let o := add(str, 0x22)
            let hashed := and(keccak256(o, 40), mul(34, mask)) // `0b10001000 ... `
            let t := shl(240, 136) // `0b10001000 << 240`
            for { let i := 0 } 1 {} {
                mstore(add(i, i), mul(t, byte(i, hashed)))
                i := add(i, 1)
                if eq(i, 20) { break }
            }
            mstore(o, xor(mload(o), shr(1, and(mload(0x00), and(mload(o), mask)))))
            o := add(o, 0x20)
            mstore(o, xor(mload(o), shr(1, and(mload(0x20), and(mload(o), mask)))))
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte.
    function toHexString(address value) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(value);
        /// @solidity memory-safe-assembly
        assembly {
            let strLength := add(mload(str), 2) // Compute the length.
            mstore(str, 0x3078) // Write the "0x" prefix.
            str := sub(str, 2) // Move the pointer.
            mstore(str, strLength) // Write the length.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is encoded using 2 hexadecimal digits per byte.
    function toHexStringNoPrefix(address value) internal pure returns (string memory str) {
        /// @solidity memory-safe-assembly
        assembly {
            str := mload(0x40)

            // Allocate the memory.
            // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length,
            // 0x02 bytes for the prefix, and 0x28 bytes for the digits.
            // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x28) is 0x80.
            mstore(0x40, add(str, 0x80))

            // Store "0123456789abcdef" in scratch space.
            mstore(0x0f, 0x30313233343536373839616263646566)

            str := add(str, 2)
            mstore(str, 40)

            let o := add(str, 0x20)
            mstore(add(o, 40), 0)

            value := shl(96, value)

            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            for { let i := 0 } 1 {} {
                let p := add(o, add(i, i))
                let temp := byte(i, value)
                mstore8(add(p, 1), mload(and(temp, 15)))
                mstore8(p, mload(shr(4, temp)))
                i := add(i, 1)
                if eq(i, 20) { break }
            }
        }
    }

    /// @dev Returns the hex encoded string from the raw bytes.
    /// The output is encoded using 2 hexadecimal digits per byte.
    function toHexString(bytes memory raw) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(raw);
        /// @solidity memory-safe-assembly
        assembly {
            let strLength := add(mload(str), 2) // Compute the length.
            mstore(str, 0x3078) // Write the "0x" prefix.
            str := sub(str, 2) // Move the pointer.
            mstore(str, strLength) // Write the length.
        }
    }

    /// @dev Returns the hex encoded string from the raw bytes.
    /// The output is encoded using 2 hexadecimal digits per byte.
    function toHexStringNoPrefix(bytes memory raw) internal pure returns (string memory str) {
        /// @solidity memory-safe-assembly
        assembly {
            let length := mload(raw)
            str := add(mload(0x40), 2) // Skip 2 bytes for the optional prefix.
            mstore(str, add(length, length)) // Store the length of the output.

            // Store "0123456789abcdef" in scratch space.
            mstore(0x0f, 0x30313233343536373839616263646566)

            let o := add(str, 0x20)
            let end := add(raw, length)

            for {} iszero(eq(raw, end)) {} {
                raw := add(raw, 1)
                mstore8(add(o, 1), mload(and(mload(raw), 15)))
                mstore8(o, mload(and(shr(4, mload(raw)), 15)))
                o := add(o, 2)
            }
            mstore(o, 0) // Zeroize the slot after the string.
            mstore(0x40, add(o, 0x20)) // Allocate the memory.
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   RUNE STRING OPERATIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the number of UTF characters in the string.
    function runeCount(string memory s) internal pure returns (uint256 result) {
        /// @solidity memory-safe-assembly
        assembly {
            if mload(s) {
                mstore(0x00, div(not(0), 255))
                mstore(0x20, 0x0202020202020202020202020202020202020202020202020303030304040506)
                let o := add(s, 0x20)
                let end := add(o, mload(s))
                for { result := 1 } 1 { result := add(result, 1) } {
                    o := add(o, byte(0, mload(shr(250, mload(o)))))
                    if iszero(lt(o, end)) { break }
                }
            }
        }
    }

    /// @dev Returns if this string is a 7-bit ASCII string.
    /// (i.e. all characters codes are in [0..127])
    function is7BitASCII(string memory s) internal pure returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            let mask := shl(7, div(not(0), 255))
            result := 1
            let n := mload(s)
            if n {
                let o := add(s, 0x20)
                let end := add(o, n)
                let last := mload(end)
                mstore(end, 0)
                for {} 1 {} {
                    if and(mask, mload(o)) {
                        result := 0
                        break
                    }
                    o := add(o, 0x20)
                    if iszero(lt(o, end)) { break }
                }
                mstore(end, last)
            }
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   BYTE STRING OPERATIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    // For performance and bytecode compactness, byte string operations are restricted
    // to 7-bit ASCII strings. All offsets are byte offsets, not UTF character offsets.
    // Usage of byte string operations on charsets with runes spanning two or more bytes
    // can lead to undefined behavior.

    /// @dev Returns `subject` all occurrences of `search` replaced with `replacement`.
    function replace(string memory subject, string memory search, string memory replacement)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let subjectLength := mload(subject)
            let searchLength := mload(search)
            let replacementLength := mload(replacement)

            subject := add(subject, 0x20)
            search := add(search, 0x20)
            replacement := add(replacement, 0x20)
            result := add(mload(0x40), 0x20)

            let subjectEnd := add(subject, subjectLength)
            if iszero(gt(searchLength, subjectLength)) {
                let subjectSearchEnd := add(sub(subjectEnd, searchLength), 1)
                let h := 0
                if iszero(lt(searchLength, 0x20)) { h := keccak256(search, searchLength) }
                let m := shl(3, sub(0x20, and(searchLength, 0x1f)))
                let s := mload(search)
                for {} 1 {} {
                    let t := mload(subject)
                    // Whether the first `searchLength % 32` bytes of
                    // `subject` and `search` matches.
                    if iszero(shr(m, xor(t, s))) {
                        if h {
                            if iszero(eq(keccak256(subject, searchLength), h)) {
                                mstore(result, t)
                                result := add(result, 1)
                                subject := add(subject, 1)
                                if iszero(lt(subject, subjectSearchEnd)) { break }
                                continue
                            }
                        }
                        // Copy the `replacement` one word at a time.
                        for { let o := 0 } 1 {} {
                            mstore(add(result, o), mload(add(replacement, o)))
                            o := add(o, 0x20)
                            if iszero(lt(o, replacementLength)) { break }
                        }
                        result := add(result, replacementLength)
                        subject := add(subject, searchLength)
                        if searchLength {
                            if iszero(lt(subject, subjectSearchEnd)) { break }
                            continue
                        }
                    }
                    mstore(result, t)
                    result := add(result, 1)
                    subject := add(subject, 1)
                    if iszero(lt(subject, subjectSearchEnd)) { break }
                }
            }

            let resultRemainder := result
            result := add(mload(0x40), 0x20)
            let k := add(sub(resultRemainder, result), sub(subjectEnd, subject))
            // Copy the rest of the string one word at a time.
            for {} lt(subject, subjectEnd) {} {
                mstore(resultRemainder, mload(subject))
                resultRemainder := add(resultRemainder, 0x20)
                subject := add(subject, 0x20)
            }
            result := sub(result, 0x20)
            let last := add(add(result, 0x20), k) // Zeroize the slot after the string.
            mstore(last, 0)
            mstore(0x40, add(last, 0x20)) // Allocate the memory.
            mstore(result, k) // Store the length.
        }
    }

    /// @dev Returns the byte index of the first location of `search` in `subject`,
    /// searching from left to right, starting from `from`.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found.
    function indexOf(string memory subject, string memory search, uint256 from)
        internal
        pure
        returns (uint256 result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            for { let subjectLength := mload(subject) } 1 {} {
                if iszero(mload(search)) {
                    if iszero(gt(from, subjectLength)) {
                        result := from
                        break
                    }
                    result := subjectLength
                    break
                }
                let searchLength := mload(search)
                let subjectStart := add(subject, 0x20)

                result := not(0) // Initialize to `NOT_FOUND`.

                subject := add(subjectStart, from)
                let end := add(sub(add(subjectStart, subjectLength), searchLength), 1)

                let m := shl(3, sub(0x20, and(searchLength, 0x1f)))
                let s := mload(add(search, 0x20))

                if iszero(and(lt(subject, end), lt(from, subjectLength))) { break }

                if iszero(lt(searchLength, 0x20)) {
                    for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} {
                        if iszero(shr(m, xor(mload(subject), s))) {
                            if eq(keccak256(subject, searchLength), h) {
                                result := sub(subject, subjectStart)
                                break
                            }
                        }
                        subject := add(subject, 1)
                        if iszero(lt(subject, end)) { break }
                    }
                    break
                }
                for {} 1 {} {
                    if iszero(shr(m, xor(mload(subject), s))) {
                        result := sub(subject, subjectStart)
                        break
                    }
                    subject := add(subject, 1)
                    if iszero(lt(subject, end)) { break }
                }
                break
            }
        }
    }

    /// @dev Returns the byte index of the first location of `search` in `subject`,
    /// searching from left to right.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found.
    function indexOf(string memory subject, string memory search)
        internal
        pure
        returns (uint256 result)
    {
        result = indexOf(subject, search, 0);
    }

    /// @dev Returns the byte index of the first location of `search` in `subject`,
    /// searching from right to left, starting from `from`.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found.
    function lastIndexOf(string memory subject, string memory search, uint256 from)
        internal
        pure
        returns (uint256 result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            for {} 1 {} {
                result := not(0) // Initialize to `NOT_FOUND`.
                let searchLength := mload(search)
                if gt(searchLength, mload(subject)) { break }
                let w := result

                let fromMax := sub(mload(subject), searchLength)
                if iszero(gt(fromMax, from)) { from := fromMax }

                let end := add(add(subject, 0x20), w)
                subject := add(add(subject, 0x20), from)
                if iszero(gt(subject, end)) { break }
                // As this function is not too often used,
                // we shall simply use keccak256 for smaller bytecode size.
                for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} {
                    if eq(keccak256(subject, searchLength), h) {
                        result := sub(subject, add(end, 1))
                        break
                    }
                    subject := add(subject, w) // `sub(subject, 1)`.
                    if iszero(gt(subject, end)) { break }
                }
                break
            }
        }
    }

    /// @dev Returns the byte index of the first location of `search` in `subject`,
    /// searching from right to left.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found.
    function lastIndexOf(string memory subject, string memory search)
        internal
        pure
        returns (uint256 result)
    {
        result = lastIndexOf(subject, search, uint256(int256(-1)));
    }

    /// @dev Returns true if `search` is found in `subject`, false otherwise.
    function contains(string memory subject, string memory search) internal pure returns (bool) {
        return indexOf(subject, search) != NOT_FOUND;
    }

    /// @dev Returns whether `subject` starts with `search`.
    function startsWith(string memory subject, string memory search)
        internal
        pure
        returns (bool result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let searchLength := mload(search)
            // Just using keccak256 directly is actually cheaper.
            // forgefmt: disable-next-item
            result := and(
                iszero(gt(searchLength, mload(subject))),
                eq(
                    keccak256(add(subject, 0x20), searchLength),
                    keccak256(add(search, 0x20), searchLength)
                )
            )
        }
    }

    /// @dev Returns whether `subject` ends with `search`.
    function endsWith(string memory subject, string memory search)
        internal
        pure
        returns (bool result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let searchLength := mload(search)
            let subjectLength := mload(subject)
            // Whether `search` is not longer than `subject`.
            let withinRange := iszero(gt(searchLength, subjectLength))
            // Just using keccak256 directly is actually cheaper.
            // forgefmt: disable-next-item
            result := and(
                withinRange,
                eq(
                    keccak256(
                        // `subject + 0x20 + max(subjectLength - searchLength, 0)`.
                        add(add(subject, 0x20), mul(withinRange, sub(subjectLength, searchLength))),
                        searchLength
                    ),
                    keccak256(add(search, 0x20), searchLength)
                )
            )
        }
    }

    /// @dev Returns `subject` repeated `times`.
    function repeat(string memory subject, uint256 times)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let subjectLength := mload(subject)
            if iszero(or(iszero(times), iszero(subjectLength))) {
                subject := add(subject, 0x20)
                result := mload(0x40)
                let output := add(result, 0x20)
                for {} 1 {} {
                    // Copy the `subject` one word at a time.
                    for { let o := 0 } 1 {} {
                        mstore(add(output, o), mload(add(subject, o)))
                        o := add(o, 0x20)
                        if iszero(lt(o, subjectLength)) { break }
                    }
                    output := add(output, subjectLength)
                    times := sub(times, 1)
                    if iszero(times) { break }
                }
                mstore(output, 0) // Zeroize the slot after the string.
                let resultLength := sub(output, add(result, 0x20))
                mstore(result, resultLength) // Store the length.
                // Allocate the memory.
                mstore(0x40, add(result, add(resultLength, 0x20)))
            }
        }
    }

    /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive).
    /// `start` and `end` are byte offsets.
    function slice(string memory subject, uint256 start, uint256 end)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let subjectLength := mload(subject)
            if iszero(gt(subjectLength, end)) { end := subjectLength }
            if iszero(gt(subjectLength, start)) { start := subjectLength }
            if lt(start, end) {
                result := mload(0x40)
                let resultLength := sub(end, start)
                mstore(result, resultLength)
                subject := add(subject, start)
                let w := not(0x1f)
                // Copy the `subject` one word at a time, backwards.
                for { let o := and(add(resultLength, 0x1f), w) } 1 {} {
                    mstore(add(result, o), mload(add(subject, o)))
                    o := add(o, w) // `sub(o, 0x20)`.
                    if iszero(o) { break }
                }
                // Zeroize the slot after the string.
                mstore(add(add(result, 0x20), resultLength), 0)
                // Allocate memory for the length and the bytes,
                // rounded up to a multiple of 32.
                mstore(0x40, add(result, and(add(resultLength, 0x3f), w)))
            }
        }
    }

    /// @dev Returns a copy of `subject` sliced from `start` to the end of the string.
    /// `start` is a byte offset.
    function slice(string memory subject, uint256 start)
        internal
        pure
        returns (string memory result)
    {
        result = slice(subject, start, uint256(int256(-1)));
    }

    /// @dev Returns all the indices of `search` in `subject`.
    /// The indices are byte offsets.
    function indicesOf(string memory subject, string memory search)
        internal
        pure
        returns (uint256[] memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let subjectLength := mload(subject)
            let searchLength := mload(search)

            if iszero(gt(searchLength, subjectLength)) {
                subject := add(subject, 0x20)
                search := add(search, 0x20)
                result := add(mload(0x40), 0x20)

                let subjectStart := subject
                let subjectSearchEnd := add(sub(add(subject, subjectLength), searchLength), 1)
                let h := 0
                if iszero(lt(searchLength, 0x20)) { h := keccak256(search, searchLength) }
                let m := shl(3, sub(0x20, and(searchLength, 0x1f)))
                let s := mload(search)
                for {} 1 {} {
                    let t := mload(subject)
                    // Whether the first `searchLength % 32` bytes of
                    // `subject` and `search` matches.
                    if iszero(shr(m, xor(t, s))) {
                        if h {
                            if iszero(eq(keccak256(subject, searchLength), h)) {
                                subject := add(subject, 1)
                                if iszero(lt(subject, subjectSearchEnd)) { break }
                                continue
                            }
                        }
                        // Append to `result`.
                        mstore(result, sub(subject, subjectStart))
                        result := add(result, 0x20)
                        // Advance `subject` by `searchLength`.
                        subject := add(subject, searchLength)
                        if searchLength {
                            if iszero(lt(subject, subjectSearchEnd)) { break }
                            continue
                        }
                    }
                    subject := add(subject, 1)
                    if iszero(lt(subject, subjectSearchEnd)) { break }
                }
                let resultEnd := result
                // Assign `result` to the free memory pointer.
                result := mload(0x40)
                // Store the length of `result`.
                mstore(result, shr(5, sub(resultEnd, add(result, 0x20))))
                // Allocate memory for result.
                // We allocate one more word, so this array can be recycled for {split}.
                mstore(0x40, add(resultEnd, 0x20))
            }
        }
    }

    /// @dev Returns a arrays of strings based on the `delimiter` inside of the `subject` string.
    function split(string memory subject, string memory delimiter)
        internal
        pure
        returns (string[] memory result)
    {
        uint256[] memory indices = indicesOf(subject, delimiter);
        /// @solidity memory-safe-assembly
        assembly {
            let w := not(0x1f)
            let indexPtr := add(indices, 0x20)
            let indicesEnd := add(indexPtr, shl(5, add(mload(indices), 1)))
            mstore(add(indicesEnd, w), mload(subject))
            mstore(indices, add(mload(indices), 1))
            let prevIndex := 0
            for {} 1 {} {
                let index := mload(indexPtr)
                mstore(indexPtr, 0x60)
                if iszero(eq(index, prevIndex)) {
                    let element := mload(0x40)
                    let elementLength := sub(index, prevIndex)
                    mstore(element, elementLength)
                    // Copy the `subject` one word at a time, backwards.
                    for { let o := and(add(elementLength, 0x1f), w) } 1 {} {
                        mstore(add(element, o), mload(add(add(subject, prevIndex), o)))
                        o := add(o, w) // `sub(o, 0x20)`.
                        if iszero(o) { break }
                    }
                    // Zeroize the slot after the string.
                    mstore(add(add(element, 0x20), elementLength), 0)
                    // Allocate memory for the length and the bytes,
                    // rounded up to a multiple of 32.
                    mstore(0x40, add(element, and(add(elementLength, 0x3f), w)))
                    // Store the `element` into the array.
                    mstore(indexPtr, element)
                }
                prevIndex := add(index, mload(delimiter))
                indexPtr := add(indexPtr, 0x20)
                if iszero(lt(indexPtr, indicesEnd)) { break }
            }
            result := indices
            if iszero(mload(delimiter)) {
                result := add(indices, 0x20)
                mstore(result, sub(mload(indices), 2))
            }
        }
    }

    /// @dev Returns a concatenated string of `a` and `b`.
    /// Cheaper than `string.concat()` and does not de-align the free memory pointer.
    function concat(string memory a, string memory b)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let w := not(0x1f)
            result := mload(0x40)
            let aLength := mload(a)
            // Copy `a` one word at a time, backwards.
            for { let o := and(add(aLength, 0x20), w) } 1 {} {
                mstore(add(result, o), mload(add(a, o)))
                o := add(o, w) // `sub(o, 0x20)`.
                if iszero(o) { break }
            }
            let bLength := mload(b)
            let output := add(result, aLength)
            // Copy `b` one word at a time, backwards.
            for { let o := and(add(bLength, 0x20), w) } 1 {} {
                mstore(add(output, o), mload(add(b, o)))
                o := add(o, w) // `sub(o, 0x20)`.
                if iszero(o) { break }
            }
            let totalLength := add(aLength, bLength)
            let last := add(add(result, 0x20), totalLength)
            // Zeroize the slot after the string.
            mstore(last, 0)
            // Stores the length.
            mstore(result, totalLength)
            // Allocate memory for the length and the bytes,
            // rounded up to a multiple of 32.
            mstore(0x40, and(add(last, 0x1f), w))
        }
    }

    /// @dev Returns a copy of the string in either lowercase or UPPERCASE.
    /// WARNING! This function is only compatible with 7-bit ASCII strings.
    function toCase(string memory subject, bool toUpper)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let length := mload(subject)
            if length {
                result := add(mload(0x40), 0x20)
                subject := add(subject, 1)
                let flags := shl(add(70, shl(5, toUpper)), 0x3ffffff)
                let w := not(0)
                for { let o := length } 1 {} {
                    o := add(o, w)
                    let b := and(0xff, mload(add(subject, o)))
                    mstore8(add(result, o), xor(b, and(shr(b, flags), 0x20)))
                    if iszero(o) { break }
                }
                result := mload(0x40)
                mstore(result, length) // Store the length.
                let last := add(add(result, 0x20), length)
                mstore(last, 0) // Zeroize the slot after the string.
                mstore(0x40, add(last, 0x20)) // Allocate the memory.
            }
        }
    }

    /// @dev Returns a string from a small bytes32 string.
    /// `s` must be null-terminated, or behavior will be undefined.
    function fromSmallString(bytes32 s) internal pure returns (string memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            let n := 0
            for {} byte(n, s) { n := add(n, 1) } {} // Scan for '\0'.
            mstore(result, n)
            let o := add(result, 0x20)
            mstore(o, s)
            mstore(add(o, n), 0)
            mstore(0x40, add(result, 0x40))
        }
    }

    /// @dev Returns the small string, with all bytes after the first null byte zeroized.
    function normalizeSmallString(bytes32 s) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            for {} byte(result, s) { result := add(result, 1) } {} // Scan for '\0'.
            mstore(0x00, s)
            mstore(result, 0x00)
            result := mload(0x00)
        }
    }

    /// @dev Returns the string as a normalized null-terminated small string.
    function toSmallString(string memory s) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(s)
            if iszero(lt(result, 33)) {
                mstore(0x00, 0xec92f9a3) // `TooBigForSmallString()`.
                revert(0x1c, 0x04)
            }
            result := shl(shl(3, sub(32, result)), mload(add(s, result)))
        }
    }

    /// @dev Returns a lowercased copy of the string.
    /// WARNING! This function is only compatible with 7-bit ASCII strings.
    function lower(string memory subject) internal pure returns (string memory result) {
        result = toCase(subject, false);
    }

    /// @dev Returns an UPPERCASED copy of the string.
    /// WARNING! This function is only compatible with 7-bit ASCII strings.
    function upper(string memory subject) internal pure returns (string memory result) {
        result = toCase(subject, true);
    }

    /// @dev Escapes the string to be used within HTML tags.
    function escapeHTML(string memory s) internal pure returns (string memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            let end := add(s, mload(s))
            result := add(mload(0x40), 0x20)
            // Store the bytes of the packed offsets and strides into the scratch space.
            // `packed = (stride << 5) | offset`. Max offset is 20. Max stride is 6.
            mstore(0x1f, 0x900094)
            mstore(0x08, 0xc0000000a6ab)
            // Store "&quot;&amp;&#39;&lt;&gt;" into the scratch space.
            mstore(0x00, shl(64, 0x2671756f743b26616d703b262333393b266c743b2667743b))
            for {} iszero(eq(s, end)) {} {
                s := add(s, 1)
                let c := and(mload(s), 0xff)
                // Not in `["\"","'","&","<",">"]`.
                if iszero(and(shl(c, 1), 0x500000c400000000)) {
                    mstore8(result, c)
                    result := add(result, 1)
                    continue
                }
                let t := shr(248, mload(c))
                mstore(result, mload(and(t, 0x1f)))
                result := add(result, shr(5, t))
            }
            let last := result
            mstore(last, 0) // Zeroize the slot after the string.
            result := mload(0x40)
            mstore(result, sub(last, add(result, 0x20))) // Store the length.
            mstore(0x40, add(last, 0x20)) // Allocate the memory.
        }
    }

    /// @dev Escapes the string to be used within double-quotes in a JSON.
    /// If `addDoubleQuotes` is true, the result will be enclosed in double-quotes.
    function escapeJSON(string memory s, bool addDoubleQuotes)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let end := add(s, mload(s))
            result := add(mload(0x40), 0x20)
            if addDoubleQuotes {
                mstore8(result, 34)
                result := add(1, result)
            }
            // Store "\\u0000" in scratch space.
            // Store "0123456789abcdef" in scratch space.
            // Also, store `{0x08:"b", 0x09:"t", 0x0a:"n", 0x0c:"f", 0x0d:"r"}`.
            // into the scratch space.
            mstore(0x15, 0x5c75303030303031323334353637383961626364656662746e006672)
            // Bitmask for detecting `["\"","\\"]`.
            let e := or(shl(0x22, 1), shl(0x5c, 1))
            for {} iszero(eq(s, end)) {} {
                s := add(s, 1)
                let c := and(mload(s), 0xff)
                if iszero(lt(c, 0x20)) {
                    if iszero(and(shl(c, 1), e)) {
                        // Not in `["\"","\\"]`.
                        mstore8(result, c)
                        result := add(result, 1)
                        continue
                    }
                    mstore8(result, 0x5c) // "\\".
                    mstore8(add(result, 1), c)
                    result := add(result, 2)
                    continue
                }
                if iszero(and(shl(c, 1), 0x3700)) {
                    // Not in `["\b","\t","\n","\f","\d"]`.
                    mstore8(0x1d, mload(shr(4, c))) // Hex value.
                    mstore8(0x1e, mload(and(c, 15))) // Hex value.
                    mstore(result, mload(0x19)) // "\\u00XX".
                    result := add(result, 6)
                    continue
                }
                mstore8(result, 0x5c) // "\\".
                mstore8(add(result, 1), mload(add(c, 8)))
                result := add(result, 2)
            }
            if addDoubleQuotes {
                mstore8(result, 34)
                result := add(1, result)
            }
            let last := result
            mstore(last, 0) // Zeroize the slot after the string.
            result := mload(0x40)
            mstore(result, sub(last, add(result, 0x20))) // Store the length.
            mstore(0x40, add(last, 0x20)) // Allocate the memory.
        }
    }

    /// @dev Escapes the string to be used within double-quotes in a JSON.
    function escapeJSON(string memory s) internal pure returns (string memory result) {
        result = escapeJSON(s, false);
    }

    /// @dev Returns whether `a` equals `b`.
    function eq(string memory a, string memory b) internal pure returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := eq(keccak256(add(a, 0x20), mload(a)), keccak256(add(b, 0x20), mload(b)))
        }
    }

    /// @dev Returns whether `a` equals `b`, where `b` is a null-terminated small string.
    function eqs(string memory a, bytes32 b) internal pure returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            // These should be evaluated on compile time, as far as possible.
            let m := not(shl(7, div(not(iszero(b)), 255))) // `0x7f7f ...`.
            let x := not(or(m, or(b, add(m, and(b, m)))))
            let r := shl(7, iszero(iszero(shr(128, x))))
            r := or(r, shl(6, iszero(iszero(shr(64, shr(r, x))))))
            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))
            r := or(r, shl(4, lt(0xffff, shr(r, x))))
            r := or(r, shl(3, lt(0xff, shr(r, x))))
            // forgefmt: disable-next-item
            result := gt(eq(mload(a), add(iszero(x), xor(31, shr(3, r)))),
                xor(shr(add(8, r), b), shr(add(8, r), mload(add(a, 0x20)))))
        }
    }

    /// @dev Packs a single string with its length into a single word.
    /// Returns `bytes32(0)` if the length is zero or greater than 31.
    function packOne(string memory a) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            // We don't need to zero right pad the string,
            // since this is our own custom non-standard packing scheme.
            result :=
                mul(
                    // Load the length and the bytes.
                    mload(add(a, 0x1f)),
                    // `length != 0 && length < 32`. Abuses underflow.
                    // Assumes that the length is valid and within the block gas limit.
                    lt(sub(mload(a), 1), 0x1f)
                )
        }
    }

    /// @dev Unpacks a string packed using {packOne}.
    /// Returns the empty string if `packed` is `bytes32(0)`.
    /// If `packed` is not an output of {packOne}, the output behavior is undefined.
    function unpackOne(bytes32 packed) internal pure returns (string memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            // Grab the free memory pointer.
            result := mload(0x40)
            // Allocate 2 words (1 for the length, 1 for the bytes).
            mstore(0x40, add(result, 0x40))
            // Zeroize the length slot.
            mstore(result, 0)
            // Store the length and bytes.
            mstore(add(result, 0x1f), packed)
            // Right pad with zeroes.
            mstore(add(add(result, 0x20), mload(result)), 0)
        }
    }

    /// @dev Packs two strings with their lengths into a single word.
    /// Returns `bytes32(0)` if combined length is zero or greater than 30.
    function packTwo(string memory a, string memory b) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            let aLength := mload(a)
            // We don't need to zero right pad the strings,
            // since this is our own custom non-standard packing scheme.
            result :=
                mul(
                    // Load the length and the bytes of `a` and `b`.
                    or(
                        shl(shl(3, sub(0x1f, aLength)), mload(add(a, aLength))),
                        mload(sub(add(b, 0x1e), aLength))
                    ),
                    // `totalLength != 0 && totalLength < 31`. Abuses underflow.
                    // Assumes that the lengths are valid and within the block gas limit.
                    lt(sub(add(aLength, mload(b)), 1), 0x1e)
                )
        }
    }

    /// @dev Unpacks strings packed using {packTwo}.
    /// Returns the empty strings if `packed` is `bytes32(0)`.
    /// If `packed` is not an output of {packTwo}, the output behavior is undefined.
    function unpackTwo(bytes32 packed)
        internal
        pure
        returns (string memory resultA, string memory resultB)
    {
        /// @solidity memory-safe-assembly
        assembly {
            // Grab the free memory pointer.
            resultA := mload(0x40)
            resultB := add(resultA, 0x40)
            // Allocate 2 words for each string (1 for the length, 1 for the byte). Total 4 words.
            mstore(0x40, add(resultB, 0x40))
            // Zeroize the length slots.
            mstore(resultA, 0)
            mstore(resultB, 0)
            // Store the lengths and bytes.
            mstore(add(resultA, 0x1f), packed)
            mstore(add(resultB, 0x1f), mload(add(add(resultA, 0x20), mload(resultA))))
            // Right pad with zeroes.
            mstore(add(add(resultA, 0x20), mload(resultA)), 0)
            mstore(add(add(resultB, 0x20), mload(resultB)), 0)
        }
    }

    /// @dev Directly returns `a` without copying.
    function directReturn(string memory a) internal pure {
        assembly {
            // Assumes that the string does not start from the scratch space.
            let retStart := sub(a, 0x20)
            let retSize := add(mload(a), 0x40)
            // Right pad with zeroes. Just in case the string is produced
            // by a method that doesn't zero right pad.
            mstore(add(retStart, retSize), 0)
            // Store the return offset.
            mstore(retStart, 0x20)
            // End the transaction, returning the string.
            return(retStart, retSize)
        }
    }
}

File 9 of 9 : SafeTransferLib.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeTransferLib.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
///
/// @dev Note:
/// - For ETH transfers, please use `forceSafeTransferETH` for DoS protection.
/// - For ERC20s, this implementation won't check that a token has code,
///   responsibility is delegated to the caller.
library SafeTransferLib {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                       CUSTOM ERRORS                        */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The ETH transfer has failed.
    error ETHTransferFailed();

    /// @dev The ERC20 `transferFrom` has failed.
    error TransferFromFailed();

    /// @dev The ERC20 `transfer` has failed.
    error TransferFailed();

    /// @dev The ERC20 `approve` has failed.
    error ApproveFailed();

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                         CONSTANTS                          */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Suggested gas stipend for contract receiving ETH that disallows any storage writes.
    uint256 internal constant GAS_STIPEND_NO_STORAGE_WRITES = 2300;

    /// @dev Suggested gas stipend for contract receiving ETH to perform a few
    /// storage reads and writes, but low enough to prevent griefing.
    uint256 internal constant GAS_STIPEND_NO_GRIEF = 100000;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                       ETH OPERATIONS                       */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    // If the ETH transfer MUST succeed with a reasonable gas budget, use the force variants.
    //
    // The regular variants:
    // - Forwards all remaining gas to the target.
    // - Reverts if the target reverts.
    // - Reverts if the current contract has insufficient balance.
    //
    // The force variants:
    // - Forwards with an optional gas stipend
    //   (defaults to `GAS_STIPEND_NO_GRIEF`, which is sufficient for most cases).
    // - If the target reverts, or if the gas stipend is exhausted,
    //   creates a temporary contract to force send the ETH via `SELFDESTRUCT`.
    //   Future compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758.
    // - Reverts if the current contract has insufficient balance.
    //
    // The try variants:
    // - Forwards with a mandatory gas stipend.
    // - Instead of reverting, returns whether the transfer succeeded.

    /// @dev Sends `amount` (in wei) ETH to `to`.
    function safeTransferETH(address to, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            if iszero(call(gas(), to, amount, codesize(), 0x00, codesize(), 0x00)) {
                mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
                revert(0x1c, 0x04)
            }
        }
    }

    /// @dev Sends all the ETH in the current contract to `to`.
    function safeTransferAllETH(address to) internal {
        /// @solidity memory-safe-assembly
        assembly {
            // Transfer all the ETH and check if it succeeded or not.
            if iszero(call(gas(), to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {
                mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
                revert(0x1c, 0x04)
            }
        }
    }

    /// @dev Force sends `amount` (in wei) ETH to `to`, with a `gasStipend`.
    function forceSafeTransferETH(address to, uint256 amount, uint256 gasStipend) internal {
        /// @solidity memory-safe-assembly
        assembly {
            if lt(selfbalance(), amount) {
                mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
                revert(0x1c, 0x04)
            }
            if iszero(call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)) {
                mstore(0x00, to) // Store the address in scratch space.
                mstore8(0x0b, 0x73) // Opcode `PUSH20`.
                mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
                if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
            }
        }
    }

    /// @dev Force sends all the ETH in the current contract to `to`, with a `gasStipend`.
    function forceSafeTransferAllETH(address to, uint256 gasStipend) internal {
        /// @solidity memory-safe-assembly
        assembly {
            if iszero(call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {
                mstore(0x00, to) // Store the address in scratch space.
                mstore8(0x0b, 0x73) // Opcode `PUSH20`.
                mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
                if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
            }
        }
    }

    /// @dev Force sends `amount` (in wei) ETH to `to`, with `GAS_STIPEND_NO_GRIEF`.
    function forceSafeTransferETH(address to, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            if lt(selfbalance(), amount) {
                mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
                revert(0x1c, 0x04)
            }
            if iszero(call(GAS_STIPEND_NO_GRIEF, to, amount, codesize(), 0x00, codesize(), 0x00)) {
                mstore(0x00, to) // Store the address in scratch space.
                mstore8(0x0b, 0x73) // Opcode `PUSH20`.
                mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
                if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
            }
        }
    }

    /// @dev Force sends all the ETH in the current contract to `to`, with `GAS_STIPEND_NO_GRIEF`.
    function forceSafeTransferAllETH(address to) internal {
        /// @solidity memory-safe-assembly
        assembly {
            // forgefmt: disable-next-item
            if iszero(call(GAS_STIPEND_NO_GRIEF, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {
                mstore(0x00, to) // Store the address in scratch space.
                mstore8(0x0b, 0x73) // Opcode `PUSH20`.
                mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
                if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
            }
        }
    }

    /// @dev Sends `amount` (in wei) ETH to `to`, with a `gasStipend`.
    function trySafeTransferETH(address to, uint256 amount, uint256 gasStipend)
        internal
        returns (bool success)
    {
        /// @solidity memory-safe-assembly
        assembly {
            success := call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)
        }
    }

    /// @dev Sends all the ETH in the current contract to `to`, with a `gasStipend`.
    function trySafeTransferAllETH(address to, uint256 gasStipend)
        internal
        returns (bool success)
    {
        /// @solidity memory-safe-assembly
        assembly {
            success := call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                      ERC20 OPERATIONS                      */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Sends `amount` of ERC20 `token` from `from` to `to`.
    /// Reverts upon failure.
    ///
    /// The `from` account must have at least `amount` approved for
    /// the current contract to manage.
    function safeTransferFrom(address token, address from, address to, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40) // Cache the free memory pointer.
            mstore(0x60, amount) // Store the `amount` argument.
            mstore(0x40, to) // Store the `to` argument.
            mstore(0x2c, shl(96, from)) // Store the `from` argument.
            mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`.
            // Perform the transfer, reverting upon failure.
            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
                    call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
                )
            ) {
                mstore(0x00, 0x7939f424) // `TransferFromFailed()`.
                revert(0x1c, 0x04)
            }
            mstore(0x60, 0) // Restore the zero slot to zero.
            mstore(0x40, m) // Restore the free memory pointer.
        }
    }

    /// @dev Sends all of ERC20 `token` from `from` to `to`.
    /// Reverts upon failure.
    ///
    /// The `from` account must have their entire balance approved for
    /// the current contract to manage.
    function safeTransferAllFrom(address token, address from, address to)
        internal
        returns (uint256 amount)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40) // Cache the free memory pointer.
            mstore(0x40, to) // Store the `to` argument.
            mstore(0x2c, shl(96, from)) // Store the `from` argument.
            mstore(0x0c, 0x70a08231000000000000000000000000) // `balanceOf(address)`.
            // Read the balance, reverting upon failure.
            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    gt(returndatasize(), 0x1f), // At least 32 bytes returned.
                    staticcall(gas(), token, 0x1c, 0x24, 0x60, 0x20)
                )
            ) {
                mstore(0x00, 0x7939f424) // `TransferFromFailed()`.
                revert(0x1c, 0x04)
            }
            mstore(0x00, 0x23b872dd) // `transferFrom(address,address,uint256)`.
            amount := mload(0x60) // The `amount` is already at 0x60. We'll need to return it.
            // Perform the transfer, reverting upon failure.
            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
                    call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
                )
            ) {
                mstore(0x00, 0x7939f424) // `TransferFromFailed()`.
                revert(0x1c, 0x04)
            }
            mstore(0x60, 0) // Restore the zero slot to zero.
            mstore(0x40, m) // Restore the free memory pointer.
        }
    }

    /// @dev Sends `amount` of ERC20 `token` from the current contract to `to`.
    /// Reverts upon failure.
    function safeTransfer(address token, address to, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x14, to) // Store the `to` argument.
            mstore(0x34, amount) // Store the `amount` argument.
            mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.
            // Perform the transfer, reverting upon failure.
            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
                    call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
                )
            ) {
                mstore(0x00, 0x90b8ec18) // `TransferFailed()`.
                revert(0x1c, 0x04)
            }
            mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
        }
    }

    /// @dev Sends all of ERC20 `token` from the current contract to `to`.
    /// Reverts upon failure.
    function safeTransferAll(address token, address to) internal returns (uint256 amount) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`.
            mstore(0x20, address()) // Store the address of the current contract.
            // Read the balance, reverting upon failure.
            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    gt(returndatasize(), 0x1f), // At least 32 bytes returned.
                    staticcall(gas(), token, 0x1c, 0x24, 0x34, 0x20)
                )
            ) {
                mstore(0x00, 0x90b8ec18) // `TransferFailed()`.
                revert(0x1c, 0x04)
            }
            mstore(0x14, to) // Store the `to` argument.
            amount := mload(0x34) // The `amount` is already at 0x34. We'll need to return it.
            mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.
            // Perform the transfer, reverting upon failure.
            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
                    call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
                )
            ) {
                mstore(0x00, 0x90b8ec18) // `TransferFailed()`.
                revert(0x1c, 0x04)
            }
            mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
        }
    }

    /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.
    /// Reverts upon failure.
    function safeApprove(address token, address to, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x14, to) // Store the `to` argument.
            mstore(0x34, amount) // Store the `amount` argument.
            mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.
            // Perform the approval, reverting upon failure.
            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
                    call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
                )
            ) {
                mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`.
                revert(0x1c, 0x04)
            }
            mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
        }
    }

    /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.
    /// If the initial attempt to approve fails, attempts to reset the approved amount to zero,
    /// then retries the approval again (some tokens, e.g. USDT, requires this).
    /// Reverts upon failure.
    function safeApproveWithRetry(address token, address to, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x14, to) // Store the `to` argument.
            mstore(0x34, amount) // Store the `amount` argument.
            mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.
            // Perform the approval, retrying upon failure.
            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
                    call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
                )
            ) {
                mstore(0x34, 0) // Store 0 for the `amount`.
                mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.
                pop(call(gas(), token, 0, 0x10, 0x44, codesize(), 0x00)) // Reset the approval.
                mstore(0x34, amount) // Store back the original `amount`.
                // Retry the approval, reverting upon failure.
                if iszero(
                    and(
                        or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
                        call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
                    )
                ) {
                    mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`.
                    revert(0x1c, 0x04)
                }
            }
            mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
        }
    }

    /// @dev Returns the amount of ERC20 `token` owned by `account`.
    /// Returns zero if the `token` does not exist.
    function balanceOf(address token, address account) internal view returns (uint256 amount) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x14, account) // Store the `account` argument.
            mstore(0x00, 0x70a08231000000000000000000000000) // `balanceOf(address)`.
            amount :=
                mul(
                    mload(0x20),
                    and( // The arguments of `and` are evaluated from right to left.
                        gt(returndatasize(), 0x1f), // At least 32 bytes returned.
                        staticcall(gas(), token, 0x10, 0x24, 0x20, 0x20)
                    )
                )
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint96","name":"initialTokenSupply","type":"uint96"},{"internalType":"address","name":"initialSupplyOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"DNAlreadyInitialized","type":"error"},{"inputs":[],"name":"InsufficientAllowance","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"LinkMirrorContractFailed","type":"error"},{"inputs":[],"name":"MirrorAddressIsZero","type":"error"},{"inputs":[],"name":"NewOwnerIsZeroAddress","type":"error"},{"inputs":[],"name":"NoHandoverRequest","type":"error"},{"inputs":[],"name":"SenderNotMirror","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"TotalSupplyOverflow","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"SkipNFTSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"completeOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getCybernetic","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getGender","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getPersonalityTrait","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRace","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getSkill","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"a","type":"address"}],"name":"getSkipNFT","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mirrorERC721","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"result","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"ownershipHandoverExpiresAt","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"requestOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"skipNFT","type":"bool"}],"name":"setSkipNFT","outputs":[],"stateMutability":"nonpayable","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":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040526040518061010001604052806040518060400160405280600581526020017f48756d616e00000000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600981526020017f4e656f2d48756d616e000000000000000000000000000000000000000000000081525081526020016040518060400160405280600581526020017f53796e746800000000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600681526020017f4379626f7267000000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600981526020017f414920456e74697479000000000000000000000000000000000000000000000081525081526020016040518060400160405280600781526020017f416e64726f69640000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600481526020017f4e656f6e0000000000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600781526020017f53706563747265000000000000000000000000000000000000000000000000008152508152506003906008620001f8929190620013cf565b506040518060a001604052806040518060400160405280600481526020017f4d616c650000000000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600681526020017f46656d616c65000000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600a81526020017f4e6f6e2d42696e6172790000000000000000000000000000000000000000000081525081526020016040518060400160405280600b81526020017f47656e646572666c75696400000000000000000000000000000000000000000081525081526020016040518060400160405280600781526020017f4167656e6465720000000000000000000000000000000000000000000000000081525081525060049060056200033b9291906200142f565b506040518061014001604052806040518060400160405280601181526020017f456e6372797074696f6e20536176616e7400000000000000000000000000000081525081526020016040518060400160405280601181526020017f5175616e74756d204e6176696761746f7200000000000000000000000000000081525081526020016040518060400160405280600e81526020017f4e6575726f2d456e67696e65657200000000000000000000000000000000000081525081526020016040518060400160405280601081526020017f436f6d6261742054616374696369616e0000000000000000000000000000000081525081526020016040518060400160405280601381526020017f4469676974616c20496c6c7573696f6e6973740000000000000000000000000081525081526020016040518060400160405280601181526020017f4861636b696e672045787065727469736500000000000000000000000000000081525081526020016040518060400160405280601381526020017f5175616e74756d2050726f6772616d6d696e670000000000000000000000000081525081526020016040518060400160405280600f81526020017f537465616c74682054616374696373000000000000000000000000000000000081525081526020016040518060400160405280601281526020017f436f6d6261742050726f66696369656e6379000000000000000000000000000081525081526020016040518060400160405280601681526020017f4469706c6f6d61746963204e65676f74696174696f6e00000000000000000000815250815250600590600a620005a69291906200148f565b506040518061032001604052806040518060400160405280600c81526020017f4563686f204c6f6361746f72000000000000000000000000000000000000000081525081526020016040518060400160405280601181526020017f546865726d616c20526567756c61746f7200000000000000000000000000000081525081526020016040518060400160405280601381526020017f4461746173747265616d2044697665727465720000000000000000000000000081525081526020016040518060400160405280600c81526020017f4d656d6f7279205661756c74000000000000000000000000000000000000000081525081526020016040518060400160405280600c81526020017f4f63756c61722044726f6e65000000000000000000000000000000000000000081525081526020016040518060400160405280601281526020017f4e657572616c20416363656c657261746f72000000000000000000000000000081525081526020016040518060400160405280601681526020017f5175616e74756d20436f72652050726f636573736f720000000000000000000081525081526020016040518060400160405280601181526020017f53796e617074696320456e68616e63657200000000000000000000000000000081525081526020016040518060400160405280601381526020017f526574696e616c2048554420446973706c61790000000000000000000000000081525081526020016040518060400160405280601481526020017f4e616e697465205265706169722053797374656d00000000000000000000000081525081526020016040518060400160405280600f81526020017f436f72746578204669726577616c6c000000000000000000000000000000000081525081526020016040518060400160405280601c81526020017f4469676974616c2043616d6f75666c616765204d6f64756c61746f720000000081525081526020016040518060400160405280601781526020017f48617074696320466565646261636b2053656e736f727300000000000000000081525081526020016040518060400160405280601a81526020017f4d6f6c6563756c617220417373656d626c7920546f6f6c6b697400000000000081525081526020016040518060400160405280601581526020017f43796265726e657469632052657370697261746f72000000000000000000000081525081526020016040518060400160405280600d81526020017f454d5020536869656c64696e670000000000000000000000000000000000000081525081526020016040518060400160405280601781526020017f536f6e69632044697372757074696f6e2044657669636500000000000000000081525081526020016040518060400160405280601f81526020017f416461707469766520436c696d61746520436f6e74726f6c2053797374656d0081525081526020016040518060400160405280601981526020017f4b696e6574696320456e6572677920486172766573746572730000000000000081525081526020016040518060400160405280601e81526020017f4f7074696d697a6564204d657461626f6c69736d20526567756c61746f72000081525081526020016040518060400160405280601481526020017f4e6575726f2d4c696e6b20496e7465726661636500000000000000000000000081525081526020016040518060400160405280601681526020017f50686f746f6e20436c6f616b2050726f6a6563746f720000000000000000000081525081526020016040518060400160405280601b81526020017f4d61676e65746963204d616e6970756c6174696f6e20436f696c73000000000081525081526020016040518060400160405280601881526020017f537065637472616c20416e616c79736973204c656e736573000000000000000081525081526020016040518060400160405280601881526020017f42696f6e6963204c696d6220456e68616e63656d656e74730000000000000000815250815250600690601962000b86929190620014ef565b506040518060e001604052806040518060400160405280600a81526020017f416e616c79746963616c0000000000000000000000000000000000000000000081525081526020016040518060400160405280600b81526020017f4368617269736d6174696300000000000000000000000000000000000000000081525081526020016040518060400160405280600581526020017f53746f696300000000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600a81526020017f496e6e6f7661746976650000000000000000000000000000000000000000000081525081526020016040518060400160405280600981526020017f5265636c7573697665000000000000000000000000000000000000000000000081525081526020016040518060400160405280600a81526020017f526562656c6c696f75730000000000000000000000000000000000000000000081525081526020016040518060400160405280600881526020017f456d706174686963000000000000000000000000000000000000000000000000815250815250600790600762000d3f9291906200154f565b5034801562000d4d57600080fd5b5060405162008f1638038062008f16833981810160405281019062000d7391906200188b565b62000d843362000e1160201b60201c565b836000908162000d95919062001b86565b50826001908162000da7919062001b86565b5060003360405162000db990620015af565b62000dc5919062001c7e565b604051809103906000f08015801562000de2573d6000803e3d6000fd5b50905062000e06836bffffffffffffffffffffffff16838362000ef760201b60201c565b505050505062001d03565b62000e21620011f560201b60201c565b1562000e9f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541562000e5e57630dc149f06000526004601cfd5b8160601b60601c9150811560ff1b821781558160007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a35062000ef4565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927558060007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a35b50565b600062000f09620011fa60201b60201c565b905060008160000160049054906101000a900463ffffffff1663ffffffff161462000f60576040517fead4d2e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160362000fc7576040517f39a84a7b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62000fd8826200120b60201b60201c565b60018160000160046101000a81548163ffffffff021916908363ffffffff160217905550818160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000841115620011ef57600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603620010b0576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6b0de0b6b39983494c589bffff841115620010f7576040517fe5cfe95700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8381600001600c6101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555060006200113d846200124160201b60201c565b9050848160000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef87604051620011d2919062001cac565b60405180910390a3620011ed8460016200130260201b60201c565b505b50505050565b600090565b600068a20d6e21d0e5255308905090565b630f4599e560005233602052602060006024601c6000855af1600160005114166200123e5763d125259c6000526004601cfd5b50565b60008062001254620011fa60201b60201c565b90508060080160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091506000600183600001600b9054906101000a900460ff161660ff1603620012fc57600060019050620012d084620013c460201b60201c565b15620012dd576002811790505b8083600001600b6101000a81548160ff021916908360ff160217905550505b50919050565b600062001315836200124160201b60201c565b90508115156000600283600001600b9054906101000a900460ff161660ff1614151515146200136f57600281600001600b8282829054906101000a900460ff161892506101000a81548160ff021916908360ff1602179055505b8273ffffffffffffffffffffffffffffffffffffffff167fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d642039383604051620013b7919062001ce6565b60405180910390a2505050565b6000813b9050919050565b8280548282559060005260206000209081019282156200141c579160200282015b828111156200141b5782518290816200140a919062001b86565b5091602001919060010190620013f0565b5b5090506200142b9190620015bd565b5090565b8280548282559060005260206000209081019282156200147c579160200282015b828111156200147b5782518290816200146a919062001b86565b509160200191906001019062001450565b5b5090506200148b9190620015bd565b5090565b828054828255906000526020600020908101928215620014dc579160200282015b82811115620014db578251829081620014ca919062001b86565b5091602001919060010190620014b0565b5b509050620014eb9190620015bd565b5090565b8280548282559060005260206000209081019282156200153c579160200282015b828111156200153b5782518290816200152a919062001b86565b509160200191906001019062001510565b5b5090506200154b9190620015bd565b5090565b8280548282559060005260206000209081019282156200159c579160200282015b828111156200159b5782518290816200158a919062001b86565b509160200191906001019062001570565b5b509050620015ab9190620015bd565b5090565b61137f8062007b9783390190565b5b80821115620015e15760008181620015d79190620015e5565b50600101620015be565b5090565b508054620015f39062001975565b6000825580601f1062001607575062001628565b601f0160209004906000526020600020908101906200162791906200162b565b5b50565b5b80821115620016465760008160009055506001016200162c565b5090565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620016b38262001668565b810181811067ffffffffffffffff82111715620016d557620016d462001679565b5b80604052505050565b6000620016ea6200164a565b9050620016f88282620016a8565b919050565b600067ffffffffffffffff8211156200171b576200171a62001679565b5b620017268262001668565b9050602081019050919050565b60005b838110156200175357808201518184015260208101905062001736565b60008484015250505050565b6000620017766200177084620016fd565b620016de565b90508281526020810184848401111562001795576200179462001663565b5b620017a284828562001733565b509392505050565b600082601f830112620017c257620017c16200165e565b5b8151620017d48482602086016200175f565b91505092915050565b60006bffffffffffffffffffffffff82169050919050565b6200180081620017dd565b81146200180c57600080fd5b50565b6000815190506200182081620017f5565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620018538262001826565b9050919050565b620018658162001846565b81146200187157600080fd5b50565b60008151905062001885816200185a565b92915050565b60008060008060808587031215620018a857620018a762001654565b5b600085015167ffffffffffffffff811115620018c957620018c862001659565b5b620018d787828801620017aa565b945050602085015167ffffffffffffffff811115620018fb57620018fa62001659565b5b6200190987828801620017aa565b93505060406200191c878288016200180f565b92505060606200192f8782880162001874565b91505092959194509250565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200198e57607f821691505b602082108103620019a457620019a362001946565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b60006008830262001a0e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620019cf565b62001a1a8683620019cf565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b600062001a6762001a6162001a5b8462001a32565b62001a3c565b62001a32565b9050919050565b6000819050919050565b62001a838362001a46565b62001a9b62001a928262001a6e565b848454620019dc565b825550505050565b600090565b62001ab262001aa3565b62001abf81848462001a78565b505050565b5b8181101562001ae75762001adb60008262001aa8565b60018101905062001ac5565b5050565b601f82111562001b365762001b0081620019aa565b62001b0b84620019bf565b8101602085101562001b1b578190505b62001b3362001b2a85620019bf565b83018262001ac4565b50505b505050565b600082821c905092915050565b600062001b5b6000198460080262001b3b565b1980831691505092915050565b600062001b76838362001b48565b9150826002028217905092915050565b62001b91826200193b565b67ffffffffffffffff81111562001bad5762001bac62001679565b5b62001bb9825462001975565b62001bc682828562001aeb565b600060209050601f83116001811462001bfe576000841562001be9578287015190505b62001bf5858262001b68565b86555062001c65565b601f19841662001c0e86620019aa565b60005b8281101562001c385784890151825560018201915060208501945060208101905062001c11565b8683101562001c58578489015162001c54601f89168262001b48565b8355505b6001600288020188555050505b505050505050565b62001c788162001846565b82525050565b600060208201905062001c95600083018462001c6d565b92915050565b62001ca68162001a32565b82525050565b600060208201905062001cc3600083018462001c9b565b92915050565b60008115159050919050565b62001ce08162001cc9565b82525050565b600060208201905062001cfd600083018462001cd5565b92915050565b615e848062001d136000396000f3fe6080604052600436106101bb5760003560e01c806355f804b3116100ec578063b74044bc1161008a578063e06d2eb511610064578063e06d2eb514610dcd578063f04e283e14610e0a578063f2fde38b14610e26578063fee81cf414610e42576101c2565b8063b74044bc14610d16578063c87b56dd14610d53578063dd62ed3e14610d90576101c2565b806382c119a9116100c657806382c119a914610c465780638da5cb5b14610c8357806395d89b4114610cae578063a9059cbb14610cd9576101c2565b806355f804b314610bd657806370a0823114610bff578063715018a614610c3c576101c2565b80632a6a935d1161015957806340c10f191161013357806340c10f1914610b3b5780634707da1a14610b645780634ef41efc14610ba157806354d1f13d14610bcc576101c2565b80632a6a935d14610ad0578063313ce56714610af95780633ccfd60b14610b24576101c2565b806318160ddd1161019557806318160ddd14610a2157806323b872dd14610a4c5780632569296214610a89578063274e430b14610a93576101c2565b806306fdde031461097c578063095ea7b3146109a75780630d71aba5146109e4576101c2565b366101c257005b60006101cc610e7f565b9050600060e06101dc6000610e90565b901c905063e985e9c5810361034a578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610274576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60446000369050101561028657600080fd5b60006102926004610e90565b905060006102a06024610e90565b90506103478460030160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661033c57600061033f565b60015b60ff16610e9b565b50505b636352211e8103610427578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103de576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6024600036905010156103f057600080fd5b60006103fc6004610e90565b905061042561040a82610ea5565b73ffffffffffffffffffffffffffffffffffffffff16610e9b565b505b63e5eb36c88103610520578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104bb576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6084600036905010156104cd57600080fd5b60006104d96004610e90565b905060006104e76024610e90565b905060006104f56044610e90565b905060006105036064610e90565b905061051184848484610ef6565b61051b6001610e9b565b505050505b63813500fc810361060c578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105b4576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6064600036905010156105c657600080fd5b60006105d26004610e90565b90506000806105e16024610e90565b1415905060006105f16044610e90565b90506105fe8383836114f0565b6106086001610e9b565b5050505b63d10b6e0c8103610709578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106a0576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6064600036905010156106b257600080fd5b60006106be6004610e90565b905060006106cc6024610e90565b905060006106da6044610e90565b90506107056106ea848484611592565b73ffffffffffffffffffffffffffffffffffffffff16610e9b565b5050505b63081812fc81036107e6578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461079d576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6024600036905010156107af57600080fd5b60006107bb6004610e90565b90506107e46107c98261174f565b73ffffffffffffffffffffffffffffffffffffffff16610e9b565b505b63f5b100ea81036108ad578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461087a576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60246000369050101561088c57600080fd5b60006108986004610e90565b90506108ab6108a6826117d4565b610e9b565b505b63e2c792818103610964578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610941576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60046000369050101561095357600080fd5b61096361095e61183f565b610e9b565b5b63b7a94eb8810361097a576109796001610e9b565b5b005b34801561098857600080fd5b50610991611868565b60405161099e9190614364565b60405180910390f35b3480156109b357600080fd5b506109ce60048036038101906109c99190614424565b6118fa565b6040516109db919061447f565b60405180910390f35b3480156109f057600080fd5b50610a0b6004803603810190610a06919061449a565b6119fa565b604051610a189190614364565b60405180910390f35b348015610a2d57600080fd5b50610a36611b14565b604051610a4391906144d6565b60405180910390f35b348015610a5857600080fd5b50610a736004803603810190610a6e91906144f1565b611b4d565b604051610a80919061447f565b60405180910390f35b610a91611cdc565b005b348015610a9f57600080fd5b50610aba6004803603810190610ab59190614544565b611d30565b604051610ac7919061447f565b60405180910390f35b348015610adc57600080fd5b50610af76004803603810190610af2919061459d565b611dd2565b005b348015610b0557600080fd5b50610b0e611ddf565b604051610b1b91906145e6565b60405180910390f35b348015610b3057600080fd5b50610b39611de8565b005b348015610b4757600080fd5b50610b626004803603810190610b5d9190614424565b611dfb565b005b348015610b7057600080fd5b50610b8b6004803603810190610b86919061449a565b611e11565b604051610b989190614364565b60405180910390f35b348015610bad57600080fd5b50610bb6611f2b565b604051610bc39190614610565b60405180910390f35b610bd4611f5e565b005b348015610be257600080fd5b50610bfd6004803603810190610bf89190614690565b611f9a565b005b348015610c0b57600080fd5b50610c266004803603810190610c219190614544565b611fb8565b604051610c3391906144d6565b60405180910390f35b610c44612033565b005b348015610c5257600080fd5b50610c6d6004803603810190610c6891906146dd565b612047565b604051610c7a9190614364565b60405180910390f35b348015610c8f57600080fd5b50610c986121a0565b604051610ca59190614610565b60405180910390f35b348015610cba57600080fd5b50610cc36121c9565b604051610cd09190614364565b60405180910390f35b348015610ce557600080fd5b50610d006004803603810190610cfb9190614424565b61225b565b604051610d0d919061447f565b60405180910390f35b348015610d2257600080fd5b50610d3d6004803603810190610d3891906146dd565b612272565b604051610d4a9190614364565b60405180910390f35b348015610d5f57600080fd5b50610d7a6004803603810190610d75919061449a565b6123cb565b604051610d879190614364565b60405180910390f35b348015610d9c57600080fd5b50610db76004803603810190610db2919061471d565b61296d565b604051610dc491906144d6565b60405180910390f35b348015610dd957600080fd5b50610df46004803603810190610def919061449a565b6129fd565b604051610e019190614364565b60405180910390f35b610e246004803603810190610e1f9190614544565b612b17565b005b610e406004803603810190610e3b9190614544565b612b58565b005b348015610e4e57600080fd5b50610e696004803603810190610e649190614544565b612b82565b604051610e7691906144d6565b60405180910390f35b600068a20d6e21d0e5255308905090565b600081359050919050565b8060005260206000f35b6000610eb082612b9d565b610ee6576040517fceea21b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610eef82612bde565b9050919050565b6000610f00610e7f565b9050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603610f68576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000816002016000610f8584600701610f8088612c49565b612c57565b63ffffffff1663ffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614611027576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611186578160030160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166111855781600401600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611184576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b5b600061119187612c85565b9050600061119e87612c85565b9050670de0b6b3a76400008260000160148282829054906101000a90046bffffffffffffffffffffffff166111d391906147a4565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550670de0b6b3a76400008160000160148282829054906101000a90046bffffffffffffffffffffffff160192506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506112788460070161126988612c49565b611273848b612d34565b612e30565b83600401600087815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560006113398560060160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084600001601081819054906101000a900463ffffffff166001900391906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff16612c57565b63ffffffff1690506113a68560060160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061139a876007016113958b612e64565b612c57565b63ffffffff1683612e30565b600082600001601081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff16021790555063ffffffff169050611416866007016113fc84612e64565b6114118960070161140c8d612e64565b612c57565b612e30565b6114618660060160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828a612e30565b611477866007016114718a612e64565b83612e30565b50508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef670de0b6b3a76400006040516114de91906144d6565b60405180910390a35050505050505050565b816114f9610e7f565b60030160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505050565b60008061159d610e7f565b905060008160020160006115bc846007016115b789612c49565b612c57565b63ffffffff1663ffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146116ef578160030160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166116ee576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b8582600401600087815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080925050509392505050565b600061175a82612b9d565b611790576040517fceea21b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611798610e7f565b600401600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006117de610e7f565b60080160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160109054906101000a900463ffffffff1663ffffffff169050919050565b6000611849610e7f565b60000160089054906101000a900463ffffffff1663ffffffff16905090565b60606000805461187790614813565b80601f01602080910402602001604051908101604052809291908181526020018280546118a390614813565b80156118f05780601f106118c5576101008083540402835291602001916118f0565b820191906000526020600020905b8154815290600101906020018083116118d357829003601f168201915b5050505050905090565b600080611905610e7f565b9050828160050160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040516119e791906144d6565b60405180910390a3600191505092915050565b6060611b0d826040518060400160405280600481526020017f52414345000000000000000000000000000000000000000000000000000000008152506003805480602002602001604051908101604052809291908181526020016000905b82821015611b04578382906000526020600020018054611a7790614813565b80601f0160208091040260200160405190810160405280929190818152602001828054611aa390614813565b8015611af05780601f10611ac557610100808354040283529160200191611af0565b820191906000526020600020905b815481529060010190602001808311611ad357829003601f168201915b505050505081526020019060010190611a58565b50505050612e74565b9050919050565b6000611b1e610e7f565b600001600c9054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905090565b600080611b58610e7f565b905060008160050160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114611cc45780841115611c3e576040517f13be252b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8381038260050160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b611ccf868686612f05565b6001925050509392505050565b6000611ce66135b7565b67ffffffffffffffff164201905063389a75e1600c5233600052806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d600080a250565b600080611d3b610e7f565b60080160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000600182600001600b9054906101000a900460ff161660ff1603611dad57611da5836135c2565b915050611dcd565b6000600282600001600b9054906101000a900460ff161660ff1614159150505b919050565b611ddc33826135cd565b50565b60006012905090565b611df0613684565b611df9336136bc565b565b611e03613684565b611e0d82826136db565b5050565b6060611f24826040518060400160405280600b81526020017f504552534f4e414c4954590000000000000000000000000000000000000000008152506007805480602002602001604051908101604052809291908181526020016000905b82821015611f1b578382906000526020600020018054611e8e90614813565b80601f0160208091040260200160405190810160405280929190818152602001828054611eba90614813565b8015611f075780601f10611edc57610100808354040283529160200191611f07565b820191906000526020600020905b815481529060010190602001808311611eea57829003601f168201915b505050505081526020019060010190611e6f565b50505050612e74565b9050919050565b6000611f35610e7f565b60010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b63389a75e1600c523360005260006020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92600080a2565b611fa2613684565b818160029182611fb3929190614a2a565b505050565b6000611fc2610e7f565b60080160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b61203b613684565b6120456000613b60565b565b606060008211801561205e57506006805490508211155b61209d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209490614b46565b60405180910390fd5b60006120d96120ab84613c28565b6120b486613c28565b6040516020016120c5929190614bee565b604051602081830303815290604052613d88565b9050600060068080549050836120ef9190614c4c565b81548110612100576120ff614c7d565b5b90600052602060002001805461211590614813565b80601f016020809104026020016040519081016040528092919081815260200182805461214190614813565b801561218e5780601f106121635761010080835404028352916020019161218e565b820191906000526020600020905b81548152906001019060200180831161217157829003601f168201915b50505050509050809250505092915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b6060600180546121d890614813565b80601f016020809104026020016040519081016040528092919081815260200182805461220490614813565b80156122515780601f1061222657610100808354040283529160200191612251565b820191906000526020600020905b81548152906001019060200180831161223457829003601f168201915b5050505050905090565b6000612268338484612f05565b6001905092915050565b606060008211801561228957506005805490508211155b6122c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122bf90614b46565b60405180910390fd5b60006123046122d684613dbb565b6122df86613dbb565b6040516020016122f0929190614cf8565b604051602081830303815290604052613d88565b90506000600580805490508361231a9190614c4c565b8154811061232b5761232a614c7d565b5b90600052602060002001805461234090614813565b80601f016020809104026020016040519081016040528092919081815260200182805461236c90614813565b80156123b95780601f1061238e576101008083540402835291602001916123b9565b820191906000526020600020905b81548152906001019060200180831161239c57829003601f168201915b50505050509050809250505092915050565b60606123d561425c565b60405180610b600160405280610b25815260200161532a610b2591398160006011811061240557612404614c7d565b5b6020020181905250612416836119fa565b8160016011811061242a57612429614c7d565b5b60200201819052506040518060600160405280602981526020016151e5602991398160026011811061245f5761245e614c7d565b5b6020020181905250612470836129fd565b8160036011811061248457612483614c7d565b5b60200201819052506040518060600160405280602c815260200161523a602c9139816004601181106124b9576124b8614c7d565b5b60200201819052506124cc836001612047565b816005601181106124e0576124df614c7d565b5b60200201819052506040518060600160405280602c81526020016152fe602c91398160066011811061251557612514614c7d565b5b6020020181905250612528836002612047565b8160076011811061253c5761253b614c7d565b5b60200201819052506040518060600160405280602c8152602001615292602c91398160086011811061257157612570614c7d565b5b6020020181905250612584836003612047565b8160096011811061259857612597614c7d565b5b60200201819052506040518060600160405280602c815260200161520e602c913981600a601181106125cd576125cc614c7d565b5b60200201819052506125e0836001612272565b81600b601181106125f4576125f3614c7d565b5b60200201819052506040518060600160405280602c8152602001615266602c913981600c6011811061262957612628614c7d565b5b602002018190525061263c836002612272565b81600d601181106126505761264f614c7d565b5b60200201819052506040518060600160405280602981526020016151bc6029913981600e6011811061268557612684614c7d565b5b602002018190525061269683611e11565b81600f601181106126aa576126a9614c7d565b5b60200201819052506040518060400160405280600d81526020017f3c2f746578743e3c2f7376673e00000000000000000000000000000000000000815250816010601181106126fc576126fb614c7d565b5b602002018190525060008160006011811061271a57612719614c7d565b5b60200201518260016011811061273357612732614c7d565b5b60200201518360026011811061274c5761274b614c7d565b5b60200201518460036011811061276557612764614c7d565b5b60200201518560046011811061277e5761277d614c7d565b5b60200201518660056011811061279757612796614c7d565b5b6020020151876006601181106127b0576127af614c7d565b5b6020020151886007601181106127c9576127c8614c7d565b5b6020020151896008601181106127e2576127e1614c7d565b5b60200201516040516020016127ff99989796959493929190614d27565b6040516020818303038152906040529050808260096011811061282557612824614c7d565b5b602002015183600a6011811061283e5761283d614c7d565b5b602002015184600b6011811061285757612856614c7d565b5b602002015185600c601181106128705761286f614c7d565b5b602002015186600d6011811061288957612888614c7d565b5b602002015187600e601181106128a2576128a1614c7d565b5b602002015188600f601181106128bb576128ba614c7d565b5b6020020151896010601181106128d4576128d3614c7d565b5b60200201516040516020016128f199989796959493929190614d27565b6040516020818303038152906040529050600061293e61291086613dbb565b61291984613e89565b60405160200161292a929190614f6e565b604051602081830303815290604052613e89565b9050806040516020016129519190614fff565b6040516020818303038152906040529150819350505050919050565b6000612977610e7f565b60050160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6060612b10826040518060400160405280600681526020017f47454e44455200000000000000000000000000000000000000000000000000008152506004805480602002602001604051908101604052809291908181526020016000905b82821015612b07578382906000526020600020018054612a7a90614813565b80601f0160208091040260200160405190810160405280929190818152602001828054612aa690614813565b8015612af35780601f10612ac857610100808354040283529160200191612af3565b820191906000526020600020905b815481529060010190602001808311612ad657829003601f168201915b505050505081526020019060010190612a5b565b50505050612e74565b9050919050565b612b1f613684565b63389a75e1600c52806000526020600c208054421115612b4757636f5e88186000526004601cfd5b6000815550612b5581613b60565b50565b612b60613684565b8060601b612b7657637448fbae6000526004601cfd5b612b7f81613b60565b50565b600063389a75e1600c52816000526020600c20549050919050565b60008073ffffffffffffffffffffffffffffffffffffffff16612bbf83612bde565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600080612be9610e7f565b9050806002016000612c0683600701612c0187612c49565b612c57565b63ffffffff1663ffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b6000600182901b9050919050565b6000600560078316901b836000016000600385901c815260200190815260200160002054901c905092915050565b600080612c90610e7f565b90508060080160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091506000600183600001600b9054906101000a900460ff161660ff1603612d2e57600060019050612d03846135c2565b15612d0f576002811790505b8083600001600b6101000a81548160ff021916908360ff160217905550505b50919050565b600080612d3f610e7f565b905083600001600c9054906101000a900463ffffffff16915060008263ffffffff1603612e295780600001600081819054906101000a900463ffffffff16612d8690615031565b91906101000a81548163ffffffff021916908363ffffffff160217905591508184600001600c6101000a81548163ffffffff021916908363ffffffff160217905550828160020160008463ffffffff1663ffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5092915050565b826020528160031c60005260406000206007831660051b815463ffffffff8482841c188116831b8218845550505050505050565b600060018083901b019050919050565b60606000612eaa84612e8587613c28565b604051602001612e9692919061505d565b604051602081830303815290604052613d88565b9050600083845183612ebc9190614c4c565b81518110612ecd57612ecc614c7d565b5b6020026020010151905080604051602001612ee89190615081565b604051602081830303815290604052905080925050509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612f6b576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612f75610e7f565b90506000612f8285612c85565b90506000612f8f85612c85565b9050612f99614284565b8260000160109054906101000a900463ffffffff1663ffffffff168160800181815250508160000160109054906101000a900463ffffffff1663ffffffff168160a00181815250508260000160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff168160400181815250508060400151851115613053576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8481604001818151039150818152505080604001518360000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550848260000160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff160181606001818152508260000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555061312b8160800151670de0b6b3a764000083604001518161312557613124614c1d565b5b04614020565b8160000181815250506000600283600001600b9054906101000a900460ff161660ff16036131cf578573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff160361319b5780600001518160800151038160a00181815250505b6131c5670de0b6b3a76400008260600151816131ba576131b9614c1d565b5b048260a00151614020565b8160200181815250505b60006131e48260200151836000015101614031565b905060008260000151146133275760008560060160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600083608001519050600084600001518203905084600001518860000160088282829054906101000a900463ffffffff160392506101000a81548163ffffffff021916908363ffffffff160217905550808760000160106101000a81548163ffffffff021916908363ffffffff1602179055505b60006132be848460019003945084612c57565b63ffffffff1690506132d6896007018260008061405e565b88600401600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905561331b858d8360016140a4565b508082036132ab575050505b600082602001511461350c5760008560060160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008360a00151905060008460200151820190506000613398878c612d34565b90506000670de0b6b3a76400008a600001600c9054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16816133de576133dd614c1d565b5b04905060008a60000160049054906101000a900463ffffffff1663ffffffff16905087602001518b60000160088282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff160217905550838960000160106101000a81548163ffffffff021916908363ffffffff1602179055505b5b60006134788c60070161347384612c49565b612c57565b63ffffffff161461349b578181600101915081111561349657600190505b613461565b6134a6868683612e30565b6134bb8b60070182858880600101995061405e565b6134c8878e8360006140a4565b818160010191508111156134db57600190505b83850361346057808b60000160046101000a81548163ffffffff021916908363ffffffff1602179055505050505050505b60008160000151511461354857613547818660010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166140c6565b5b508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040516135a691906144d6565b60405180910390a350505050505050565b60006202a300905090565b6000813b9050919050565b60006135d883612c85565b90508115156000600283600001600b9054906101000a900460ff161660ff16141515151461363157600281600001600b8282829054906101000a900460ff161892506101000a81548160ff021916908360ff1602179055505b8273ffffffffffffffffffffffffffffffffffffffff167fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d642039383604051613677919061447f565b60405180910390a2505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146136ba576382b429006000526004601cfd5b565b60003860003847855af16136d85763b12d13eb6000526004601cfd5b50565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603613741576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061374b610e7f565b9050600061375884612c85565b905060008383600001600c9054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff160190506b0de0b6b39983494c589bffff8411806137b057506b0de0b6b39983494c589bffff81115b156137e7576040517fe5cfe95700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8083600001600c6101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506000848360000160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16019050808360000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506000600284600001600b9054906101000a900460ff161660ff1603613af25760008460060160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008460000160109054906101000a900463ffffffff1663ffffffff1690506000670de0b6b3a7640000848161391b5761391a614c1d565b5b049050600061393261392d8385614020565b614031565b9050600081600001515114613aed576000670de0b6b3a764000089600001600c9054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff168161398557613984614c1d565b5b0490506000613994898d612d34565b905060008a60000160049054906101000a900463ffffffff1663ffffffff1690508360000151518b60000160088282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff160217905550848a60000160106101000a81548163ffffffff021916908363ffffffff1602179055505b5b6000613a2e8c600701613a2984612c49565b612c57565b63ffffffff1614613a515782816001019150811115613a4c57600190505b613a17565b613a5c878783612e30565b613a718b600701828489806001019a5061405e565b613a7e848e8360006140a4565b82816001019150811115613a9157600190505b848603613a1657808b60000160046101000a81548163ffffffff021916908363ffffffff160217905550613ae9848c60010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166140c6565b5050505b505050505b50508373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051613b5291906144d6565b60405180910390a350505050565b613b68614104565b15613bce577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3811560ff1b8217815550613c25565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3818155505b50565b606060008203613c6f576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050613d83565b600082905060005b60008214613ca1578080613c8a90615098565b915050600a82613c9a91906150e0565b9150613c77565b60008167ffffffffffffffff811115613cbd57613cbc61484f565b5b6040519080825280601f01601f191660200182016040528015613cef5781602001600182028036833780820191505090505b5090505b60008514613d7c57600182613d089190615111565b9150600a85613d179190614c4c565b6030613d239190615145565b60f81b818381518110613d3957613d38614c7d565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a85613d7591906150e0565b9450613cf3565b8093505050505b919050565b600081604051602001613d9b9190615081565b6040516020818303038152906040528051906020012060001c9050919050565b606060006001613dca84614109565b01905060008167ffffffffffffffff811115613de957613de861484f565b5b6040519080825280601f01601f191660200182016040528015613e1b5781602001600182028036833780820191505090505b509050600082602001820190505b600115613e7e578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581613e7257613e71614c1d565b5b04945060008503613e29575b819350505050919050565b606060008251905060008103613eb1576040518060200160405280600081525091505061401b565b60006003600283613ec29190615145565b613ecc91906150e0565b6004613ed89190615179565b90506000602082613ee99190615145565b67ffffffffffffffff811115613f0257613f0161484f565b5b6040519080825280601f01601f191660200182016040528015613f345781602001600182028036833780820191505090505b50905060006040518060600160405280604081526020016152be604091399050600181016020830160005b86811015613fd85760038101905062ffffff818a015116603f8160121c168401518060081b905060ff603f83600c1c1686015116810190508060081b905060ff603f8360061c1686015116810190508060081b905060ff603f831686015116810190508060e01b90508084526004840193505050613f5f565b506003860660018114613ff257600281146140025761400d565b613d3d60f01b600283035261400d565b603d60f81b60018303525b508484525050819450505050505b919050565b600081830382841102905092915050565b6140396142ba565b6040805101828152806020018360051b81016040528183528083602001525050919050565b8163ffffffff168160201b17846020528360021c60005260406000206003851660061b815467ffffffffffffffff8482841c188116831b82188455505050505050505050565b8360200151818360081b8560601b171781526020810185602001525050505050565b81516040810363263c69d68152602080820152815160051b60440160208282601c85016000885af16001835114166140fd57600082fd5b5050505050565b600090565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310614167577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161415d5761415c614c1d565b5b0492506040810190505b6d04ee2d6d415b85acef810000000083106141a4576d04ee2d6d415b85acef8100000000838161419a57614199614c1d565b5b0492506020810190505b662386f26fc1000083106141d357662386f26fc1000083816141c9576141c8614c1d565b5b0492506010810190505b6305f5e10083106141fc576305f5e10083816141f2576141f1614c1d565b5b0492506008810190505b612710831061422157612710838161421757614216614c1d565b5b0492506004810190505b60648310614244576064838161423a57614239614c1d565b5b0492506002810190505b600a8310614253576001810190505b80915050919050565b6040518061022001604052806011905b606081526020019060019003908161426c5790505090565b6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b604051806040016040528060608152602001600081525090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561430e5780820151818401526020810190506142f3565b60008484015250505050565b6000601f19601f8301169050919050565b6000614336826142d4565b61434081856142df565b93506143508185602086016142f0565b6143598161431a565b840191505092915050565b6000602082019050818103600083015261437e818461432b565b905092915050565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006143bb82614390565b9050919050565b6143cb816143b0565b81146143d657600080fd5b50565b6000813590506143e8816143c2565b92915050565b6000819050919050565b614401816143ee565b811461440c57600080fd5b50565b60008135905061441e816143f8565b92915050565b6000806040838503121561443b5761443a614386565b5b6000614449858286016143d9565b925050602061445a8582860161440f565b9150509250929050565b60008115159050919050565b61447981614464565b82525050565b60006020820190506144946000830184614470565b92915050565b6000602082840312156144b0576144af614386565b5b60006144be8482850161440f565b91505092915050565b6144d0816143ee565b82525050565b60006020820190506144eb60008301846144c7565b92915050565b60008060006060848603121561450a57614509614386565b5b6000614518868287016143d9565b9350506020614529868287016143d9565b925050604061453a8682870161440f565b9150509250925092565b60006020828403121561455a57614559614386565b5b6000614568848285016143d9565b91505092915050565b61457a81614464565b811461458557600080fd5b50565b60008135905061459781614571565b92915050565b6000602082840312156145b3576145b2614386565b5b60006145c184828501614588565b91505092915050565b600060ff82169050919050565b6145e0816145ca565b82525050565b60006020820190506145fb60008301846145d7565b92915050565b61460a816143b0565b82525050565b60006020820190506146256000830184614601565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126146505761464f61462b565b5b8235905067ffffffffffffffff81111561466d5761466c614630565b5b60208301915083600182028301111561468957614688614635565b5b9250929050565b600080602083850312156146a7576146a6614386565b5b600083013567ffffffffffffffff8111156146c5576146c461438b565b5b6146d18582860161463a565b92509250509250929050565b600080604083850312156146f4576146f3614386565b5b60006147028582860161440f565b92505060206147138582860161440f565b9150509250929050565b6000806040838503121561473457614733614386565b5b6000614742858286016143d9565b9250506020614753858286016143d9565b9150509250929050565b60006bffffffffffffffffffffffff82169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006147af8261475d565b91506147ba8361475d565b925082820390506bffffffffffffffffffffffff8111156147de576147dd614775565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061482b57607f821691505b60208210810361483e5761483d6147e4565b5b50919050565b600082905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026148e07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826148a3565b6148ea86836148a3565b95508019841693508086168417925050509392505050565b6000819050919050565b600061492761492261491d846143ee565b614902565b6143ee565b9050919050565b6000819050919050565b6149418361490c565b61495561494d8261492e565b8484546148b0565b825550505050565b600090565b61496a61495d565b614975818484614938565b505050565b5b818110156149995761498e600082614962565b60018101905061497b565b5050565b601f8211156149de576149af8161487e565b6149b884614893565b810160208510156149c7578190505b6149db6149d385614893565b83018261497a565b50505b505050565b600082821c905092915050565b6000614a01600019846008026149e3565b1980831691505092915050565b6000614a1a83836149f0565b9150826002028217905092915050565b614a348383614844565b67ffffffffffffffff811115614a4d57614a4c61484f565b5b614a578254614813565b614a6282828561499d565b6000601f831160018114614a915760008415614a7f578287013590505b614a898582614a0e565b865550614af1565b601f198416614a9f8661487e565b60005b82811015614ac757848901358255600182019150602085019450602081019050614aa2565b86831015614ae45784890135614ae0601f8916826149f0565b8355505b6001600288020188555050505b50505050505050565b7f496e646578206f7574206f6620626f756e647300000000000000000000000000600082015250565b6000614b306013836142df565b9150614b3b82614afa565b602082019050919050565b60006020820190508181036000830152614b5f81614b23565b9050919050565b600081905092915050565b7f43594245524e4554494300000000000000000000000000000000000000000000600082015250565b6000614ba7600a83614b66565b9150614bb282614b71565b600a82019050919050565b6000614bc8826142d4565b614bd28185614b66565b9350614be28185602086016142f0565b80840191505092915050565b6000614bf982614b9a565b9150614c058285614bbd565b9150614c118284614bbd565b91508190509392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000614c57826143ee565b9150614c62836143ee565b925082614c7257614c71614c1d565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f534b494c4c000000000000000000000000000000000000000000000000000000600082015250565b6000614ce2600583614b66565b9150614ced82614cac565b600582019050919050565b6000614d0382614cd5565b9150614d0f8285614bbd565b9150614d1b8284614bbd565b91508190509392505050565b6000614d33828c614bbd565b9150614d3f828b614bbd565b9150614d4b828a614bbd565b9150614d578289614bbd565b9150614d638288614bbd565b9150614d6f8287614bbd565b9150614d7b8286614bbd565b9150614d878285614bbd565b9150614d938284614bbd565b91508190509a9950505050505050505050565b7f7b226e616d65223a202243334944202300000000000000000000000000000000600082015250565b6000614ddc601083614b66565b9150614de782614da6565b601082019050919050565b7f222c20226465736372697074696f6e223a202243334944206973206120756e6960008201527f717565206469676974616c206964656e746974792077697468696e207468652060208201527f43796265726e6574696320436f6e7363696f75736e65737320436f6c6c65637460408201527f6976652c206275696c74206f6e2042617365207769746820746865204469766960608201527f7369626c65204e4654202d20444e343034205374616e646172642e222c20226960808201527f6d616765223a2022646174613a696d6167652f7376672b786d6c3b626173653660a08201527f342c00000000000000000000000000000000000000000000000000000000000060c082015250565b6000614f0c60c283614b66565b9150614f1782614df2565b60c282019050919050565b7f227d000000000000000000000000000000000000000000000000000000000000600082015250565b6000614f58600283614b66565b9150614f6382614f22565b600282019050919050565b6000614f7982614dcf565b9150614f858285614bbd565b9150614f9082614eff565b9150614f9c8284614bbd565b9150614fa782614f4b565b91508190509392505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000600082015250565b6000614fe9601d83614b66565b9150614ff482614fb3565b601d82019050919050565b600061500a82614fdc565b91506150168284614bbd565b915081905092915050565b600063ffffffff82169050919050565b600061503c82615021565b915063ffffffff820361505257615051614775565b5b600182019050919050565b60006150698285614bbd565b91506150758284614bbd565b91508190509392505050565b600061508d8284614bbd565b915081905092915050565b60006150a3826143ee565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036150d5576150d4614775565b5b600182019050919050565b60006150eb826143ee565b91506150f6836143ee565b92508261510657615105614c1d565b5b828204905092915050565b600061511c826143ee565b9150615127836143ee565b925082820390508181111561513f5761513e614775565b5b92915050565b6000615150826143ee565b915061515b836143ee565b925082820190508082111561517357615172614775565b5b92915050565b6000615184826143ee565b915061518f836143ee565b925082820261519d816143ee565b915082820484148315176151b4576151b3614775565b5b509291505056fe3c2f746578743e3c7465787420783d2731302720793d273331352720636c6173733d2774657874273e3c2f746578743e3c7465787420783d273130302720793d2737392720636c6173733d2774657874273e3c2f746578743e3c7465787420783d2731302720793d273234302720636c6173733d2774657874273e312e203c2f746578743e3c7465787420783d2731302720793d273134302720636c6173733d2774657874273e312e203c2f746578743e3c7465787420783d2731302720793d273236302720636c6173733d2774657874273e322e203c2f746578743e3c7465787420783d2731302720793d273138302720636c6173733d2774657874273e332e204142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f3c2f746578743e3c7465787420783d2731302720793d273136302720636c6173733d2774657874273e322e203c73766720786d6c6e733d27687474703a2f2f7777772e77332e6f72672f323030302f73766727207072657365727665417370656374526174696f3d27784d696e594d696e206d656574272076696577426f783d273020302033353020333530273e3c7374796c653e40696d706f72742075726c2868747470733a2f2f666f6e74732e676f6f676c65617069732e636f6d2f637373323f66616d696c793d4f72626974726f6e3a77676874403430303b393030293b2e626173652c2e666f6f7465722c2e746578747b666f6e742d66616d696c793a2671756f743b4f72626974726f6e2671756f743b2c436f75726965722c73657269667d2e626173657b66696c6c3a233230633230653b666f6e742d73697a653a323070783b666f6e742d7765696768743a3930307d2e666f6f7465722c2e746578747b66696c6c3a233961636339357d2e746578747b666f6e742d73697a653a313470787d2e666f6f7465727b666f6e742d73697a653a3870787d3c2f7374796c653e3c646566733e3c7061747465726e2069643d276261636b67726f756e642d696d6727207061747465726e556e6974733d277573657253706163654f6e557365272077696474683d2731303027206865696768743d27313030272066696c6c3d2723303030273e3c696d61676520687265663d22646174613a696d6167652f7376672b786d6c2c25334373766720786d6c6e733d27687474703a2f2f7777772e77332e6f72672f323030302f737667272077696474683d2731303027206865696768743d27313030272076696577426f783d27302030203130302031303027253345253343672066696c6c2d72756c653d276576656e6f646427253345253343672066696c6c3d27253233343265343038272066696c6c2d6f7061636974793d27302e332725334525334370617468206f7061636974793d272e352720643d274d393620393568347631682d347634682d31762d34682d397634682d31762d34682d397634682d31762d34682d397634682d31762d34682d397634682d31762d34682d397634682d31762d34682d397634682d31762d34682d397634682d31762d34682d397634682d31762d344830762d31683135762d394830762d31683135762d394830762d31683135762d394830762d31683135762d394830762d31683135762d394830762d31683135762d394830762d31683135762d394830762d31683135762d394830762d316831355630683176313568395630683176313568395630683176313568395630683176313568395630683176313568395630683176313568395630683176313568395630683176313568395630683176313568347631682d34763968347631682d34763968347631682d34763968347631682d34763968347631682d34763968347631682d34763968347631682d34763968347631682d3476397a6d2d312030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d392d31306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d392d3130762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d392d31306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d392d3130762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d392d31306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d392d3130762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d392d31306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a272f2533452533437061746820643d274d36203556304835763548307631683576393468315636683934563548367a272f2533452533432f672533452533432f672533452533432f737667253345222077696474683d2731303027206865696768743d27313030272f3e3c2f7061747465726e3e3c2f646566733e3c726563742077696474683d273130302527206865696768743d2731303025272066696c6c3d272330333066303227207374726f6b653d272334326534303827207374726f6b652d77696474683d2735272f3e3c726563742077696474683d273130302527206865696768743d2731303025272066696c6c3d2775726c28236261636b67726f756e642d696d672927206f7061636974793d272e35272f3e3c7465787420783d273135302720793d2732352720636c6173733d2762617365273e433349443c2f746578743e3c7465787420783d2731302720793d2735352720636c6173733d2762617365273e526163653a3c2f746578743e3c7465787420783d2731302720793d2738302720636c6173733d2762617365273e47656e6465723a3c2f746578743e3c7465787420783d2731302720793d273132302720636c6173733d2762617365273e43796265726e65746963733a3c2f746578743e3c7465787420783d2731302720793d273232302720636c6173733d2762617365273e536b696c6c733a3c2f746578743e3c7465787420783d2731302720793d273239352720636c6173733d2762617365273e506572736f6e616c6974792054726169743a3c2f746578743e3c7465787420783d2731302720793d273334302720636c6173733d27666f6f746572273e583a204043335f444e3430343c2f746578743e3c7465787420783d273138302720793d273334302720636c6173733d27666f6f746572273e43796265726e6574696320436f6e7363696f75736e65737320436f6c6c6563746976653c2f746578743e3c7465787420783d2737352720793d2735342720636c6173733d2774657874273ea2646970667358221220352713f9c68b135e8f36d3374c246e69708941495e801f5120e32e91c4099f7164736f6c6343000814003360806040523480156200001157600080fd5b506040516200137f3803806200137f83398181016040528101906200003791906200010b565b80620000486200009060201b60201c565b60010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506200013d565b6000683602298b8c10b01230905090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000d382620000a6565b9050919050565b620000e581620000c6565b8114620000f157600080fd5b50565b6000815190506200010581620000da565b92915050565b600060208284031215620001245762000123620000a1565b5b60006200013484828501620000f4565b91505092915050565b611232806200014d6000396000f3fe6080604052600436106100ec5760003560e01c80636352211e1161008a578063a22cb46511610059578063a22cb46514610607578063b88d4fde14610630578063c87b56dd14610659578063e985e9c514610696576100f3565b80636352211e1461053757806370a082311461057457806395d89b41146105b157806397e5311c146105dc576100f3565b8063095ea7b3116100c6578063095ea7b31461049e57806318160ddd146104c757806323b872dd146104f257806342842e0e1461051b576100f3565b806301ffc9a7146103f957806306fdde0314610436578063081812fc14610461576100f3565b366100f357005b60006100fd6106d3565b9050600060e061010d60006106e4565b901c905063263c69d68103610229578160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101a5576040517f363cb31200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602036103d60003e6004356024018036103d60003e602081033560051b81018036103d60003e5b80821461021e5781358060601c816001168260a01b60a81c811583028284027fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600038a45050508160200191506101cc565b600160005260206000f35b630f4599e581036103f757600073ffffffffffffffffffffffffffffffffffffffff168260010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461031f578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166102d160046106e4565b73ffffffffffffffffffffffffffffffffffffffff161461031e576040517fc59ec47a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146103a9576040517fbf656a4600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b338260000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160005260206000f35b005b34801561040557600080fd5b50610420600480360381019061041b9190610d79565b6106ef565b60405161042d9190610dc1565b60405180910390f35b34801561044257600080fd5b5061044b610714565b6040516104589190610e6c565b60405180910390f35b34801561046d57600080fd5b5061048860048036038101906104839190610ec4565b61076e565b6040516104959190610f32565b60405180910390f35b3480156104aa57600080fd5b506104c560048036038101906104c09190610f79565b6107b6565b005b3480156104d357600080fd5b506104dc61083c565b6040516104e99190610fc8565b60405180910390f35b3480156104fe57600080fd5b5061051960048036038101906105149190610fe3565b61087b565b005b61053560048036038101906105309190610fe3565b61090a565b005b34801561054357600080fd5b5061055e60048036038101906105599190610ec4565b610944565b60405161056b9190610f32565b60405180910390f35b34801561058057600080fd5b5061059b60048036038101906105969190611036565b61098c565b6040516105a89190610fc8565b60405180910390f35b3480156105bd57600080fd5b506105c66109d7565b6040516105d39190610e6c565b60405180910390f35b3480156105e857600080fd5b506105f1610a31565b6040516105fe9190610f32565b60405180910390f35b34801561061357600080fd5b5061062e6004803603810190610629919061108f565b610aca565b005b34801561063c57600080fd5b5061065760048036038101906106529190611134565b610b4f565b005b34801561066557600080fd5b50610680600480360381019061067b9190610ec4565b610bc0565b60405161068d9190610e6c565b60405180910390f35b3480156106a257600080fd5b506106bd60048036038101906106b891906111bc565b610c20565b6040516106ca9190610dc1565b60405180910390f35b6000683602298b8c10b01230905090565b600081359050919050565b60008160e01c635b5e139f81146380ac58cd82146301ffc9a783141717915050919050565b60606000610720610a31565b905060405191506306fdde036000526000806004601c845afa610746573d6000833e3d82fd5b60206000803e6020600051833e8151602060005101602084013e815160208301016040525090565b600080610779610a31565b905063081812fc60005282602052602060006024601c845afa601f3d11166107a8573d60006040513e3d604051fd5b600c5160601c915050919050565b60006107c0610a31565b90508260601b60601c925060405163d10b6e0c600052836020528260405233606052602060006064601c34865af1601f3d1116610800573d6000823e3d81fd5b8060405260006060528284600c5160601c7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600038a450505050565b600080610847610a31565b905063e2c79281600052602060006004601c845afa601f3d1116610872573d60006040513e3d604051fd5b60005191505090565b6000610885610a31565b90508360601b60601c93508260601b60601c925060405163e5eb36c881528460208201528360408201528260608201523360808201526020816084601c840134865af16001825114166108db573d6000823e3d81fd5b8284867fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600038a45050505050565b61091583838361087b565b61091e82610c7f565b1561093f5761093e83838360405180602001604052806000815250610c8a565b5b505050565b60008061094f610a31565b9050636352211e60005282602052602060006024601c845afa601f3d111661097e573d60006040513e3d604051fd5b600c5160601c915050919050565b600080610997610a31565b90508260601b60601c60205263f5b100ea600052602060006024601c845afa601f3d11166109cc573d60006040513e3d604051fd5b600051915050919050565b606060006109e3610a31565b905060405191506395d89b416000526000806004601c845afa610a09573d6000833e3d82fd5b60206000803e6020600051833e8151602060005101602084013e815160208301016040525090565b6000610a3b6106d3565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610ac7576040517f5b2a47ae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b90565b6000610ad4610a31565b90508260601b60601c925060405163813500fc6000528360205282151560405233606052602060006064601c34865af160016000511416610b18573d6000823e3d81fd5b83337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206040a380604052600060605250505050565b610b5a85858561087b565b610b6384610c7f565b15610bb957610bb885858585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610c8a565b5b5050505050565b60606000610bcc610a31565b905060405191508260205263c87b56dd6000526000806024601c845afa610bf6573d6000833e3d82fd5b60206000803e6020600051833e8151602060005101602084013e8151602083010160405250919050565b600080610c2b610a31565b9050604051836040528460601b602c526fe985e9c5000000000000000000000000600c52602060006044601c855afa601f3d1116610c6c573d6000823e3d81fd5b8060405260005115159250505092915050565b6000813b9050919050565b60405163150b7a028082523360208301528560601b60601c604083015283606083015260808083015282518060a08401528015610cd1578060c08401826020870160045afa505b60208360a48301601c860160008a5af1610cf5573d15610cf4573d6000843e3d83fd5b5b8160e01b835114610d0e5763d1a57ed66000526004601cfd5b50505050505050565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610d5681610d21565b8114610d6157600080fd5b50565b600081359050610d7381610d4d565b92915050565b600060208284031215610d8f57610d8e610d17565b5b6000610d9d84828501610d64565b91505092915050565b60008115159050919050565b610dbb81610da6565b82525050565b6000602082019050610dd66000830184610db2565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610e16578082015181840152602081019050610dfb565b60008484015250505050565b6000601f19601f8301169050919050565b6000610e3e82610ddc565b610e488185610de7565b9350610e58818560208601610df8565b610e6181610e22565b840191505092915050565b60006020820190508181036000830152610e868184610e33565b905092915050565b6000819050919050565b610ea181610e8e565b8114610eac57600080fd5b50565b600081359050610ebe81610e98565b92915050565b600060208284031215610eda57610ed9610d17565b5b6000610ee884828501610eaf565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610f1c82610ef1565b9050919050565b610f2c81610f11565b82525050565b6000602082019050610f476000830184610f23565b92915050565b610f5681610f11565b8114610f6157600080fd5b50565b600081359050610f7381610f4d565b92915050565b60008060408385031215610f9057610f8f610d17565b5b6000610f9e85828601610f64565b9250506020610faf85828601610eaf565b9150509250929050565b610fc281610e8e565b82525050565b6000602082019050610fdd6000830184610fb9565b92915050565b600080600060608486031215610ffc57610ffb610d17565b5b600061100a86828701610f64565b935050602061101b86828701610f64565b925050604061102c86828701610eaf565b9150509250925092565b60006020828403121561104c5761104b610d17565b5b600061105a84828501610f64565b91505092915050565b61106c81610da6565b811461107757600080fd5b50565b60008135905061108981611063565b92915050565b600080604083850312156110a6576110a5610d17565b5b60006110b485828601610f64565b92505060206110c58582860161107a565b9150509250929050565b600080fd5b600080fd5b600080fd5b60008083601f8401126110f4576110f36110cf565b5b8235905067ffffffffffffffff811115611111576111106110d4565b5b60208301915083600182028301111561112d5761112c6110d9565b5b9250929050565b6000806000806000608086880312156111505761114f610d17565b5b600061115e88828901610f64565b955050602061116f88828901610f64565b945050604061118088828901610eaf565b935050606086013567ffffffffffffffff8111156111a1576111a0610d1c565b5b6111ad888289016110de565b92509250509295509295909350565b600080604083850312156111d3576111d2610d17565b5b60006111e185828601610f64565b92505060206111f285828601610f64565b915050925092905056fea2646970667358221220d47f47163e820435fff70736d2662a0538b66a6e9c6f4634f0975b2e22bc16a864736f6c63430008140033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000021e19e0c9bab2400000000000000000000000000000f7b9db2fea32c84af352ac28a879c06f749804cf0000000000000000000000000000000000000000000000000000000000000004433349440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044333494400000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106101bb5760003560e01c806355f804b3116100ec578063b74044bc1161008a578063e06d2eb511610064578063e06d2eb514610dcd578063f04e283e14610e0a578063f2fde38b14610e26578063fee81cf414610e42576101c2565b8063b74044bc14610d16578063c87b56dd14610d53578063dd62ed3e14610d90576101c2565b806382c119a9116100c657806382c119a914610c465780638da5cb5b14610c8357806395d89b4114610cae578063a9059cbb14610cd9576101c2565b806355f804b314610bd657806370a0823114610bff578063715018a614610c3c576101c2565b80632a6a935d1161015957806340c10f191161013357806340c10f1914610b3b5780634707da1a14610b645780634ef41efc14610ba157806354d1f13d14610bcc576101c2565b80632a6a935d14610ad0578063313ce56714610af95780633ccfd60b14610b24576101c2565b806318160ddd1161019557806318160ddd14610a2157806323b872dd14610a4c5780632569296214610a89578063274e430b14610a93576101c2565b806306fdde031461097c578063095ea7b3146109a75780630d71aba5146109e4576101c2565b366101c257005b60006101cc610e7f565b9050600060e06101dc6000610e90565b901c905063e985e9c5810361034a578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610274576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60446000369050101561028657600080fd5b60006102926004610e90565b905060006102a06024610e90565b90506103478460030160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661033c57600061033f565b60015b60ff16610e9b565b50505b636352211e8103610427578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103de576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6024600036905010156103f057600080fd5b60006103fc6004610e90565b905061042561040a82610ea5565b73ffffffffffffffffffffffffffffffffffffffff16610e9b565b505b63e5eb36c88103610520578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104bb576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6084600036905010156104cd57600080fd5b60006104d96004610e90565b905060006104e76024610e90565b905060006104f56044610e90565b905060006105036064610e90565b905061051184848484610ef6565b61051b6001610e9b565b505050505b63813500fc810361060c578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105b4576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6064600036905010156105c657600080fd5b60006105d26004610e90565b90506000806105e16024610e90565b1415905060006105f16044610e90565b90506105fe8383836114f0565b6106086001610e9b565b5050505b63d10b6e0c8103610709578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106a0576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6064600036905010156106b257600080fd5b60006106be6004610e90565b905060006106cc6024610e90565b905060006106da6044610e90565b90506107056106ea848484611592565b73ffffffffffffffffffffffffffffffffffffffff16610e9b565b5050505b63081812fc81036107e6578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461079d576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6024600036905010156107af57600080fd5b60006107bb6004610e90565b90506107e46107c98261174f565b73ffffffffffffffffffffffffffffffffffffffff16610e9b565b505b63f5b100ea81036108ad578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461087a576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60246000369050101561088c57600080fd5b60006108986004610e90565b90506108ab6108a6826117d4565b610e9b565b505b63e2c792818103610964578160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610941576040517fce5a776b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60046000369050101561095357600080fd5b61096361095e61183f565b610e9b565b5b63b7a94eb8810361097a576109796001610e9b565b5b005b34801561098857600080fd5b50610991611868565b60405161099e9190614364565b60405180910390f35b3480156109b357600080fd5b506109ce60048036038101906109c99190614424565b6118fa565b6040516109db919061447f565b60405180910390f35b3480156109f057600080fd5b50610a0b6004803603810190610a06919061449a565b6119fa565b604051610a189190614364565b60405180910390f35b348015610a2d57600080fd5b50610a36611b14565b604051610a4391906144d6565b60405180910390f35b348015610a5857600080fd5b50610a736004803603810190610a6e91906144f1565b611b4d565b604051610a80919061447f565b60405180910390f35b610a91611cdc565b005b348015610a9f57600080fd5b50610aba6004803603810190610ab59190614544565b611d30565b604051610ac7919061447f565b60405180910390f35b348015610adc57600080fd5b50610af76004803603810190610af2919061459d565b611dd2565b005b348015610b0557600080fd5b50610b0e611ddf565b604051610b1b91906145e6565b60405180910390f35b348015610b3057600080fd5b50610b39611de8565b005b348015610b4757600080fd5b50610b626004803603810190610b5d9190614424565b611dfb565b005b348015610b7057600080fd5b50610b8b6004803603810190610b86919061449a565b611e11565b604051610b989190614364565b60405180910390f35b348015610bad57600080fd5b50610bb6611f2b565b604051610bc39190614610565b60405180910390f35b610bd4611f5e565b005b348015610be257600080fd5b50610bfd6004803603810190610bf89190614690565b611f9a565b005b348015610c0b57600080fd5b50610c266004803603810190610c219190614544565b611fb8565b604051610c3391906144d6565b60405180910390f35b610c44612033565b005b348015610c5257600080fd5b50610c6d6004803603810190610c6891906146dd565b612047565b604051610c7a9190614364565b60405180910390f35b348015610c8f57600080fd5b50610c986121a0565b604051610ca59190614610565b60405180910390f35b348015610cba57600080fd5b50610cc36121c9565b604051610cd09190614364565b60405180910390f35b348015610ce557600080fd5b50610d006004803603810190610cfb9190614424565b61225b565b604051610d0d919061447f565b60405180910390f35b348015610d2257600080fd5b50610d3d6004803603810190610d3891906146dd565b612272565b604051610d4a9190614364565b60405180910390f35b348015610d5f57600080fd5b50610d7a6004803603810190610d75919061449a565b6123cb565b604051610d879190614364565b60405180910390f35b348015610d9c57600080fd5b50610db76004803603810190610db2919061471d565b61296d565b604051610dc491906144d6565b60405180910390f35b348015610dd957600080fd5b50610df46004803603810190610def919061449a565b6129fd565b604051610e019190614364565b60405180910390f35b610e246004803603810190610e1f9190614544565b612b17565b005b610e406004803603810190610e3b9190614544565b612b58565b005b348015610e4e57600080fd5b50610e696004803603810190610e649190614544565b612b82565b604051610e7691906144d6565b60405180910390f35b600068a20d6e21d0e5255308905090565b600081359050919050565b8060005260206000f35b6000610eb082612b9d565b610ee6576040517fceea21b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610eef82612bde565b9050919050565b6000610f00610e7f565b9050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603610f68576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000816002016000610f8584600701610f8088612c49565b612c57565b63ffffffff1663ffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614611027576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611186578160030160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166111855781600401600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611184576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b5b600061119187612c85565b9050600061119e87612c85565b9050670de0b6b3a76400008260000160148282829054906101000a90046bffffffffffffffffffffffff166111d391906147a4565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550670de0b6b3a76400008160000160148282829054906101000a90046bffffffffffffffffffffffff160192506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506112788460070161126988612c49565b611273848b612d34565b612e30565b83600401600087815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560006113398560060160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084600001601081819054906101000a900463ffffffff166001900391906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff16612c57565b63ffffffff1690506113a68560060160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061139a876007016113958b612e64565b612c57565b63ffffffff1683612e30565b600082600001601081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff16021790555063ffffffff169050611416866007016113fc84612e64565b6114118960070161140c8d612e64565b612c57565b612e30565b6114618660060160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828a612e30565b611477866007016114718a612e64565b83612e30565b50508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef670de0b6b3a76400006040516114de91906144d6565b60405180910390a35050505050505050565b816114f9610e7f565b60030160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505050565b60008061159d610e7f565b905060008160020160006115bc846007016115b789612c49565b612c57565b63ffffffff1663ffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146116ef578160030160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166116ee576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b8582600401600087815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080925050509392505050565b600061175a82612b9d565b611790576040517fceea21b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611798610e7f565b600401600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006117de610e7f565b60080160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160109054906101000a900463ffffffff1663ffffffff169050919050565b6000611849610e7f565b60000160089054906101000a900463ffffffff1663ffffffff16905090565b60606000805461187790614813565b80601f01602080910402602001604051908101604052809291908181526020018280546118a390614813565b80156118f05780601f106118c5576101008083540402835291602001916118f0565b820191906000526020600020905b8154815290600101906020018083116118d357829003601f168201915b5050505050905090565b600080611905610e7f565b9050828160050160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040516119e791906144d6565b60405180910390a3600191505092915050565b6060611b0d826040518060400160405280600481526020017f52414345000000000000000000000000000000000000000000000000000000008152506003805480602002602001604051908101604052809291908181526020016000905b82821015611b04578382906000526020600020018054611a7790614813565b80601f0160208091040260200160405190810160405280929190818152602001828054611aa390614813565b8015611af05780601f10611ac557610100808354040283529160200191611af0565b820191906000526020600020905b815481529060010190602001808311611ad357829003601f168201915b505050505081526020019060010190611a58565b50505050612e74565b9050919050565b6000611b1e610e7f565b600001600c9054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905090565b600080611b58610e7f565b905060008160050160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114611cc45780841115611c3e576040517f13be252b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8381038260050160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b611ccf868686612f05565b6001925050509392505050565b6000611ce66135b7565b67ffffffffffffffff164201905063389a75e1600c5233600052806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d600080a250565b600080611d3b610e7f565b60080160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000600182600001600b9054906101000a900460ff161660ff1603611dad57611da5836135c2565b915050611dcd565b6000600282600001600b9054906101000a900460ff161660ff1614159150505b919050565b611ddc33826135cd565b50565b60006012905090565b611df0613684565b611df9336136bc565b565b611e03613684565b611e0d82826136db565b5050565b6060611f24826040518060400160405280600b81526020017f504552534f4e414c4954590000000000000000000000000000000000000000008152506007805480602002602001604051908101604052809291908181526020016000905b82821015611f1b578382906000526020600020018054611e8e90614813565b80601f0160208091040260200160405190810160405280929190818152602001828054611eba90614813565b8015611f075780601f10611edc57610100808354040283529160200191611f07565b820191906000526020600020905b815481529060010190602001808311611eea57829003601f168201915b505050505081526020019060010190611e6f565b50505050612e74565b9050919050565b6000611f35610e7f565b60010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b63389a75e1600c523360005260006020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92600080a2565b611fa2613684565b818160029182611fb3929190614a2a565b505050565b6000611fc2610e7f565b60080160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b61203b613684565b6120456000613b60565b565b606060008211801561205e57506006805490508211155b61209d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209490614b46565b60405180910390fd5b60006120d96120ab84613c28565b6120b486613c28565b6040516020016120c5929190614bee565b604051602081830303815290604052613d88565b9050600060068080549050836120ef9190614c4c565b81548110612100576120ff614c7d565b5b90600052602060002001805461211590614813565b80601f016020809104026020016040519081016040528092919081815260200182805461214190614813565b801561218e5780601f106121635761010080835404028352916020019161218e565b820191906000526020600020905b81548152906001019060200180831161217157829003601f168201915b50505050509050809250505092915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b6060600180546121d890614813565b80601f016020809104026020016040519081016040528092919081815260200182805461220490614813565b80156122515780601f1061222657610100808354040283529160200191612251565b820191906000526020600020905b81548152906001019060200180831161223457829003601f168201915b5050505050905090565b6000612268338484612f05565b6001905092915050565b606060008211801561228957506005805490508211155b6122c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122bf90614b46565b60405180910390fd5b60006123046122d684613dbb565b6122df86613dbb565b6040516020016122f0929190614cf8565b604051602081830303815290604052613d88565b90506000600580805490508361231a9190614c4c565b8154811061232b5761232a614c7d565b5b90600052602060002001805461234090614813565b80601f016020809104026020016040519081016040528092919081815260200182805461236c90614813565b80156123b95780601f1061238e576101008083540402835291602001916123b9565b820191906000526020600020905b81548152906001019060200180831161239c57829003601f168201915b50505050509050809250505092915050565b60606123d561425c565b60405180610b600160405280610b25815260200161532a610b2591398160006011811061240557612404614c7d565b5b6020020181905250612416836119fa565b8160016011811061242a57612429614c7d565b5b60200201819052506040518060600160405280602981526020016151e5602991398160026011811061245f5761245e614c7d565b5b6020020181905250612470836129fd565b8160036011811061248457612483614c7d565b5b60200201819052506040518060600160405280602c815260200161523a602c9139816004601181106124b9576124b8614c7d565b5b60200201819052506124cc836001612047565b816005601181106124e0576124df614c7d565b5b60200201819052506040518060600160405280602c81526020016152fe602c91398160066011811061251557612514614c7d565b5b6020020181905250612528836002612047565b8160076011811061253c5761253b614c7d565b5b60200201819052506040518060600160405280602c8152602001615292602c91398160086011811061257157612570614c7d565b5b6020020181905250612584836003612047565b8160096011811061259857612597614c7d565b5b60200201819052506040518060600160405280602c815260200161520e602c913981600a601181106125cd576125cc614c7d565b5b60200201819052506125e0836001612272565b81600b601181106125f4576125f3614c7d565b5b60200201819052506040518060600160405280602c8152602001615266602c913981600c6011811061262957612628614c7d565b5b602002018190525061263c836002612272565b81600d601181106126505761264f614c7d565b5b60200201819052506040518060600160405280602981526020016151bc6029913981600e6011811061268557612684614c7d565b5b602002018190525061269683611e11565b81600f601181106126aa576126a9614c7d565b5b60200201819052506040518060400160405280600d81526020017f3c2f746578743e3c2f7376673e00000000000000000000000000000000000000815250816010601181106126fc576126fb614c7d565b5b602002018190525060008160006011811061271a57612719614c7d565b5b60200201518260016011811061273357612732614c7d565b5b60200201518360026011811061274c5761274b614c7d565b5b60200201518460036011811061276557612764614c7d565b5b60200201518560046011811061277e5761277d614c7d565b5b60200201518660056011811061279757612796614c7d565b5b6020020151876006601181106127b0576127af614c7d565b5b6020020151886007601181106127c9576127c8614c7d565b5b6020020151896008601181106127e2576127e1614c7d565b5b60200201516040516020016127ff99989796959493929190614d27565b6040516020818303038152906040529050808260096011811061282557612824614c7d565b5b602002015183600a6011811061283e5761283d614c7d565b5b602002015184600b6011811061285757612856614c7d565b5b602002015185600c601181106128705761286f614c7d565b5b602002015186600d6011811061288957612888614c7d565b5b602002015187600e601181106128a2576128a1614c7d565b5b602002015188600f601181106128bb576128ba614c7d565b5b6020020151896010601181106128d4576128d3614c7d565b5b60200201516040516020016128f199989796959493929190614d27565b6040516020818303038152906040529050600061293e61291086613dbb565b61291984613e89565b60405160200161292a929190614f6e565b604051602081830303815290604052613e89565b9050806040516020016129519190614fff565b6040516020818303038152906040529150819350505050919050565b6000612977610e7f565b60050160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6060612b10826040518060400160405280600681526020017f47454e44455200000000000000000000000000000000000000000000000000008152506004805480602002602001604051908101604052809291908181526020016000905b82821015612b07578382906000526020600020018054612a7a90614813565b80601f0160208091040260200160405190810160405280929190818152602001828054612aa690614813565b8015612af35780601f10612ac857610100808354040283529160200191612af3565b820191906000526020600020905b815481529060010190602001808311612ad657829003601f168201915b505050505081526020019060010190612a5b565b50505050612e74565b9050919050565b612b1f613684565b63389a75e1600c52806000526020600c208054421115612b4757636f5e88186000526004601cfd5b6000815550612b5581613b60565b50565b612b60613684565b8060601b612b7657637448fbae6000526004601cfd5b612b7f81613b60565b50565b600063389a75e1600c52816000526020600c20549050919050565b60008073ffffffffffffffffffffffffffffffffffffffff16612bbf83612bde565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600080612be9610e7f565b9050806002016000612c0683600701612c0187612c49565b612c57565b63ffffffff1663ffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b6000600182901b9050919050565b6000600560078316901b836000016000600385901c815260200190815260200160002054901c905092915050565b600080612c90610e7f565b90508060080160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091506000600183600001600b9054906101000a900460ff161660ff1603612d2e57600060019050612d03846135c2565b15612d0f576002811790505b8083600001600b6101000a81548160ff021916908360ff160217905550505b50919050565b600080612d3f610e7f565b905083600001600c9054906101000a900463ffffffff16915060008263ffffffff1603612e295780600001600081819054906101000a900463ffffffff16612d8690615031565b91906101000a81548163ffffffff021916908363ffffffff160217905591508184600001600c6101000a81548163ffffffff021916908363ffffffff160217905550828160020160008463ffffffff1663ffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5092915050565b826020528160031c60005260406000206007831660051b815463ffffffff8482841c188116831b8218845550505050505050565b600060018083901b019050919050565b60606000612eaa84612e8587613c28565b604051602001612e9692919061505d565b604051602081830303815290604052613d88565b9050600083845183612ebc9190614c4c565b81518110612ecd57612ecc614c7d565b5b6020026020010151905080604051602001612ee89190615081565b604051602081830303815290604052905080925050509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612f6b576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612f75610e7f565b90506000612f8285612c85565b90506000612f8f85612c85565b9050612f99614284565b8260000160109054906101000a900463ffffffff1663ffffffff168160800181815250508160000160109054906101000a900463ffffffff1663ffffffff168160a00181815250508260000160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff168160400181815250508060400151851115613053576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8481604001818151039150818152505080604001518360000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550848260000160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff160181606001818152508260000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555061312b8160800151670de0b6b3a764000083604001518161312557613124614c1d565b5b04614020565b8160000181815250506000600283600001600b9054906101000a900460ff161660ff16036131cf578573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff160361319b5780600001518160800151038160a00181815250505b6131c5670de0b6b3a76400008260600151816131ba576131b9614c1d565b5b048260a00151614020565b8160200181815250505b60006131e48260200151836000015101614031565b905060008260000151146133275760008560060160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600083608001519050600084600001518203905084600001518860000160088282829054906101000a900463ffffffff160392506101000a81548163ffffffff021916908363ffffffff160217905550808760000160106101000a81548163ffffffff021916908363ffffffff1602179055505b60006132be848460019003945084612c57565b63ffffffff1690506132d6896007018260008061405e565b88600401600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905561331b858d8360016140a4565b508082036132ab575050505b600082602001511461350c5760008560060160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008360a00151905060008460200151820190506000613398878c612d34565b90506000670de0b6b3a76400008a600001600c9054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16816133de576133dd614c1d565b5b04905060008a60000160049054906101000a900463ffffffff1663ffffffff16905087602001518b60000160088282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff160217905550838960000160106101000a81548163ffffffff021916908363ffffffff1602179055505b5b60006134788c60070161347384612c49565b612c57565b63ffffffff161461349b578181600101915081111561349657600190505b613461565b6134a6868683612e30565b6134bb8b60070182858880600101995061405e565b6134c8878e8360006140a4565b818160010191508111156134db57600190505b83850361346057808b60000160046101000a81548163ffffffff021916908363ffffffff1602179055505050505050505b60008160000151511461354857613547818660010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166140c6565b5b508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040516135a691906144d6565b60405180910390a350505050505050565b60006202a300905090565b6000813b9050919050565b60006135d883612c85565b90508115156000600283600001600b9054906101000a900460ff161660ff16141515151461363157600281600001600b8282829054906101000a900460ff161892506101000a81548160ff021916908360ff1602179055505b8273ffffffffffffffffffffffffffffffffffffffff167fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d642039383604051613677919061447f565b60405180910390a2505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146136ba576382b429006000526004601cfd5b565b60003860003847855af16136d85763b12d13eb6000526004601cfd5b50565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603613741576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061374b610e7f565b9050600061375884612c85565b905060008383600001600c9054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff160190506b0de0b6b39983494c589bffff8411806137b057506b0de0b6b39983494c589bffff81115b156137e7576040517fe5cfe95700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8083600001600c6101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506000848360000160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16019050808360000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506000600284600001600b9054906101000a900460ff161660ff1603613af25760008460060160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008460000160109054906101000a900463ffffffff1663ffffffff1690506000670de0b6b3a7640000848161391b5761391a614c1d565b5b049050600061393261392d8385614020565b614031565b9050600081600001515114613aed576000670de0b6b3a764000089600001600c9054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff168161398557613984614c1d565b5b0490506000613994898d612d34565b905060008a60000160049054906101000a900463ffffffff1663ffffffff1690508360000151518b60000160088282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff160217905550848a60000160106101000a81548163ffffffff021916908363ffffffff1602179055505b5b6000613a2e8c600701613a2984612c49565b612c57565b63ffffffff1614613a515782816001019150811115613a4c57600190505b613a17565b613a5c878783612e30565b613a718b600701828489806001019a5061405e565b613a7e848e8360006140a4565b82816001019150811115613a9157600190505b848603613a1657808b60000160046101000a81548163ffffffff021916908363ffffffff160217905550613ae9848c60010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166140c6565b5050505b505050505b50508373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051613b5291906144d6565b60405180910390a350505050565b613b68614104565b15613bce577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3811560ff1b8217815550613c25565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3818155505b50565b606060008203613c6f576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050613d83565b600082905060005b60008214613ca1578080613c8a90615098565b915050600a82613c9a91906150e0565b9150613c77565b60008167ffffffffffffffff811115613cbd57613cbc61484f565b5b6040519080825280601f01601f191660200182016040528015613cef5781602001600182028036833780820191505090505b5090505b60008514613d7c57600182613d089190615111565b9150600a85613d179190614c4c565b6030613d239190615145565b60f81b818381518110613d3957613d38614c7d565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a85613d7591906150e0565b9450613cf3565b8093505050505b919050565b600081604051602001613d9b9190615081565b6040516020818303038152906040528051906020012060001c9050919050565b606060006001613dca84614109565b01905060008167ffffffffffffffff811115613de957613de861484f565b5b6040519080825280601f01601f191660200182016040528015613e1b5781602001600182028036833780820191505090505b509050600082602001820190505b600115613e7e578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581613e7257613e71614c1d565b5b04945060008503613e29575b819350505050919050565b606060008251905060008103613eb1576040518060200160405280600081525091505061401b565b60006003600283613ec29190615145565b613ecc91906150e0565b6004613ed89190615179565b90506000602082613ee99190615145565b67ffffffffffffffff811115613f0257613f0161484f565b5b6040519080825280601f01601f191660200182016040528015613f345781602001600182028036833780820191505090505b50905060006040518060600160405280604081526020016152be604091399050600181016020830160005b86811015613fd85760038101905062ffffff818a015116603f8160121c168401518060081b905060ff603f83600c1c1686015116810190508060081b905060ff603f8360061c1686015116810190508060081b905060ff603f831686015116810190508060e01b90508084526004840193505050613f5f565b506003860660018114613ff257600281146140025761400d565b613d3d60f01b600283035261400d565b603d60f81b60018303525b508484525050819450505050505b919050565b600081830382841102905092915050565b6140396142ba565b6040805101828152806020018360051b81016040528183528083602001525050919050565b8163ffffffff168160201b17846020528360021c60005260406000206003851660061b815467ffffffffffffffff8482841c188116831b82188455505050505050505050565b8360200151818360081b8560601b171781526020810185602001525050505050565b81516040810363263c69d68152602080820152815160051b60440160208282601c85016000885af16001835114166140fd57600082fd5b5050505050565b600090565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310614167577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161415d5761415c614c1d565b5b0492506040810190505b6d04ee2d6d415b85acef810000000083106141a4576d04ee2d6d415b85acef8100000000838161419a57614199614c1d565b5b0492506020810190505b662386f26fc1000083106141d357662386f26fc1000083816141c9576141c8614c1d565b5b0492506010810190505b6305f5e10083106141fc576305f5e10083816141f2576141f1614c1d565b5b0492506008810190505b612710831061422157612710838161421757614216614c1d565b5b0492506004810190505b60648310614244576064838161423a57614239614c1d565b5b0492506002810190505b600a8310614253576001810190505b80915050919050565b6040518061022001604052806011905b606081526020019060019003908161426c5790505090565b6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b604051806040016040528060608152602001600081525090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561430e5780820151818401526020810190506142f3565b60008484015250505050565b6000601f19601f8301169050919050565b6000614336826142d4565b61434081856142df565b93506143508185602086016142f0565b6143598161431a565b840191505092915050565b6000602082019050818103600083015261437e818461432b565b905092915050565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006143bb82614390565b9050919050565b6143cb816143b0565b81146143d657600080fd5b50565b6000813590506143e8816143c2565b92915050565b6000819050919050565b614401816143ee565b811461440c57600080fd5b50565b60008135905061441e816143f8565b92915050565b6000806040838503121561443b5761443a614386565b5b6000614449858286016143d9565b925050602061445a8582860161440f565b9150509250929050565b60008115159050919050565b61447981614464565b82525050565b60006020820190506144946000830184614470565b92915050565b6000602082840312156144b0576144af614386565b5b60006144be8482850161440f565b91505092915050565b6144d0816143ee565b82525050565b60006020820190506144eb60008301846144c7565b92915050565b60008060006060848603121561450a57614509614386565b5b6000614518868287016143d9565b9350506020614529868287016143d9565b925050604061453a8682870161440f565b9150509250925092565b60006020828403121561455a57614559614386565b5b6000614568848285016143d9565b91505092915050565b61457a81614464565b811461458557600080fd5b50565b60008135905061459781614571565b92915050565b6000602082840312156145b3576145b2614386565b5b60006145c184828501614588565b91505092915050565b600060ff82169050919050565b6145e0816145ca565b82525050565b60006020820190506145fb60008301846145d7565b92915050565b61460a816143b0565b82525050565b60006020820190506146256000830184614601565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126146505761464f61462b565b5b8235905067ffffffffffffffff81111561466d5761466c614630565b5b60208301915083600182028301111561468957614688614635565b5b9250929050565b600080602083850312156146a7576146a6614386565b5b600083013567ffffffffffffffff8111156146c5576146c461438b565b5b6146d18582860161463a565b92509250509250929050565b600080604083850312156146f4576146f3614386565b5b60006147028582860161440f565b92505060206147138582860161440f565b9150509250929050565b6000806040838503121561473457614733614386565b5b6000614742858286016143d9565b9250506020614753858286016143d9565b9150509250929050565b60006bffffffffffffffffffffffff82169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006147af8261475d565b91506147ba8361475d565b925082820390506bffffffffffffffffffffffff8111156147de576147dd614775565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061482b57607f821691505b60208210810361483e5761483d6147e4565b5b50919050565b600082905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026148e07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826148a3565b6148ea86836148a3565b95508019841693508086168417925050509392505050565b6000819050919050565b600061492761492261491d846143ee565b614902565b6143ee565b9050919050565b6000819050919050565b6149418361490c565b61495561494d8261492e565b8484546148b0565b825550505050565b600090565b61496a61495d565b614975818484614938565b505050565b5b818110156149995761498e600082614962565b60018101905061497b565b5050565b601f8211156149de576149af8161487e565b6149b884614893565b810160208510156149c7578190505b6149db6149d385614893565b83018261497a565b50505b505050565b600082821c905092915050565b6000614a01600019846008026149e3565b1980831691505092915050565b6000614a1a83836149f0565b9150826002028217905092915050565b614a348383614844565b67ffffffffffffffff811115614a4d57614a4c61484f565b5b614a578254614813565b614a6282828561499d565b6000601f831160018114614a915760008415614a7f578287013590505b614a898582614a0e565b865550614af1565b601f198416614a9f8661487e565b60005b82811015614ac757848901358255600182019150602085019450602081019050614aa2565b86831015614ae45784890135614ae0601f8916826149f0565b8355505b6001600288020188555050505b50505050505050565b7f496e646578206f7574206f6620626f756e647300000000000000000000000000600082015250565b6000614b306013836142df565b9150614b3b82614afa565b602082019050919050565b60006020820190508181036000830152614b5f81614b23565b9050919050565b600081905092915050565b7f43594245524e4554494300000000000000000000000000000000000000000000600082015250565b6000614ba7600a83614b66565b9150614bb282614b71565b600a82019050919050565b6000614bc8826142d4565b614bd28185614b66565b9350614be28185602086016142f0565b80840191505092915050565b6000614bf982614b9a565b9150614c058285614bbd565b9150614c118284614bbd565b91508190509392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000614c57826143ee565b9150614c62836143ee565b925082614c7257614c71614c1d565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f534b494c4c000000000000000000000000000000000000000000000000000000600082015250565b6000614ce2600583614b66565b9150614ced82614cac565b600582019050919050565b6000614d0382614cd5565b9150614d0f8285614bbd565b9150614d1b8284614bbd565b91508190509392505050565b6000614d33828c614bbd565b9150614d3f828b614bbd565b9150614d4b828a614bbd565b9150614d578289614bbd565b9150614d638288614bbd565b9150614d6f8287614bbd565b9150614d7b8286614bbd565b9150614d878285614bbd565b9150614d938284614bbd565b91508190509a9950505050505050505050565b7f7b226e616d65223a202243334944202300000000000000000000000000000000600082015250565b6000614ddc601083614b66565b9150614de782614da6565b601082019050919050565b7f222c20226465736372697074696f6e223a202243334944206973206120756e6960008201527f717565206469676974616c206964656e746974792077697468696e207468652060208201527f43796265726e6574696320436f6e7363696f75736e65737320436f6c6c65637460408201527f6976652c206275696c74206f6e2042617365207769746820746865204469766960608201527f7369626c65204e4654202d20444e343034205374616e646172642e222c20226960808201527f6d616765223a2022646174613a696d6167652f7376672b786d6c3b626173653660a08201527f342c00000000000000000000000000000000000000000000000000000000000060c082015250565b6000614f0c60c283614b66565b9150614f1782614df2565b60c282019050919050565b7f227d000000000000000000000000000000000000000000000000000000000000600082015250565b6000614f58600283614b66565b9150614f6382614f22565b600282019050919050565b6000614f7982614dcf565b9150614f858285614bbd565b9150614f9082614eff565b9150614f9c8284614bbd565b9150614fa782614f4b565b91508190509392505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000600082015250565b6000614fe9601d83614b66565b9150614ff482614fb3565b601d82019050919050565b600061500a82614fdc565b91506150168284614bbd565b915081905092915050565b600063ffffffff82169050919050565b600061503c82615021565b915063ffffffff820361505257615051614775565b5b600182019050919050565b60006150698285614bbd565b91506150758284614bbd565b91508190509392505050565b600061508d8284614bbd565b915081905092915050565b60006150a3826143ee565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036150d5576150d4614775565b5b600182019050919050565b60006150eb826143ee565b91506150f6836143ee565b92508261510657615105614c1d565b5b828204905092915050565b600061511c826143ee565b9150615127836143ee565b925082820390508181111561513f5761513e614775565b5b92915050565b6000615150826143ee565b915061515b836143ee565b925082820190508082111561517357615172614775565b5b92915050565b6000615184826143ee565b915061518f836143ee565b925082820261519d816143ee565b915082820484148315176151b4576151b3614775565b5b509291505056fe3c2f746578743e3c7465787420783d2731302720793d273331352720636c6173733d2774657874273e3c2f746578743e3c7465787420783d273130302720793d2737392720636c6173733d2774657874273e3c2f746578743e3c7465787420783d2731302720793d273234302720636c6173733d2774657874273e312e203c2f746578743e3c7465787420783d2731302720793d273134302720636c6173733d2774657874273e312e203c2f746578743e3c7465787420783d2731302720793d273236302720636c6173733d2774657874273e322e203c2f746578743e3c7465787420783d2731302720793d273138302720636c6173733d2774657874273e332e204142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f3c2f746578743e3c7465787420783d2731302720793d273136302720636c6173733d2774657874273e322e203c73766720786d6c6e733d27687474703a2f2f7777772e77332e6f72672f323030302f73766727207072657365727665417370656374526174696f3d27784d696e594d696e206d656574272076696577426f783d273020302033353020333530273e3c7374796c653e40696d706f72742075726c2868747470733a2f2f666f6e74732e676f6f676c65617069732e636f6d2f637373323f66616d696c793d4f72626974726f6e3a77676874403430303b393030293b2e626173652c2e666f6f7465722c2e746578747b666f6e742d66616d696c793a2671756f743b4f72626974726f6e2671756f743b2c436f75726965722c73657269667d2e626173657b66696c6c3a233230633230653b666f6e742d73697a653a323070783b666f6e742d7765696768743a3930307d2e666f6f7465722c2e746578747b66696c6c3a233961636339357d2e746578747b666f6e742d73697a653a313470787d2e666f6f7465727b666f6e742d73697a653a3870787d3c2f7374796c653e3c646566733e3c7061747465726e2069643d276261636b67726f756e642d696d6727207061747465726e556e6974733d277573657253706163654f6e557365272077696474683d2731303027206865696768743d27313030272066696c6c3d2723303030273e3c696d61676520687265663d22646174613a696d6167652f7376672b786d6c2c25334373766720786d6c6e733d27687474703a2f2f7777772e77332e6f72672f323030302f737667272077696474683d2731303027206865696768743d27313030272076696577426f783d27302030203130302031303027253345253343672066696c6c2d72756c653d276576656e6f646427253345253343672066696c6c3d27253233343265343038272066696c6c2d6f7061636974793d27302e332725334525334370617468206f7061636974793d272e352720643d274d393620393568347631682d347634682d31762d34682d397634682d31762d34682d397634682d31762d34682d397634682d31762d34682d397634682d31762d34682d397634682d31762d34682d397634682d31762d34682d397634682d31762d34682d397634682d31762d344830762d31683135762d394830762d31683135762d394830762d31683135762d394830762d31683135762d394830762d31683135762d394830762d31683135762d394830762d31683135762d394830762d31683135762d394830762d316831355630683176313568395630683176313568395630683176313568395630683176313568395630683176313568395630683176313568395630683176313568395630683176313568395630683176313568347631682d34763968347631682d34763968347631682d34763968347631682d34763968347631682d34763968347631682d34763968347631682d34763968347631682d3476397a6d2d312030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d392d31306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d392d3130762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d392d31306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d392d3130762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d392d31306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d392d3130762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d31302030762d39682d39763968397a6d2d392d31306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a6d313020306839762d39682d3976397a272f2533452533437061746820643d274d36203556304835763548307631683576393468315636683934563548367a272f2533452533432f672533452533432f672533452533432f737667253345222077696474683d2731303027206865696768743d27313030272f3e3c2f7061747465726e3e3c2f646566733e3c726563742077696474683d273130302527206865696768743d2731303025272066696c6c3d272330333066303227207374726f6b653d272334326534303827207374726f6b652d77696474683d2735272f3e3c726563742077696474683d273130302527206865696768743d2731303025272066696c6c3d2775726c28236261636b67726f756e642d696d672927206f7061636974793d272e35272f3e3c7465787420783d273135302720793d2732352720636c6173733d2762617365273e433349443c2f746578743e3c7465787420783d2731302720793d2735352720636c6173733d2762617365273e526163653a3c2f746578743e3c7465787420783d2731302720793d2738302720636c6173733d2762617365273e47656e6465723a3c2f746578743e3c7465787420783d2731302720793d273132302720636c6173733d2762617365273e43796265726e65746963733a3c2f746578743e3c7465787420783d2731302720793d273232302720636c6173733d2762617365273e536b696c6c733a3c2f746578743e3c7465787420783d2731302720793d273239352720636c6173733d2762617365273e506572736f6e616c6974792054726169743a3c2f746578743e3c7465787420783d2731302720793d273334302720636c6173733d27666f6f746572273e583a204043335f444e3430343c2f746578743e3c7465787420783d273138302720793d273334302720636c6173733d27666f6f746572273e43796265726e6574696320436f6e7363696f75736e65737320436f6c6c6563746976653c2f746578743e3c7465787420783d2737352720793d2735342720636c6173733d2774657874273ea2646970667358221220352713f9c68b135e8f36d3374c246e69708941495e801f5120e32e91c4099f7164736f6c63430008140033

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

000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000021e19e0c9bab2400000000000000000000000000000f7b9db2fea32c84af352ac28a879c06f749804cf0000000000000000000000000000000000000000000000000000000000000004433349440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044333494400000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : name_ (string): C3ID
Arg [1] : symbol_ (string): C3ID
Arg [2] : initialTokenSupply (uint96): 10000000000000000000000
Arg [3] : initialSupplyOwner (address): 0xf7b9Db2FEa32c84aF352Ac28A879c06F749804cf

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 00000000000000000000000000000000000000000000021e19e0c9bab2400000
Arg [3] : 000000000000000000000000f7b9db2fea32c84af352ac28a879c06f749804cf
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [5] : 4333494400000000000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [7] : 4333494400000000000000000000000000000000000000000000000000000000


Loading