ETH Price: $3,435.71 (-0.35%)

Contract

0x4f89214A1EeC1171772C2FBB71019DA9A24Ff61A

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
0x60806040721788412023-02-04 1:28:55531 days ago1675474135IN
 Create: OrigamiMembershipToken
0 ETH0.0060216492210.001

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
1075561982023-07-30 9:59:33354 days ago1690711173
0x4f89214A...9A24Ff61A
0 ETH
1075545832023-07-30 9:05:43354 days ago1690707943
0x4f89214A...9A24Ff61A
0 ETH
1075542222023-07-30 8:53:41354 days ago1690707221
0x4f89214A...9A24Ff61A
0 ETH
1075538132023-07-30 8:40:03354 days ago1690706403
0x4f89214A...9A24Ff61A
0 ETH
1075536842023-07-30 8:35:45354 days ago1690706145
0x4f89214A...9A24Ff61A
0 ETH
1075536002023-07-30 8:32:57354 days ago1690705977
0x4f89214A...9A24Ff61A
0 ETH
1075488482023-07-30 5:54:33355 days ago1690696473
0x4f89214A...9A24Ff61A
0 ETH
1075122972023-07-29 9:36:11355 days ago1690623371
0x4f89214A...9A24Ff61A
0 ETH
1075101942023-07-29 8:26:05355 days ago1690619165
0x4f89214A...9A24Ff61A
0 ETH
1074285472023-07-27 11:04:31357 days ago1690455871
0x4f89214A...9A24Ff61A
0 ETH
1073440382023-07-25 12:07:33359 days ago1690286853
0x4f89214A...9A24Ff61A
0 ETH
1072949142023-07-24 8:50:05360 days ago1690188605
0x4f89214A...9A24Ff61A
0 ETH
1072289112023-07-22 20:09:59362 days ago1690056599
0x4f89214A...9A24Ff61A
0 ETH
1071648462023-07-21 8:34:29363 days ago1689928469
0x4f89214A...9A24Ff61A
0 ETH
1071442902023-07-20 21:09:17364 days ago1689887357
0x4f89214A...9A24Ff61A
0 ETH
1071188992023-07-20 7:02:55364 days ago1689836575
0x4f89214A...9A24Ff61A
0 ETH
1070934752023-07-19 16:55:27365 days ago1689785727
0x4f89214A...9A24Ff61A
0 ETH
1070852572023-07-19 12:21:31365 days ago1689769291
0x4f89214A...9A24Ff61A
0 ETH
1070516372023-07-18 17:40:51366 days ago1689702051
0x4f89214A...9A24Ff61A
0 ETH
1069453112023-07-16 6:36:39369 days ago1689489399
0x4f89214A...9A24Ff61A
0 ETH
1068938492023-07-15 2:01:15370 days ago1689386475
0x4f89214A...9A24Ff61A
0 ETH
1068913762023-07-15 0:38:49370 days ago1689381529
0x4f89214A...9A24Ff61A
0 ETH
1068513012023-07-14 2:22:59371 days ago1689301379
0x4f89214A...9A24Ff61A
0 ETH
1067965322023-07-12 19:57:21372 days ago1689191841
0x4f89214A...9A24Ff61A
0 ETH
1067773852023-07-12 9:19:07372 days ago1689153547
0x4f89214A...9A24Ff61A
0 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OrigamiMembershipToken

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 17500 runs

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

import "src/utils/Votes.sol";

import "@oz-upgradeable/access/AccessControlUpgradeable.sol";
import "@oz-upgradeable/proxy/utils/Initializable.sol";
import "@oz-upgradeable/security/PausableUpgradeable.sol";
import "@oz-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@oz-upgradeable/token/ERC721/extensions/ERC721BurnableUpgradeable.sol";
import "@oz-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol";
import "@oz-upgradeable/utils/CountersUpgradeable.sol";

/// @title Origami Membership Token
/// @author Stephen Caudill
/// @notice This contract is a configurable NFT used to represent membership in a DAO supported by the Origami platform and ecosystem.
/// @custom:security-contact [email protected]
contract OrigamiMembershipToken is
    Initializable,
    ERC721Upgradeable,
    ERC721EnumerableUpgradeable,
    PausableUpgradeable,
    AccessControlUpgradeable,
    ERC721BurnableUpgradeable,
    Votes
{
    using CountersUpgradeable for CountersUpgradeable.Counter;

    /// @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 membership 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 revoke membership tokens. By default, this role is granted to the contract admin.
    bytes32 public constant REVOKER_ROLE = keccak256("REVOKER_ROLE");

    CountersUpgradeable.Counter private _tokenIdCounter;
    // @notice: timestamp is purely informative and may vary by up to 900 seconds from actual time of execution
    mapping(uint256 => uint256) public tokenIdToBlockTimestamp;

    /// @notice this sets the base URI of the token's URI and is used to generate the token's URI. This is set during initialization or by calling setBaseURI.
    string public _metadataBaseURI;
    /// @notice this private variable denotes whether or not the contract allows token transfers. By default, this is disabled.
    bool private _transferEnabled;

    /// @notice this event is fired when a new token is minted. Origami's platform uses this event to determine which tokenId was minted to a particular member's wallet.
    event Mint(address indexed _to, uint256 indexed _tokenId);
    /// @notice monitoring: this is fired when the baseURI is changed.
    event BaseURIChanged(address indexed caller, string value);
    /// @notice monitoring: this is fired when the transferEnabled state is changed.
    event TransferEnabled(address indexed caller, bool value);
    /// @notice monitoring: this is fired when a token is revoked.
    event TokenRevoked(address indexed caller, address indexed tokenOwner, uint256 indexed tokenId);
    /// @notice monitoring: this is fired when the paused state is changed.
    event Paused(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();
    }

    /// @dev this function is used to initialize the contract. It is called during contract deployment.
    /// @notice this function is not intended to be called by external users.
    /// @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 _name the name of the token. Typically this is the name of the DAO.
    /// @param _symbol the symbol of the token. Typically this is a short abbreviation of the DAO's name.
    /// @param baseURI_ the base URI of the token. This is used to generate the token's URI.
    function initialize(address _admin, string memory _name, string memory _symbol, string memory baseURI_)
        public
        initializer
    {
        require(_admin != address(0x0), "Admin address cannot be zero");

        __ERC721_init(_name, _symbol);
        __ERC721Enumerable_init();
        __Pausable_init();
        __AccessControl_init();
        __ERC721Burnable_init();

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

        _metadataBaseURI = baseURI_;
        _transferEnabled = false;
    }

    /// @dev this overrides the ERC721Upgradeable's function to return our internal base URI variable. It is called by `super.tokenURI`.
    function _baseURI() internal view override returns (string memory) {
        return _metadataBaseURI;
    }

    function name() public view virtual override(ERC721Upgradeable, IVotesToken) returns (string memory) {
        return super.name();
    }

    function version() public pure returns (string memory) {
        return "1.0.0";
    }

    function balanceOf(address owner)
        public
        view
        override(ERC721Upgradeable, IERC721Upgradeable, IVotesToken)
        returns (uint256)
    {
        return super.balanceOf(owner);
    }

    /// @dev this is only callable by the contract admin.
    /// @notice this allows setting the base URI of the token. This is used to generate the token's URI. An event is fired when the base URI is changed.
    /// @param baseURI_ the new value for the base URI of the token. Typically this is either a string representation of JSON metadata or a URI.
    function setBaseURI(string memory baseURI_) public onlyRole(DEFAULT_ADMIN_ROLE) {
        emit BaseURIChanged(_msgSender(), baseURI_);
        _metadataBaseURI = baseURI_;
    }

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

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

    /// @dev this is only callable by an address that has the MINTER_ROLE. The Origami platform airdrops membership tokens to members' wallets.
    /// @notice this function mints a new membership token to the recipient's wallet. An event is fired when the token is minted. Only one token may be minted to any given wallet.
    /// @param to the address of the recipient's wallet.
    function safeMint(address to) public onlyRole(MINTER_ROLE) {
        _tokenIdCounter.increment();
        uint256 tokenId = _tokenIdCounter.current();
        _safeMint(to, tokenId);
        tokenIdToBlockTimestamp[tokenId] = block.timestamp;
        emit Mint(to, tokenId);
    }

    /**
     * @dev this is only callable by an address that has the MINTER_ROLE. The Origami platform airdrops membership tokens to members' wallets. A best effort is made to check the addreses and avoid attempting mints that would fail.
     * @notice this function mints membership tokens to all wallets in the recipients array.
     * @param recipients - an array of addresses to mint tokens to.
     */
    function safeBatchMint(address[] calldata recipients) public onlyRole(MINTER_ROLE) {
        require(recipients.length > 0, "Must mint at least one token");
        require(recipients.length <= 100, "Cannot mint more than 100 tokens at once");
        for (uint256 i = 0; i < recipients.length; i++) {
            if (recipients[i] != address(0) && balanceOf(recipients[i]) == 0) {
                safeMint(recipients[i]);
            }
        }
    }

    /// @dev this is only callable by an address that has the REVOKER_ROLE. Membership in a DAO may be revoked by the DAO.
    /// @notice this function revokes a membership token from the recipient's wallet. An event is fired when the token is revoked.
    /// @param from the address of the owner's wallet to revoke the token from.
    function revoke(address from) public onlyRole(REVOKER_ROLE) {
        require(balanceOf(from) == 1, "Revoke: cannot revoke");
        uint256 tokenId = tokenOfOwnerByIndex(from, 0);
        _burn(tokenId);
        emit TokenRevoked(_msgSender(), from, tokenId);
    }

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

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

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

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

    /// @dev this is overridden so we can apply the `whenTransferrable` modifier
    /// @notice this allows transfers when the transferrable state is enabled.
    function safeTransferFrom(address from, address to, uint256 tokenId)
        public
        virtual
        override(ERC721Upgradeable, IERC721Upgradeable)
        whenTransferrable
    {
        super.safeTransferFrom(from, to, tokenId);
    }

    /// @dev this is overridden so we can apply the `whenTransferrable` modifier
    /// @notice this allows transfers when the transferrable state is enabled.
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data)
        public
        virtual
        override(ERC721Upgradeable, IERC721Upgradeable)
        whenTransferrable
    {
        super.safeTransferFrom(from, to, tokenId, _data);
    }

    /// @dev this is overridden so we can apply the `limitBalance` and `whenNotPaused` modifiers
    function _beforeTokenTransfer(address from, address to, uint256 tokenId, uint256 batchSize)
        internal
        override(ERC721Upgradeable, ERC721EnumerableUpgradeable)
        limitBalance(to)
        whenNotPaused
    {
        super._beforeTokenTransfer(from, to, tokenId, batchSize);
    }

    // The following functions are overrides required by Solidity.

    function _afterTokenTransfer(address from, address to, uint256 tokenId, uint256 batchSize)
        internal
        override(ERC721Upgradeable)
    {
        Checkpoints.transferVotingUnits(from, to, batchSize);
        super._afterTokenTransfer(from, to, tokenId, batchSize);
    }

    /// @inheritdoc ERC721Upgradeable
    function tokenURI(uint256 tokenId) public view override(ERC721Upgradeable) returns (string memory) {
        require(tokenId > 0, "Invalid token ID");
        require(tokenId <= _tokenIdCounter.current(), "Invalid token ID");
        return super.tokenURI(tokenId);
    }

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

    /// @notice this modifier allows us to ensure that no more than one token is minted to a given wallet.
    modifier limitBalance(address recipient) {
        // allow unlimited transfers to the burn address
        require(recipient == address(0) || balanceOf(recipient) == 0, "Holders may only have one token");
        _;
    }

    /// @notice this modifier allows us to ensure that something may only occur when transfers are disabled
    modifier whenNontransferrable() {
        require(!transferrable(), "Transferrable: transfers are enabled");
        _;
    }

    /// @notice this modifier allows us to ensure that something may only occur when the transfers are enabled
    modifier whenTransferrable() {
        require(transferrable(), "Transferrable: transfers are disabled");
        _;
    }
}

File 2 of 25 : 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 3 of 25 : 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 4 of 25 : 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 5 of 25 : 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 6 of 25 : 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 7 of 25 : 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 8 of 25 : 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 9 of 25 : ERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721Upgradeable.sol";
import "./IERC721ReceiverUpgradeable.sol";
import "./extensions/IERC721MetadataUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/StringsUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
    using AddressUpgradeable for address;
    using StringsUpgradeable for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {
        __ERC721_init_unchained(name_, symbol_);
    }

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

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: address zero is not a valid owner");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        require(owner != address(0), "ERC721: invalid token ID");
        return owner;
    }

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

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

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

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721Upgradeable.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
        _safeTransfer(from, to, tokenId, data);
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
    }

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

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _ownerOf(tokenId) != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        address owner = ERC721Upgradeable.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

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

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        require(!_exists(tokenId), "ERC721: token already minted");

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

        _owners[tokenId] = to;

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

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

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

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

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

        // Clear approvals
        delete _tokenApprovals[tokenId];

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

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

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

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");

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

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

        emit Transfer(from, to, tokenId);

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

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

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                return retval == IERC721ReceiverUpgradeable.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

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

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

    /**
     * @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[44] private __gap;
}

File 10 of 25 : IERC721ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721ReceiverUpgradeable {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 11 of 25 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 12 of 25 : ERC721BurnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Burnable.sol)

pragma solidity ^0.8.0;

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

/**
 * @title ERC721 Burnable Token
 * @dev ERC721 Token that can be burned (destroyed).
 */
abstract contract ERC721BurnableUpgradeable is Initializable, ContextUpgradeable, ERC721Upgradeable {
    function __ERC721Burnable_init() internal onlyInitializing {
    }

    function __ERC721Burnable_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev Burns `tokenId`. See {ERC721-_burn}.
     *
     * Requirements:
     *
     * - The caller must own `tokenId` or be an approved operator.
     */
    function burn(uint256 tokenId) public virtual {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
        _burn(tokenId);
    }

    /**
     * @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 25 : ERC721EnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../ERC721Upgradeable.sol";
import "./IERC721EnumerableUpgradeable.sol";
import "../../../proxy/utils/Initializable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721EnumerableUpgradeable {
    function __ERC721Enumerable_init() internal onlyInitializing {
    }

    function __ERC721Enumerable_init_unchained() internal onlyInitializing {
    }
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

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

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Upgradeable.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

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

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721EnumerableUpgradeable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @dev See {ERC721-_beforeTokenTransfer}.
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual override {
        super._beforeTokenTransfer(from, to, firstTokenId, batchSize);

        if (batchSize > 1) {
            // Will only trigger during construction. Batch transferring (minting) is not available afterwards.
            revert("ERC721Enumerable: consecutive transfers not supported");
        }

        uint256 tokenId = firstTokenId;

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721Upgradeable.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721Upgradeable.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }

    /**
     * @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[46] private __gap;
}

File 14 of 25 : IERC721EnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721EnumerableUpgradeable is IERC721Upgradeable {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

File 15 of 25 : IERC721MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721MetadataUpgradeable is IERC721Upgradeable {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 16 of 25 : 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 17 of 25 : 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 18 of 25 : CountersUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

File 19 of 25 : 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 20 of 25 : 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 21 of 25 : 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 22 of 25 : 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 23 of 25 : IVotes.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (governance/utils/IVotes.sol)
pragma solidity 0.8.16;

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

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

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

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

    /**
     * @dev Returns the total supply of votes available at the end of a past block's 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);

    /**
     * @dev Returns the delegate that `account` has chosen.
     */
    function delegates(address account) external view returns (address);

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

    /**
     * @dev Delegates votes from signer to `delegatee`.
     */
    function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;
}

File 24 of 25 : 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
 * 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 delegate.
     */
    event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);

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

    struct Checkpoint {
        uint256 timestamp;
        uint256 votes;
    }

    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;
    }

    struct DelegateStorage {
        mapping(address => address) delegates;
        mapping(address => uint256) nonces;
    }

    function checkpointStorage() internal pure returns (CheckpointStorage storage cs) {
        bytes32 position = CHECKPOINT_STORAGE_POSITION;
        //solhint-disable-next-line no-inline-assembly
        assembly {
            cs.slot := position
        }
    }

    function getWeight(mapping(uint32 => Checkpoint) storage checkpoints, uint32 count)
        internal
        view
        returns (uint256 weight)
    {
        if (count > 0) {
            weight = checkpoints[count - 1].votes;
        } else {
            weight = 0;
        }
    }

    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;
    }

    function getVotes(address account) internal view returns (uint256 votes) {
        CheckpointStorage storage cs = checkpointStorage();
        uint32 count = cs.voterCheckpointsCount[account];
        return getWeight(cs.voterCheckpoints[account], count);
    }

    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);
    }

    function getTotalSupply() internal view returns (uint256 supply) {
        CheckpointStorage storage cs = checkpointStorage();
        uint32 count = cs.supplyCheckpointsCount;
        return getWeight(cs.supplyCheckpoints, count);
    }

    function getPastTotalSupply(uint256 timestamp) internal view returns (uint256 supply) {
        CheckpointStorage storage cs = checkpointStorage();
        uint32 count = cs.supplyCheckpointsCount;
        return getPastWeight(cs.supplyCheckpoints, count, timestamp);
    }

    function delegateStorage() internal pure returns (DelegateStorage storage ds) {
        bytes32 position = DELEGATE_STORAGE_POSITION;
        //solhint-disable-next-line no-inline-assembly
        assembly {
            ds.slot := position
        }
    }

    function delegates(address account) internal view returns (address) {
        DelegateStorage storage ds = delegateStorage();
        return ds.delegates[account];
    }

    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);
    }

    function writeSupplyCheckpoint(uint256 newSupply) internal {
        CheckpointStorage storage cs = checkpointStorage();
        uint32 checkpointCount = cs.supplyCheckpointsCount;
        cs.supplyCheckpoints[checkpointCount] = Checkpoint(block.timestamp, newSupply);
        cs.supplyCheckpointsCount = checkpointCount + 1;
    }

    function moveDelegation(address oldDelegate, address newDelegate, uint256 amount) internal {
        if (oldDelegate != newDelegate && amount > 0) {
            if (oldDelegate != address(0)) {
                // decrease old delegate
                uint256 oldVotes = getVotes(oldDelegate);
                uint256 newVotes = oldVotes - amount;
                writeCheckpoint(oldDelegate, oldVotes, newVotes);
            }

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

    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);
    }

    function delegate(address delegator, address delegatee) internal {
        DelegateStorage storage ds = delegateStorage();
        address currentDelegate = ds.delegates[delegator];
        ds.delegates[delegator] = delegatee;
        emit DelegateChanged(delegator, currentDelegate, delegatee);
    }
}

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

import "src/utils/Checkpoints.sol";
import "src/interfaces/IVotes.sol";

import "@oz/utils/cryptography/ECDSA.sol";

interface IVotesToken {
    function balanceOf(address owner) external view returns (uint256 balance);
    function name() external view returns (string memory);
    function version() external pure returns (string memory);
}

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)");

    // Implement the IVotes interface

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

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

    function getPastTotalSupply(uint256 timestamp) external view returns (uint256) {
        return Checkpoints.getPastTotalSupply(timestamp);
    }

    function delegates(address delegator) external view returns (address) {
        return Checkpoints.delegates(delegator);
    }

    function delegate(address delegatee) external {
        address oldDelegate = Checkpoints.delegates(msg.sender);
        Checkpoints.delegate(msg.sender, delegatee);
        Checkpoints.moveDelegation(oldDelegate, delegatee, IVotesToken(this).balanceOf(msg.sender));
    }

    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)
            )
        );
    }

    function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external {
        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]++;
        Checkpoints.delegate(delegator, delegatee);
    }
}

Settings
{
  "remappings": [
    "@diamond/=lib/diamond-2-hardhat/contracts/",
    "@oz-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@oz/=lib/openzeppelin-contracts/contracts/",
    "@std/=lib/forge-std/src/",
    "diamond-2-hardhat/=lib/diamond-2-hardhat/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "src/=src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 17500
  },
  "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":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"string","name":"value","type":"string"}],"name":"BaseURIChanged","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":"delegate","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":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"bool","name":"value","type":"bool"}],"name":"Paused","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":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"tokenOwner","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"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":"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":"REVOKER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_metadataBaseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"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":"disableTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"domainSeparatorV4","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"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":"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":"_admin","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"baseURI_","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"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":"address","name":"from","type":"address"}],"name":"revoke","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":"address[]","name":"recipients","type":"address[]"}],"name":"safeBatchMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"safeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToBlockTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"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"}]

60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b614bc280620000f46000396000f3fe608060405234801561001057600080fd5b506004361061032b5760003560e01c80635c975abb116101b25780639ab24eb0116100f9578063c87b56dd116100a2578063e63ab1e91161007c578063e63ab1e914610701578063e7a324dc14610728578063e985e9c51461074f578063f1b50c1d1461078b57600080fd5b8063c87b56dd146106b4578063d5391393146106c7578063d547741f146106ee57600080fd5b8063b187984f116100d3578063b187984f14610686578063b88d4fde1461068e578063c3cda520146106a157600080fd5b80639ab24eb014610658578063a217fddf1461066b578063a22cb4651461067357600080fd5b806378e890ba1161015b5780638e539e8c116101355780638e539e8c1461060457806391d148541461061757806395d89b411461065057600080fd5b806378e890ba146105cd5780637c4acabf146105d55780638456cb59146105fc57600080fd5b8063681db87c1161018c578063681db87c1461059457806370a08231146105a757806374a8f103146105ba57600080fd5b80635c975abb146105635780635f1e6f6d1461056e5780636352211e1461058157600080fd5b8063357f931a1161027657806342966c681161021f57806355f804b3116101f957806355f804b31461052a578063587cde1e1461053d5780635c19a95c1461055057600080fd5b806342966c68146104cb5780634f6ccce7146104de57806354fd4d50146104f157600080fd5b80633f4ba83a116102505780633f4ba83a1461049d57806340d097c3146104a557806342842e0e146104b857600080fd5b8063357f931a1461045657806336568abe146104775780633a46b1a81461048a57600080fd5b806323b872dd116102d857806328b8692a116102b257806328b8692a146104285780632f2ff15d146104305780632f745c591461044357600080fd5b806323b872dd146103cb578063248a9ca3146103de578063253d2c7d1461040157600080fd5b8063081812fc11610309578063081812fc14610379578063095ea7b3146103a457806318160ddd146103b957600080fd5b806301ffc9a714610330578063047a7ef11461035857806306fdde0314610364575b600080fd5b61034361033e366004614187565b610793565b60405190151581526020015b60405180910390f35b6101625460ff16610343565b61036c6107ef565b60405161034f91906141f4565b61038c610387366004614207565b6107fe565b6040516001600160a01b03909116815260200161034f565b6103b76103b236600461423c565b610825565b005b6099545b60405190815260200161034f565b6103b76103d9366004614266565b61095b565b6103bd6103ec366004614207565b600090815260fb602052604090206001015490565b6103bd7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b61036c6109df565b6103b761043e3660046142a2565b610a6e565b6103bd61045136600461423c565b610a93565b6103bd610464366004614207565b6101606020526000908152604090205481565b6103b76104853660046142a2565b610b3b565b6103bd61049836600461423c565b610bc7565b6103b7610bda565b6103b76104b33660046142ce565b610c46565b6103b76104c6366004614266565b610ce1565b6103b76104d9366004614207565b610d65565b6103bd6104ec366004614207565b610dee565b60408051808201909152600581527f312e302e30000000000000000000000000000000000000000000000000000000602082015261036c565b6103b76105383660046143cf565b610e92565b61038c61054b3660046142ce565b610eeb565b6103b761055e3660046142ce565b610f2c565b60c95460ff16610343565b6103b761057c366004614404565b610ff4565b61038c61058f366004614207565b61126c565b6103b76105a236600461449d565b6112d1565b6103bd6105b53660046142ce565b611478565b6103b76105c83660046142ce565b611483565b6103bd61155a565b6103bd7fce3f34913921da558f105cefb578d87278debbbd073a8d552b5de0d168deee3081565b6103b761169c565b6103bd610612366004614207565b611701565b6103436106253660046142a2565b600091825260fb602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61036c61170c565b6103bd6106663660046142ce565b61179e565b6103bd600081565b6103b7610681366004614512565b6117a9565b6103b76117b4565b6103b761069c36600461454e565b61188c565b6103b76106af3660046145be565b611911565b61036c6106c2366004614207565b611af8565b6103bd7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6103b76106fc3660046142a2565b611ba6565b6103bd7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6103bd7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b61034361075d36600461461e565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b6103b7611bcb565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fe90fb3f60000000000000000000000000000000000000000000000000000000014806107e957506107e982611c64565b92915050565b60606107f9611cba565b905090565b600061080982611cc9565b506000908152606960205260409020546001600160a01b031690565b60006108308261126c565b9050806001600160a01b0316836001600160a01b0316036108be5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b336001600160a01b03821614806108da57506108da813361075d565b61094c5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016108b5565b6109568383611d2d565b505050565b6101625460ff166109d45760405162461bcd60e51b815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c656400000000000000000000000000000000000000000000000000000060648201526084016108b5565b610956838383611db3565b61016180546109ed90614648565b80601f0160208091040260200160405190810160405280929190818152602001828054610a1990614648565b8015610a665780601f10610a3b57610100808354040283529160200191610a66565b820191906000526020600020905b815481529060010190602001808311610a4957829003601f168201915b505050505081565b600082815260fb6020526040902060010154610a8981611e39565b6109568383611e43565b6000610a9e83611ee5565b8210610b125760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e647300000000000000000000000000000000000000000060648201526084016108b5565b506001600160a01b03919091166000908152609760209081526040808320938352929052205490565b6001600160a01b0381163314610bb95760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084016108b5565b610bc38282611f7f565b5050565b6000610bd38383612002565b9392505050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610c0481611e39565b610c0c6120a0565b6040516000815233907fe8699cf681560fd07de85543bd994263f4557bdc5179dd702f256d15fd083e1d906020015b60405180910390a250565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610c7081611e39565b610c7f61015f80546001019055565b6000610c8b61015f5490565b9050610c9783826120f2565b600081815261016060205260408082204290555182916001600160a01b038616917f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859190a3505050565b6101625460ff16610d5a5760405162461bcd60e51b815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c656400000000000000000000000000000000000000000000000000000060648201526084016108b5565b61095683838361210c565b610d70335b82612127565b610de25760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f7665640000000000000000000000000000000000000060648201526084016108b5565b610deb816121a6565b50565b6000610df960995490565b8210610e6d5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e6473000000000000000000000000000000000000000060648201526084016108b5565b60998281548110610e8057610e8061469b565b90600052602060002001549050919050565b6000610e9d81611e39565b336001600160a01b03167f165934242147f3edfff841cdc7eaf9c061b07a451d00ad31e6ad1a4dc1c9402a83604051610ed691906141f4565b60405180910390a26101616109568382614718565b6001600160a01b0380821660009081527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e60205260408120549091166107e9565b3360008181527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e60205260409020546001600160a01b031690610f6f9083612289565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152336004820152610bc3908290849030906370a0823190602401602060405180830381865afa158015610fcb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fef9190614814565b612327565b600054610100900460ff16158080156110145750600054600160ff909116105b8061102e5750303b15801561102e575060005460ff166001145b6110a05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016108b5565b6000805460ff1916600117905580156110e057600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6001600160a01b0385166111365760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20616464726573732063616e6e6f74206265207a65726f0000000060448201526064016108b5565b61114084846123bb565b611148612442565b6111506124c1565b611158612442565b611160612442565b61116b600086611e43565b6111957f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a86611e43565b6111bf7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a686611e43565b6111e97fce3f34913921da558f105cefb578d87278debbbd073a8d552b5de0d168deee3086611e43565b6101616111f68382614718565b50610162805460ff19169055801561126557600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6000818152606760205260408120546001600160a01b0316806107e95760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e204944000000000000000060448201526064016108b5565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66112fb81611e39565b816113485760405162461bcd60e51b815260206004820152601c60248201527f4d757374206d696e74206174206c65617374206f6e6520746f6b656e0000000060448201526064016108b5565b60648211156113bf5760405162461bcd60e51b815260206004820152602860248201527f43616e6e6f74206d696e74206d6f7265207468616e2031303020746f6b656e7360448201527f206174206f6e636500000000000000000000000000000000000000000000000060648201526084016108b5565b60005b828110156114725760008484838181106113de576113de61469b565b90506020020160208101906113f391906142ce565b6001600160a01b031614158015611431575061142f84848381811061141a5761141a61469b565b90506020020160208101906105b591906142ce565b155b156114605761146084848381811061144b5761144b61469b565b90506020020160208101906104b391906142ce565b8061146a8161485c565b9150506113c2565b50505050565b60006107e982611ee5565b7fce3f34913921da558f105cefb578d87278debbbd073a8d552b5de0d168deee306114ad81611e39565b6114b682611478565b6001146115055760405162461bcd60e51b815260206004820152601560248201527f5265766f6b653a2063616e6e6f74207265766f6b65000000000000000000000060448201526064016108b5565b6000611512836000610a93565b905061151d816121a6565b60405181906001600160a01b0385169033907fcee654d6181ed9db0a91636d81bb2238964fea079a5a8119b8962303774592da90600090a4505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f306001600160a01b03166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa1580156115bb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526115e39190810190614894565b80519060200120306001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401600060405180830381865afa158015611628573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526116509190810190614894565b805160209182012060408051928301949094529281019190915260608101919091524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6116c681611e39565b6116ce612546565b6040516001815233907fe8699cf681560fd07de85543bd994263f4557bdc5179dd702f256d15fd083e1d90602001610c3b565b60006107e982612583565b60606066805461171b90614648565b80601f016020809104026020016040519081016040528092919081815260200182805461174790614648565b80156117945780601f1061176957610100808354040283529160200191611794565b820191906000526020600020905b81548152906001019060200180831161177757829003601f168201915b5050505050905090565b60006107e9826125db565b610bc333838361266f565b60006117bf81611e39565b6101625460ff166118385760405162461bcd60e51b815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c656400000000000000000000000000000000000000000000000000000060648201526084016108b5565b610162805460ff19169055335b6101625460405160ff909116151581526001600160a01b0391909116907f750bc2ec2b9643783080f064b960113af5a2a708345c7e3cf509ca7fec55e24490602001610c3b565b6101625460ff166119055760405162461bcd60e51b815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c656400000000000000000000000000000000000000000000000000000060648201526084016108b5565b6114728484848461273d565b834211156119615760405162461bcd60e51b815260206004820152601160248201527f5369676e6174757265206578706972656400000000000000000000000000000060448201526064016108b5565b7f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e6000611a4d611a4561199261155a565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf6020808301919091526001600160a01b038e1682840152606082018d905260808083018d90528351808403909101815260a0830184528051908201207f190100000000000000000000000000000000000000000000000000000000000060c084015260c283019490945260e28083019490945282518083039094018452610102909101909152815191012090565b8686866127c5565b6001600160a01b03811660009081526001840160205260409020549091508714611ab95760405162461bcd60e51b815260206004820152600d60248201527f496e76616c6964206e6f6e63650000000000000000000000000000000000000060448201526064016108b5565b6001600160a01b03811660009081526001830160205260408120805491611adf8361485c565b9190505550611aee8189612289565b5050505050505050565b606060008211611b4a5760405162461bcd60e51b815260206004820152601060248201527f496e76616c696420746f6b656e2049440000000000000000000000000000000060448201526064016108b5565b61015f54821115611b9d5760405162461bcd60e51b815260206004820152601060248201527f496e76616c696420746f6b656e2049440000000000000000000000000000000060448201526064016108b5565b6107e9826127ed565b600082815260fb6020526040902060010154611bc181611e39565b6109568383611f7f565b6000611bd681611e39565b6101625460ff1615611c4f5760405162461bcd60e51b8152602060048201526024808201527f5472616e736665727261626c653a207472616e73666572732061726520656e6160448201527f626c65640000000000000000000000000000000000000000000000000000000060648201526084016108b5565b610162805460ff191660011790556118453390565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806107e957506107e982612853565b60606065805461171b90614648565b6000818152606760205260409020546001600160a01b0316610deb5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e204944000000000000000060448201526064016108b5565b600081815260696020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0384169081179091558190611d7a8261126c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b611dbc33610d6a565b611e2e5760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f7665640000000000000000000000000000000000000060648201526084016108b5565b6109568383836128a9565b610deb8133612b1d565b600082815260fb602090815260408083206001600160a01b038516845290915290205460ff16610bc357600082815260fb602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611ea13390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006001600160a01b038216611f635760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e6572000000000000000000000000000000000000000000000060648201526084016108b5565b506001600160a01b031660009081526068602052604090205490565b600082815260fb602090815260408083206001600160a01b038516845290915290205460ff1615610bc357600082815260fb602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b03821660009081527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5160209081526040808320547fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5290925282207fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f9163ffffffff1690612097908286612b92565b95945050505050565b6120a8612d00565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610bc3828260405180602001604052806000815250612d52565b6109568383836040518060200160405280600081525061188c565b6000806121338361126c565b9050806001600160a01b0316846001600160a01b0316148061217a57506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b8061219e5750836001600160a01b0316612193846107fe565b6001600160a01b0316145b949350505050565b60006121b18261126c565b90506121c1816000846001612ddb565b6121ca8261126c565b600083815260696020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081169091556001600160a01b0385168085526068845282852080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190558785526067909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a4610bc3816000846001612e58565b60007f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e6001600160a01b0380851660008181526020849052604080822080548886167fffffffffffffffffffffffff00000000000000000000000000000000000000008216811790925591519596509316938492917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f91a450505050565b816001600160a01b0316836001600160a01b0316141580156123495750600081115b15610956576001600160a01b03831615612386576000612368846125db565b905060006123768383614902565b9050612383858383612e68565b50505b6001600160a01b038216156109565760006123a0836125db565b905060006123ae8383614915565b9050611265848383612e68565b600054610100900460ff166124385760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016108b5565b610bc38282612fb7565b600054610100900460ff166124bf5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016108b5565b565b600054610100900460ff1661253e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016108b5565b6124bf61304d565b61254e6130d6565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586120d53390565b7fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f80546000919063ffffffff1661219e7fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece508286612b92565b6001600160a01b03811660009081527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5160209081526040808320547fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5290925282207fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f9163ffffffff169061219e9082613129565b816001600160a01b0316836001600160a01b0316036126d05760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016108b5565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6127473383612127565b6127b95760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f7665640000000000000000000000000000000000000060648201526084016108b5565b61147284848484613173565b60008060006127d6878787876131fc565b915091506127e3816132c0565b5095945050505050565b60606127f882611cc9565b6000612802613425565b905060008151116128225760405180602001604052806000815250610bd3565b8061282c84613435565b60405160200161283d929190614928565b6040516020818303038152906040529392505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d630000000000000000000000000000000000000000000000000000000014806107e957506107e9826134f3565b826001600160a01b03166128bc8261126c565b6001600160a01b0316146129385760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e657200000000000000000000000000000000000000000000000000000060648201526084016108b5565b6001600160a01b0382166129b35760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016108b5565b6129c08383836001612ddb565b826001600160a01b03166129d38261126c565b6001600160a01b031614612a4f5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e657200000000000000000000000000000000000000000000000000000060648201526084016108b5565b600081815260696020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081169091556001600160a01b038781168086526068855283862080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905590871680865283862080546001019055868652606790945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a46109568383836001612e58565b600082815260fb602090815260408083206001600160a01b038516845290915290205460ff16610bc357612b50816135d6565b612b5b8360206135e8565b604051602001612b6c929190614957565b60408051601f198184030181529082905262461bcd60e51b82526108b5916004016141f4565b60008263ffffffff16600003612baa57506000610bd3565b81846000612bb96001876149d8565b63ffffffff16815260208101919091526040016000205411612c0857836000612be36001866149d8565b63ffffffff1663ffffffff168152602001908152602001600020600101549050610bd3565b600080805260208590526040902054821015612c2657506000610bd3565b600080612c346001866149d8565b90505b8163ffffffff168163ffffffff161115612cde5760006002612c5984846149d8565b612c6391906149fc565b612c6d90836149d8565b63ffffffff811660009081526020898152604091829020825180840190935280548084526001909101549183019190915291925090869003612cb857602001519350610bd392505050565b8051861115612cc957819350612cd7565b612cd46001836149d8565b92505b5050612c37565b5063ffffffff1660009081526020859052604090206001015490509392505050565b60c95460ff166124bf5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016108b5565b612d5c8383613811565b612d6960008484846139cc565b6109565760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e746572000000000000000000000000000060648201526084016108b5565b826001600160a01b0381161580612df85750612df681611478565b155b612e445760405162461bcd60e51b815260206004820152601f60248201527f486f6c64657273206d6179206f6e6c792068617665206f6e6520746f6b656e0060448201526064016108b5565b612e4c6130d6565b61126585858585613b6a565b612e63848483613cab565b611472565b6001600160a01b03831660008181527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece516020908152604080832054815180830183524281528084018781529585527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece52845282852063ffffffff9092168086529190935292209051815591516001928301557fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f91612f26908290614a46565b6001600160a01b038616600081815260028501602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff9590951694909417909355805187815292830186905290917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a25050505050565b600054610100900460ff166130345760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016108b5565b60656130408382614718565b5060666109568282614718565b600054610100900460ff166130ca5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016108b5565b60c9805460ff19169055565b60c95460ff16156124bf5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016108b5565b600063ffffffff82161561316a578260006131456001856149d8565b63ffffffff1663ffffffff1681526020019081526020016000206001015490506107e9565b50600092915050565b61317e8484846128a9565b61318a848484846139cc565b6114725760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e746572000000000000000000000000000060648201526084016108b5565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561323357506000905060036132b7565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613287573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166132b0576000600192509250506132b7565b9150600090505b94509492505050565b60008160048111156132d4576132d4614a63565b036132dc5750565b60018160048111156132f0576132f0614a63565b0361333d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108b5565b600281600481111561335157613351614a63565b0361339e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108b5565b60038160048111156133b2576133b2614a63565b03610deb5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016108b5565b6060610161805461171b90614648565b6060600061344283613d49565b600101905060008167ffffffffffffffff811115613462576134626142e9565b6040519080825280601f01601f19166020018201604052801561348c576020820181803683370190505b5090508181016020015b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461349657509392505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061358657507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806107e957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146107e9565b60606107e96001600160a01b03831660145b606060006135f7836002614a92565b613602906002614915565b67ffffffffffffffff81111561361a5761361a6142e9565b6040519080825280601f01601f191660200182016040528015613644576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061367b5761367b61469b565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106136de576136de61469b565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600061371a846002614a92565b613725906001614915565b90505b60018111156137c2577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106137665761376661469b565b1a60f81b82828151811061377c5761377c61469b565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936137bb81614acf565b9050613728565b508315610bd35760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016108b5565b6001600160a01b0382166138675760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016108b5565b6000818152606760205260409020546001600160a01b0316156138cc5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108b5565b6138da600083836001612ddb565b6000818152606760205260409020546001600160a01b03161561393f5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108b5565b6001600160a01b038216600081815260686020908152604080832080546001019055848352606790915280822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4610bc3600083836001612e58565b60006001600160a01b0384163b15613b62576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a0290613a29903390899088908890600401614b04565b6020604051808303816000875af1925050508015613a64575060408051601f3d908101601f19168201909252613a6191810190614b40565b60015b613b17573d808015613a92576040519150601f19603f3d011682016040523d82523d6000602084013e613a97565b606091505b508051600003613b0f5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e746572000000000000000000000000000060648201526084016108b5565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a020000000000000000000000000000000000000000000000000000000014905061219e565b50600161219e565b613b7684848484613e2b565b6001811115613bed5760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e736563757469766520747260448201527f616e7366657273206e6f7420737570706f72746564000000000000000000000060648201526084016108b5565b816001600160a01b038516613c4957613c4481609980546000838152609a60205260408120829055600182018355919091527f72a152ddfb8e864297c917af52ea6c1c68aead0fee1a62673fcc7e0c94979d000155565b613c6c565b836001600160a01b0316856001600160a01b031614613c6c57613c6c8582613eb3565b6001600160a01b038416613c8857613c8381613f50565b611265565b846001600160a01b0316846001600160a01b031614611265576112658482613fff565b6001600160a01b038316613cd457613cd481613cc5614043565b613ccf9190614915565b6140a1565b6001600160a01b038216613cf857613cf881613cee614043565b613ccf9190614902565b6001600160a01b0383811660009081527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e602052604080822054858416835291205461095692918216911683612327565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310613d92577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310613dbe576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613ddc57662386f26fc10000830492506010015b6305f5e1008310613df4576305f5e100830492506008015b6127108310613e0857612710830492506004015b60648310613e1a576064830492506002015b600a83106107e95760010192915050565b6001811115611472576001600160a01b03841615613e71576001600160a01b03841660009081526068602052604081208054839290613e6b908490614902565b90915550505b6001600160a01b03831615611472576001600160a01b03831660009081526068602052604081208054839290613ea8908490614915565b909155505050505050565b60006001613ec084611ee5565b613eca9190614902565b600083815260986020526040902054909150808214613f1d576001600160a01b03841660009081526097602090815260408083208584528252808320548484528184208190558352609890915290208190555b5060009182526098602090815260408084208490556001600160a01b039094168352609781528383209183525290812055565b609954600090613f6290600190614902565b6000838152609a602052604081205460998054939450909284908110613f8a57613f8a61469b565b906000526020600020015490508060998381548110613fab57613fab61469b565b6000918252602080832090910192909255828152609a90915260408082208490558582528120556099805480613fe357613fe3614b5d565b6001900381819060005260206000200160009055905550505050565b600061400a83611ee5565b6001600160a01b039093166000908152609760209081526040808320868452825280832085905593825260989052919091209190915550565b7fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f80546000919063ffffffff1661409a7fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5082613129565b9250505090565b7fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f8054604080518082018252428152602080820186815263ffffffff90941660008181527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5090925292902090518155915160019283015590614124908290614a46565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff91909116179091555050565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114610deb57600080fd5b60006020828403121561419957600080fd5b8135610bd381614159565b60005b838110156141bf5781810151838201526020016141a7565b50506000910152565b600081518084526141e08160208601602086016141a4565b601f01601f19169290920160200192915050565b602081526000610bd360208301846141c8565b60006020828403121561421957600080fd5b5035919050565b80356001600160a01b038116811461423757600080fd5b919050565b6000806040838503121561424f57600080fd5b61425883614220565b946020939093013593505050565b60008060006060848603121561427b57600080fd5b61428484614220565b925061429260208501614220565b9150604084013590509250925092565b600080604083850312156142b557600080fd5b823591506142c560208401614220565b90509250929050565b6000602082840312156142e057600080fd5b610bd382614220565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715614341576143416142e9565b604052919050565b600067ffffffffffffffff821115614363576143636142e9565b50601f01601f191660200190565b600061438461437f84614349565b614318565b905082815283838301111561439857600080fd5b828260208301376000602084830101529392505050565b600082601f8301126143c057600080fd5b610bd383833560208501614371565b6000602082840312156143e157600080fd5b813567ffffffffffffffff8111156143f857600080fd5b61219e848285016143af565b6000806000806080858703121561441a57600080fd5b61442385614220565b9350602085013567ffffffffffffffff8082111561444057600080fd5b61444c888389016143af565b9450604087013591508082111561446257600080fd5b61446e888389016143af565b9350606087013591508082111561448457600080fd5b50614491878288016143af565b91505092959194509250565b600080602083850312156144b057600080fd5b823567ffffffffffffffff808211156144c857600080fd5b818501915085601f8301126144dc57600080fd5b8135818111156144eb57600080fd5b8660208260051b850101111561450057600080fd5b60209290920196919550909350505050565b6000806040838503121561452557600080fd5b61452e83614220565b91506020830135801515811461454357600080fd5b809150509250929050565b6000806000806080858703121561456457600080fd5b61456d85614220565b935061457b60208601614220565b925060408501359150606085013567ffffffffffffffff81111561459e57600080fd5b8501601f810187136145af57600080fd5b61449187823560208401614371565b60008060008060008060c087890312156145d757600080fd5b6145e087614220565b95506020870135945060408701359350606087013560ff8116811461460457600080fd5b9598949750929560808101359460a0909101359350915050565b6000806040838503121561463157600080fd5b61463a83614220565b91506142c560208401614220565b600181811c9082168061465c57607f821691505b602082108103614695577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b601f82111561095657600081815260208120601f850160051c810160208610156146f15750805b601f850160051c820191505b81811015614710578281556001016146fd565b505050505050565b815167ffffffffffffffff811115614732576147326142e9565b614746816147408454614648565b846146ca565b602080601f83116001811461479957600084156147635750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555614710565b600085815260208120601f198616915b828110156147c8578886015182559484019460019091019084016147a9565b508582101561480457878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b60006020828403121561482657600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361488d5761488d61482d565b5060010190565b6000602082840312156148a657600080fd5b815167ffffffffffffffff8111156148bd57600080fd5b8201601f810184136148ce57600080fd5b80516148dc61437f82614349565b8181528560208385010111156148f157600080fd5b6120978260208301602086016141a4565b818103818111156107e9576107e961482d565b808201808211156107e9576107e961482d565b6000835161493a8184602088016141a4565b83519083019061494e8183602088016141a4565b01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161498f8160178501602088016141a4565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516149cc8160288401602088016141a4565b01602801949350505050565b63ffffffff8281168282160390808211156149f5576149f561482d565b5092915050565b600063ffffffff80841680614a3a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b92169190910492915050565b63ffffffff8181168382160190808211156149f5576149f561482d565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614aca57614aca61482d565b500290565b600081614ade57614ade61482d565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60006001600160a01b03808716835280861660208401525083604083015260806060830152614b3660808301846141c8565b9695505050505050565b600060208284031215614b5257600080fd5b8151610bd381614159565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea264697066735822122004984144038f10171650d836fa3ebcef51548108f6acb9077e7fe35a3cb28a6e64736f6c63430008100033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061032b5760003560e01c80635c975abb116101b25780639ab24eb0116100f9578063c87b56dd116100a2578063e63ab1e91161007c578063e63ab1e914610701578063e7a324dc14610728578063e985e9c51461074f578063f1b50c1d1461078b57600080fd5b8063c87b56dd146106b4578063d5391393146106c7578063d547741f146106ee57600080fd5b8063b187984f116100d3578063b187984f14610686578063b88d4fde1461068e578063c3cda520146106a157600080fd5b80639ab24eb014610658578063a217fddf1461066b578063a22cb4651461067357600080fd5b806378e890ba1161015b5780638e539e8c116101355780638e539e8c1461060457806391d148541461061757806395d89b411461065057600080fd5b806378e890ba146105cd5780637c4acabf146105d55780638456cb59146105fc57600080fd5b8063681db87c1161018c578063681db87c1461059457806370a08231146105a757806374a8f103146105ba57600080fd5b80635c975abb146105635780635f1e6f6d1461056e5780636352211e1461058157600080fd5b8063357f931a1161027657806342966c681161021f57806355f804b3116101f957806355f804b31461052a578063587cde1e1461053d5780635c19a95c1461055057600080fd5b806342966c68146104cb5780634f6ccce7146104de57806354fd4d50146104f157600080fd5b80633f4ba83a116102505780633f4ba83a1461049d57806340d097c3146104a557806342842e0e146104b857600080fd5b8063357f931a1461045657806336568abe146104775780633a46b1a81461048a57600080fd5b806323b872dd116102d857806328b8692a116102b257806328b8692a146104285780632f2ff15d146104305780632f745c591461044357600080fd5b806323b872dd146103cb578063248a9ca3146103de578063253d2c7d1461040157600080fd5b8063081812fc11610309578063081812fc14610379578063095ea7b3146103a457806318160ddd146103b957600080fd5b806301ffc9a714610330578063047a7ef11461035857806306fdde0314610364575b600080fd5b61034361033e366004614187565b610793565b60405190151581526020015b60405180910390f35b6101625460ff16610343565b61036c6107ef565b60405161034f91906141f4565b61038c610387366004614207565b6107fe565b6040516001600160a01b03909116815260200161034f565b6103b76103b236600461423c565b610825565b005b6099545b60405190815260200161034f565b6103b76103d9366004614266565b61095b565b6103bd6103ec366004614207565b600090815260fb602052604090206001015490565b6103bd7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b61036c6109df565b6103b761043e3660046142a2565b610a6e565b6103bd61045136600461423c565b610a93565b6103bd610464366004614207565b6101606020526000908152604090205481565b6103b76104853660046142a2565b610b3b565b6103bd61049836600461423c565b610bc7565b6103b7610bda565b6103b76104b33660046142ce565b610c46565b6103b76104c6366004614266565b610ce1565b6103b76104d9366004614207565b610d65565b6103bd6104ec366004614207565b610dee565b60408051808201909152600581527f312e302e30000000000000000000000000000000000000000000000000000000602082015261036c565b6103b76105383660046143cf565b610e92565b61038c61054b3660046142ce565b610eeb565b6103b761055e3660046142ce565b610f2c565b60c95460ff16610343565b6103b761057c366004614404565b610ff4565b61038c61058f366004614207565b61126c565b6103b76105a236600461449d565b6112d1565b6103bd6105b53660046142ce565b611478565b6103b76105c83660046142ce565b611483565b6103bd61155a565b6103bd7fce3f34913921da558f105cefb578d87278debbbd073a8d552b5de0d168deee3081565b6103b761169c565b6103bd610612366004614207565b611701565b6103436106253660046142a2565b600091825260fb602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61036c61170c565b6103bd6106663660046142ce565b61179e565b6103bd600081565b6103b7610681366004614512565b6117a9565b6103b76117b4565b6103b761069c36600461454e565b61188c565b6103b76106af3660046145be565b611911565b61036c6106c2366004614207565b611af8565b6103bd7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6103b76106fc3660046142a2565b611ba6565b6103bd7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6103bd7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b61034361075d36600461461e565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b6103b7611bcb565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fe90fb3f60000000000000000000000000000000000000000000000000000000014806107e957506107e982611c64565b92915050565b60606107f9611cba565b905090565b600061080982611cc9565b506000908152606960205260409020546001600160a01b031690565b60006108308261126c565b9050806001600160a01b0316836001600160a01b0316036108be5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b336001600160a01b03821614806108da57506108da813361075d565b61094c5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016108b5565b6109568383611d2d565b505050565b6101625460ff166109d45760405162461bcd60e51b815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c656400000000000000000000000000000000000000000000000000000060648201526084016108b5565b610956838383611db3565b61016180546109ed90614648565b80601f0160208091040260200160405190810160405280929190818152602001828054610a1990614648565b8015610a665780601f10610a3b57610100808354040283529160200191610a66565b820191906000526020600020905b815481529060010190602001808311610a4957829003601f168201915b505050505081565b600082815260fb6020526040902060010154610a8981611e39565b6109568383611e43565b6000610a9e83611ee5565b8210610b125760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e647300000000000000000000000000000000000000000060648201526084016108b5565b506001600160a01b03919091166000908152609760209081526040808320938352929052205490565b6001600160a01b0381163314610bb95760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084016108b5565b610bc38282611f7f565b5050565b6000610bd38383612002565b9392505050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610c0481611e39565b610c0c6120a0565b6040516000815233907fe8699cf681560fd07de85543bd994263f4557bdc5179dd702f256d15fd083e1d906020015b60405180910390a250565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610c7081611e39565b610c7f61015f80546001019055565b6000610c8b61015f5490565b9050610c9783826120f2565b600081815261016060205260408082204290555182916001600160a01b038616917f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859190a3505050565b6101625460ff16610d5a5760405162461bcd60e51b815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c656400000000000000000000000000000000000000000000000000000060648201526084016108b5565b61095683838361210c565b610d70335b82612127565b610de25760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f7665640000000000000000000000000000000000000060648201526084016108b5565b610deb816121a6565b50565b6000610df960995490565b8210610e6d5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e6473000000000000000000000000000000000000000060648201526084016108b5565b60998281548110610e8057610e8061469b565b90600052602060002001549050919050565b6000610e9d81611e39565b336001600160a01b03167f165934242147f3edfff841cdc7eaf9c061b07a451d00ad31e6ad1a4dc1c9402a83604051610ed691906141f4565b60405180910390a26101616109568382614718565b6001600160a01b0380821660009081527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e60205260408120549091166107e9565b3360008181527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e60205260409020546001600160a01b031690610f6f9083612289565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152336004820152610bc3908290849030906370a0823190602401602060405180830381865afa158015610fcb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fef9190614814565b612327565b600054610100900460ff16158080156110145750600054600160ff909116105b8061102e5750303b15801561102e575060005460ff166001145b6110a05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016108b5565b6000805460ff1916600117905580156110e057600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6001600160a01b0385166111365760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20616464726573732063616e6e6f74206265207a65726f0000000060448201526064016108b5565b61114084846123bb565b611148612442565b6111506124c1565b611158612442565b611160612442565b61116b600086611e43565b6111957f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a86611e43565b6111bf7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a686611e43565b6111e97fce3f34913921da558f105cefb578d87278debbbd073a8d552b5de0d168deee3086611e43565b6101616111f68382614718565b50610162805460ff19169055801561126557600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6000818152606760205260408120546001600160a01b0316806107e95760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e204944000000000000000060448201526064016108b5565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66112fb81611e39565b816113485760405162461bcd60e51b815260206004820152601c60248201527f4d757374206d696e74206174206c65617374206f6e6520746f6b656e0000000060448201526064016108b5565b60648211156113bf5760405162461bcd60e51b815260206004820152602860248201527f43616e6e6f74206d696e74206d6f7265207468616e2031303020746f6b656e7360448201527f206174206f6e636500000000000000000000000000000000000000000000000060648201526084016108b5565b60005b828110156114725760008484838181106113de576113de61469b565b90506020020160208101906113f391906142ce565b6001600160a01b031614158015611431575061142f84848381811061141a5761141a61469b565b90506020020160208101906105b591906142ce565b155b156114605761146084848381811061144b5761144b61469b565b90506020020160208101906104b391906142ce565b8061146a8161485c565b9150506113c2565b50505050565b60006107e982611ee5565b7fce3f34913921da558f105cefb578d87278debbbd073a8d552b5de0d168deee306114ad81611e39565b6114b682611478565b6001146115055760405162461bcd60e51b815260206004820152601560248201527f5265766f6b653a2063616e6e6f74207265766f6b65000000000000000000000060448201526064016108b5565b6000611512836000610a93565b905061151d816121a6565b60405181906001600160a01b0385169033907fcee654d6181ed9db0a91636d81bb2238964fea079a5a8119b8962303774592da90600090a4505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f306001600160a01b03166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa1580156115bb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526115e39190810190614894565b80519060200120306001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401600060405180830381865afa158015611628573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526116509190810190614894565b805160209182012060408051928301949094529281019190915260608101919091524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6116c681611e39565b6116ce612546565b6040516001815233907fe8699cf681560fd07de85543bd994263f4557bdc5179dd702f256d15fd083e1d90602001610c3b565b60006107e982612583565b60606066805461171b90614648565b80601f016020809104026020016040519081016040528092919081815260200182805461174790614648565b80156117945780601f1061176957610100808354040283529160200191611794565b820191906000526020600020905b81548152906001019060200180831161177757829003601f168201915b5050505050905090565b60006107e9826125db565b610bc333838361266f565b60006117bf81611e39565b6101625460ff166118385760405162461bcd60e51b815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c656400000000000000000000000000000000000000000000000000000060648201526084016108b5565b610162805460ff19169055335b6101625460405160ff909116151581526001600160a01b0391909116907f750bc2ec2b9643783080f064b960113af5a2a708345c7e3cf509ca7fec55e24490602001610c3b565b6101625460ff166119055760405162461bcd60e51b815260206004820152602560248201527f5472616e736665727261626c653a207472616e7366657273206172652064697360448201527f61626c656400000000000000000000000000000000000000000000000000000060648201526084016108b5565b6114728484848461273d565b834211156119615760405162461bcd60e51b815260206004820152601160248201527f5369676e6174757265206578706972656400000000000000000000000000000060448201526064016108b5565b7f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e6000611a4d611a4561199261155a565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf6020808301919091526001600160a01b038e1682840152606082018d905260808083018d90528351808403909101815260a0830184528051908201207f190100000000000000000000000000000000000000000000000000000000000060c084015260c283019490945260e28083019490945282518083039094018452610102909101909152815191012090565b8686866127c5565b6001600160a01b03811660009081526001840160205260409020549091508714611ab95760405162461bcd60e51b815260206004820152600d60248201527f496e76616c6964206e6f6e63650000000000000000000000000000000000000060448201526064016108b5565b6001600160a01b03811660009081526001830160205260408120805491611adf8361485c565b9190505550611aee8189612289565b5050505050505050565b606060008211611b4a5760405162461bcd60e51b815260206004820152601060248201527f496e76616c696420746f6b656e2049440000000000000000000000000000000060448201526064016108b5565b61015f54821115611b9d5760405162461bcd60e51b815260206004820152601060248201527f496e76616c696420746f6b656e2049440000000000000000000000000000000060448201526064016108b5565b6107e9826127ed565b600082815260fb6020526040902060010154611bc181611e39565b6109568383611f7f565b6000611bd681611e39565b6101625460ff1615611c4f5760405162461bcd60e51b8152602060048201526024808201527f5472616e736665727261626c653a207472616e73666572732061726520656e6160448201527f626c65640000000000000000000000000000000000000000000000000000000060648201526084016108b5565b610162805460ff191660011790556118453390565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806107e957506107e982612853565b60606065805461171b90614648565b6000818152606760205260409020546001600160a01b0316610deb5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e204944000000000000000060448201526064016108b5565b600081815260696020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0384169081179091558190611d7a8261126c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b611dbc33610d6a565b611e2e5760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f7665640000000000000000000000000000000000000060648201526084016108b5565b6109568383836128a9565b610deb8133612b1d565b600082815260fb602090815260408083206001600160a01b038516845290915290205460ff16610bc357600082815260fb602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611ea13390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006001600160a01b038216611f635760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e6572000000000000000000000000000000000000000000000060648201526084016108b5565b506001600160a01b031660009081526068602052604090205490565b600082815260fb602090815260408083206001600160a01b038516845290915290205460ff1615610bc357600082815260fb602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b03821660009081527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5160209081526040808320547fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5290925282207fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f9163ffffffff1690612097908286612b92565b95945050505050565b6120a8612d00565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610bc3828260405180602001604052806000815250612d52565b6109568383836040518060200160405280600081525061188c565b6000806121338361126c565b9050806001600160a01b0316846001600160a01b0316148061217a57506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b8061219e5750836001600160a01b0316612193846107fe565b6001600160a01b0316145b949350505050565b60006121b18261126c565b90506121c1816000846001612ddb565b6121ca8261126c565b600083815260696020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081169091556001600160a01b0385168085526068845282852080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190558785526067909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a4610bc3816000846001612e58565b60007f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e6001600160a01b0380851660008181526020849052604080822080548886167fffffffffffffffffffffffff00000000000000000000000000000000000000008216811790925591519596509316938492917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f91a450505050565b816001600160a01b0316836001600160a01b0316141580156123495750600081115b15610956576001600160a01b03831615612386576000612368846125db565b905060006123768383614902565b9050612383858383612e68565b50505b6001600160a01b038216156109565760006123a0836125db565b905060006123ae8383614915565b9050611265848383612e68565b600054610100900460ff166124385760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016108b5565b610bc38282612fb7565b600054610100900460ff166124bf5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016108b5565b565b600054610100900460ff1661253e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016108b5565b6124bf61304d565b61254e6130d6565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586120d53390565b7fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f80546000919063ffffffff1661219e7fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece508286612b92565b6001600160a01b03811660009081527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5160209081526040808320547fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5290925282207fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f9163ffffffff169061219e9082613129565b816001600160a01b0316836001600160a01b0316036126d05760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016108b5565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6127473383612127565b6127b95760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f7665640000000000000000000000000000000000000060648201526084016108b5565b61147284848484613173565b60008060006127d6878787876131fc565b915091506127e3816132c0565b5095945050505050565b60606127f882611cc9565b6000612802613425565b905060008151116128225760405180602001604052806000815250610bd3565b8061282c84613435565b60405160200161283d929190614928565b6040516020818303038152906040529392505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d630000000000000000000000000000000000000000000000000000000014806107e957506107e9826134f3565b826001600160a01b03166128bc8261126c565b6001600160a01b0316146129385760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e657200000000000000000000000000000000000000000000000000000060648201526084016108b5565b6001600160a01b0382166129b35760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016108b5565b6129c08383836001612ddb565b826001600160a01b03166129d38261126c565b6001600160a01b031614612a4f5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e657200000000000000000000000000000000000000000000000000000060648201526084016108b5565b600081815260696020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081169091556001600160a01b038781168086526068855283862080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905590871680865283862080546001019055868652606790945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a46109568383836001612e58565b600082815260fb602090815260408083206001600160a01b038516845290915290205460ff16610bc357612b50816135d6565b612b5b8360206135e8565b604051602001612b6c929190614957565b60408051601f198184030181529082905262461bcd60e51b82526108b5916004016141f4565b60008263ffffffff16600003612baa57506000610bd3565b81846000612bb96001876149d8565b63ffffffff16815260208101919091526040016000205411612c0857836000612be36001866149d8565b63ffffffff1663ffffffff168152602001908152602001600020600101549050610bd3565b600080805260208590526040902054821015612c2657506000610bd3565b600080612c346001866149d8565b90505b8163ffffffff168163ffffffff161115612cde5760006002612c5984846149d8565b612c6391906149fc565b612c6d90836149d8565b63ffffffff811660009081526020898152604091829020825180840190935280548084526001909101549183019190915291925090869003612cb857602001519350610bd392505050565b8051861115612cc957819350612cd7565b612cd46001836149d8565b92505b5050612c37565b5063ffffffff1660009081526020859052604090206001015490509392505050565b60c95460ff166124bf5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016108b5565b612d5c8383613811565b612d6960008484846139cc565b6109565760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e746572000000000000000000000000000060648201526084016108b5565b826001600160a01b0381161580612df85750612df681611478565b155b612e445760405162461bcd60e51b815260206004820152601f60248201527f486f6c64657273206d6179206f6e6c792068617665206f6e6520746f6b656e0060448201526064016108b5565b612e4c6130d6565b61126585858585613b6a565b612e63848483613cab565b611472565b6001600160a01b03831660008181527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece516020908152604080832054815180830183524281528084018781529585527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece52845282852063ffffffff9092168086529190935292209051815591516001928301557fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f91612f26908290614a46565b6001600160a01b038616600081815260028501602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff9590951694909417909355805187815292830186905290917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a25050505050565b600054610100900460ff166130345760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016108b5565b60656130408382614718565b5060666109568282614718565b600054610100900460ff166130ca5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016108b5565b60c9805460ff19169055565b60c95460ff16156124bf5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016108b5565b600063ffffffff82161561316a578260006131456001856149d8565b63ffffffff1663ffffffff1681526020019081526020016000206001015490506107e9565b50600092915050565b61317e8484846128a9565b61318a848484846139cc565b6114725760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e746572000000000000000000000000000060648201526084016108b5565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561323357506000905060036132b7565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613287573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166132b0576000600192509250506132b7565b9150600090505b94509492505050565b60008160048111156132d4576132d4614a63565b036132dc5750565b60018160048111156132f0576132f0614a63565b0361333d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108b5565b600281600481111561335157613351614a63565b0361339e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108b5565b60038160048111156133b2576133b2614a63565b03610deb5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016108b5565b6060610161805461171b90614648565b6060600061344283613d49565b600101905060008167ffffffffffffffff811115613462576134626142e9565b6040519080825280601f01601f19166020018201604052801561348c576020820181803683370190505b5090508181016020015b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461349657509392505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061358657507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806107e957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146107e9565b60606107e96001600160a01b03831660145b606060006135f7836002614a92565b613602906002614915565b67ffffffffffffffff81111561361a5761361a6142e9565b6040519080825280601f01601f191660200182016040528015613644576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061367b5761367b61469b565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106136de576136de61469b565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600061371a846002614a92565b613725906001614915565b90505b60018111156137c2577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106137665761376661469b565b1a60f81b82828151811061377c5761377c61469b565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936137bb81614acf565b9050613728565b508315610bd35760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016108b5565b6001600160a01b0382166138675760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016108b5565b6000818152606760205260409020546001600160a01b0316156138cc5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108b5565b6138da600083836001612ddb565b6000818152606760205260409020546001600160a01b03161561393f5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108b5565b6001600160a01b038216600081815260686020908152604080832080546001019055848352606790915280822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4610bc3600083836001612e58565b60006001600160a01b0384163b15613b62576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a0290613a29903390899088908890600401614b04565b6020604051808303816000875af1925050508015613a64575060408051601f3d908101601f19168201909252613a6191810190614b40565b60015b613b17573d808015613a92576040519150601f19603f3d011682016040523d82523d6000602084013e613a97565b606091505b508051600003613b0f5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e746572000000000000000000000000000060648201526084016108b5565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a020000000000000000000000000000000000000000000000000000000014905061219e565b50600161219e565b613b7684848484613e2b565b6001811115613bed5760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e736563757469766520747260448201527f616e7366657273206e6f7420737570706f72746564000000000000000000000060648201526084016108b5565b816001600160a01b038516613c4957613c4481609980546000838152609a60205260408120829055600182018355919091527f72a152ddfb8e864297c917af52ea6c1c68aead0fee1a62673fcc7e0c94979d000155565b613c6c565b836001600160a01b0316856001600160a01b031614613c6c57613c6c8582613eb3565b6001600160a01b038416613c8857613c8381613f50565b611265565b846001600160a01b0316846001600160a01b031614611265576112658482613fff565b6001600160a01b038316613cd457613cd481613cc5614043565b613ccf9190614915565b6140a1565b6001600160a01b038216613cf857613cf881613cee614043565b613ccf9190614902565b6001600160a01b0383811660009081527f9445b0664c72f3ea82b4b0b66945b3e984dc3f563e04a52fd810eae883d2840e602052604080822054858416835291205461095692918216911683612327565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310613d92577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310613dbe576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613ddc57662386f26fc10000830492506010015b6305f5e1008310613df4576305f5e100830492506008015b6127108310613e0857612710830492506004015b60648310613e1a576064830492506002015b600a83106107e95760010192915050565b6001811115611472576001600160a01b03841615613e71576001600160a01b03841660009081526068602052604081208054839290613e6b908490614902565b90915550505b6001600160a01b03831615611472576001600160a01b03831660009081526068602052604081208054839290613ea8908490614915565b909155505050505050565b60006001613ec084611ee5565b613eca9190614902565b600083815260986020526040902054909150808214613f1d576001600160a01b03841660009081526097602090815260408083208584528252808320548484528184208190558352609890915290208190555b5060009182526098602090815260408084208490556001600160a01b039094168352609781528383209183525290812055565b609954600090613f6290600190614902565b6000838152609a602052604081205460998054939450909284908110613f8a57613f8a61469b565b906000526020600020015490508060998381548110613fab57613fab61469b565b6000918252602080832090910192909255828152609a90915260408082208490558582528120556099805480613fe357613fe3614b5d565b6001900381819060005260206000200160009055905550505050565b600061400a83611ee5565b6001600160a01b039093166000908152609760209081526040808320868452825280832085905593825260989052919091209190915550565b7fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f80546000919063ffffffff1661409a7fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5082613129565b9250505090565b7fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece4f8054604080518082018252428152602080820186815263ffffffff90941660008181527fee4ae5af77c122a0dd9754efb22d3c0c090d029d2b3ef538a7acea090eeece5090925292902090518155915160019283015590614124908290614a46565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff91909116179091555050565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114610deb57600080fd5b60006020828403121561419957600080fd5b8135610bd381614159565b60005b838110156141bf5781810151838201526020016141a7565b50506000910152565b600081518084526141e08160208601602086016141a4565b601f01601f19169290920160200192915050565b602081526000610bd360208301846141c8565b60006020828403121561421957600080fd5b5035919050565b80356001600160a01b038116811461423757600080fd5b919050565b6000806040838503121561424f57600080fd5b61425883614220565b946020939093013593505050565b60008060006060848603121561427b57600080fd5b61428484614220565b925061429260208501614220565b9150604084013590509250925092565b600080604083850312156142b557600080fd5b823591506142c560208401614220565b90509250929050565b6000602082840312156142e057600080fd5b610bd382614220565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715614341576143416142e9565b604052919050565b600067ffffffffffffffff821115614363576143636142e9565b50601f01601f191660200190565b600061438461437f84614349565b614318565b905082815283838301111561439857600080fd5b828260208301376000602084830101529392505050565b600082601f8301126143c057600080fd5b610bd383833560208501614371565b6000602082840312156143e157600080fd5b813567ffffffffffffffff8111156143f857600080fd5b61219e848285016143af565b6000806000806080858703121561441a57600080fd5b61442385614220565b9350602085013567ffffffffffffffff8082111561444057600080fd5b61444c888389016143af565b9450604087013591508082111561446257600080fd5b61446e888389016143af565b9350606087013591508082111561448457600080fd5b50614491878288016143af565b91505092959194509250565b600080602083850312156144b057600080fd5b823567ffffffffffffffff808211156144c857600080fd5b818501915085601f8301126144dc57600080fd5b8135818111156144eb57600080fd5b8660208260051b850101111561450057600080fd5b60209290920196919550909350505050565b6000806040838503121561452557600080fd5b61452e83614220565b91506020830135801515811461454357600080fd5b809150509250929050565b6000806000806080858703121561456457600080fd5b61456d85614220565b935061457b60208601614220565b925060408501359150606085013567ffffffffffffffff81111561459e57600080fd5b8501601f810187136145af57600080fd5b61449187823560208401614371565b60008060008060008060c087890312156145d757600080fd5b6145e087614220565b95506020870135945060408701359350606087013560ff8116811461460457600080fd5b9598949750929560808101359460a0909101359350915050565b6000806040838503121561463157600080fd5b61463a83614220565b91506142c560208401614220565b600181811c9082168061465c57607f821691505b602082108103614695577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b601f82111561095657600081815260208120601f850160051c810160208610156146f15750805b601f850160051c820191505b81811015614710578281556001016146fd565b505050505050565b815167ffffffffffffffff811115614732576147326142e9565b614746816147408454614648565b846146ca565b602080601f83116001811461479957600084156147635750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555614710565b600085815260208120601f198616915b828110156147c8578886015182559484019460019091019084016147a9565b508582101561480457878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b60006020828403121561482657600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361488d5761488d61482d565b5060010190565b6000602082840312156148a657600080fd5b815167ffffffffffffffff8111156148bd57600080fd5b8201601f810184136148ce57600080fd5b80516148dc61437f82614349565b8181528560208385010111156148f157600080fd5b6120978260208301602086016141a4565b818103818111156107e9576107e961482d565b808201808211156107e9576107e961482d565b6000835161493a8184602088016141a4565b83519083019061494e8183602088016141a4565b01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161498f8160178501602088016141a4565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516149cc8160288401602088016141a4565b01602801949350505050565b63ffffffff8281168282160390808211156149f5576149f561482d565b5092915050565b600063ffffffff80841680614a3a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b92169190910492915050565b63ffffffff8181168382160190808211156149f5576149f561482d565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614aca57614aca61482d565b500290565b600081614ade57614ade61482d565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60006001600160a01b03808716835280861660208401525083604083015260806060830152614b3660808301846141c8565b9695505050505050565b600060208284031215614b5257600080fd5b8151610bd381614159565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea264697066735822122004984144038f10171650d836fa3ebcef51548108f6acb9077e7fe35a3cb28a6e64736f6c63430008100033

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
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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.