ETH Price: $3,363.49 (-2.59%)
Gas: 4.62 Gwei

Contract

0xa83E912E0f5A9465A10EdaF40C6Edea0a93f7fFF
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OrigamiGovernanceToken

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
default evmVersion
File 1 of 28 : OrigamiGovernanceToken.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

import "src/utils/TransferLocks.sol";
import "src/utils/Votes.sol";
import "src/token/governance/ERC20Base.sol";

/**
 * @title Origami Governance Token
 * @author Origami
 * @notice This contract is an ERC20 token used for DAO governance functions and is supported and depended upon by the Origami platform and ecosystem.
 * @custom:security-contact [email protected]
 */
contract OrigamiGovernanceToken is ERC20Base, TransferLocks, Votes {
    /**
     * @notice the constructor is not used since the contract is upgradeable except to disable initializers in the implementations that are deployed.
     * @custom:oz-upgrades-unsafe-allow constructor
     */
    constructor() {
        _disableInitializers();
    }

    /// @inheritdoc ERC20Base
    function name() public view virtual override(ERC20Base, IVotesToken) returns (string memory) {
        return super.name();
    }

    /**
     * @notice returns the EIP-712 version number for this token.
     */
    function version() public pure returns (string memory) {
        return "1.0.0";
    }

    /// @inheritdoc ERC20Upgradeable
    function balanceOf(address owner) public view override(ERC20Base, IVotesToken) returns (uint256) {
        return super.balanceOf(owner);
    }

    /**
     * @inheritdoc ERC20Upgradeable
     * @dev this is overridden so we can apply the `whenTransferrable` modifier
     */
    function transferFrom(address from, address to, uint256 amount)
        public
        virtual
        override(ERC20Base)
        whenTransferrable
        returns (bool)
    {
        return super.transferFrom(from, to, amount);
    }

    /**
     * @inheritdoc ERC20Upgradeable
     * @dev this is overridden so we can apply the `whenTransferrable` modifier
     */
    function transfer(address to, uint256 amount) public virtual override(ERC20Base) whenTransferrable returns (bool) {
        return super.transfer(to, amount);
    }

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

    /**
     * @inheritdoc ERC20Upgradeable
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount)
        internal
        override(ERC20Base, TransferLocks)
    {
        super._beforeTokenTransfer(from, to, amount);
    }

    /// @inheritdoc ERC20Upgradeable
    function _afterTokenTransfer(address from, address to, uint256 amount) internal override(ERC20Upgradeable) {
        transferVotingUnits(from, to, amount);
        super._afterTokenTransfer(from, to, amount);
    }
}

File 2 of 28 : IERC165.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IERC165 {
    /// @notice Query if a contract implements an interface
    /// @param interfaceId The interface identifier, as specified in ERC-165
    /// @dev Interface identification is specified in ERC-165. This function
    ///  uses less than 30,000 gas.
    /// @return `true` if the contract implements `interfaceID` and
    ///  `interfaceID` is not 0xffffffff, `false` otherwise
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

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

pragma solidity ^0.8.0;

import "./math/Math.sol";

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

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

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

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

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

File 4 of 28 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 5 of 28 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 6 of 28 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";

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

    function __AccessControl_init_unchained() internal onlyInitializing {
    }
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

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

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

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

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

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

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

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

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

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

        _revokeRole(role, account);
    }

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 8 of 28 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

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

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

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

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

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

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

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

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

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 9 of 28 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    function __Pausable_init() internal onlyInitializing {
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }

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

File 10 of 28 : ERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20Upgradeable.sol";
import "./extensions/IERC20MetadataUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../proxy/utils/Initializable.sol";

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

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

        return true;
    }

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

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

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

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

        _totalSupply += amount;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _balances[account] += amount;
        }
        emit Transfer(address(0), account, amount);

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

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

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

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _totalSupply -= amount;
        }

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 12 of 28 : ERC20BurnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
abstract contract ERC20BurnableUpgradeable is Initializable, ContextUpgradeable, ERC20Upgradeable {
    function __ERC20Burnable_init() internal onlyInitializing {
    }

    function __ERC20Burnable_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev Destroys `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) public virtual {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, deducting from the caller's
     * allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) public virtual {
        _spendAllowance(account, _msgSender(), amount);
        _burn(account, amount);
    }

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

File 13 of 28 : ERC20CappedUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/ERC20Capped.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Extension of {ERC20} that adds a cap to the supply of tokens.
 *
 * @custom:storage-size 51
 */
abstract contract ERC20CappedUpgradeable is Initializable, ERC20Upgradeable {
    uint256 private _cap;

    /**
     * @dev Sets the value of the `cap`. This value is immutable, it can only be
     * set once during construction.
     */
    function __ERC20Capped_init(uint256 cap_) internal onlyInitializing {
        __ERC20Capped_init_unchained(cap_);
    }

    function __ERC20Capped_init_unchained(uint256 cap_) internal onlyInitializing {
        require(cap_ > 0, "ERC20Capped: cap is 0");
        _cap = cap_;
    }

    /**
     * @dev Returns the cap on the token's total supply.
     */
    function cap() public view virtual returns (uint256) {
        return _cap;
    }

    /**
     * @dev See {ERC20-_mint}.
     */
    function _mint(address account, uint256 amount) internal virtual override {
        require(ERC20Upgradeable.totalSupply() + amount <= cap(), "ERC20Capped: cap exceeded");
        super._mint(account, amount);
    }

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

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

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";

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

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

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

File 15 of 28 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

File 16 of 28 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./math/MathUpgradeable.sol";

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

pragma solidity ^0.8.0;

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

File 20 of 28 : MathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 21 of 28 : ITransferLocks.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

interface ITransferLocks {
    /**
     * @notice Used to voluntarily lock up `amount` tokens until a given time. Tokens in excess of `amount` may be transferred.
     * @dev Block timestamp may be innaccurate by up to 15 minutes, but on a timescale of years this is negligible.
     * @param amount the amount of tokens to restrict the transfer of.
     * @param deadline the date (as a unix timestamp in UTC) until which amount will be untransferrable.
     */
    function addTransferLock(uint256 amount, uint256 deadline) external;

    /**
     * @notice Returns the number of transfer locks `account` has permitted `recipient`.
     * @param account the address that granted the allowance.
     * @param recipient the address that is allowed to add transfer locks.
     */
    function allowances(address account, address recipient) external view returns (uint8);

    /**
     * @notice Used to increase the number of transfer locks that can be added
     * by another address. Only allowing a limited number of locks to be added
     * by a given address prevents a variety of potentially abusive patterns.
     * @param account the address to increase the allowance for.
     * @param amount the amount to increase the allowance by.
     */
    function increaseTransferLockAllowance(address account, uint8 amount) external;

    /**
     * @notice Used to decrease the number of transfer locks that can be added
     * by another address. This cannot be used to revoke or otherwise remove an
     * existing transfer lock, only to reduce the number of additional locks
     * that can be added by the specified account.
     * @param account the address to decrease the allowance for.
     * @param amount the amount to decrease the allowance by.
     */
    function decreaseTransferLockAllowance(address account, uint8 amount) external;

    /**
     * @notice Returns the total amount locked up as of current block.timestamp. Returns 0 if there are no transfer locks.
     * @param account the address to check.
     * @return amount the amount of tokens that are transfer-locked.
     */
    function getTransferLockTotal(address account) external view returns (uint256 amount);

    /**
     * @notice Returns the total amount locked up as of the given timestamp. Returns 0 if there are no transfer locks.
     * @param account the address to check.
     * @param timestamp the timestamp to check at.
     * @return amount the amount of tokens that are transfer-locked.
     */
    function getTransferLockTotalAt(address account, uint256 timestamp) external view returns (uint256 amount);

    /**
     * @notice Returns the amount of tokens that are not locked up as of current block.timestamp.
     * @param account the address to check.
     * @return amount the amount of tokens that are not transfer-locked.
     */
    function getAvailableBalance(address account) external view returns (uint256 amount);

    /**
     * @notice Retrieves the balance of an account that is not locked at a given timestamp.
     * @param account the address to check.
     * @param timestamp the timestamp to check.
     * @return amount the amount of tokens that are not transfer-locked.
     */
    function getAvailableBalanceAt(address account, uint256 timestamp) external view returns (uint256 amount);

    /**
     * @notice Used to transfer tokens to an address and lock them up until a given time.
     * @dev block timestamp may be innaccurate by up to 15 minutes, but on the expected timescales, this is negligible.
     * @param recipient the address to transfer tokens to.
     * @param amount the amount of tokens to transfer.
     * @param deadline the date (as a unix timestamp in UTC) until which amount will be untransferrable.
     */
    function transferWithLock(address recipient, uint256 amount, uint256 deadline) external;

    /**
     * @notice Used to transfer tokens to multiple addresses and lock them up until a given time.
     * @dev block timestamp may be innaccurate by up to 15 minutes, but on the expected timescales, this is negligible.
     * @param recipients the addresses to transfer tokens to.
     * @param amounts the amounts of tokens to transfer.
     * @param deadlines the dates (as unix timestamps in UTC) until which amounts will be untransferrable.
     */
    function batchTransferWithLocks(
        address[] calldata recipients,
        uint256[] calldata amounts,
        uint256[] calldata deadlines
    ) external;
}

File 22 of 28 : IVotes.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (governance/utils/IVotes.sol)
pragma solidity 0.8.16;

/**
 * @notice Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.
 */
interface IVotes {
    /// @dev Emitted when an account changes their delegatee.
    event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);

    /// @dev Emitted when a token transfer or delegatee change results in changes to a delegatee's number of votes.
    event DelegateVotesChanged(address indexed delegatee, uint256 previousBalance, uint256 newBalance);

    /// @dev Returns the current amount of votes that `account` has.
    function getVotes(address account) external view returns (uint256);

    /// @notice Returns the amount of votes that `account` had at the end of a past block's timestamp.
    function getPastVotes(address account, uint256 timestamp) external view returns (uint256);

    /**
     * @notice Returns the total supply of votes available at the end of a past block's timestamp.
     * @param timestamp The timestamp to check the total supply of votes at.
     * @return The total supply of votes available at the last checkpoint before `timestamp`.
     *
     * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.
     * Votes that have not been delegated are still part of total supply, even though they would not participate in a
     * vote.
     */
    function getPastTotalSupply(uint256 timestamp) external view returns (uint256);

    /// @notice Returns the EIP712 domain separator for this contract.
    function domainSeparatorV4() external view returns (bytes32);

    /**
     * @notice Returns the current nonce for `delegator`.
     * @dev Used to prevent replay attacks when delegating by signature.
     * @param delegator The address of the delegator to get the nonce for.
     * @return The nonce for `delegator`.
     */
    function getDelegatorNonce(address delegator) external view returns (uint256);

    /**
     * @notice Returns the delegatee that `account` has chosen.
     * @param account The address of the account to get the delegatee for.
     * @return The address of the delegatee for `account`.
     */
    function delegates(address account) external view returns (address);

    /**
     * @notice Delegates votes from the sender to `delegatee`.
     * @param delegatee The address to delegate votes to.
     */
    function delegate(address delegatee) external;

    /**
     * @notice Delegates votes from the signer to `delegatee`.
     * @dev This allows execution by proxy of a delegation, so that signers do not need to pay gas.
     * @param delegatee The address to delegate votes to.
     * @param nonce The nonce of the delegator.
     * @param expiry The timestamp at which the delegation expires.
     * @param v The recovery byte of the signature.
     * @param r Half of the ECDSA signature pair.
     * @param s Half of the ECDSA signature pair.
     */
    function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;
}

File 23 of 28 : IVotesToken.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

/**
 * @title Votes Token Interface
 * @author Origami
 * @notice Interface for tokens that can be used for voting. Part EIP-712 and part ERC20.
 * @custom:security-contact [email protected]
 */
interface IVotesToken {
    /**
     * @notice returns the token balance for an account
     * @param owner the account to check
     * @return balance the token balance for the account
     */
    function balanceOf(address owner) external view returns (uint256 balance);
    /// @notice returns the token name for compatibility with EIP-712
    function name() external view returns (string memory);
    /// @notice returns the token symbol for compatibility with EIP-712
    function version() external pure returns (string memory);
}

File 24 of 28 : ERC20Base.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

import "@oz-upgradeable/access/AccessControlUpgradeable.sol";
import "@oz-upgradeable/proxy/utils/Initializable.sol";
import "@oz-upgradeable/security/PausableUpgradeable.sol";
import "@oz-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@oz-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol";
import "@oz-upgradeable/token/ERC20/extensions/ERC20CappedUpgradeable.sol";

/**
 * @title Base ERC20 token contract for Origami Governance Tokens
 * @author Origami Inc.
 * @custom:security-contact [email protected]
 */
contract ERC20Base is
    Initializable,
    ERC20Upgradeable,
    ERC20BurnableUpgradeable,
    PausableUpgradeable,
    AccessControlUpgradeable,
    ERC20CappedUpgradeable
{
    /// @notice the role hash for granting the ability to pause the contract. By default, this role is granted to the contract admin.
    bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
    /// @notice the role hash for granting the ability to mint new governance tokens. By default, this role is granted to the contract admin.
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
    /// @notice the role hash for granting the ability to burn governance tokens.
    bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
    /// @notice the role has for granting the ability to transfer governance tokens. By default, this role is granted to the contract admin. This is also typically granted to the DAO's treaury multisig for distributing compensation in the form of governance tokens.
    bytes32 public constant TRANSFERRER_ROLE = keccak256("TRANSFERRER_ROLE");

    /// @dev Denotes whether or not the contract allows buring tokens. By default, this is disabled.
    bool private _burnEnabled;
    /// @notice Denotes whether or not the contract allows token transfers. By default, this is disabled.
    bool private _transferEnabled;

    /// @dev monitoring: this is fired when the transferEnabled state is changed.
    event TransferEnabled(address indexed caller, bool value);
    /// @dev monitoring: this is fired when the burnEnabled state is changed.
    event BurnEnabled(address indexed caller, bool value);

    /**
     * @notice the constructor is not used since the contract is upgradeable except to disable initializers in the implementations that are deployed.
     * @custom:oz-upgrades-unsafe-allow constructor
     */
    constructor() {
        _disableInitializers();
    }

    /**
     * @notice Initialize the ERC20Base contract. It is called during contract deployment.
     * @param admin the address of the contract admin. This address receives all roles by default and should be used to delegate them to DAO committees and/or permanent members.
     * @param tokenName the name of the token. Typically this is the name of the DAO.
     * @param tokenSymbol the symbol of the token. Typically this is a short abbreviation of the DAO's name.
     * @param supplyCap cap on the total supply mintable by this contract.
     */
    function initialize(address admin, string memory tokenName, string memory tokenSymbol, uint256 supplyCap)
        public
        initializer
    {
        require(admin != address(0), "Admin address cannot be zero");

        bytes32 blank = keccak256(abi.encode(""));
        require(keccak256(abi.encode(tokenName)) != blank, "ERC20Base: Token name cannot be empty");
        require(keccak256(abi.encode(tokenSymbol)) != blank, "ERC20Base: Token symbol cannot be empty");

        __AccessControl_init();
        __ERC20Burnable_init();
        __ERC20Capped_init(supplyCap);
        __ERC20_init(tokenName, tokenSymbol);
        __Pausable_init();

        // grant roles to the admin
        _grantRole(DEFAULT_ADMIN_ROLE, admin);
        _grantRole(MINTER_ROLE, admin);
        _grantRole(PAUSER_ROLE, admin);

        // disable burning and transfers by default
        _burnEnabled = false;
        _transferEnabled = false;
    }

    /// @inheritdoc ERC20Upgradeable
    function name() public view virtual override returns (string memory) {
        return super.name();
    }

    /// @inheritdoc ERC20Upgradeable
    function balanceOf(address owner) public view virtual override returns (uint256) {
        return super.balanceOf(owner);
    }

    /**
     * @notice indicates whether or not governance tokens are burnable
     * @return true if tokens are burnable, false otherwise.
     */
    function burnable() public view returns (bool) {
        return _burnEnabled;
    }

    /**
     * @notice this function enables the burning of governance tokens. Only the contract admin can call this function.
     * @dev this emits an event indicating that the burnable state has been set to enabled and by whom.
     */
    function enableBurn() public onlyRole(DEFAULT_ADMIN_ROLE) whenNotBurnable {
        _burnEnabled = true;
        emit BurnEnabled(_msgSender(), _burnEnabled);
    }

    /**
     * @notice this function disables the burning of governance tokens. Only the contract admin can call this function.
     * @dev this emits an event indicating that the burnable state has been set to disabled and by whom.
     */
    function disableBurn() public onlyRole(DEFAULT_ADMIN_ROLE) whenBurnable {
        _burnEnabled = false;
        emit BurnEnabled(_msgSender(), _burnEnabled);
    }

    /**
     * @notice indicates whether or not governance tokens are transferrable
     * @return true if tokens are transferrable, false otherwise.
     */
    function transferrable() public view returns (bool) {
        return _transferEnabled;
    }

    /**
     * @notice this function enables transfers of governance tokens. Only the contract admin can call this function.
     * @dev this emits an event indicating that the transferrable state has been set to enabled and by whom.
     */
    function enableTransfer() public onlyRole(DEFAULT_ADMIN_ROLE) whenNontransferrable {
        _transferEnabled = true;
        emit TransferEnabled(_msgSender(), _transferEnabled);
    }

    /**
     * @notice this function disables transfers of governance tokens. Only the contract admin can call this function.
     * @dev this emits an event indicating that the transferrable state has been set to disabled and by whom.
     */
    function disableTransfer() public onlyRole(DEFAULT_ADMIN_ROLE) whenTransferrable {
        _transferEnabled = false;
        emit TransferEnabled(_msgSender(), _transferEnabled);
    }

    /**
     * @notice this function pauses the contract, restricting mints, transfers and burns regardless of the independent state of other configurations.
     * @dev this is only callable by an address that has the PAUSER_ROLE
     */
    function pause() public onlyRole(PAUSER_ROLE) {
        _pause();
    }

    /**
     * @notice this function unpauses the contract
     * @dev this is only callable by an address that has the PAUSER_ROLE
     */
    function unpause() public onlyRole(PAUSER_ROLE) {
        _unpause();
    }

    /**
     * @notice this function mints governance token to the recipient's wallet. An event is fired whenever new tokens are minted indicating who initiated the mint, where they were minted to and how many tokens were minted.
     * @dev this is only callable by an address that has the MINTER_ROLE. The Origami platform may call this function to mint new governance tokens in accordance with a DAO's charter. When it does so, they will always be minted to the treasury multisig.
     * @param to the address of the recipient's wallet.
     * @param amount the amount of tokens to mint.
     */
    function mint(address to, uint256 amount) public virtual onlyRole(MINTER_ROLE) {
        _mint(to, amount);
    }

    /**
     * @notice this allows transfers when the transferrable state is enabled.
     * @dev this is overridden so we can apply the `whenTransferrable` modifier
     */
    function transferFrom(address from, address to, uint256 amount)
        public
        virtual
        override
        whenTransferrable
        returns (bool)
    {
        return super.transferFrom(from, to, amount);
    }

    /**
     * @notice this allows transfers when the transferrable state is enabled.
     * @dev this is overridden so we can apply the `whenTransferrable` modifier
     */
    function transfer(address to, uint256 amount) public virtual override whenTransferrable returns (bool) {
        return super.transfer(to, amount);
    }

    /// @inheritdoc ERC20BurnableUpgradeable
    function burn(uint256 amount) public override whenBurnable {
        super.burn(amount);
    }

    /// @inheritdoc ERC20BurnableUpgradeable
    function burnFrom(address account, uint256 amount) public override whenBurnable {
        super.burnFrom(account, amount);
    }

    /**
     * @notice Query if a contract implements an interface
     * @param interfaceId The interface identifier, as specified in ERC-165
     * @return true if the contract implements interfaceID and interfaceID is not 0xffffffff, false otherwise
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return super.supportsInterface(interfaceId);
    }

    /// Start OpenZeppelin hooks --v

    /**
     * @inheritdoc ERC20Upgradeable
     * @dev this is overridden so we can apply the `whenNotPaused` modifier
     */
    // slither-disable-next-line dead-code
    function _beforeTokenTransfer(address from, address to, uint256 amount)
        internal
        virtual
        override(ERC20Upgradeable)
        whenNotPaused
    {
        super._beforeTokenTransfer(from, to, amount);
    }

    /// @dev specify overrides
    function _mint(address to, uint256 amount) internal virtual override(ERC20Upgradeable, ERC20CappedUpgradeable) {
        super._mint(to, amount);
    }

    /// End OpenZeppelin hooks --^

    /// @dev this modifier prevents calls to functions it is applied to unless burning is disabled.
    modifier whenNotBurnable() {
        require(!burnable(), "Burnable: burning is enabled");
        _;
    }

    /// @dev this modifier prevents calls to functions it is applied to unless
    /// burning is enabled or when the caller has the `BURNER_ROLE` role.
    modifier whenBurnable() {
        require(hasRole(BURNER_ROLE, _msgSender()) || burnable(), "Burnable: burning is disabled");
        _;
    }

    /// @dev this modifier prevents calls to functions it is applied to unless transfers are disabled.
    modifier whenNontransferrable() {
        require(!transferrable(), "Transferrable: transfers are enabled");
        _;
    }

    /// @dev this modifier prevents calls to functions it is applied to unless
    /// transfers are enabled or when the caller has the `TRANSFERRER_ROLE` role.
    modifier whenTransferrable() {
        require(hasRole(TRANSFERRER_ROLE, _msgSender()) || transferrable(), "Transferrable: transfers are disabled");
        _;
    }
}

File 25 of 28 : Checkpoints.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

/**
 * @title CheckpointVoteStorage
 * @dev This contract is used to store the checkpoints for votes and delegates
 * NB: This library is strictly internal so it does not deploy a new contract
 * h/t YAM Protocol for the binary search approach:
 * https://github.com/yam-finance/yam-protocol/blob/3960424bdd5e921b0e283fa7feae3f996c480e49/contracts/token/YAMGovernance.sol
 */
library Checkpoints {
    bytes32 public constant CHECKPOINT_STORAGE_POSITION = keccak256("com.origami.ivotes.checkpoints");
    bytes32 public constant DELEGATE_STORAGE_POSITION = keccak256("com.origami.ivotes.delegates");

    /**
     * @dev Emitted when an account changes their delegatee.
     */
    event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);

    /**
     * @dev Emitted when a token transfer or delegatee change results in changes to a delegatee's number of votes.
     */
    event DelegateVotesChanged(address indexed delegatee, uint256 previousBalance, uint256 newBalance);

    /// @dev struct to store checkpoint data
    struct Checkpoint {
        uint256 timestamp;
        uint256 votes;
    }

    /// @dev struct to store information about checkpoint data
    struct CheckpointStorage {
        /**
         * @dev The number of checkpoints for the total supply of tokens
         */
        uint32 supplyCheckpointsCount;
        /**
         * @notice An indexed mapping of checkpoints for the total supply of tokens
         * @dev this allows for 4.3 billion supply checkpoints
         */
        mapping(uint32 => Checkpoint) supplyCheckpoints;
        /**
         * @dev The number of checkpoints for each `account`
         */
        mapping(address => uint32) voterCheckpointsCount;
        /**
         * @notice An indexed mapping of checkpoints for each account
         * @dev this allows for 4.3 billion checkpoints per account
         */
        mapping(address => mapping(uint32 => Checkpoint)) voterCheckpoints;
    }

    /// @dev struct to store delegate data
    struct DelegateStorage {
        mapping(address => address) delegates;
        mapping(address => uint256) nonces;
    }

    /// @dev Diamond storage pointer for checkpoint data
    function checkpointStorage() internal pure returns (CheckpointStorage storage cs) {
        bytes32 position = CHECKPOINT_STORAGE_POSITION;
        // solhint-disable no-inline-assembly
        // slither-disable-next-line assembly
        assembly {
            cs.slot := position
        }
        // solhint-enable no-inline-assembly
    }

    /**
     * @dev This is generalized to allow lookups in any indexed mapping of checkpoints
     * @param checkpoints the mapping with a sequence of checkpoints
     * @param count the sequence number of the desired checkpoint
     * @return weight the weight for the checkpoint specified by the count
     */
    function getWeight(mapping(uint32 => Checkpoint) storage checkpoints, uint32 count)
        internal
        view
        returns (uint256 weight)
    {
        if (count > 0) {
            uint32 index = count - 1;
            weight = checkpoints[index].votes;
        } else {
            weight = 0;
        }
    }

    /**
     * @dev This is generalized to allow lookups in any indexed mapping of checkpoints
     * @param checkpoints the mapping with a sequence of checkpoints
     * @param count the total number of checkpoints for param checkpoints
     * @param timestamp the timestamp of the snapshot
     * @return the weight for the latest checkpoint before the timestamp specified
     *
     * This uses a binary search to find the correct checkpoint, which has a
     * worst case of O(log n) where n is the number of checkpoints. In order to
     * further optimize this, without greatly increasing complexity, we check for
     * three common cases before resorting to binary search:
     *  * If there are no checkpoints, return 0
     *  * If the latest checkpoint is older than the specified timestamp, return the latest checkpoint
     *  * If the first checkpoint is newer than the specified timestamp, return 0
     * Otherwise, use binary search.
     */
    function getPastWeight(mapping(uint32 => Checkpoint) storage checkpoints, uint32 count, uint256 timestamp)
        internal
        view
        returns (uint256)
    {
        // If there are no checkpoints, return 0
        if (count == 0) {
            return 0;
        }

        // Most recent checkpoint is older than specified timestamp, use it
        if (checkpoints[count - 1].timestamp <= timestamp) {
            return checkpoints[count - 1].votes;
        }

        // First checkpoint is after the specified timestamp
        if (checkpoints[0].timestamp > timestamp) {
            return 0;
        }

        // Failing the above, binary search the checkpoints
        uint32 lower = 0;
        uint32 upper = count - 1;
        while (upper > lower) {
            uint32 center = upper - (upper - lower) / 2; // rounds up
            Checkpoint memory cp = checkpoints[center];
            if (cp.timestamp == timestamp) {
                return cp.votes;
            } else if (cp.timestamp < timestamp) {
                lower = center;
            } else {
                upper = center - 1;
            }
        }
        return checkpoints[lower].votes;
    }

    /**
     * @notice Get the voting weight from the most recent checkpoint for `account`
     * @param account The address of the account to get the votes of
     * @return votes The number of votes held by `account`, possibly zero
     */
    function getVotes(address account) internal view returns (uint256 votes) {
        CheckpointStorage storage cs = checkpointStorage();
        uint32 count = cs.voterCheckpointsCount[account];
        return getWeight(cs.voterCheckpoints[account], count);
    }

    /**
     * @notice Get the voting weight for `account` as of `timestamp`
     * @param account The address of the account to get the votes of
     * @param timestamp The timestamp of the snapshot to retrieve the vote balance at
     * @return votes The number of votes held by `account` at `timestamp`, possibly zero
     */
    function getPastVotes(address account, uint256 timestamp) internal view returns (uint256 votes) {
        CheckpointStorage storage cs = checkpointStorage();
        uint32 count = cs.voterCheckpointsCount[account];
        return getPastWeight(cs.voterCheckpoints[account], count, timestamp);
    }

    /**
     * @notice Get the total supply as of the most recent checkpoint
     * @return supply The total supply as of the most recent checkpoint
     */
    function getTotalSupply() internal view returns (uint256 supply) {
        CheckpointStorage storage cs = checkpointStorage();
        uint32 count = cs.supplyCheckpointsCount;
        return getWeight(cs.supplyCheckpoints, count);
    }

    /**
     * @notice get the total supply as of the last checkpoint before `timestamp`
     * @dev this can be used for deriving Quorum
     * @param timestamp The timestamp of the snapshot to retrieve the total supply at
     * @return supply The total supply as of the most recent checkpoint before `timestamp`
     */
    function getPastTotalSupply(uint256 timestamp) internal view returns (uint256 supply) {
        CheckpointStorage storage cs = checkpointStorage();
        uint32 count = cs.supplyCheckpointsCount;
        return getPastWeight(cs.supplyCheckpoints, count, timestamp);
    }

    // @dev Diamond storage pointer for delegation data
    function delegateStorage() internal pure returns (DelegateStorage storage ds) {
        bytes32 position = DELEGATE_STORAGE_POSITION;
        // solhint-disable no-inline-assembly
        // slither-disable-next-line assembly
        assembly {
            ds.slot := position
        }
        // solhint-enable no-inline-assembly
    }

    /**
     * @notice Returns the address of the account which `account` has delegated to
     * @param account The address to return the delegatee for
     * @return The address of the account which `account` delegated to. If `account` has not delegated, returns address(0).
     */
    function delegates(address account) internal view returns (address) {
        DelegateStorage storage ds = delegateStorage();
        return ds.delegates[account];
    }

    /**
     * @notice Creates a new voter checkpoint and updates the delegatee's count of checkpoints
     * @dev this function emits a DelegateVotesChanged event
     * @param delegatee The address of the delegatee to create a checkpoint for
     * @param oldVotes The number of votes the delegatee had prior to the checkpoint
     * @param newVotes The number of votes the delegatee has after the checkpoint
     */
    function writeCheckpoint(address delegatee, uint256 oldVotes, uint256 newVotes) internal {
        CheckpointStorage storage cs = checkpointStorage();
        uint32 checkpointCount = cs.voterCheckpointsCount[delegatee];
        cs.voterCheckpoints[delegatee][checkpointCount] = Checkpoint(block.timestamp, newVotes);
        cs.voterCheckpointsCount[delegatee] = checkpointCount + 1;
        emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
    }

    /**
     * @notice Creates a new supply checkpoint and updates the count of supply checkpoints
     * @param newSupply The new total supply
     */
    function writeSupplyCheckpoint(uint256 newSupply) internal {
        CheckpointStorage storage cs = checkpointStorage();
        uint32 checkpointCount = cs.supplyCheckpointsCount;
        cs.supplyCheckpoints[checkpointCount] = Checkpoint(block.timestamp, newSupply);
        cs.supplyCheckpointsCount = checkpointCount + 1;
    }

    /**
     * @notice Moves the delegated voting weight from one delegatee to another
     * @dev because it calls writeCheckpoint, as a side effect, a DelegateVotesChanged event is emitted
     * @param oldDelegate The address of the delegatee to remove voting units from. If not address(0), then the voting units are removed from the oldDelegate
     * @param newDelegate The address of the delegatee to add voting units to. If not address(0), then the voting units are added to the newDelegate
     * @param amount The number of voting units to move
     */
    function moveDelegation(address oldDelegate, address newDelegate, uint256 amount) internal {
        if (oldDelegate != newDelegate && amount > 0) {
            if (oldDelegate != address(0)) {
                // decrease old delegatee
                uint256 oldVotes = getVotes(oldDelegate);
                uint256 newVotes = oldVotes - amount;
                writeCheckpoint(oldDelegate, oldVotes, newVotes);
            }

            if (newDelegate != address(0)) {
                // increase new delegatee
                uint256 oldVotes = getVotes(newDelegate);
                uint256 newVotes = oldVotes + amount;
                writeCheckpoint(newDelegate, oldVotes, newVotes);
            }
        }
    }

    /**
     * @notice Moves voting units from one account to another
     * @dev this function potentially updates the total supply when burning or minting, and emits a DelegateVotesChanged event
     * @param from The address of the account to remove voting units from
     * @param to The address of the account to add voting units to
     * @param amount The number of voting units to move
     */
    function transferVotingUnits(address from, address to, uint256 amount) internal {
        if (from == address(0)) {
            writeSupplyCheckpoint(getTotalSupply() + amount);
        }
        if (to == address(0)) {
            writeSupplyCheckpoint(getTotalSupply() - amount);
        }
        moveDelegation(delegates(from), delegates(to), amount);
    }

    /**
     * @dev Internal function to delegate voting power from one account to another
     * @param delegator The address delegating their voting power
     * @param delegatee The address receiving the voting power
     * @dev this function emits a DelegateChanged event
     */
    function delegate(address delegator, address delegatee) internal {
        DelegateStorage storage ds = delegateStorage();
        address currentDelegate = ds.delegates[delegator];
        require(delegatee != currentDelegate, "Delegate: already delegated to this delegatee");
        ds.delegates[delegator] = delegatee;
        emit DelegateChanged(delegator, currentDelegate, delegatee);
    }

    /**
     * @dev Internal function to clear the delegation of a delegator
     * @param delegator The address delegating their voting power
     * @dev this function emits a DelegateChanged event
     */
    function clearDelegation(address delegator) internal {
        DelegateStorage storage ds = delegateStorage();
        address currentDelegate = ds.delegates[delegator];
        ds.delegates[delegator] = address(0);
        emit DelegateChanged(delegator, currentDelegate, address(0));
    }
}

File 26 of 28 : TransferLocks.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

import {ITransferLocks} from "src/interfaces/ITransferLocks.sol";
import {ERC20Base} from "src/token/governance/ERC20Base.sol";
import {TransferLocksStorage} from "src/utils/TransferLocksStorage.sol";
import {IERC165} from "@diamond/interfaces/IERC165.sol";

/**
 * @title TransferLocks
 * @author Origami
 * @notice this library enables time-locked transfers of ERC20 tokens.
 * Transferlocks are the inverse of a vesting schedule. They allow the holder to
 * vote with their weight but not to transfer them before a certain date.
 * @dev TransferLocks are resilient to timestamp manipulation by using
 * block.timestamp, locks will typically be measured in months, not seconds.
 * @custom:security-contact [email protected]
 */
contract TransferLocks is ERC20Base, IERC165, ITransferLocks {
    /// @inheritdoc ITransferLocks
    function addTransferLock(uint256 amount, uint256 deadline) public whenValidLock(amount, deadline) {
        TransferLocksStorage.addTransferLock(msg.sender, amount, deadline);
    }

    /// @inheritdoc ITransferLocks
    function allowances(address account, address recipient) public view returns (uint8) {
        return TransferLocksStorage.allowances(account, recipient);
    }

    /// @inheritdoc ITransferLocks
    function increaseTransferLockAllowance(address account, uint8 amount) public {
        require(account != msg.sender, "TransferLock: accounts do not need to approve themselves");
        TransferLocksStorage.increaseAllowances(msg.sender, account, amount);
    }

    /// @inheritdoc ITransferLocks
    function decreaseTransferLockAllowance(address account, uint8 amount) public {
        require(account != msg.sender, "TransferLock: accounts do not need to approve themselves");
        TransferLocksStorage.decreaseAllowances(msg.sender, account, amount);
    }

    /// @inheritdoc ITransferLocks
    function getTransferLockTotal(address account) public view returns (uint256 amount) {
        return TransferLocksStorage.getTotalLockedAt(account, block.timestamp);
    }

    /// @inheritdoc ITransferLocks
    function getTransferLockTotalAt(address account, uint256 timestamp) public view returns (uint256 amount) {
        return TransferLocksStorage.getTotalLockedAt(account, timestamp);
    }

    /// @inheritdoc ITransferLocks
    function getAvailableBalance(address account) public view returns (uint256 amount) {
        return getAvailableBalanceAt(account, block.timestamp);
    }

    /// @inheritdoc ITransferLocks
    function getAvailableBalanceAt(address account, uint256 timestamp) public view returns (uint256 amount) {
        uint256 totalLocked = TransferLocksStorage.getTotalLockedAt(account, timestamp);
        return balanceOf(account) - totalLocked;
    }

    /// @dev Override ERC20Upgradeable._beforeTokenTransfer to check for transfer locks.
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {
        uint256 lockedAmount = getTransferLockTotal(from);
        // slither-disable-next-line timestamp
        if (lockedAmount > 0 && balanceOf(from) >= amount) {
            // slither-disable-next-line timestamp
            require(balanceOf(from) - amount >= lockedAmount, "TransferLock: this exceeds your unlocked balance");
        }
        super._beforeTokenTransfer(from, to, amount);
    }

    /// @inheritdoc ITransferLocks
    function transferWithLock(address recipient, uint256 amount, uint256 deadline)
        public
        whenValidLock(amount, deadline)
    {
        require(recipient != address(0) && recipient != msg.sender, "TransferLock: invalid recipient");
        TransferLocksStorage.decreaseAllowances(recipient, msg.sender, 1);
        _transfer(msg.sender, recipient, amount);
        TransferLocksStorage.addTransferLock(recipient, amount, deadline);
    }

    /// @inheritdoc ITransferLocks
    function batchTransferWithLocks(
        address[] calldata recipients,
        uint256[] calldata amounts,
        uint256[] calldata deadlines
    ) external {
        require(recipients.length == amounts.length, "TransferLock: recipients and amounts must be the same length");
        require(recipients.length == deadlines.length, "TransferLock: recipients and deadlines must be the same length");
        for (uint256 i = 0; i < recipients.length; i++) {
            transferWithLock(recipients[i], amounts[i], deadlines[i]);
        }
    }

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

    /// @dev Modifier to check that the deadline is in the future and the amount is not greater than the available balance.
    modifier whenValidLock(uint256 amount, uint256 deadline) {
        // slither-disable-next-line timestamp
        require(amount > 0, "TransferLock: amount must be greater than zero");
        require(deadline > block.timestamp, "TransferLock: deadline must be in the future");
        require(
            amount <= getAvailableBalanceAt(msg.sender, block.timestamp),
            "TransferLock: amount cannot exceed available balance"
        );
        _;
    }
}

File 27 of 28 : TransferLocksStorage.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

/**
 * @title Transfer Locks Storage Library
 * @author Origami
 * @notice This library is used to store transfer locks for the Origami Governance Token.
 * @custom:security-contact [email protected]
 */
library TransferLocksStorage {
    bytes32 public constant TRANSFER_LOCKS_STORAGE_POSITION = keccak256("com.origami.transferlocks");
    uint8 public constant MAX_LOCKS_PER_ACCOUNT = type(uint8).max;

    /// @dev storage data structure for transfer locks
    struct TransferLock {
        uint256 amount;
        uint256 deadline;
        uint256 next;
        uint256 prev;
    }

    /// @dev address mapping for transfer locks
    struct TransferLocks {
        mapping(address => mapping(uint256 => TransferLock)) locks;
        mapping(address => mapping(address => uint8)) allowances;
        mapping(address => uint8) numLocks;
        mapping(address => uint8) numAllowances;
        mapping(address => uint8) firstLock;
        mapping(address => uint8) lastLock;
    }

    function increaseAllowances(address account, address recipient, uint8 amount) internal {
        TransferLocks storage tls = transferLocksStorage();
        require(
            MAX_LOCKS_PER_ACCOUNT - amount >= tls.numLocks[account] + tls.numAllowances[account],
            "TransferLocks: cannot exceed max account locks and allowances"
        );
        tls.numAllowances[account] += amount;
        tls.allowances[account][recipient] += amount;
    }

    function decreaseAllowances(address account, address recipient, uint8 amount) internal {
        TransferLocks storage tls = transferLocksStorage();
        require(tls.allowances[account][recipient] >= amount, "TransferLocks: insufficient allowance");
        tls.numAllowances[account] -= amount;
        tls.allowances[account][recipient] -= amount;
    }

    function allowances(address account, address recipient) internal view returns (uint8) {
        TransferLocks storage tls = transferLocksStorage();
        return tls.allowances[account][recipient];
    }

    /// @dev returns the storage pointer for transfer locks
    function transferLocksStorage() internal pure returns (TransferLocks storage tls) {
        bytes32 position = TRANSFER_LOCKS_STORAGE_POSITION;
        // solhint-disable no-inline-assembly
        // slither-disable-next-line assembly
        assembly {
            tls.slot := position
        }
        // solhint-enable no-inline-assembly
    }

    /**
     * @notice adds a transfer lock to an account
     * @param account the account to add the transfer lock to
     * @param amount the amount of tokens to lock
     * @param deadline the timestamp after which the lock expires
     */
    function addTransferLock(address account, uint256 amount, uint256 deadline) internal {
        TransferLocks storage tls = transferLocksStorage();

        // Remove expired locks from the head of the linked list
        while (tls.numLocks[account] > 0 && tls.locks[account][tls.firstLock[account]].deadline < block.timestamp) {
            // Delete the expired lock from storage
            delete tls.locks[account][tls.firstLock[account]];
            // Increment the index of the first lock in the list
            tls.firstLock[account] += 1;
            // Decrement the number of locks
            tls.numLocks[account] -= 1;
        }

        // Make sure we haven't exceeded the maximum number of locks
        require(
            MAX_LOCKS_PER_ACCOUNT - 1 >= tls.numLocks[account] + tls.numAllowances[account],
            "TransferLocks: cannot exceed max account locks and allowances"
        );

        // Get the index of the new lock
        uint8 index = tls.numLocks[account];

        // Create the new lock and add it to storage
        tls.locks[account][index] = TransferLock(amount, deadline, 0, 0);

        // If this is the first lock, update the first and last lock indices
        if (index == 0) {
            tls.firstLock[account] = 0;
            tls.lastLock[account] = 0;
        } else {
            // If this is not the first lock, update the next and prev pointers of the locks
            // Update the prev pointer of the new lock to point to the last lock in the list
            tls.locks[account][index].prev = tls.lastLock[account];
            // Update the next pointer of the last lock in the list to point to the new lock
            tls.locks[account][tls.lastLock[account]].next = index;
            // Update the last lock index to point to the new lock
            tls.lastLock[account] = index;
        }

        // Increment the number of locks
        tls.numLocks[account] += 1;
    }

    /**
     * @notice returns the total amount of tokens locked for an account as of a given timestamp
     * @param account the account to check
     * @param timestamp the timestamp to check
     * @return the total amount of tokens locked for an account at the given timestamp
     */
    function getTotalLockedAt(address account, uint256 timestamp) internal view returns (uint256) {
        TransferLocks storage tls = transferLocksStorage();
        uint256 totalLocked = 0;

        // Iterate over the linked list of transfer locks and add up the amount of tokens that are locked
        for (uint256 i = tls.firstLock[account]; i <= tls.lastLock[account]; i++) {
            if (tls.locks[account][i].deadline >= timestamp) {
                totalLocked += tls.locks[account][i].amount;
            }
        }

        return totalLocked;
    }
}

File 28 of 28 : Votes.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

import {Checkpoints} from "src/utils/Checkpoints.sol";
import {IVotes} from "src/interfaces/IVotes.sol";
import {IVotesToken} from "src/interfaces/IVotesToken.sol";

import {ECDSA} from "@oz/utils/cryptography/ECDSA.sol";

/**
 * @title Votes
 * @notice Implements voting weight calculation for Origami Governance Token
 * @dev This contract is abstract and must be inherited by a contract that implements IVotesToken
 * NB: this is a lightweight integration around Checkpoints.sol that implements IVotes
 * @custom:security-contact [email protected]
 */
abstract contract Votes is IVotes, IVotesToken {
    /// @notice the typehash for the EIP712 domain separator
    bytes32 public constant EIP712_TYPEHASH =
        keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
    /// @notice the typehash for the delegation struct
    bytes32 public constant DELEGATION_TYPEHASH =
        keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");

    /// @inheritdoc IVotes
    function getVotes(address account) public view returns (uint256) {
        return Checkpoints.getVotes(account);
    }

    /// @inheritdoc IVotes
    function getPastVotes(address account, uint256 timestamp) public view returns (uint256) {
        return Checkpoints.getPastVotes(account, timestamp);
    }

    /// @inheritdoc IVotes
    function getPastTotalSupply(uint256 timestamp) external view returns (uint256) {
        return Checkpoints.getPastTotalSupply(timestamp);
    }

    /// @inheritdoc IVotes
    function delegates(address delegator) external view returns (address) {
        return Checkpoints.delegates(delegator);
    }

    /// @inheritdoc IVotes
    function delegate(address delegatee) external {
        handleDelegation(msg.sender, delegatee);
    }

    /// @inheritdoc IVotes
    function getDelegatorNonce(address delegator) external view returns (uint256) {
        return Checkpoints.delegateStorage().nonces[delegator];
    }

    /// @inheritdoc IVotes
    function domainSeparatorV4() public view returns (bytes32) {
        return keccak256(
            abi.encode(
                EIP712_TYPEHASH,
                keccak256(bytes(IVotesToken(this).name())),
                keccak256(bytes(IVotesToken(this).version())),
                block.chainid,
                address(this)
            )
        );
    }

    /// @inheritdoc IVotes
    function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external {
        // slither-disable-next-line timestamp
        require(block.timestamp <= expiry, "Signature expired");

        Checkpoints.DelegateStorage storage ds = Checkpoints.delegateStorage();
        address delegator = ECDSA.recover(
            ECDSA.toTypedDataHash(
                domainSeparatorV4(), keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))
            ),
            v,
            r,
            s
        );

        require(nonce == ds.nonces[delegator], "Invalid nonce");

        ds.nonces[delegator]++;
        handleDelegation(delegator, delegatee);
    }

    /**
     * @notice clears the delegation of the sender
     */
    function clearDelegation() external {
        address currentDelegate = Checkpoints.delegates(msg.sender);

        // Ensure the caller has an active delegation
        require(currentDelegate != address(0), "Votes: No active delegation to clear");

        uint256 balance = IVotesToken(this).balanceOf(msg.sender);
        uint256 votes = getVotes(msg.sender);

        if (currentDelegate == msg.sender) {
            Checkpoints.moveDelegation(currentDelegate, address(0), votes > balance ? balance : votes);
        } else {
            Checkpoints.moveDelegation(currentDelegate, address(0), balance);
        }
        Checkpoints.clearDelegation(msg.sender);
    }

    /**
     * @dev internal function to transfer voting units from one account to another. This should be called by contracts inheriting this one after a transfer.
     * @param from the address to transfer voting units from
     * @param to the address to transfer voting units to
     * @param amount the amount of voting units to transfer
     */
    function transferVotingUnits(address from, address to, uint256 amount) internal {
        Checkpoints.transferVotingUnits(from, to, amount);
    }

    /**
     * @dev internal function to delegate voting units from one account to another. This should be called by contracts inheriting this one after a transfer.
     * @param delegator the address to delegate voting units from
     * @param delegatee the address to delegate voting units to
     */
    function handleDelegation(address delegator, address delegatee) internal {
        require(delegatee != address(0), "Votes: delegatee cannot be zero address");
        address oldDelegate = Checkpoints.delegates(delegator);
        Checkpoints.delegate(delegator, delegatee);
        Checkpoints.moveDelegation(oldDelegate, delegatee, IVotesToken(this).balanceOf(delegator));
    }
}

Settings
{
  "remappings": [
    "@create3/=lib/create3-factory/src/",
    "@diamond/=lib/diamond-2-hardhat/contracts/",
    "@oz-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@oz/=lib/openzeppelin-contracts/contracts/",
    "@std/=lib/forge-std/src/",
    "create3-factory/=lib/create3-factory/",
    "diamond-2-hardhat/=lib/diamond-2-hardhat/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "solmate/=lib/create3-factory/lib/solmate/src/",
    "src/=src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"bool","name":"value","type":"bool"}],"name":"BurnEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"fromDelegate","type":"address"},{"indexed":true,"internalType":"address","name":"toDelegate","type":"address"}],"name":"DelegateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"DelegateVotesChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","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":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"bool","name":"value","type":"bool"}],"name":"TransferEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"BURNER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DELEGATION_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EIP712_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TRANSFERRER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addTransferLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"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":"account","type":"address"},{"internalType":"address","name":"recipient","type":"address"}],"name":"allowances","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"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":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"deadlines","type":"uint256[]"}],"name":"batchTransferWithLocks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"burnable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"clearDelegation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint8","name":"amount","type":"uint8"}],"name":"decreaseTransferLockAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"delegateBySig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegator","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disableBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"domainSeparatorV4","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getAvailableBalance","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"getAvailableBalanceAt","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"delegator","type":"address"}],"name":"getDelegatorNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"getPastTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"getPastVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getTransferLockTotal","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"getTransferLockTotalAt","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint8","name":"amount","type":"uint8"}],"name":"increaseTransferLockAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"},{"internalType":"string","name":"tokenName","type":"string"},{"internalType":"string","name":"tokenSymbol","type":"string"},{"internalType":"uint256","name":"supplyCap","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"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":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"transferWithLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"transferrable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"}]

60806040523480156200001157600080fd5b506200001c6200002c565b620000266200002c565b620000ee565b600054610100900460ff1615620000995760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000ec576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b615f6680620000fe6000396000f3fe608060405234801561001057600080fd5b506004361061038e5760003560e01c80635c975abb116101de578063a217fddf1161010f578063d90964cd116100ad578063e672ce3a1161007c578063e672ce3a14610898578063e7a324dc146108ab578063e851b720146108d2578063f1b50c1d146108e557600080fd5b8063d90964cd14610805578063dd62ed3e14610818578063de6baccb1461085e578063e63ab1e91461087157600080fd5b8063b187984f116100e9578063b187984f146107b0578063c3cda520146107b8578063d5391393146107cb578063d547741f146107f257600080fd5b8063a217fddf14610782578063a457c2d71461078a578063a9059cbb1461079d57600080fd5b806379cc67901161017c57806391d148541161015657806391d148541461071557806395d89b411461075b5780639ab24eb014610763578063a07c7ce41461077657600080fd5b806379cc6790146106e75780638456cb59146106fa5780638e539e8c1461070257600080fd5b80636ab6cd6c116101b85780636ab6cd6c146106645780636c24a76f146106b957806370a08231146106cc57806378e890ba146106df57600080fd5b80635c975abb1461061f5780636239d4a31461062a57806363ac5d971461063d57600080fd5b8063355274ea116102c35780633f4ba83a1161026157806354fd4d501161023057806354fd4d501461058857806355b6ed5c146105c1578063587cde1e146105d45780635c19a95c1461060c57600080fd5b80633f4ba83a1461054757806340c10f191461054f57806342966c68146105625780634d12d4b61461057557600080fd5b80633a46b1a81161029d5780633a46b1a8146105115780633b37d1d6146105245780633b632bb91461052c5780633def60381461053457600080fd5b8063355274ea146104e257806336568abe146104eb57806339509351146104fe57600080fd5b80632403c08e11610330578063282c51f31161030a578063282c51f3146104805780632909ae01146104a75780632f2ff15d146104ba578063313ce567146104cd57600080fd5b80632403c08e1461042e578063248a9ca314610436578063253d2c7d1461045957600080fd5b8063095ea7b31161036c578063095ea7b3146103e157806318160ddd146103f45780631f1eb79b1461040657806323b872dd1461041b57600080fd5b806301ffc9a714610393578063047a7ef1146103bb57806306fdde03146103cc575b600080fd5b6103a66103a136600461551f565b6108ed565b60405190151581526020015b60405180910390f35b61016054610100900460ff166103a6565b6103d4610949565b6040516103b29190615585565b6103a66103ef3660046155ff565b610958565b6035545b6040519081526020016103b2565b61041961041436600461563a565b610970565b005b6103a661042936600461566d565b610a29565b610419610b09565b6103f86104443660046156a9565b600090815260fb602052604090206001015490565b6103f87f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b6103f87f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b6103f86104b53660046156c2565b610c38565b6104196104c83660046156dd565b610c44565b60125b60405160ff90911681526020016103b2565b61012d546103f8565b6104196104f93660046156dd565b610c6e565b6103a661050c3660046155ff565b610d1d565b6103f861051f3660046155ff565b610d69565b610419610d75565b610419610e21565b61041961054236600461574c565b610fcd565b610419611172565b61041961055d3660046155ff565b6111a7565b6104196105703660046156a9565b6111db565b610419610583366004615900565b611282565b60408051808201909152600581527f312e302e3000000000000000000000000000000000000000000000000000000060208201526103d4565b6104d06105cf36600461597c565b6116d8565b6105e76105e23660046156c2565b611734565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016103b2565b61041961061a3660046156c2565b611782565b60975460ff166103a6565b61041961063836600461563a565b61178c565b6103f87f9c0b3a9882e11a6bfb8283b46d1e79513afb8024ee864cd3a5b3a9050c42a7d781565b6103f86106723660046156c2565b73ffffffffffffffffffffffffffffffffffffffff1660009081527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840f602052604090205490565b6103f86106c73660046156c2565b61183c565b6103f86106da3660046156c2565b611848565b6103f8611853565b6104196106f53660046155ff565b6119eb565b610419611a93565b6103f86107103660046156a9565b611ac5565b6103a66107233660046156dd565b600091825260fb6020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6103d4611ad0565b6103f86107713660046156c2565b611b62565b6101605460ff166103a6565b6103f8600081565b6103a66107983660046155ff565b611b6d565b6103a66107ab3660046155ff565b611c49565b610419611d1e565b6104196107c63660046159a6565b611e76565b6103f87f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6104196108003660046156dd565b6120b8565b6103f86108133660046155ff565b6120dd565b6103f861082636600461597c565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260346020908152604080832093909416825291909152205490565b61041961086c3660046159fe565b6120e9565b6103f87f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6104196108a6366004615a31565b612366565b6103f87fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b6103f86108e03660046155ff565b612531565b61041961255c565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167ffb51ee20000000000000000000000000000000000000000000000000000000001480610943575061094382612633565b92915050565b6060610953612689565b905090565b600033610966818585612693565b5060019392505050565b3373ffffffffffffffffffffffffffffffffffffffff831603610a1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f5472616e736665724c6f636b3a206163636f756e747320646f206e6f74206e6560448201527f656420746f20617070726f7665207468656d73656c766573000000000000000060648201526084015b60405180910390fd5b610a25338383612846565b5050565b6000610a557f9c0b3a9882e11a6bfb8283b46d1e79513afb8024ee864cd3a5b3a9050c42a7d733610723565b80610a68575061016054610100900460ff165b610af4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c65640000000000000000000000000000000000000000000000000000006064820152608401610a11565b610aff848484612a0a565b90505b9392505050565b6000610b1481612ae0565b610b3e7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84833610723565b80610b4c57506101605460ff165b610bb2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4275726e61626c653a206275726e696e672069732064697361626c65640000006044820152606401610a11565b61016080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055335b6101605460405160ff9091161515815273ffffffffffffffffffffffffffffffffffffffff91909116907f373d051cc9c39a097512f5befac8840dd3395ef720e43a8d0f62d1756e0bb924906020015b60405180910390a250565b60006109438242612aea565b600082815260fb6020526040902060010154610c5f81612ae0565b610c698383612c17565b505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610d13576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610a11565b610a258282612d0b565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906109669082908690610d64908790615a82565b612693565b6000610b028383612dc6565b6000610d8081612ae0565b6101605460ff1615610dee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4275726e61626c653a206275726e696e6720697320656e61626c6564000000006044820152606401610a11565b61016080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610bdd3390565b3360009081527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e602052604090205473ffffffffffffffffffffffffffffffffffffffff1680610ef2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f566f7465733a204e6f206163746976652064656c65676174696f6e20746f206360448201527f6c656172000000000000000000000000000000000000000000000000000000006064820152608401610a11565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815233600482015260009030906370a0823190602401602060405180830381865afa158015610f49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6d9190615a95565b90506000610f7a33611b62565b90503373ffffffffffffffffffffffffffffffffffffffff841603610fb857610fb3836000848411610fac5783612e71565b845b612e71565b610fc4565b610fc483600084612e71565b610c6933612f39565b84831461105c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f5472616e736665724c6f636b3a20726563697069656e747320616e6420616d6f60448201527f756e7473206d757374206265207468652073616d65206c656e677468000000006064820152608401610a11565b8481146110eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f5472616e736665724c6f636b3a20726563697069656e747320616e642064656160448201527f646c696e6573206d757374206265207468652073616d65206c656e67746800006064820152608401610a11565b60005b858110156111695761115787878381811061110b5761110b615aae565b905060200201602081019061112091906156c2565b86868481811061113257611132615aae565b9050602002013585858581811061114b5761114b615aae565b905060200201356120e9565b8061116181615add565b9150506110ee565b50505050505050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61119c81612ae0565b6111a4612fdb565b50565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66111d181612ae0565b610c698383613058565b6112057f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84833610723565b8061121357506101605460ff165b611279576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4275726e61626c653a206275726e696e672069732064697361626c65640000006044820152606401610a11565b6111a481613062565b600054610100900460ff16158080156112a25750600054600160ff909116105b806112bc5750303b1580156112bc575060005460ff166001145b611348576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610a11565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156113a657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff8516611423576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f41646d696e20616464726573732063616e6e6f74206265207a65726f000000006044820152606401610a11565b60408051602080820152600091810182905260600160405160208183030381529060405280519060200120905080856040516020016114629190615585565b6040516020818303038152906040528051906020012003611505576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433230426173653a20546f6b656e206e616d652063616e6e6f742062652060448201527f656d7074790000000000000000000000000000000000000000000000000000006064820152608401610a11565b80846040516020016115179190615585565b60405160208183030381529060405280519060200120036115ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4552433230426173653a20546f6b656e2073796d626f6c2063616e6e6f74206260448201527f6520656d707479000000000000000000000000000000000000000000000000006064820152608401610a11565b6115c261306c565b6115ca61306c565b6115d383613105565b6115dd85856131a5565b6115e5613246565b6115f0600087612c17565b61161a7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a687612c17565b6116447f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a87612c17565b5061016080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016905580156116d157600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b73ffffffffffffffffffffffffffffffffffffffff80831660009081527fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a8146539116020908152604080832093851683529290529081205460ff16610b02565b73ffffffffffffffffffffffffffffffffffffffff80821660009081527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e6020526040812054909116610943565b6111a433826132e5565b3373ffffffffffffffffffffffffffffffffffffffff831603611831576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f5472616e736665724c6f636b3a206163636f756e747320646f206e6f74206e6560448201527f656420746f20617070726f7665207468656d73656c76657300000000000000006064820152608401610a11565b610a2533838361346f565b60006109438242612531565b60006109438261364f565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f3073ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa1580156118c1573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526119079190810190615b15565b805190602001203073ffffffffffffffffffffffffffffffffffffffff166354fd4d506040518163ffffffff1660e01b8152600401600060405180830381865afa158015611959573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261199f9190810190615b15565b805160209182012060408051928301949094529281019190915260608101919091524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b611a157f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84833610723565b80611a2357506101605460ff165b611a89576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4275726e61626c653a206275726e696e672069732064697361626c65640000006044820152606401610a11565b610a25828261367a565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a611abd81612ae0565b6111a461368f565b6000610943826136ea565b606060378054611adf90615b83565b80601f0160208091040260200160405190810160405280929190818152602001828054611b0b90615b83565b8015611b585780601f10611b2d57610100808354040283529160200191611b58565b820191906000526020600020905b815481529060010190602001808311611b3b57829003601f168201915b5050505050905090565b600061094382613742565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015611c31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610a11565b611c3e8286868403612693565b506001949350505050565b6000611c757f9c0b3a9882e11a6bfb8283b46d1e79513afb8024ee864cd3a5b3a9050c42a7d733610723565b80611c88575061016054610100900460ff165b611d14576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c65640000000000000000000000000000000000000000000000000000006064820152608401610a11565b610b0283836137e3565b6000611d2981612ae0565b611d537f9c0b3a9882e11a6bfb8283b46d1e79513afb8024ee864cd3a5b3a9050c42a7d733610723565b80611d66575061016054610100900460ff165b611df2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c65640000000000000000000000000000000000000000000000000000006064820152608401610a11565b61016080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055335b73ffffffffffffffffffffffffffffffffffffffff167f750bc2ec2b9643783080f064b960113af5a2a708345c7e3cf509ca7fec55e24461016060019054906101000a900460ff16604051610c2d911515815260200190565b83421115611ee0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f5369676e617475726520657870697265640000000000000000000000000000006044820152606401610a11565b7f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e6000611fd9611fd1611f11611853565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208083019190915273ffffffffffffffffffffffffffffffffffffffff8e1682840152606082018d905260808083018d90528351808403909101815260a0830184528051908201207f190100000000000000000000000000000000000000000000000000000000000060c084015260c283019490945260e28083019490945282518083039094018452610102909101909152815191012090565b8686866138b8565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600184016020526040902054909150871461206c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c6964206e6f6e6365000000000000000000000000000000000000006044820152606401610a11565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600183016020526040812080549161209f83615add565b91905055506120ae81896132e5565b5050505050505050565b600082815260fb60205260409020600101546120d381612ae0565b610c698383612d0b565b6000610b028383612aea565b81816000821161217b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f5472616e736665724c6f636b3a20616d6f756e74206d7573742062652067726560448201527f61746572207468616e207a65726f0000000000000000000000000000000000006064820152608401610a11565b42811161220a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f5472616e736665724c6f636b3a20646561646c696e65206d757374206265206960448201527f6e207468652066757475726500000000000000000000000000000000000000006064820152608401610a11565b6122143342612531565b8211156122a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f5472616e736665724c6f636b3a20616d6f756e742063616e6e6f74206578636560448201527f656420617661696c61626c652062616c616e63650000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff8516158015906122de575073ffffffffffffffffffffffffffffffffffffffff85163314155b612344576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5472616e736665724c6f636b3a20696e76616c696420726563697069656e74006044820152606401610a11565b61235085336001612846565b61235b3386866138e0565b6116d1858585613b67565b8181600082116123f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f5472616e736665724c6f636b3a20616d6f756e74206d7573742062652067726560448201527f61746572207468616e207a65726f0000000000000000000000000000000000006064820152608401610a11565b428111612487576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f5472616e736665724c6f636b3a20646561646c696e65206d757374206265206960448201527f6e207468652066757475726500000000000000000000000000000000000000006064820152608401610a11565b6124913342612531565b821115612520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f5472616e736665724c6f636b3a20616d6f756e742063616e6e6f74206578636560448201527f656420617661696c61626c652062616c616e63650000000000000000000000006064820152608401610a11565b61252b338585613b67565b50505050565b60008061253e8484612aea565b90508061254a85611848565b6125549190615bd6565b949350505050565b600061256781612ae0565b61016054610100900460ff16156125ff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f5472616e736665727261626c653a207472616e73666572732061726520656e6160448201527f626c6564000000000000000000000000000000000000000000000000000000006064820152608401610a11565b61016080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055611e1d3390565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5912562e000000000000000000000000000000000000000000000000000000001480610943575061094382613f9e565b6060610953613fa9565b73ffffffffffffffffffffffffffffffffffffffff8316612735576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff82166127d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff83811660009081527fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a81465391160209081526040808320938616835292905220547fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a8146539109060ff8381169116101561294f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f5472616e736665724c6f636b733a20696e73756666696369656e7420616c6c6f60448201527f77616e63650000000000000000000000000000000000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff841660009081526003820160205260408120805484929061298990849060ff16615be9565b82546101009290920a60ff81810219909316918316021790915573ffffffffffffffffffffffffffffffffffffffff868116600090815260018501602090815260408083209389168352929052908120805486945090926129ec91859116615be9565b92506101000a81548160ff021916908360ff16021790555050505050565b6000612a367f9c0b3a9882e11a6bfb8283b46d1e79513afb8024ee864cd3a5b3a9050c42a7d733610723565b80612a49575061016054610100900460ff165b612ad5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c65640000000000000000000000000000000000000000000000000000006064820152608401610a11565b610aff848484613fb8565b6111a48133613fd1565b73ffffffffffffffffffffffffffffffffffffffff821660009081527fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a81465391460205260408120547fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a81465391090829060ff165b73ffffffffffffffffffffffffffffffffffffffff8616600090815260058401602052604090205460ff168111612c0e5773ffffffffffffffffffffffffffffffffffffffff86166000908152602084815260408083208484529091529020600101548511612bfc5773ffffffffffffffffffffffffffffffffffffffff8616600090815260208481526040808320848452909152902054612bf99083615a82565b91505b80612c0681615add565b915050612b57565b50949350505050565b600082815260fb6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610a2557600082815260fb6020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055612cad3390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260fb6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610a2557600082815260fb6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b73ffffffffffffffffffffffffffffffffffffffff821660009081527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5160209081526040808320547fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5290925282207fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f9163ffffffff1690612e6890828661408b565b95945050505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015612ead5750600081115b15610c695773ffffffffffffffffffffffffffffffffffffffff831615612ef7576000612ed984613742565b90506000612ee78383615bd6565b9050612ef48583836141f9565b50505b73ffffffffffffffffffffffffffffffffffffffff821615610c69576000612f1e83613742565b90506000612f2c8383615a82565b90506116d18483836141f9565b73ffffffffffffffffffffffffffffffffffffffff81811660008181527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e6020819052604080832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000811690915590519194169283917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f908490a4505050565b612fe3614362565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b610a2582826143ce565b6111a43382614458565b600054610100900460ff16613103576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b565b600054610100900460ff1661319c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b6111a481614631565b600054610100900460ff1661323c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b610a258282614738565b600054610100900460ff166132dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b6131036147e8565b73ffffffffffffffffffffffffffffffffffffffff8116613388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f566f7465733a2064656c6567617465652063616e6e6f74206265207a65726f2060448201527f61646472657373000000000000000000000000000000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff82811660009081527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e6020526040902054166133d983836148a9565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152610c69908290849030906370a0823190602401602060405180830381865afa15801561344b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fae9190615a95565b73ffffffffffffffffffffffffffffffffffffffff831660009081527fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a81465391360209081526040808320547fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a814653912909252909120547fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a814653910916135119160ff9182169116615c02565b60ff168260ff6135219190615be9565b60ff1610156135b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f5472616e736665724c6f636b733a2063616e6e6f7420657863656564206d617860448201527f206163636f756e74206c6f636b7320616e6420616c6c6f77616e6365730000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600382016020526040812080548492906135ec90849060ff16615c02565b82546101009290920a60ff81810219909316918316021790915573ffffffffffffffffffffffffffffffffffffffff868116600090815260018501602090815260408083209389168352929052908120805486945090926129ec91859116615c02565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260336020526040812054610943565b613685823383614a0e565b610a258282614458565b613697614adf565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861302e3390565b7fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f80546000919063ffffffff166125547fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece50828661408b565b73ffffffffffffffffffffffffffffffffffffffff811660009081527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5160209081526040808320547fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5290925282207fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f9163ffffffff16906125549082614b4c565b600061380f7f9c0b3a9882e11a6bfb8283b46d1e79513afb8024ee864cd3a5b3a9050c42a7d733610723565b80613822575061016054610100900460ff165b6138ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c65640000000000000000000000000000000000000000000000000000006064820152608401610a11565b610b028383614b91565b60008060006138c987878787614b9f565b915091506138d681614c8e565b5095945050505050565b73ffffffffffffffffffffffffffffffffffffffff8316613983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff8216613a26576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610a11565b613a31838383614e41565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604090205481811015613ae7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff80851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90613b549086815260200190565b60405180910390a361252b848484614e4c565b7fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a8146539105b73ffffffffffffffffffffffffffffffffffffffff8416600090815260028201602052604090205460ff1615801590613bfe575073ffffffffffffffffffffffffffffffffffffffff84166000908152602082815260408083206004850183528184205460ff16845290915290206001015442115b15613ce55773ffffffffffffffffffffffffffffffffffffffff841660008181526020838152604080832060048601808452828520805460ff908116875292855292852085815560018181018790556002820187905560039091018690559585529092528054909291613c7391859116615c02565b82546101009290920a60ff81810219909316918316021790915573ffffffffffffffffffffffffffffffffffffffff8616600090815260028401602052604081208054600194509092613cc891859116615be9565b92506101000a81548160ff021916908360ff160217905550613b89565b73ffffffffffffffffffffffffffffffffffffffff841660009081526003820160209081526040808320546002850190925290912054613d2b9160ff9081169116615c02565b60ff16600160ff613d3c9190615be9565b60ff161015613dcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f5472616e736665724c6f636b733a2063616e6e6f7420657863656564206d617860448201527f206163636f756e74206c6f636b7320616e6420616c6c6f77616e6365730000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff841660008181526002808401602090815260408084205481516080810183528981528084018981528184018781526060830188815298885289865284882060ff9094168089529390955292862090518155915160018301559151928101929092559251600390910155819003613ebb5773ffffffffffffffffffffffffffffffffffffffff85166000908152600483016020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009081169091556005860190925290912080549091169055613f44565b73ffffffffffffffffffffffffffffffffffffffff851660008181526005840160208181526040808420805488845282862060ff89811680895282875285892093821660039094019390935583541687528452918520600201829055949093525281547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00161790555b73ffffffffffffffffffffffffffffffffffffffff851660009081526002830160205260408120805460019290613f7f90849060ff16615c02565b92506101000a81548160ff021916908360ff1602179055505050505050565b600061094382614e57565b606060368054611adf90615b83565b600033613fc6858285614a0e565b611c3e8585856138e0565b600082815260fb6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610a255761401181614eee565b61401c836020614f0d565b60405160200161402d929190615c1b565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610a1191600401615585565b60008263ffffffff166000036140a357506000610b02565b818460006140b2600187615c9c565b63ffffffff16815260208101919091526040016000205411614101578360006140dc600186615c9c565b63ffffffff1663ffffffff168152602001908152602001600020600101549050610b02565b60008080526020859052604090205482101561411f57506000610b02565b60008061412d600186615c9c565b90505b8163ffffffff168163ffffffff1611156141d757600060026141528484615c9c565b61415c9190615cc0565b6141669083615c9c565b63ffffffff8116600090815260208981526040918290208251808401909352805480845260019091015491830191909152919250908690036141b157602001519350610b0292505050565b80518611156141c2578193506141d0565b6141cd600183615c9c565b92505b5050614130565b5063ffffffff1660009081526020859052604090206001015490509392505050565b73ffffffffffffffffffffffffffffffffffffffff831660008181527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece516020908152604080832054815180830183524281528084018781529585527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece52845282852063ffffffff9092168086529190935292209051815591516001928301557fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f916142c4908290615d0a565b73ffffffffffffffffffffffffffffffffffffffff8616600081815260028501602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff9590951694909417909355805187815292830186905290917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a25050505050565b60975460ff16613103576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610a11565b61012d54816143dc60355490565b6143e69190615a82565b111561444e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f45524332304361707065643a20636170206578636565646564000000000000006044820152606401610a11565b610a258282615150565b73ffffffffffffffffffffffffffffffffffffffff82166144fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610a11565b61450782600083614e41565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260336020526040902054818110156145bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610c6983600084614e4c565b600054610100900460ff166146c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b60008111614732576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f45524332304361707065643a20636170206973203000000000000000000000006044820152606401610a11565b61012d55565b600054610100900460ff166147cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b60366147db8382615d75565b506037610c698282615d75565b600054610100900460ff1661487f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b73ffffffffffffffffffffffffffffffffffffffff82811660009081527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e60208190526040909120549091908116908316819003614989576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f44656c65676174653a20616c72656164792064656c65676174656420746f207460448201527f6869732064656c656761746565000000000000000000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff84811660008181526020859052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688861690811790915590519093851692917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f91a450505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152603460209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461252b5781811015614ad2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610a11565b61252b8484848403612693565b60975460ff1615613103576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610a11565b600063ffffffff821615614b88576000614b67600184615c9c565b63ffffffff1660009081526020859052604090206001015491506109439050565b50600092915050565b6000336109668185856138e0565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115614bd65750600090506003614c85565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614c2a573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116614c7e57600060019250925050614c85565b9150600090505b94509492505050565b6000816004811115614ca257614ca2615e8f565b03614caa5750565b6001816004811115614cbe57614cbe615e8f565b03614d25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610a11565b6002816004811115614d3957614d39615e8f565b03614da0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a11565b6003816004811115614db457614db4615e8f565b036111a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610a11565b610c69838383615259565b610c69838383615331565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061094357507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610943565b606061094373ffffffffffffffffffffffffffffffffffffffff831660145b60606000614f1c836002615ebe565b614f27906002615a82565b67ffffffffffffffff811115614f3f57614f3f6157e6565b6040519080825280601f01601f191660200182016040528015614f69576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110614fa057614fa0615aae565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061500357615003615aae565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600061503f846002615ebe565b61504a906001615a82565b90505b60018111156150e7577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061508b5761508b615aae565b1a60f81b8282815181106150a1576150a1615aae565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936150e081615efb565b905061504d565b508315610b02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a11565b73ffffffffffffffffffffffffffffffffffffffff82166151cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610a11565b6151d960008383614e41565b80603560008282546151eb9190615a82565b909155505073ffffffffffffffffffffffffffffffffffffffff82166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610a2560008383614e4c565b600061526484610c38565b905060008111801561527e57508161527b85611848565b10155b1561532657808261528e86611848565b6152989190615bd6565b1015615326576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f5472616e736665724c6f636b3a2074686973206578636565647320796f75722060448201527f756e6c6f636b65642062616c616e6365000000000000000000000000000000006064820152608401610a11565b61252b84848461533c565b610c69838383615344565b610c69614adf565b73ffffffffffffffffffffffffffffffffffffffff831661537a5761537a8161536b615409565b6153759190615a82565b615467565b73ffffffffffffffffffffffffffffffffffffffff82166153ab576153ab816153a1615409565b6153759190615bd6565b73ffffffffffffffffffffffffffffffffffffffff83811660009081527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e6020526040808220548584168352912054610c6992918216911683612e71565b7fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f80546000919063ffffffff166154607fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5082614b4c565b9250505090565b7fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f8054604080518082018252428152602080820186815263ffffffff90941660008181527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece50909252929020905181559151600192830155906154ea908290615d0a565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff91909116179091555050565b60006020828403121561553157600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610b0257600080fd5b60005b8381101561557c578181015183820152602001615564565b50506000910152565b60208152600082518060208401526155a4816040850160208701615561565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b803573ffffffffffffffffffffffffffffffffffffffff811681146155fa57600080fd5b919050565b6000806040838503121561561257600080fd5b61561b836155d6565b946020939093013593505050565b803560ff811681146155fa57600080fd5b6000806040838503121561564d57600080fd5b615656836155d6565b915061566460208401615629565b90509250929050565b60008060006060848603121561568257600080fd5b61568b846155d6565b9250615699602085016155d6565b9150604084013590509250925092565b6000602082840312156156bb57600080fd5b5035919050565b6000602082840312156156d457600080fd5b610b02826155d6565b600080604083850312156156f057600080fd5b82359150615664602084016155d6565b60008083601f84011261571257600080fd5b50813567ffffffffffffffff81111561572a57600080fd5b6020830191508360208260051b850101111561574557600080fd5b9250929050565b6000806000806000806060878903121561576557600080fd5b863567ffffffffffffffff8082111561577d57600080fd5b6157898a838b01615700565b909850965060208901359150808211156157a257600080fd5b6157ae8a838b01615700565b909650945060408901359150808211156157c757600080fd5b506157d489828a01615700565b979a9699509497509295939492505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561585c5761585c6157e6565b604052919050565b600067ffffffffffffffff82111561587e5761587e6157e6565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f8301126158bb57600080fd5b81356158ce6158c982615864565b615815565b8181528460208386010111156158e357600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561591657600080fd5b61591f856155d6565b9350602085013567ffffffffffffffff8082111561593c57600080fd5b615948888389016158aa565b9450604087013591508082111561595e57600080fd5b5061596b878288016158aa565b949793965093946060013593505050565b6000806040838503121561598f57600080fd5b615998836155d6565b9150615664602084016155d6565b60008060008060008060c087890312156159bf57600080fd5b6159c8876155d6565b955060208701359450604087013593506159e460608801615629565b92506080870135915060a087013590509295509295509295565b600080600060608486031215615a1357600080fd5b615a1c846155d6565b95602085013595506040909401359392505050565b60008060408385031215615a4457600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561094357610943615a53565b600060208284031215615aa757600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203615b0e57615b0e615a53565b5060010190565b600060208284031215615b2757600080fd5b815167ffffffffffffffff811115615b3e57600080fd5b8201601f81018413615b4f57600080fd5b8051615b5d6158c982615864565b818152856020838501011115615b7257600080fd5b612e68826020830160208601615561565b600181811c90821680615b9757607f821691505b602082108103615bd0577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b8181038181111561094357610943615a53565b60ff828116828216039081111561094357610943615a53565b60ff818116838216019081111561094357610943615a53565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615c53816017850160208801615561565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351615c90816028840160208801615561565b01602801949350505050565b63ffffffff828116828216039080821115615cb957615cb9615a53565b5092915050565b600063ffffffff80841680615cfe577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b92169190910492915050565b63ffffffff818116838216019080821115615cb957615cb9615a53565b601f821115610c6957600081815260208120601f850160051c81016020861015615d4e5750805b601f850160051c820191505b81811015615d6d57828155600101615d5a565b505050505050565b815167ffffffffffffffff811115615d8f57615d8f6157e6565b615da381615d9d8454615b83565b84615d27565b602080601f831160018114615df65760008415615dc05750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555615d6d565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015615e4357888601518255948401946001909101908401615e24565b5085821015615e7f57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615615ef657615ef6615a53565b500290565b600081615f0a57615f0a615a53565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea2646970667358221220e588fd7820dac465b0909fb87619d5bd74cb15d8c4677f2412cc8c1770ac13d764736f6c63430008100033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061038e5760003560e01c80635c975abb116101de578063a217fddf1161010f578063d90964cd116100ad578063e672ce3a1161007c578063e672ce3a14610898578063e7a324dc146108ab578063e851b720146108d2578063f1b50c1d146108e557600080fd5b8063d90964cd14610805578063dd62ed3e14610818578063de6baccb1461085e578063e63ab1e91461087157600080fd5b8063b187984f116100e9578063b187984f146107b0578063c3cda520146107b8578063d5391393146107cb578063d547741f146107f257600080fd5b8063a217fddf14610782578063a457c2d71461078a578063a9059cbb1461079d57600080fd5b806379cc67901161017c57806391d148541161015657806391d148541461071557806395d89b411461075b5780639ab24eb014610763578063a07c7ce41461077657600080fd5b806379cc6790146106e75780638456cb59146106fa5780638e539e8c1461070257600080fd5b80636ab6cd6c116101b85780636ab6cd6c146106645780636c24a76f146106b957806370a08231146106cc57806378e890ba146106df57600080fd5b80635c975abb1461061f5780636239d4a31461062a57806363ac5d971461063d57600080fd5b8063355274ea116102c35780633f4ba83a1161026157806354fd4d501161023057806354fd4d501461058857806355b6ed5c146105c1578063587cde1e146105d45780635c19a95c1461060c57600080fd5b80633f4ba83a1461054757806340c10f191461054f57806342966c68146105625780634d12d4b61461057557600080fd5b80633a46b1a81161029d5780633a46b1a8146105115780633b37d1d6146105245780633b632bb91461052c5780633def60381461053457600080fd5b8063355274ea146104e257806336568abe146104eb57806339509351146104fe57600080fd5b80632403c08e11610330578063282c51f31161030a578063282c51f3146104805780632909ae01146104a75780632f2ff15d146104ba578063313ce567146104cd57600080fd5b80632403c08e1461042e578063248a9ca314610436578063253d2c7d1461045957600080fd5b8063095ea7b31161036c578063095ea7b3146103e157806318160ddd146103f45780631f1eb79b1461040657806323b872dd1461041b57600080fd5b806301ffc9a714610393578063047a7ef1146103bb57806306fdde03146103cc575b600080fd5b6103a66103a136600461551f565b6108ed565b60405190151581526020015b60405180910390f35b61016054610100900460ff166103a6565b6103d4610949565b6040516103b29190615585565b6103a66103ef3660046155ff565b610958565b6035545b6040519081526020016103b2565b61041961041436600461563a565b610970565b005b6103a661042936600461566d565b610a29565b610419610b09565b6103f86104443660046156a9565b600090815260fb602052604090206001015490565b6103f87f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b6103f87f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b6103f86104b53660046156c2565b610c38565b6104196104c83660046156dd565b610c44565b60125b60405160ff90911681526020016103b2565b61012d546103f8565b6104196104f93660046156dd565b610c6e565b6103a661050c3660046155ff565b610d1d565b6103f861051f3660046155ff565b610d69565b610419610d75565b610419610e21565b61041961054236600461574c565b610fcd565b610419611172565b61041961055d3660046155ff565b6111a7565b6104196105703660046156a9565b6111db565b610419610583366004615900565b611282565b60408051808201909152600581527f312e302e3000000000000000000000000000000000000000000000000000000060208201526103d4565b6104d06105cf36600461597c565b6116d8565b6105e76105e23660046156c2565b611734565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016103b2565b61041961061a3660046156c2565b611782565b60975460ff166103a6565b61041961063836600461563a565b61178c565b6103f87f9c0b3a9882e11a6bfb8283b46d1e79513afb8024ee864cd3a5b3a9050c42a7d781565b6103f86106723660046156c2565b73ffffffffffffffffffffffffffffffffffffffff1660009081527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840f602052604090205490565b6103f86106c73660046156c2565b61183c565b6103f86106da3660046156c2565b611848565b6103f8611853565b6104196106f53660046155ff565b6119eb565b610419611a93565b6103f86107103660046156a9565b611ac5565b6103a66107233660046156dd565b600091825260fb6020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6103d4611ad0565b6103f86107713660046156c2565b611b62565b6101605460ff166103a6565b6103f8600081565b6103a66107983660046155ff565b611b6d565b6103a66107ab3660046155ff565b611c49565b610419611d1e565b6104196107c63660046159a6565b611e76565b6103f87f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6104196108003660046156dd565b6120b8565b6103f86108133660046155ff565b6120dd565b6103f861082636600461597c565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260346020908152604080832093909416825291909152205490565b61041961086c3660046159fe565b6120e9565b6103f87f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6104196108a6366004615a31565b612366565b6103f87fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b6103f86108e03660046155ff565b612531565b61041961255c565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167ffb51ee20000000000000000000000000000000000000000000000000000000001480610943575061094382612633565b92915050565b6060610953612689565b905090565b600033610966818585612693565b5060019392505050565b3373ffffffffffffffffffffffffffffffffffffffff831603610a1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f5472616e736665724c6f636b3a206163636f756e747320646f206e6f74206e6560448201527f656420746f20617070726f7665207468656d73656c766573000000000000000060648201526084015b60405180910390fd5b610a25338383612846565b5050565b6000610a557f9c0b3a9882e11a6bfb8283b46d1e79513afb8024ee864cd3a5b3a9050c42a7d733610723565b80610a68575061016054610100900460ff165b610af4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c65640000000000000000000000000000000000000000000000000000006064820152608401610a11565b610aff848484612a0a565b90505b9392505050565b6000610b1481612ae0565b610b3e7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84833610723565b80610b4c57506101605460ff165b610bb2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4275726e61626c653a206275726e696e672069732064697361626c65640000006044820152606401610a11565b61016080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055335b6101605460405160ff9091161515815273ffffffffffffffffffffffffffffffffffffffff91909116907f373d051cc9c39a097512f5befac8840dd3395ef720e43a8d0f62d1756e0bb924906020015b60405180910390a250565b60006109438242612aea565b600082815260fb6020526040902060010154610c5f81612ae0565b610c698383612c17565b505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610d13576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610a11565b610a258282612d0b565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906109669082908690610d64908790615a82565b612693565b6000610b028383612dc6565b6000610d8081612ae0565b6101605460ff1615610dee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4275726e61626c653a206275726e696e6720697320656e61626c6564000000006044820152606401610a11565b61016080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610bdd3390565b3360009081527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e602052604090205473ffffffffffffffffffffffffffffffffffffffff1680610ef2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f566f7465733a204e6f206163746976652064656c65676174696f6e20746f206360448201527f6c656172000000000000000000000000000000000000000000000000000000006064820152608401610a11565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815233600482015260009030906370a0823190602401602060405180830381865afa158015610f49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6d9190615a95565b90506000610f7a33611b62565b90503373ffffffffffffffffffffffffffffffffffffffff841603610fb857610fb3836000848411610fac5783612e71565b845b612e71565b610fc4565b610fc483600084612e71565b610c6933612f39565b84831461105c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f5472616e736665724c6f636b3a20726563697069656e747320616e6420616d6f60448201527f756e7473206d757374206265207468652073616d65206c656e677468000000006064820152608401610a11565b8481146110eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f5472616e736665724c6f636b3a20726563697069656e747320616e642064656160448201527f646c696e6573206d757374206265207468652073616d65206c656e67746800006064820152608401610a11565b60005b858110156111695761115787878381811061110b5761110b615aae565b905060200201602081019061112091906156c2565b86868481811061113257611132615aae565b9050602002013585858581811061114b5761114b615aae565b905060200201356120e9565b8061116181615add565b9150506110ee565b50505050505050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61119c81612ae0565b6111a4612fdb565b50565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66111d181612ae0565b610c698383613058565b6112057f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84833610723565b8061121357506101605460ff165b611279576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4275726e61626c653a206275726e696e672069732064697361626c65640000006044820152606401610a11565b6111a481613062565b600054610100900460ff16158080156112a25750600054600160ff909116105b806112bc5750303b1580156112bc575060005460ff166001145b611348576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610a11565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156113a657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff8516611423576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f41646d696e20616464726573732063616e6e6f74206265207a65726f000000006044820152606401610a11565b60408051602080820152600091810182905260600160405160208183030381529060405280519060200120905080856040516020016114629190615585565b6040516020818303038152906040528051906020012003611505576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433230426173653a20546f6b656e206e616d652063616e6e6f742062652060448201527f656d7074790000000000000000000000000000000000000000000000000000006064820152608401610a11565b80846040516020016115179190615585565b60405160208183030381529060405280519060200120036115ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4552433230426173653a20546f6b656e2073796d626f6c2063616e6e6f74206260448201527f6520656d707479000000000000000000000000000000000000000000000000006064820152608401610a11565b6115c261306c565b6115ca61306c565b6115d383613105565b6115dd85856131a5565b6115e5613246565b6115f0600087612c17565b61161a7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a687612c17565b6116447f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a87612c17565b5061016080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016905580156116d157600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b73ffffffffffffffffffffffffffffffffffffffff80831660009081527fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a8146539116020908152604080832093851683529290529081205460ff16610b02565b73ffffffffffffffffffffffffffffffffffffffff80821660009081527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e6020526040812054909116610943565b6111a433826132e5565b3373ffffffffffffffffffffffffffffffffffffffff831603611831576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f5472616e736665724c6f636b3a206163636f756e747320646f206e6f74206e6560448201527f656420746f20617070726f7665207468656d73656c76657300000000000000006064820152608401610a11565b610a2533838361346f565b60006109438242612531565b60006109438261364f565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f3073ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa1580156118c1573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526119079190810190615b15565b805190602001203073ffffffffffffffffffffffffffffffffffffffff166354fd4d506040518163ffffffff1660e01b8152600401600060405180830381865afa158015611959573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261199f9190810190615b15565b805160209182012060408051928301949094529281019190915260608101919091524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b611a157f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84833610723565b80611a2357506101605460ff165b611a89576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4275726e61626c653a206275726e696e672069732064697361626c65640000006044820152606401610a11565b610a25828261367a565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a611abd81612ae0565b6111a461368f565b6000610943826136ea565b606060378054611adf90615b83565b80601f0160208091040260200160405190810160405280929190818152602001828054611b0b90615b83565b8015611b585780601f10611b2d57610100808354040283529160200191611b58565b820191906000526020600020905b815481529060010190602001808311611b3b57829003601f168201915b5050505050905090565b600061094382613742565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015611c31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610a11565b611c3e8286868403612693565b506001949350505050565b6000611c757f9c0b3a9882e11a6bfb8283b46d1e79513afb8024ee864cd3a5b3a9050c42a7d733610723565b80611c88575061016054610100900460ff165b611d14576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c65640000000000000000000000000000000000000000000000000000006064820152608401610a11565b610b0283836137e3565b6000611d2981612ae0565b611d537f9c0b3a9882e11a6bfb8283b46d1e79513afb8024ee864cd3a5b3a9050c42a7d733610723565b80611d66575061016054610100900460ff165b611df2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c65640000000000000000000000000000000000000000000000000000006064820152608401610a11565b61016080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055335b73ffffffffffffffffffffffffffffffffffffffff167f750bc2ec2b9643783080f064b960113af5a2a708345c7e3cf509ca7fec55e24461016060019054906101000a900460ff16604051610c2d911515815260200190565b83421115611ee0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f5369676e617475726520657870697265640000000000000000000000000000006044820152606401610a11565b7f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e6000611fd9611fd1611f11611853565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208083019190915273ffffffffffffffffffffffffffffffffffffffff8e1682840152606082018d905260808083018d90528351808403909101815260a0830184528051908201207f190100000000000000000000000000000000000000000000000000000000000060c084015260c283019490945260e28083019490945282518083039094018452610102909101909152815191012090565b8686866138b8565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600184016020526040902054909150871461206c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c6964206e6f6e6365000000000000000000000000000000000000006044820152606401610a11565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600183016020526040812080549161209f83615add565b91905055506120ae81896132e5565b5050505050505050565b600082815260fb60205260409020600101546120d381612ae0565b610c698383612d0b565b6000610b028383612aea565b81816000821161217b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f5472616e736665724c6f636b3a20616d6f756e74206d7573742062652067726560448201527f61746572207468616e207a65726f0000000000000000000000000000000000006064820152608401610a11565b42811161220a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f5472616e736665724c6f636b3a20646561646c696e65206d757374206265206960448201527f6e207468652066757475726500000000000000000000000000000000000000006064820152608401610a11565b6122143342612531565b8211156122a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f5472616e736665724c6f636b3a20616d6f756e742063616e6e6f74206578636560448201527f656420617661696c61626c652062616c616e63650000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff8516158015906122de575073ffffffffffffffffffffffffffffffffffffffff85163314155b612344576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5472616e736665724c6f636b3a20696e76616c696420726563697069656e74006044820152606401610a11565b61235085336001612846565b61235b3386866138e0565b6116d1858585613b67565b8181600082116123f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f5472616e736665724c6f636b3a20616d6f756e74206d7573742062652067726560448201527f61746572207468616e207a65726f0000000000000000000000000000000000006064820152608401610a11565b428111612487576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f5472616e736665724c6f636b3a20646561646c696e65206d757374206265206960448201527f6e207468652066757475726500000000000000000000000000000000000000006064820152608401610a11565b6124913342612531565b821115612520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f5472616e736665724c6f636b3a20616d6f756e742063616e6e6f74206578636560448201527f656420617661696c61626c652062616c616e63650000000000000000000000006064820152608401610a11565b61252b338585613b67565b50505050565b60008061253e8484612aea565b90508061254a85611848565b6125549190615bd6565b949350505050565b600061256781612ae0565b61016054610100900460ff16156125ff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f5472616e736665727261626c653a207472616e73666572732061726520656e6160448201527f626c6564000000000000000000000000000000000000000000000000000000006064820152608401610a11565b61016080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055611e1d3390565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5912562e000000000000000000000000000000000000000000000000000000001480610943575061094382613f9e565b6060610953613fa9565b73ffffffffffffffffffffffffffffffffffffffff8316612735576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff82166127d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff83811660009081527fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a81465391160209081526040808320938616835292905220547fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a8146539109060ff8381169116101561294f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f5472616e736665724c6f636b733a20696e73756666696369656e7420616c6c6f60448201527f77616e63650000000000000000000000000000000000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff841660009081526003820160205260408120805484929061298990849060ff16615be9565b82546101009290920a60ff81810219909316918316021790915573ffffffffffffffffffffffffffffffffffffffff868116600090815260018501602090815260408083209389168352929052908120805486945090926129ec91859116615be9565b92506101000a81548160ff021916908360ff16021790555050505050565b6000612a367f9c0b3a9882e11a6bfb8283b46d1e79513afb8024ee864cd3a5b3a9050c42a7d733610723565b80612a49575061016054610100900460ff165b612ad5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c65640000000000000000000000000000000000000000000000000000006064820152608401610a11565b610aff848484613fb8565b6111a48133613fd1565b73ffffffffffffffffffffffffffffffffffffffff821660009081527fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a81465391460205260408120547fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a81465391090829060ff165b73ffffffffffffffffffffffffffffffffffffffff8616600090815260058401602052604090205460ff168111612c0e5773ffffffffffffffffffffffffffffffffffffffff86166000908152602084815260408083208484529091529020600101548511612bfc5773ffffffffffffffffffffffffffffffffffffffff8616600090815260208481526040808320848452909152902054612bf99083615a82565b91505b80612c0681615add565b915050612b57565b50949350505050565b600082815260fb6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610a2557600082815260fb6020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055612cad3390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260fb6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610a2557600082815260fb6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b73ffffffffffffffffffffffffffffffffffffffff821660009081527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5160209081526040808320547fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5290925282207fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f9163ffffffff1690612e6890828661408b565b95945050505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015612ead5750600081115b15610c695773ffffffffffffffffffffffffffffffffffffffff831615612ef7576000612ed984613742565b90506000612ee78383615bd6565b9050612ef48583836141f9565b50505b73ffffffffffffffffffffffffffffffffffffffff821615610c69576000612f1e83613742565b90506000612f2c8383615a82565b90506116d18483836141f9565b73ffffffffffffffffffffffffffffffffffffffff81811660008181527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e6020819052604080832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000811690915590519194169283917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f908490a4505050565b612fe3614362565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b610a2582826143ce565b6111a43382614458565b600054610100900460ff16613103576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b565b600054610100900460ff1661319c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b6111a481614631565b600054610100900460ff1661323c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b610a258282614738565b600054610100900460ff166132dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b6131036147e8565b73ffffffffffffffffffffffffffffffffffffffff8116613388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f566f7465733a2064656c6567617465652063616e6e6f74206265207a65726f2060448201527f61646472657373000000000000000000000000000000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff82811660009081527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e6020526040902054166133d983836148a9565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152610c69908290849030906370a0823190602401602060405180830381865afa15801561344b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fae9190615a95565b73ffffffffffffffffffffffffffffffffffffffff831660009081527fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a81465391360209081526040808320547fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a814653912909252909120547fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a814653910916135119160ff9182169116615c02565b60ff168260ff6135219190615be9565b60ff1610156135b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f5472616e736665724c6f636b733a2063616e6e6f7420657863656564206d617860448201527f206163636f756e74206c6f636b7320616e6420616c6c6f77616e6365730000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600382016020526040812080548492906135ec90849060ff16615c02565b82546101009290920a60ff81810219909316918316021790915573ffffffffffffffffffffffffffffffffffffffff868116600090815260018501602090815260408083209389168352929052908120805486945090926129ec91859116615c02565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260336020526040812054610943565b613685823383614a0e565b610a258282614458565b613697614adf565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861302e3390565b7fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f80546000919063ffffffff166125547fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece50828661408b565b73ffffffffffffffffffffffffffffffffffffffff811660009081527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5160209081526040808320547fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5290925282207fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f9163ffffffff16906125549082614b4c565b600061380f7f9c0b3a9882e11a6bfb8283b46d1e79513afb8024ee864cd3a5b3a9050c42a7d733610723565b80613822575061016054610100900460ff165b6138ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c65640000000000000000000000000000000000000000000000000000006064820152608401610a11565b610b028383614b91565b60008060006138c987878787614b9f565b915091506138d681614c8e565b5095945050505050565b73ffffffffffffffffffffffffffffffffffffffff8316613983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff8216613a26576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610a11565b613a31838383614e41565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604090205481811015613ae7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff80851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90613b549086815260200190565b60405180910390a361252b848484614e4c565b7fde59cf009759767a48aa56366ad77af93d2a112ef08516a1a2a182a8146539105b73ffffffffffffffffffffffffffffffffffffffff8416600090815260028201602052604090205460ff1615801590613bfe575073ffffffffffffffffffffffffffffffffffffffff84166000908152602082815260408083206004850183528184205460ff16845290915290206001015442115b15613ce55773ffffffffffffffffffffffffffffffffffffffff841660008181526020838152604080832060048601808452828520805460ff908116875292855292852085815560018181018790556002820187905560039091018690559585529092528054909291613c7391859116615c02565b82546101009290920a60ff81810219909316918316021790915573ffffffffffffffffffffffffffffffffffffffff8616600090815260028401602052604081208054600194509092613cc891859116615be9565b92506101000a81548160ff021916908360ff160217905550613b89565b73ffffffffffffffffffffffffffffffffffffffff841660009081526003820160209081526040808320546002850190925290912054613d2b9160ff9081169116615c02565b60ff16600160ff613d3c9190615be9565b60ff161015613dcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f5472616e736665724c6f636b733a2063616e6e6f7420657863656564206d617860448201527f206163636f756e74206c6f636b7320616e6420616c6c6f77616e6365730000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff841660008181526002808401602090815260408084205481516080810183528981528084018981528184018781526060830188815298885289865284882060ff9094168089529390955292862090518155915160018301559151928101929092559251600390910155819003613ebb5773ffffffffffffffffffffffffffffffffffffffff85166000908152600483016020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009081169091556005860190925290912080549091169055613f44565b73ffffffffffffffffffffffffffffffffffffffff851660008181526005840160208181526040808420805488845282862060ff89811680895282875285892093821660039094019390935583541687528452918520600201829055949093525281547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00161790555b73ffffffffffffffffffffffffffffffffffffffff851660009081526002830160205260408120805460019290613f7f90849060ff16615c02565b92506101000a81548160ff021916908360ff1602179055505050505050565b600061094382614e57565b606060368054611adf90615b83565b600033613fc6858285614a0e565b611c3e8585856138e0565b600082815260fb6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610a255761401181614eee565b61401c836020614f0d565b60405160200161402d929190615c1b565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610a1191600401615585565b60008263ffffffff166000036140a357506000610b02565b818460006140b2600187615c9c565b63ffffffff16815260208101919091526040016000205411614101578360006140dc600186615c9c565b63ffffffff1663ffffffff168152602001908152602001600020600101549050610b02565b60008080526020859052604090205482101561411f57506000610b02565b60008061412d600186615c9c565b90505b8163ffffffff168163ffffffff1611156141d757600060026141528484615c9c565b61415c9190615cc0565b6141669083615c9c565b63ffffffff8116600090815260208981526040918290208251808401909352805480845260019091015491830191909152919250908690036141b157602001519350610b0292505050565b80518611156141c2578193506141d0565b6141cd600183615c9c565b92505b5050614130565b5063ffffffff1660009081526020859052604090206001015490509392505050565b73ffffffffffffffffffffffffffffffffffffffff831660008181527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece516020908152604080832054815180830183524281528084018781529585527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece52845282852063ffffffff9092168086529190935292209051815591516001928301557fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f916142c4908290615d0a565b73ffffffffffffffffffffffffffffffffffffffff8616600081815260028501602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff9590951694909417909355805187815292830186905290917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a25050505050565b60975460ff16613103576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610a11565b61012d54816143dc60355490565b6143e69190615a82565b111561444e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f45524332304361707065643a20636170206578636565646564000000000000006044820152606401610a11565b610a258282615150565b73ffffffffffffffffffffffffffffffffffffffff82166144fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610a11565b61450782600083614e41565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260336020526040902054818110156145bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610c6983600084614e4c565b600054610100900460ff166146c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b60008111614732576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f45524332304361707065643a20636170206973203000000000000000000000006044820152606401610a11565b61012d55565b600054610100900460ff166147cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b60366147db8382615d75565b506037610c698282615d75565b600054610100900460ff1661487f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b73ffffffffffffffffffffffffffffffffffffffff82811660009081527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e60208190526040909120549091908116908316819003614989576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f44656c65676174653a20616c72656164792064656c65676174656420746f207460448201527f6869732064656c656761746565000000000000000000000000000000000000006064820152608401610a11565b73ffffffffffffffffffffffffffffffffffffffff84811660008181526020859052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688861690811790915590519093851692917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f91a450505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152603460209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461252b5781811015614ad2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610a11565b61252b8484848403612693565b60975460ff1615613103576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610a11565b600063ffffffff821615614b88576000614b67600184615c9c565b63ffffffff1660009081526020859052604090206001015491506109439050565b50600092915050565b6000336109668185856138e0565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115614bd65750600090506003614c85565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614c2a573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116614c7e57600060019250925050614c85565b9150600090505b94509492505050565b6000816004811115614ca257614ca2615e8f565b03614caa5750565b6001816004811115614cbe57614cbe615e8f565b03614d25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610a11565b6002816004811115614d3957614d39615e8f565b03614da0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a11565b6003816004811115614db457614db4615e8f565b036111a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610a11565b610c69838383615259565b610c69838383615331565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061094357507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610943565b606061094373ffffffffffffffffffffffffffffffffffffffff831660145b60606000614f1c836002615ebe565b614f27906002615a82565b67ffffffffffffffff811115614f3f57614f3f6157e6565b6040519080825280601f01601f191660200182016040528015614f69576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110614fa057614fa0615aae565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061500357615003615aae565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600061503f846002615ebe565b61504a906001615a82565b90505b60018111156150e7577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061508b5761508b615aae565b1a60f81b8282815181106150a1576150a1615aae565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936150e081615efb565b905061504d565b508315610b02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a11565b73ffffffffffffffffffffffffffffffffffffffff82166151cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610a11565b6151d960008383614e41565b80603560008282546151eb9190615a82565b909155505073ffffffffffffffffffffffffffffffffffffffff82166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610a2560008383614e4c565b600061526484610c38565b905060008111801561527e57508161527b85611848565b10155b1561532657808261528e86611848565b6152989190615bd6565b1015615326576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f5472616e736665724c6f636b3a2074686973206578636565647320796f75722060448201527f756e6c6f636b65642062616c616e6365000000000000000000000000000000006064820152608401610a11565b61252b84848461533c565b610c69838383615344565b610c69614adf565b73ffffffffffffffffffffffffffffffffffffffff831661537a5761537a8161536b615409565b6153759190615a82565b615467565b73ffffffffffffffffffffffffffffffffffffffff82166153ab576153ab816153a1615409565b6153759190615bd6565b73ffffffffffffffffffffffffffffffffffffffff83811660009081527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e6020526040808220548584168352912054610c6992918216911683612e71565b7fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f80546000919063ffffffff166154607fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5082614b4c565b9250505090565b7fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f8054604080518082018252428152602080820186815263ffffffff90941660008181527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece50909252929020905181559151600192830155906154ea908290615d0a565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff91909116179091555050565b60006020828403121561553157600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610b0257600080fd5b60005b8381101561557c578181015183820152602001615564565b50506000910152565b60208152600082518060208401526155a4816040850160208701615561565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b803573ffffffffffffffffffffffffffffffffffffffff811681146155fa57600080fd5b919050565b6000806040838503121561561257600080fd5b61561b836155d6565b946020939093013593505050565b803560ff811681146155fa57600080fd5b6000806040838503121561564d57600080fd5b615656836155d6565b915061566460208401615629565b90509250929050565b60008060006060848603121561568257600080fd5b61568b846155d6565b9250615699602085016155d6565b9150604084013590509250925092565b6000602082840312156156bb57600080fd5b5035919050565b6000602082840312156156d457600080fd5b610b02826155d6565b600080604083850312156156f057600080fd5b82359150615664602084016155d6565b60008083601f84011261571257600080fd5b50813567ffffffffffffffff81111561572a57600080fd5b6020830191508360208260051b850101111561574557600080fd5b9250929050565b6000806000806000806060878903121561576557600080fd5b863567ffffffffffffffff8082111561577d57600080fd5b6157898a838b01615700565b909850965060208901359150808211156157a257600080fd5b6157ae8a838b01615700565b909650945060408901359150808211156157c757600080fd5b506157d489828a01615700565b979a9699509497509295939492505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561585c5761585c6157e6565b604052919050565b600067ffffffffffffffff82111561587e5761587e6157e6565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f8301126158bb57600080fd5b81356158ce6158c982615864565b615815565b8181528460208386010111156158e357600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561591657600080fd5b61591f856155d6565b9350602085013567ffffffffffffffff8082111561593c57600080fd5b615948888389016158aa565b9450604087013591508082111561595e57600080fd5b5061596b878288016158aa565b949793965093946060013593505050565b6000806040838503121561598f57600080fd5b615998836155d6565b9150615664602084016155d6565b60008060008060008060c087890312156159bf57600080fd5b6159c8876155d6565b955060208701359450604087013593506159e460608801615629565b92506080870135915060a087013590509295509295509295565b600080600060608486031215615a1357600080fd5b615a1c846155d6565b95602085013595506040909401359392505050565b60008060408385031215615a4457600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561094357610943615a53565b600060208284031215615aa757600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203615b0e57615b0e615a53565b5060010190565b600060208284031215615b2757600080fd5b815167ffffffffffffffff811115615b3e57600080fd5b8201601f81018413615b4f57600080fd5b8051615b5d6158c982615864565b818152856020838501011115615b7257600080fd5b612e68826020830160208601615561565b600181811c90821680615b9757607f821691505b602082108103615bd0577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b8181038181111561094357610943615a53565b60ff828116828216039081111561094357610943615a53565b60ff818116838216019081111561094357610943615a53565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615c53816017850160208801615561565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351615c90816028840160208801615561565b01602801949350505050565b63ffffffff828116828216039080821115615cb957615cb9615a53565b5092915050565b600063ffffffff80841680615cfe577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b92169190910492915050565b63ffffffff818116838216019080821115615cb957615cb9615a53565b601f821115610c6957600081815260208120601f850160051c81016020861015615d4e5750805b601f850160051c820191505b81811015615d6d57828155600101615d5a565b505050505050565b815167ffffffffffffffff811115615d8f57615d8f6157e6565b615da381615d9d8454615b83565b84615d27565b602080601f831160018114615df65760008415615dc05750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555615d6d565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015615e4357888601518255948401946001909101908401615e24565b5085821015615e7f57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615615ef657615ef6615a53565b500290565b600081615f0a57615f0a615a53565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea2646970667358221220e588fd7820dac465b0909fb87619d5bd74cb15d8c4677f2412cc8c1770ac13d764736f6c63430008100033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.