{"sources":{"contracts/Wrappers/CeloOFTExtension.sol":{"content":"// SPDX-License-Identifier: Apache 2.0\n\npragma solidity 0.8.4;\n\nimport {TetherTokenOFTExtension} from \"contracts/Wrappers/OFTExtension.sol\";\nimport {TetherTokenCeloExtension, EIP712Upgradeable, ERC20Upgradeable} from \"contracts/Wrappers/CeloExtension.sol\";\n\n/*\n\n   Copyright Everdawn Labs 2026\n\n   Licensed under the Apache License, Version 2.0\n   http://www.apache.org/licenses/LICENSE-2.0\n\n*/\n\n\ncontract CeloOFTExtension is TetherTokenOFTExtension, TetherTokenCeloExtension {\n  /**\n  * @dev The hash of the name parameter for the EIP712 domain.\n  *\n  * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n  * are a concern.\n  */\n  function _EIP712NameHash() internal virtual override(TetherTokenOFTExtension, EIP712Upgradeable) view returns (bytes32) {\n    return TetherTokenOFTExtension._EIP712NameHash();\n  }\n\n  /**\n  * @dev Returns the name of the token.\n  */\n  function name() public view virtual override(TetherTokenOFTExtension, ERC20Upgradeable) returns (string memory) {\n    return TetherTokenOFTExtension.name();\n  }\n\n  /**\n  * @dev Returns the symbol of the token, usually a shorter version of the\n  * name.\n  */\n  function symbol() public view virtual override(TetherTokenOFTExtension, ERC20Upgradeable) returns (string memory) {\n    return TetherTokenOFTExtension.symbol();\n  }\n}"},"contracts/Wrappers/OFTExtension.sol":{"content":"// SPDX-License-Identifier: Apache 2.0\n\npragma solidity 0.8.4;\n\nimport \"contracts/Tether/TetherTokenV2.sol\";\nimport {IERC7802, IERC165} from \"contracts/Wrappers/interfaces/IERC7802.sol\";\n\n/*\n\n   Copyright USDT0 2025\n\n   Author Will Norden\n\n   Licensed under the Apache License, Version 2.0\n   http://www.apache.org/licenses/LICENSE-2.0\n\n*/\n\n\ncontract TetherTokenOFTExtension is TetherTokenV2, IERC7802 {\n\n  event LogSetOFTContract(address indexed oftContract);\n  event Burn(address indexed from, uint256 amount);\n  event LogUpdateNameAndSymbol(string name, string symbol);\n\n  address public oftContract;\n\n  string internal _newName;\n  string internal _newSymbol;\n\n  modifier onlyAuthorizedSender() {\n    require(msg.sender == oftContract, \"Only OFT can call\");\n    _;\n  }\n\n  function crosschainMint(address _destination, uint256 _amount) public override onlyAuthorizedSender {\n    _mint(_destination, _amount);\n    emit Mint(_destination, _amount);\n    emit CrosschainMint(_destination, _amount, msg.sender);\n  }\n\n  function crosschainBurn(address _from, uint256 _amount) public override onlyAuthorizedSender {\n    _burn(_from, _amount);\n    emit Burn(_from, _amount);\n    emit CrosschainBurn(_from, _amount, msg.sender);\n  }\n\n  function setOFTContract(address _oftContract) external onlyOwner {\n    oftContract = _oftContract;\n    emit LogSetOFTContract(_oftContract);\n  }\n\n  /**\n  * @dev The hash of the name parameter for the EIP712 domain.\n  *\n  * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n  * are a concern.\n  */\n  function _EIP712NameHash() internal virtual override view returns (bytes32) {\n    return keccak256(bytes(name()));\n  }\n\n  function updateNameAndSymbol(string memory _name, string memory _symbol) public onlyOwner {\n    _newName = _name;\n    _newSymbol = _symbol;\n    emit LogUpdateNameAndSymbol(_name, _symbol);\n  }\n\n  /**\n  * @dev Returns the name of the token.\n  */\n  function name() public view virtual override returns (string memory) {\n    return bytes(_newName).length == 0 ? super.name() : _newName;\n  }\n\n  /**\n  * @dev Returns the symbol of the token, usually a shorter version of the\n  * name.\n  */\n  function symbol() public view virtual override returns (string memory) {\n    return bytes(_newSymbol).length == 0 ? super.symbol() : _newSymbol;\n  }\n\n  function supportsInterface(bytes4 interfaceId) external pure override returns (bool) {\n    return interfaceId == type(IERC7802).interfaceId || interfaceId == type(IERC165).interfaceId;\n  }\n\n  uint256[47] private __gap;\n}\n"},"contracts/Wrappers/CeloExtension.sol":{"content":"// SPDX-License-Identifier: Apache 2.0\n\npragma solidity 0.8.4;\n\nimport \"../Tether/TetherTokenV2.sol\";\n\n/*\n\n   Copyright Tether.to 2024\n\n   Author Will Harborne, Will Norden\n\n   Licensed under the Apache License, Version 2.0\n   http://www.apache.org/licenses/LICENSE-2.0\n\n*/\n\n\ncontract TetherTokenCeloExtension is TetherTokenV2 {\n\n  event LogSetFeeCurrencyWrapper(address indexed feeCurrencyWrapper);\n\n  address constant private GAS_FEE_ADDRESS = 0x000000000000000000000000000000000Ce106A5;\n\n  address public feeCurrencyWrapper;\n\n  modifier onlyFeeWrapper() {\n    require(msg.sender == address(0) || msg.sender == feeCurrencyWrapper, \"Only VM can call\");\n    _;\n  }\n\n  /**\n   * @notice Reserve balance for making payments for gas in this currency.\n   * @param from The account to reserve balance from\n   * @param value The amount of balance to reserve\n   * @dev Note that this function is called by the protocol when paying for tx fees in this\n   * currency. After the tx is executed, gas is refunded to the sender and credited to the\n   * various tx fee recipients via a call to `creditGasFees`.\n   */\n  function debitGasFees(address from, uint256 value) external onlyFeeWrapper {\n    _transfer(from, GAS_FEE_ADDRESS, value);\n  }\n\n  /**\n   * @notice Alternative function to credit balance after making payments\n   * for gas in this currency.\n   * @param refundRecipient The recipient of the refund.\n   * @param tipRecipient The recipient of the tip.\n   * @param baseFeeRecipient The recipient of the base fee.\n   * @param refundAmount amount to be refunded by the VM\n   * @param tipAmount Coinbase fee\n   * @param baseFeeAmount Community fund fee\n   * @dev Note that this function is called by the protocol when paying for tx fees in this\n   * currency. Before the tx is executed, gas is debited from the sender via a call to\n   * `debitGasFees`.\n   */\n  function creditGasFees(\n    address refundRecipient,\n    address tipRecipient,\n    address , // gateWayFeeRecipient is not used anymore\n    address baseFeeRecipient,\n    uint256 refundAmount,\n    uint256 tipAmount,\n    uint256 ,\n    uint256 baseFeeAmount\n  ) external onlyFeeWrapper {\n\n    if (tipRecipient != address(0)) {\n      _transfer(GAS_FEE_ADDRESS, tipRecipient, tipAmount);\n    }\n\n    if (baseFeeRecipient != address(0)) {\n      _transfer(GAS_FEE_ADDRESS, baseFeeRecipient, baseFeeAmount);\n    }\n\n    if (refundAmount > 0) {\n      _transfer(GAS_FEE_ADDRESS, refundRecipient, refundAmount);\n    }\n  }\n\n  function setFeeCurrencyWrapper(address _feeCurrencyWrapper) external onlyOwner {\n    feeCurrencyWrapper = _feeCurrencyWrapper;\n    emit LogSetFeeCurrencyWrapper(_feeCurrencyWrapper);\n  }\n\n}\n"},"contracts/Tether/TetherTokenV2.sol":{"content":"// SPDX-License-Identifier: Apache 2.0\nimport \"./TetherToken.sol\";\nimport \"./EIP3009.sol\";\nimport \"./util/SignatureChecker.sol\";\npragma solidity 0.8.4;\n\ncontract TetherTokenV2 is TetherToken, EIP3009 {\n    bytes32 internal constant _PERMIT_TYPEHASH =\n        keccak256(\n            \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n        );\n\n    constructor () initializer {}\n\n    function domainSeparator()\n        internal\n        view\n        virtual\n        override\n        returns (bytes32)\n    {\n        return _domainSeparatorV4();\n    }\n\n    /**\n     * The following applies to the following function and comments to that function:\n     * \n     * SPDX-License-Identifier: Apache-2.0\n     *\n     * Copyright (c) 2023, Circle Internet Financial, LLC.\n     *\n     * Licensed under the Apache License, Version 2.0 (the \"License\");\n     * you may not use this file except in compliance with the License.\n     * You may obtain a copy of the License at\n     *\n     * http://www.apache.org/licenses/LICENSE-2.0\n     * \n     * Unless required by applicable law or agreed to in writing, software\n     * distributed under the License is distributed on an \"AS IS\" BASIS,\n     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     * See the License for the specific language governing permissions and\n     * limitations under the License.\n     * \n     * ---------------------------------------------------------------------\n     * \n     * Adapted by Tether.to 2024 for greater flexibility and reusability\n     */\n    function _permit(\n        address owner_,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        bytes memory signature\n    ) internal {\n        require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n        bytes32 structHash = keccak256(\n            abi.encode(\n                _PERMIT_TYPEHASH,\n                owner_,\n                spender,\n                value,\n                _useNonce(owner_),\n                deadline\n            )\n        );\n\n        bytes32 hash = _hashTypedDataV4(structHash);\n\n        require(\n            SignatureChecker.isValidSignatureNow(owner_, hash, signature),\n            \"EIP2612: invalid signature\"\n        );\n\n        _approve(owner_, spender, value);\n    }\n\n    /**\n     * @notice Update allowance with a signed permit\n     * @param owner_       Token owner's address\n     * @param spender     Spender's address\n     * @param value       Amount of allowance\n     * @param deadline    The time at which the signature expires (unix time)\n     * @param v   signature component v\n     * @param r   signature component r\n     * @param s   signature component s\n     */\n    function permit(\n        address owner_,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) public virtual override {\n        _permit(owner_, spender, value, deadline, abi.encodePacked(r, s, v));\n    }\n\n    /**\n     * The following applies to the following function and comments to that function:\n     * \n     * SPDX-License-Identifier: Apache-2.0\n     *\n     * Copyright (c) 2023, Circle Internet Financial, LLC.\n     *\n     * Licensed under the Apache License, Version 2.0 (the \"License\");\n     * you may not use this file except in compliance with the License.\n     * You may obtain a copy of the License at\n     *\n     * http://www.apache.org/licenses/LICENSE-2.0\n     * \n     * Unless required by applicable law or agreed to in writing, software\n     * distributed under the License is distributed on an \"AS IS\" BASIS,\n     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     * See the License for the specific language governing permissions and\n     * limitations under the License.\n     * \n     * ---------------------------------------------------------------------\n     * \n     * Adapted by Tether.to 2024 for greater flexibility and reusability\n     */\n\n    /**\n     * @notice Update allowance with a signed permit\n     * @dev EOA wallet signatures should be packed in the order of r, s, v.\n     * @param owner_       Token owner's address (Authorizer)\n     * @param spender     Spender's address\n     * @param value       Amount of allowance\n     * @param deadline    The time at which the signature expires (unix time), or max uint256 value to signal no expiration\n     * @param signature   Signature bytes signed by an EOA wallet or a contract wallet\n     */\n    function permit(\n        address owner_,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        bytes memory signature\n    ) external {\n        _permit(owner_, spender, value, deadline, signature);\n    }\n\n    /**\n     * The following applies to the following function and comments to that function:\n     * \n     * SPDX-License-Identifier: Apache-2.0\n     *\n     * Copyright (c) 2023, Circle Internet Financial, LLC.\n     *\n     * Licensed under the Apache License, Version 2.0 (the \"License\");\n     * you may not use this file except in compliance with the License.\n     * You may obtain a copy of the License at\n     *\n     * http://www.apache.org/licenses/LICENSE-2.0\n     * \n     * Unless required by applicable law or agreed to in writing, software\n     * distributed under the License is distributed on an \"AS IS\" BASIS,\n     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     * See the License for the specific language governing permissions and\n     * limitations under the License.\n     * \n     * ---------------------------------------------------------------------\n     * \n     * Adapted by Tether.to 2024 for greater flexibility and reusability\n     */\n\n    /**\n     * @notice Execute a transfer with a signed authorization\n     * @param from          Payer's address (Authorizer)\n     * @param to            Payee's address\n     * @param value         Amount to be transferred\n     * @param validAfter    The time after which this is valid (unix time)\n     * @param validBefore   The time before which this is valid (unix time)\n     * @param nonce         Unique nonce\n     * @param v             v of the signature\n     * @param r             r of the signature\n     * @param s             s of the signature\n     */\n    function transferWithAuthorization(\n        address from,\n        address to,\n        uint256 value,\n        uint256 validAfter,\n        uint256 validBefore,\n        bytes32 nonce,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) public onlyNotBlocked {\n        _transferWithAuthorizationValidityCheck(\n            from,\n            to,\n            value,\n            validAfter,\n            validBefore,\n            nonce,\n            abi.encodePacked(r, s, v)\n        );\n        _transfer(from, to, value);\n    }\n\n    /**\n     * The following applies to the following function and comments to that function:\n     * \n     * SPDX-License-Identifier: Apache-2.0\n     *\n     * Copyright (c) 2023, Circle Internet Financial, LLC.\n     *\n     * Licensed under the Apache License, Version 2.0 (the \"License\");\n     * you may not use this file except in compliance with the License.\n     * You may obtain a copy of the License at\n     *\n     * http://www.apache.org/licenses/LICENSE-2.0\n     * \n     * Unless required by applicable law or agreed to in writing, software\n     * distributed under the License is distributed on an \"AS IS\" BASIS,\n     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     * See the License for the specific language governing permissions and\n     * limitations under the License.\n     * \n     * ---------------------------------------------------------------------\n     * \n     * Adapted by Tether.to 2024 for greater flexibility and reusability\n     */\n\n    /**\n     * @notice Execute a transfer with a signed authorization\n     * @dev EOA wallet signatures should be packed in the order of r, s, v.\n     * @param from          Payer's address (Authorizer)\n     * @param to            Payee's address\n     * @param value         Amount to be transferred\n     * @param validAfter    The time after which this is valid (unix time)\n     * @param validBefore   The time before which this is valid (unix time)\n     * @param nonce         Unique nonce\n     * @param signature     Signature bytes signed by an EOA wallet or a contract wallet\n     */\n    function transferWithAuthorization(\n        address from,\n        address to,\n        uint256 value,\n        uint256 validAfter,\n        uint256 validBefore,\n        bytes32 nonce,\n        bytes memory signature\n    ) external onlyNotBlocked {\n        _transferWithAuthorizationValidityCheck(\n            from,\n            to,\n            value,\n            validAfter,\n            validBefore,\n            nonce,\n            signature\n        );\n        _transfer(from, to, value);\n    }\n\n    /**\n     * The following applies to the following function and comments to that function:\n     * \n     * SPDX-License-Identifier: Apache-2.0\n     *\n     * Copyright (c) 2023, Circle Internet Financial, LLC.\n     *\n     * Licensed under the Apache License, Version 2.0 (the \"License\");\n     * you may not use this file except in compliance with the License.\n     * You may obtain a copy of the License at\n     *\n     * http://www.apache.org/licenses/LICENSE-2.0\n     * \n     * Unless required by applicable law or agreed to in writing, software\n     * distributed under the License is distributed on an \"AS IS\" BASIS,\n     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     * See the License for the specific language governing permissions and\n     * limitations under the License.\n     * \n     * ---------------------------------------------------------------------\n     * \n     * Adapted by Tether.to 2024 for greater flexibility and reusability\n     */\n\n    /**\n     * @notice Receive a transfer with a signed authorization from the payer\n     * @dev This has an additional check to ensure that the payee's address\n     * matches the caller of this function to prevent front-running attacks.\n     * @param from          Payer's address (Authorizer)\n     * @param to            Payee's address\n     * @param value         Amount to be transferred\n     * @param validAfter    The time after which this is valid (unix time)\n     * @param validBefore   The time before which this is valid (unix time)\n     * @param nonce         Unique nonce\n     * @param v             v of the signature\n     * @param r             r of the signature\n     * @param s             s of the signature\n     */\n    function receiveWithAuthorization(\n        address from,\n        address to,\n        uint256 value,\n        uint256 validAfter,\n        uint256 validBefore,\n        bytes32 nonce,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) public onlyNotBlocked {\n        _receiveWithAuthorizationValidityCheck(\n            from,\n            to,\n            value,\n            validAfter,\n            validBefore,\n            nonce,\n            abi.encodePacked(r, s, v)\n        );\n        _transfer(from, to, value);\n    }\n\n    /**\n     * The following applies to the following function and comments to that function:\n     * \n     * SPDX-License-Identifier: Apache-2.0\n     *\n     * Copyright (c) 2023, Circle Internet Financial, LLC.\n     *\n     * Licensed under the Apache License, Version 2.0 (the \"License\");\n     * you may not use this file except in compliance with the License.\n     * You may obtain a copy of the License at\n     *\n     * http://www.apache.org/licenses/LICENSE-2.0\n     * \n     * Unless required by applicable law or agreed to in writing, software\n     * distributed under the License is distributed on an \"AS IS\" BASIS,\n     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     * See the License for the specific language governing permissions and\n     * limitations under the License.\n     * \n     * ---------------------------------------------------------------------\n     * \n     * Adapted by Tether.to 2024 for greater flexibility and reusability\n     */\n\n    /**\n     * @notice Receive a transfer with a signed authorization from the payer\n     * @dev This has an additional check to ensure that the payee's address\n     * matches the caller of this function to prevent front-running attacks.\n     * EOA wallet signatures should be packed in the order of r, s, v.\n     * @param from          Payer's address (Authorizer)\n     * @param to            Payee's address\n     * @param value         Amount to be transferred\n     * @param validAfter    The time after which this is valid (unix time)\n     * @param validBefore   The time before which this is valid (unix time)\n     * @param nonce         Unique nonce\n     * @param signature     Signature bytes signed by an EOA wallet or a contract wallet\n     */\n    function receiveWithAuthorization(\n        address from,\n        address to,\n        uint256 value,\n        uint256 validAfter,\n        uint256 validBefore,\n        bytes32 nonce,\n        bytes memory signature\n    ) external onlyNotBlocked {\n        _receiveWithAuthorizationValidityCheck(\n            from,\n            to,\n            value,\n            validAfter,\n            validBefore,\n            nonce,\n            signature\n        );\n        _transfer(from, to, value);\n    }\n\n    uint256[48] private __gap;\n}"},"contracts/Wrappers/interfaces/IERC7802.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\n/// @title IERC7802\n/// @notice Defines the interface for crosschain ERC20 transfers.\ninterface IERC7802 is IERC165 {\n    /// @notice Emitted when a crosschain transfer mints tokens.\n    /// @param to       Address of the account tokens are being minted for.\n    /// @param amount   Amount of tokens minted.\n    /// @param sender   Address of the caller (msg.sender) who invoked crosschainMint.\n    event CrosschainMint(address indexed to, uint256 amount, address indexed sender);\n    /// @notice Emitted when a crosschain transfer burns tokens.\n    /// @param from     Address of the account tokens are being burned from.\n    /// @param amount   Amount of tokens burned.\n    /// @param sender   Address of the caller (msg.sender) who invoked crosschainBurn.\n    event CrosschainBurn(address indexed from, uint256 amount, address indexed sender);\n    /// @notice Mint tokens through a crosschain transfer.\n    /// @param _to     Address to mint tokens to.\n    /// @param _amount Amount of tokens to mint.\n    function crosschainMint(address _to, uint256 _amount) external;\n    /// @notice Burn tokens through a crosschain transfer.\n    /// @param _from   Address to burn tokens from.\n    /// @param _amount Amount of tokens to burn.\n    function crosschainBurn(address _from, uint256 _amount) external;\n}\n"},"contracts/Tether/TetherToken.sol":{"content":"// SPDX-License-Identifier: Apache 2.0\n\npragma solidity 0.8.4;\n\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol\";\nimport \"./WithBlockedList.sol\";\n\n/*\n\n   Copyright Tether.to 2024\n\n   Version 2.0(a)\n\n   Licensed under the Apache License, Version 2.0\n   http://www.apache.org/licenses/LICENSE-2.0\n\n*/\n\ncontract TetherToken is\n    Initializable,\n    ERC20PermitUpgradeable,\n    OwnableUpgradeable,\n    WithBlockedList\n{\n    // Unused variable by the base token, retained to preserve storage slots across upgrades\n    mapping(address => bool) public isTrusted;\n\n    uint8 private tetherDecimals;\n\n    function initialize(\n        string memory _name,\n        string memory _symbol,\n        uint8 _decimals\n    ) public initializer {\n        tetherDecimals = _decimals;\n        __Ownable_init();\n        __ERC20_init(_name, _symbol);\n        __ERC20Permit_init(_name);\n    }\n\n    function decimals() public view virtual override returns (uint8) {\n        return tetherDecimals;\n    }\n\n    function _beforeTokenTransfer(\n        address from,\n        address to,\n        uint256\n    ) internal virtual override {\n        require(!isBlocked[from] || msg.sender == owner(), \"TetherToken: from is blocked\");\n        require( \n            to != address(this), \n            \"TetherToken: transfer to the contract address\" \n        ); \n    }\n\n    function transferFrom(\n        address _sender,\n        address _recipient,\n        uint256 _amount\n    ) public virtual override onlyNotBlocked returns (bool) {\n        return super.transferFrom(_sender, _recipient, _amount);\n    }\n\n    function multiTransfer (\n        address[] calldata _recipients,\n        uint256[] calldata _values\n    ) external {\n        require(\n            _recipients.length == _values.length,\n            \"TetherToken: multiTransfer mismatch\"\n        );\n        for (uint256 i = 0; i < _recipients.length; i++) {\n            transfer(_recipients[i], _values[i]);\n        }\n    }\n\n    function mint(address _destination, uint256 _amount) public virtual onlyOwner {\n        _mint(_destination, _amount);\n        emit Mint(_destination, _amount);\n    }\n\n    function redeem(uint256 _amount) public virtual onlyOwner {\n        _burn(owner(), _amount);\n        emit Redeem(_amount);\n    }\n\n    function destroyBlockedFunds(address _blockedUser) public onlyOwner {\n        require(isBlocked[_blockedUser], \"TetherToken: user is not blocked\");\n        uint256 blockedFunds = balanceOf(_blockedUser);\n        _burn(_blockedUser, blockedFunds);\n        emit DestroyedBlockedFunds(_blockedUser, blockedFunds);\n    }\n\n    event Mint(address indexed _destination, uint256 _amount);\n    event Redeem(uint256 _amount);\n    event DestroyedBlockedFunds(address indexed _blockedUser, uint256 _balance);\n}\n"},"contracts/Tether/EIP3009.sol":{"content":"/**\n * SPDX-License-Identifier: Apache-2.0\n *\n * Copyright (c) 2023, Circle Internet Financial, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * ---------------------------------------------------------------------\n * \n * Adapted by Tether.to 2024 for greater flexibility and reusability\n */\n\npragma solidity >=0.6.12 <0.9.0;\n\nimport { SignatureChecker } from \"./util/SignatureChecker.sol\";\nimport { MessageHashUtils } from \"./util/MessageHashUtils.sol\";\n\n/**\n * @title EIP-3009\n * @notice Provide internal implementation for gas-abstracted transfers\n * @dev Contracts that inherit from this must wrap these with publicly\n * accessible functions, optionally adding modifiers where necessary\n */\nabstract contract EIP3009 {\n    bytes32 public constant TRANSFER_WITH_AUTHORIZATION_TYPEHASH = keccak256(\"TransferWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)\");\n\n    bytes32 public constant RECEIVE_WITH_AUTHORIZATION_TYPEHASH = keccak256(\"ReceiveWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)\");\n\n    bytes32 public constant CANCEL_AUTHORIZATION_TYPEHASH = keccak256(\"CancelAuthorization(address authorizer,bytes32 nonce)\");\n\n    /**\n     * @dev authorizer address => nonce => bool (true if nonce is used)\n     */\n    mapping(address => mapping(bytes32 => bool)) private _authorizationStates;\n\n    event AuthorizationUsed(address indexed authorizer, bytes32 indexed nonce);\n    event AuthorizationCanceled(\n        address indexed authorizer,\n        bytes32 indexed nonce\n    );\n\n    function domainSeparator() internal virtual view returns (bytes32);\n\n    /**\n     * @notice Returns the state of an authorization\n     * @dev Nonces are randomly generated 32-byte data unique to the\n     * authorizer's address\n     * @param authorizer    Authorizer's address\n     * @param nonce         Nonce of the authorization\n     * @return True if the nonce is used\n     */\n    function authorizationState(address authorizer, bytes32 nonce)\n        external\n        view\n        returns (bool)\n    {\n        return _authorizationStates[authorizer][nonce];\n    }\n\n    /**\n     * @notice Execute a transfer with a signed authorization\n     * @param from          Payer's address (Authorizer)\n     * @param to            Payee's address\n     * @param value         Amount to be transferred\n     * @param validAfter    The time after which this is valid (unix time)\n     * @param validBefore   The time before which this is valid (unix time)\n     * @param nonce         Unique nonce\n     * @param signature signature in bytes\n     */\n    function _transferWithAuthorizationValidityCheck(\n        address from,\n        address to,\n        uint256 value,\n        uint256 validAfter,\n        uint256 validBefore,\n        bytes32 nonce,\n        bytes memory signature\n    ) internal {\n        _requireValidAuthorization(from, nonce, validAfter, validBefore);\n        _requireValidSignature(\n            from,\n            keccak256(\n                abi.encode(\n                    TRANSFER_WITH_AUTHORIZATION_TYPEHASH,\n                    from,\n                    to,\n                    value,\n                    validAfter,\n                    validBefore,\n                    nonce\n                )\n            ),\n            signature\n        );\n\n        _markAuthorizationAsUsed(from, nonce);\n    }\n\n    /**\n     * @notice Receive a transfer with a signed authorization from the payer\n     * @dev This has an additional check to ensure that the payee's address\n     * matches the caller of this function to prevent front-running attacks.\n     * @param from          Payer's address (Authorizer)\n     * @param to            Payee's address\n     * @param value         Amount to be transferred\n     * @param validAfter    The time after which this is valid (unix time)\n     * @param validBefore   The time before which this is valid (unix time)\n     * @param nonce         Unique nonce\n     * @param signature signature in bytes\n     */\n    function _receiveWithAuthorizationValidityCheck(\n        address from,\n        address to,\n        uint256 value,\n        uint256 validAfter,\n        uint256 validBefore,\n        bytes32 nonce,\n        bytes memory signature\n    ) internal {\n        require(to == msg.sender, \"TetherToken: to != msg.sender\");\n        _requireValidAuthorization(from, nonce, validAfter, validBefore);\n        _requireValidSignature(\n            from,\n            keccak256(\n                abi.encode(\n                    RECEIVE_WITH_AUTHORIZATION_TYPEHASH,\n                    from,\n                    to,\n                    value,\n                    validAfter,\n                    validBefore,\n                    nonce\n                )\n            ),\n            signature\n        );\n\n        _markAuthorizationAsUsed(from, nonce);\n    }\n\n    function _cancelAuthorization(\n        address authorizer,\n        bytes32 nonce,\n        bytes memory signature\n    ) internal {\n        _requireUnusedAuthorization(authorizer, nonce);\n        _requireValidSignature(\n            authorizer,\n            keccak256(\n                abi.encode(CANCEL_AUTHORIZATION_TYPEHASH, authorizer, nonce)\n            ),\n            signature\n        );\n\n        _authorizationStates[authorizer][nonce] = true;\n        emit AuthorizationCanceled(authorizer, nonce);\n    }\n\n    /**\n     * @notice Attempt to cancel an authorization\n     * @param authorizer    Authorizer's address\n     * @param nonce         Nonce of the authorization\n     * @param v             v of the signature\n     * @param r             r of the signature\n     * @param s             s of the signature\n     */\n    function cancelAuthorization(\n        address authorizer,\n        bytes32 nonce,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) public {\n        _cancelAuthorization(authorizer, nonce, abi.encodePacked(r,s,v));\n    }\n\n    /**\n     * @notice Attempt to cancel an authorization\n     * @dev Works only if the authorization is not yet used.\n     * EOA wallet signatures should be packed in the order of r, s, v.\n     * @param authorizer    Authorizer's address\n     * @param nonce         Nonce of the authorization\n     * @param signature     Signature bytes signed by an EOA wallet or a contract wallet\n     */\n    function cancelAuthorization(\n        address authorizer,\n        bytes32 nonce,\n        bytes memory signature\n    ) external {\n        _cancelAuthorization(authorizer, nonce, signature);\n    }\n\n    /**\n     * @notice Validates that signature against input data struct\n     * @param signer        Signer's address\n     * @param dataHash      Hash of encoded data struct\n     * @param signature signature in bytes\n     */\n    function _requireValidSignature(\n        address signer,\n        bytes32 dataHash,\n        bytes memory signature\n    ) private view {\n        require(\n            SignatureChecker.isValidSignatureNow(\n                signer,\n                MessageHashUtils.toTypedDataHash(domainSeparator(), dataHash),\n                signature\n            ),\n            \"TetherToken: invalid signature\"\n        );\n    }\n\n    /**\n     * @notice Check that an authorization is unused\n     * @param authorizer    Authorizer's address\n     * @param nonce         Nonce of the authorization\n     */\n    function _requireUnusedAuthorization(address authorizer, bytes32 nonce)\n        private\n        view\n    {\n        require(\n            !_authorizationStates[authorizer][nonce],\n            \"TetherToken: auth invalid\"\n        );\n    }\n\n    /**\n     * @notice Check that authorization is valid\n     * @param authorizer    Authorizer's address\n     * @param nonce         Nonce of the authorization\n     * @param validAfter    The time after which this is valid (unix time)\n     * @param validBefore   The time before which this is valid (unix time)\n     */\n    function _requireValidAuthorization(\n        address authorizer,\n        bytes32 nonce,\n        uint256 validAfter,\n        uint256 validBefore\n    ) private view {\n        require(\n            block.timestamp > validAfter,\n            \"TetherToken: auth early\"\n        );\n        require(block.timestamp < validBefore, \"TetherToken: auth expired\");\n        _requireUnusedAuthorization(authorizer, nonce);\n    }\n\n    /**\n     * @notice Mark an authorization as used\n     * @param authorizer    Authorizer's address\n     * @param nonce         Nonce of the authorization\n     */\n    function _markAuthorizationAsUsed(address authorizer, bytes32 nonce)\n        private\n    {\n        _authorizationStates[authorizer][nonce] = true;\n        emit AuthorizationUsed(authorizer, nonce);\n    }\n\n    uint256[49] private __gap;\n}"},"contracts/Tether/util/SignatureChecker.sol":{"content":"/**\n * SPDX-License-Identifier: Apache-2.0\n *\n * Copyright (c) 2023, Circle Internet Financial, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * ---------------------------------------------------------------------\n * \n * Adapted by Tether.to 2024 for greater flexibility and reusability\n */\n\npragma solidity >=0.6.12 <0.9.0;\n\nimport { ECRecover } from \"./ECRecover.sol\";\nimport { IERC1271 } from \"../interfaces/IERC1271.sol\";\n\n/**\n * @dev Signature verification helper that can be used instead of `ECRecover.recover` to seamlessly support both ECDSA\n * signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets.\n *\n * Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/21bb89ef5bfc789b9333eb05e3ba2b7b284ac77c/contracts/utils/cryptography/SignatureChecker.sol\n */\nlibrary SignatureChecker {\n    /**\n     * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the\n     * signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECRecover.recover`.\n     * @param signer        Address of the claimed signer\n     * @param digest        Keccak-256 hash digest of the signed message\n     * @param signature signature byte array associated with hash\n     */\n    function isValidSignatureNow(\n        address signer,\n        bytes32 digest,\n        bytes memory signature\n    ) internal view returns (bool) {\n        if (!isContract(signer)) {\n            return ECRecover.recover(digest, signature) == signer;\n        }\n        return isValidERC1271SignatureNow(signer, digest, signature);\n    }\n\n    /**\n     * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\n     * against the signer smart contract using ERC1271.\n     * @param signer        Address of the claimed signer\n     * @param digest        Keccak-256 hash digest of the signed message\n     * @param signature     Signature byte array associated with hash\n     *\n     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n     * change through time. It could return true at block N and false at block N+1 (or the opposite).\n     */\n    function isValidERC1271SignatureNow(\n        address signer,\n        bytes32 digest,\n        bytes memory signature\n    ) internal view returns (bool) {\n        (bool success, bytes memory result) = signer.staticcall(\n            abi.encodeWithSelector(\n                IERC1271.isValidSignature.selector,\n                digest,\n                signature\n            )\n        );\n        return (success &&\n            result.length >= 32 &&\n            abi.decode(result, (bytes32)) ==\n            bytes32(IERC1271.isValidSignature.selector));\n    }\n\n    /**\n     * @dev Checks if the input address is a smart contract.\n     */\n    function isContract(address addr) internal view returns (bool) {\n        uint256 size;\n        assembly {\n            size := extcodesize(addr)\n        }\n        return size > 0;\n    }\n}"},"node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"},"node_modules/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    function __Ownable_init() internal initializer {\n        __Context_init_unchained();\n        __Ownable_init_unchained();\n    }\n\n    function __Ownable_init_unchained() internal initializer {\n        _setOwner(_msgSender());\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n        _;\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby removing any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _setOwner(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _setOwner(newOwner);\n    }\n\n    function _setOwner(address newOwner) private {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n    uint256[49] private __gap;\n}\n"},"node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin guidelines: functions revert instead\n * of returning `false` on failure. This behavior is nonetheless conventional\n * and does not conflict with the expectations of ERC20 applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\n    mapping(address => uint256) private _balances;\n\n    mapping(address => mapping(address => uint256)) private _allowances;\n\n    uint256 private _totalSupply;\n\n    string private _name;\n    string private _symbol;\n\n    /**\n     * @dev Sets the values for {name} and {symbol}.\n     *\n     * The default value of {decimals} is 18. To select a different value for\n     * {decimals} you should overload it.\n     *\n     * All two of these values are immutable: they can only be set once during\n     * construction.\n     */\n    function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\n        __Context_init_unchained();\n        __ERC20_init_unchained(name_, symbol_);\n    }\n\n    function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\n        _name = name_;\n        _symbol = symbol_;\n    }\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() public view virtual override returns (string memory) {\n        return _name;\n    }\n\n    /**\n     * @dev Returns the symbol of the token, usually a shorter version of the\n     * name.\n     */\n    function symbol() public view virtual override returns (string memory) {\n        return _symbol;\n    }\n\n    /**\n     * @dev Returns the number of decimals used to get its user representation.\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\n     * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n     *\n     * Tokens usually opt for a value of 18, imitating the relationship between\n     * Ether and Wei. This is the value {ERC20} uses, unless this function is\n     * overridden;\n     *\n     * NOTE: This information is only used for _display_ purposes: it in\n     * no way affects any of the arithmetic of the contract, including\n     * {IERC20-balanceOf} and {IERC20-transfer}.\n     */\n    function decimals() public view virtual override returns (uint8) {\n        return 18;\n    }\n\n    /**\n     * @dev See {IERC20-totalSupply}.\n     */\n    function totalSupply() public view virtual override returns (uint256) {\n        return _totalSupply;\n    }\n\n    /**\n     * @dev See {IERC20-balanceOf}.\n     */\n    function balanceOf(address account) public view virtual override returns (uint256) {\n        return _balances[account];\n    }\n\n    /**\n     * @dev See {IERC20-transfer}.\n     *\n     * Requirements:\n     *\n     * - `recipient` cannot be the zero address.\n     * - the caller must have a balance of at least `amount`.\n     */\n    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n        _transfer(_msgSender(), recipient, amount);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-allowance}.\n     */\n    function allowance(address owner, address spender) public view virtual override returns (uint256) {\n        return _allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function approve(address spender, uint256 amount) public virtual override returns (bool) {\n        _approve(_msgSender(), spender, amount);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Emits an {Approval} event indicating the updated allowance. This is not\n     * required by the EIP. See the note at the beginning of {ERC20}.\n     *\n     * Requirements:\n     *\n     * - `sender` and `recipient` cannot be the zero address.\n     * - `sender` must have a balance of at least `amount`.\n     * - the caller must have allowance for ``sender``'s tokens of at least\n     * `amount`.\n     */\n    function transferFrom(\n        address sender,\n        address recipient,\n        uint256 amount\n    ) public virtual override returns (bool) {\n        _transfer(sender, recipient, amount);\n\n        uint256 currentAllowance = _allowances[sender][_msgSender()];\n        require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n        unchecked {\n            _approve(sender, _msgSender(), currentAllowance - amount);\n        }\n\n        return true;\n    }\n\n    /**\n     * @dev Atomically increases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);\n        return true;\n    }\n\n    /**\n     * @dev Atomically decreases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `spender` must have allowance for the caller of at least\n     * `subtractedValue`.\n     */\n    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n        uint256 currentAllowance = _allowances[_msgSender()][spender];\n        require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n        unchecked {\n            _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n        }\n\n        return true;\n    }\n\n    /**\n     * @dev Moves `amount` of tokens from `sender` to `recipient`.\n     *\n     * This internal function is equivalent to {transfer}, and can be used to\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\n     *\n     * Emits a {Transfer} event.\n     *\n     * Requirements:\n     *\n     * - `sender` cannot be the zero address.\n     * - `recipient` cannot be the zero address.\n     * - `sender` must have a balance of at least `amount`.\n     */\n    function _transfer(\n        address sender,\n        address recipient,\n        uint256 amount\n    ) internal virtual {\n        require(sender != address(0), \"ERC20: transfer from the zero address\");\n        require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n        _beforeTokenTransfer(sender, recipient, amount);\n\n        uint256 senderBalance = _balances[sender];\n        require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n        unchecked {\n            _balances[sender] = senderBalance - amount;\n        }\n        _balances[recipient] += amount;\n\n        emit Transfer(sender, recipient, amount);\n\n        _afterTokenTransfer(sender, recipient, amount);\n    }\n\n    /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n     * the total supply.\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * Requirements:\n     *\n     * - `account` cannot be the zero address.\n     */\n    function _mint(address account, uint256 amount) internal virtual {\n        require(account != address(0), \"ERC20: mint to the zero address\");\n\n        _beforeTokenTransfer(address(0), account, amount);\n\n        _totalSupply += amount;\n        _balances[account] += amount;\n        emit Transfer(address(0), account, amount);\n\n        _afterTokenTransfer(address(0), account, amount);\n    }\n\n    /**\n     * @dev Destroys `amount` tokens from `account`, reducing the\n     * total supply.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * Requirements:\n     *\n     * - `account` cannot be the zero address.\n     * - `account` must have at least `amount` tokens.\n     */\n    function _burn(address account, uint256 amount) internal virtual {\n        require(account != address(0), \"ERC20: burn from the zero address\");\n\n        _beforeTokenTransfer(account, address(0), amount);\n\n        uint256 accountBalance = _balances[account];\n        require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n        unchecked {\n            _balances[account] = accountBalance - amount;\n        }\n        _totalSupply -= amount;\n\n        emit Transfer(account, address(0), amount);\n\n        _afterTokenTransfer(account, address(0), amount);\n    }\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n     *\n     * This internal function is equivalent to `approve`, and can be used to\n     * e.g. set automatic allowances for certain subsystems, etc.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     */\n    function _approve(\n        address owner,\n        address spender,\n        uint256 amount\n    ) internal virtual {\n        require(owner != address(0), \"ERC20: approve from the zero address\");\n        require(spender != address(0), \"ERC20: approve to the zero address\");\n\n        _allowances[owner][spender] = amount;\n        emit Approval(owner, spender, amount);\n    }\n\n    /**\n     * @dev Hook that is called before any transfer of tokens. This includes\n     * minting and burning.\n     *\n     * Calling conditions:\n     *\n     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n     * will be transferred to `to`.\n     * - when `from` is zero, `amount` tokens will be minted for `to`.\n     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n     * - `from` and `to` are never both zero.\n     *\n     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n     */\n    function _beforeTokenTransfer(\n        address from,\n        address to,\n        uint256 amount\n    ) internal virtual {}\n\n    /**\n     * @dev Hook that is called after any transfer of tokens. This includes\n     * minting and burning.\n     *\n     * Calling conditions:\n     *\n     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n     * has been transferred to `to`.\n     * - when `from` is zero, `amount` tokens have been minted for `to`.\n     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n     * - `from` and `to` are never both zero.\n     *\n     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n     */\n    function _afterTokenTransfer(\n        address from,\n        address to,\n        uint256 amount\n    ) internal virtual {}\n    uint256[45] private __gap;\n}\n"},"node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./draft-IERC20PermitUpgradeable.sol\";\nimport \"../ERC20Upgradeable.sol\";\nimport \"../../../utils/cryptography/draft-EIP712Upgradeable.sol\";\nimport \"../../../utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"../../../utils/CountersUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable {\n    using CountersUpgradeable for CountersUpgradeable.Counter;\n\n    mapping(address => CountersUpgradeable.Counter) private _nonces;\n\n    // solhint-disable-next-line var-name-mixedcase\n    bytes32 private _PERMIT_TYPEHASH;\n\n    /**\n     * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n     *\n     * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n     */\n    function __ERC20Permit_init(string memory name) internal initializer {\n        __Context_init_unchained();\n        __EIP712_init_unchained(name, \"1\");\n        __ERC20Permit_init_unchained(name);\n    }\n\n    function __ERC20Permit_init_unchained(string memory name) internal initializer {\n        _PERMIT_TYPEHASH = keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");}\n\n    /**\n     * @dev See {IERC20Permit-permit}.\n     */\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) public virtual override {\n        require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n        bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));\n\n        bytes32 hash = _hashTypedDataV4(structHash);\n\n        address signer = ECDSAUpgradeable.recover(hash, v, r, s);\n        require(signer == owner, \"ERC20Permit: invalid signature\");\n\n        _approve(owner, spender, value);\n    }\n\n    /**\n     * @dev See {IERC20Permit-nonces}.\n     */\n    function nonces(address owner) public view virtual override returns (uint256) {\n        return _nonces[owner].current();\n    }\n\n    /**\n     * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n     */\n    // solhint-disable-next-line func-name-mixedcase\n    function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n        return _domainSeparatorV4();\n    }\n\n    /**\n     * @dev \"Consume a nonce\": return the current value and increment.\n     *\n     * _Available since v4.1._\n     */\n    function _useNonce(address owner) internal virtual returns (uint256 current) {\n        CountersUpgradeable.Counter storage nonce = _nonces[owner];\n        current = nonce.current();\n        nonce.increment();\n    }\n    uint256[49] private __gap;\n}\n"},"contracts/Tether/WithBlockedList.sol":{"content":"// SPDX-License-Identifier: Apache 2.0\n\npragma solidity 0.8.4;\n\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\n/*\n\n   Copyright Tether.to 2020\n\n   Author Will Harborne\n\n   Licensed under the Apache License, Version 2.0\n   http://www.apache.org/licenses/LICENSE-2.0\n\n*/\n\n\ncontract WithBlockedList is OwnableUpgradeable {\n\n    /**\n     * @dev Reverts if called by a blocked account\n     */\n    modifier onlyNotBlocked() {\n      require(!isBlocked[_msgSender()], \"Blocked: msg.sender is blocked\");\n      _;\n    }\n\n    mapping (address => bool) public isBlocked;\n\n    function addToBlockedList (address _user) public onlyOwner {\n        isBlocked[_user] = true;\n        emit BlockPlaced(_user);\n    }\n\n    function removeFromBlockedList (address _user) public onlyOwner {\n        isBlocked[_user] = false;\n        emit BlockReleased(_user);\n    }\n\n    event BlockPlaced(address indexed _user);\n\n    event BlockReleased(address indexed _user);\n    \n}\n"},"contracts/Tether/util/MessageHashUtils.sol":{"content":"/**\n * SPDX-License-Identifier: Apache-2.0\n *\n * Copyright (c) 2023, Circle Internet Financial, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * ---------------------------------------------------------------------\n * \n * Adapted by Tether.to 2024 for greater flexibility and reusability\n */\n\npragma solidity >=0.6.12 <0.9.0;\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n    /**\n     * @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`).\n     * Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/21bb89ef5bfc789b9333eb05e3ba2b7b284ac77c/contracts/utils/cryptography/MessageHashUtils.sol\n     *\n     * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n     * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n     *\n     * @param domainSeparator    Domain separator\n     * @param structHash         Hashed EIP-712 data struct\n     * @return digest            The keccak256 digest of an EIP-712 typed data\n     */\n    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash)\n        internal\n        pure\n        returns (bytes32 digest)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let ptr := mload(0x40)\n            mstore(ptr, \"\\x19\\x01\")\n            mstore(add(ptr, 0x02), domainSeparator)\n            mstore(add(ptr, 0x22), structHash)\n            digest := keccak256(ptr, 0x42)\n        }\n    }\n}"},"contracts/Tether/util/ECRecover.sol":{"content":"/**\n * SPDX-License-Identifier: Apache-2.0\n *\n * Copyright (c) 2023, Circle Internet Financial, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * ---------------------------------------------------------------------\n * \n * Adapted by Tether.to 2024 for greater flexibility and reusability\n */\n\npragma solidity >=0.6.12 <0.9.0;\n\n/**\n * @title ECRecover\n * @notice A library that provides a safe ECDSA recovery function\n */\nlibrary ECRecover {\n    /**\n     * @notice Recover signer's address from a signed message\n     * @dev Adapted from: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/65e4ffde586ec89af3b7e9140bdc9235d1254853/contracts/cryptography/ECDSA.sol\n     * Modifications: Accept v, r, and s as separate arguments\n     * @param digest    Keccak-256 hash digest of the signed message\n     * @param v         v of the signature\n     * @param r         r of the signature\n     * @param s         s of the signature\n     * @return Signer address\n     */\n    function recover(\n        bytes32 digest,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal pure returns (address) {\n        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n        // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most\n        // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n        //\n        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n        // these malleable signatures as well.\n        if (\n            uint256(s) >\n            0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0\n        ) {\n            revert(\"ECRecover: invalid signature 's' value\");\n        }\n\n        if (v != 27 && v != 28) {\n            revert(\"ECRecover: invalid signature 'v' value\");\n        }\n\n        // If the signature is valid (and not malleable), return the signer address\n        address signer = ecrecover(digest, v, r, s);\n        require(signer != address(0), \"ECRecover: invalid signature\");\n\n        return signer;\n    }\n\n    /**\n     * @notice Recover signer's address from a signed message\n     * @dev Adapted from: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/0053ee040a7ff1dbc39691c9e67a69f564930a88/contracts/utils/cryptography/ECDSA.sol\n     * @param digest    Keccak-256 hash digest of the signed message\n     * @param signature Signature byte array associated with hash\n     * @return Signer address\n     */\n    function recover(bytes32 digest, bytes memory signature)\n        internal\n        pure\n        returns (address)\n    {\n        require(signature.length == 65, \"ECRecover: invalid signature length\");\n\n        bytes32 r;\n        bytes32 s;\n        uint8 v;\n\n        // ecrecover takes the signature parameters, and the only way to get them\n        // currently is to use assembly.\n        /// @solidity memory-safe-assembly\n        assembly {\n            r := mload(add(signature, 0x20))\n            s := mload(add(signature, 0x40))\n            v := byte(0, mload(add(signature, 0x60)))\n        }\n        return recover(digest, v, r, s);\n    }\n}"},"contracts/Tether/interfaces/IERC1271.sol":{"content":"/**\n * SPDX-License-Identifier: Apache-2.0\n *\n * Copyright (c) 2023, Circle Internet Financial, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * ---------------------------------------------------------------------\n * \n * Adapted by Tether.to 2024 for greater flexibility and reusability\n */\n\npragma solidity >=0.6.12 <0.9.0;\n\n/**\n * @dev Interface of the ERC1271 standard signature validation method for\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\n */\ninterface IERC1271 {\n    /**\n     * @dev Should return whether the signature provided is valid for the provided data\n     * @param hash          Hash of the data to be signed\n     * @param signature     Signature byte array associated with the provided data hash\n     * @return magicValue   bytes4 magic value 0x1626ba7e when function passes\n     */\n    function isValidSignature(bytes32 hash, bytes memory signature)\n        external\n        view\n        returns (bytes4 magicValue);\n}"},"node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal initializer {\n        __Context_init_unchained();\n    }\n\n    function __Context_init_unchained() internal initializer {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n    uint256[50] private __gap;\n}\n"},"node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n */\nabstract contract Initializable {\n    /**\n     * @dev Indicates that the contract has been initialized.\n     */\n    bool private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Modifier to protect an initializer function from being invoked twice.\n     */\n    modifier initializer() {\n        require(_initializing || !_initialized, \"Initializable: contract is already initialized\");\n\n        bool isTopLevelCall = !_initializing;\n        if (isTopLevelCall) {\n            _initializing = true;\n            _initialized = true;\n        }\n\n        _;\n\n        if (isTopLevelCall) {\n            _initializing = false;\n        }\n    }\n}\n"},"node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller's account to `recipient`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address recipient, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `sender` to `recipient` using the\n     * allowance mechanism. `amount` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(\n        address sender,\n        address recipient,\n        uint256 amount\n    ) external returns (bool);\n\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"},"node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the symbol of the token.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the decimals places of the token.\n     */\n    function decimals() external view returns (uint8);\n}\n"},"node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20PermitUpgradeable {\n    /**\n     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n     * given ``owner``'s signed approval.\n     *\n     * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n     * ordering also apply here.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `deadline` must be a timestamp in the future.\n     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n     * over the EIP712-formatted function arguments.\n     * - the signature must use ``owner``'s current nonce (see {nonces}).\n     *\n     * For more information on the signature format, see the\n     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n     * section].\n     */\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external;\n\n    /**\n     * @dev Returns the current nonce for `owner`. This value must be\n     * included whenever a signature is generated for {permit}.\n     *\n     * Every successful call to {permit} increases ``owner``'s nonce by one. This\n     * prevents a signature from being used multiple times.\n     */\n    function nonces(address owner) external view returns (uint256);\n\n    /**\n     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n     */\n    // solhint-disable-next-line func-name-mixedcase\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"},"node_modules/@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSAUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712Upgradeable is Initializable {\n    /* solhint-disable var-name-mixedcase */\n    bytes32 private _HASHED_NAME;\n    bytes32 private _HASHED_VERSION;\n    bytes32 private constant _TYPE_HASH = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n    /* solhint-enable var-name-mixedcase */\n\n    /**\n     * @dev Initializes the domain separator and parameter caches.\n     *\n     * The meaning of `name` and `version` is specified in\n     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n     *\n     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n     * - `version`: the current major version of the signing domain.\n     *\n     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n     * contract upgrade].\n     */\n    function __EIP712_init(string memory name, string memory version) internal initializer {\n        __EIP712_init_unchained(name, version);\n    }\n\n    function __EIP712_init_unchained(string memory name, string memory version) internal initializer {\n        bytes32 hashedName = keccak256(bytes(name));\n        bytes32 hashedVersion = keccak256(bytes(version));\n        _HASHED_NAME = hashedName;\n        _HASHED_VERSION = hashedVersion;\n    }\n\n    /**\n     * @dev Returns the domain separator for the current chain.\n     */\n    function _domainSeparatorV4() internal view returns (bytes32) {\n        return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\n    }\n\n    function _buildDomainSeparator(\n        bytes32 typeHash,\n        bytes32 nameHash,\n        bytes32 versionHash\n    ) private view returns (bytes32) {\n        return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n    }\n\n    /**\n     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n     * function returns the hash of the fully encoded EIP712 message for this domain.\n     *\n     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n     *\n     * ```solidity\n     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n     *     keccak256(\"Mail(address to,string contents)\"),\n     *     mailTo,\n     *     keccak256(bytes(mailContents))\n     * )));\n     * address signer = ECDSA.recover(digest, signature);\n     * ```\n     */\n    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n        return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\n    }\n\n    /**\n     * @dev The hash of the name parameter for the EIP712 domain.\n     *\n     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n     * are a concern.\n     */\n    function _EIP712NameHash() internal virtual view returns (bytes32) {\n        return _HASHED_NAME;\n    }\n\n    /**\n     * @dev The hash of the version parameter for the EIP712 domain.\n     *\n     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n     * are a concern.\n     */\n    function _EIP712VersionHash() internal virtual view returns (bytes32) {\n        return _HASHED_VERSION;\n    }\n    uint256[50] private __gap;\n}\n"},"node_modules/@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSAUpgradeable {\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with\n     * `signature`. This address can then be used for verification purposes.\n     *\n     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {toEthSignedMessageHash} on it.\n     *\n     * Documentation for signature generation:\n     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n     */\n    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n        // Check the signature length\n        // - case 65: r,s,v signature (standard)\n        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._\n        if (signature.length == 65) {\n            bytes32 r;\n            bytes32 s;\n            uint8 v;\n            // ecrecover takes the signature parameters, and the only way to get them\n            // currently is to use assembly.\n            assembly {\n                r := mload(add(signature, 0x20))\n                s := mload(add(signature, 0x40))\n                v := byte(0, mload(add(signature, 0x60)))\n            }\n            return recover(hash, v, r, s);\n        } else if (signature.length == 64) {\n            bytes32 r;\n            bytes32 vs;\n            // ecrecover takes the signature parameters, and the only way to get them\n            // currently is to use assembly.\n            assembly {\n                r := mload(add(signature, 0x20))\n                vs := mload(add(signature, 0x40))\n            }\n            return recover(hash, r, vs);\n        } else {\n            revert(\"ECDSA: invalid signature length\");\n        }\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `r` and `vs` short-signature fields separately.\n     *\n     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n     *\n     * _Available since v4.2._\n     */\n    function recover(\n        bytes32 hash,\n        bytes32 r,\n        bytes32 vs\n    ) internal pure returns (address) {\n        bytes32 s;\n        uint8 v;\n        assembly {\n            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)\n            v := add(shr(255, vs), 27)\n        }\n        return recover(hash, v, r, s);\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `v`, `r` and `s` signature fields separately.\n     */\n    function recover(\n        bytes32 hash,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal pure returns (address) {\n        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n        // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most\n        // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n        //\n        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n        // these malleable signatures as well.\n        require(\n            uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0,\n            \"ECDSA: invalid signature 's' value\"\n        );\n        require(v == 27 || v == 28, \"ECDSA: invalid signature 'v' value\");\n\n        // If the signature is valid (and not malleable), return the signer address\n        address signer = ecrecover(hash, v, r, s);\n        require(signer != address(0), \"ECDSA: invalid signature\");\n\n        return signer;\n    }\n\n    /**\n     * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n     * produces hash corresponding to the one signed with the\n     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n     * JSON-RPC method as part of EIP-191.\n     *\n     * See {recover}.\n     */\n    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n        // 32 is the length in bytes of hash,\n        // enforced by the type signature above\n        return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n    }\n\n    /**\n     * @dev Returns an Ethereum Signed Typed Data, created from a\n     * `domainSeparator` and a `structHash`. This produces hash corresponding\n     * to the one signed with the\n     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n     * JSON-RPC method as part of EIP-712.\n     *\n     * See {recover}.\n     */\n    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n        return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n    }\n}\n"},"node_modules/@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary CountersUpgradeable {\n    struct Counter {\n        // This variable should never be directly accessed by users of the library: interactions must be restricted to\n        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n        // this feature: see https://github.com/ethereum/solidity/issues/4637\n        uint256 _value; // default: 0\n    }\n\n    function current(Counter storage counter) internal view returns (uint256) {\n        return counter._value;\n    }\n\n    function increment(Counter storage counter) internal {\n        unchecked {\n            counter._value += 1;\n        }\n    }\n\n    function decrement(Counter storage counter) internal {\n        uint256 value = counter._value;\n        require(value > 0, \"Counter: decrement overflow\");\n        unchecked {\n            counter._value = value - 1;\n        }\n    }\n\n    function reset(Counter storage counter) internal {\n        counter._value = 0;\n    }\n}\n"}},"matchId":"28570484","creationMatch":"match","runtimeMatch":"match","verifiedAt":"2026-05-05T16:14:02Z","match":"match","chainId":"42220","address":"0x49912F84f43d2675d99941B7F21a5d9eD2eab71E"}