Sepolia Testnet

Contract

0xa619cdCb5D3581B30c94146671C53562e8418D97

Overview

ETH Balance

0 ETH

More Info

Multichain Info

N/A
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Advanced mode:
Parent Transaction Hash Method Block
From
To
View All Internal Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

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

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xfD6B9F2d...91909E349
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
HexTrustUSDV2

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 20000 runs

Other Settings:
shanghai EvmVersion, MIT license
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {IOFT, OFTCoreUpgradeable} from "../layerzero/oapp/contracts/oft/OFTCoreUpgradeable.sol";
import {RoleConstant} from "contracts/utils/RoleConstant.sol";
import {HexTrustUSD} from "contracts/HexTrustUSD.sol";

/**
 * @title ERC20 Upgradable token with the name 'HexTrustUSD'
 * Changes from V1:
 * 1. Extend OFT standard for LayerZero support
 * 2. _authorizeUpgrade() allow upgrade contract by defaultAdmin & when the contract is paused
 */
contract HexTrustUSDV2 is HexTrustUSD, OFTCoreUpgradeable {
    /**
     * @param _decimals ERC20's decimals, for calculate decimalConversionRate in OFT
     * @param _lzEndpoint The LayerZero endpoint address.
     * @custom:oz-upgrades-unsafe-allow constructor
     */
    constructor(uint8 _decimals, address _lzEndpoint) OFTCoreUpgradeable(_decimals, _lzEndpoint) {
        _disableInitializers();
    }

    /**
     * @dev Initializing the OFT, setting delegate of the OFT;
     */
    function initializeV2()
        external
        reinitializer(2)
    {
        __OFTCore_init(defaultAdmin());
    }

    /**
     * @notice Retrieves interfaceID and the version of the OFT.
     * @return interfaceId The interface ID.
     * @return version The version.
     *
     * @dev interfaceId: This specific interface ID is '0x02e49c2c'.
     * @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.
     * @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.
     * ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)
     */
    function oftVersion() external pure virtual returns (bytes4 interfaceId, uint64 version) {
        return (type(IOFT).interfaceId, 1);
    }

    /**
     * @dev Retrieves the address of the underlying ERC20 implementation.
     * @return The address of the OFT token.
     *
     * @dev In the case of OFT, address(this) and erc20 are the same contract.
     */
    function token() external view returns (address) {
        return address(this);
    }

    /**
     * @notice Indicates whether the OFT contract requires approval of the 'token()' to send.
     * @return requiresApproval Needs approval of the underlying token implementation.
     *
     * @dev In the case of OFT where the contract IS the token, approval is NOT required.
     */
    function approvalRequired() external pure virtual returns (bool) {
        return false;
    }

    /**
     * @dev Returns true for authorized operator who has access right to update OApp configurations
     */
    function isAuthorizedOperator(address _address) public view override returns (bool) {
        return isDefaultAdmin(_address) || hasRole(RoleConstant.UPGRADE_ADMIN_ROLE, _address);
    }

    /**
     * @dev Burns tokens from the sender's specified balance.
     * @param _amountLD The amount of tokens to send in local decimals.
     * @param _minAmountLD The minimum amount to send in local decimals.
     * @param _dstEid The destination chain ID.
     * @return amountSentLD The amount sent in local decimals.
     * @return amountReceivedLD The amount received in local decimals on the remote.
     */
    function _debit(uint256 _amountLD, uint256 _minAmountLD, uint32 _dstEid)
        internal
        virtual
        override
        returns (uint256 amountSentLD, uint256 amountReceivedLD)
    {
        (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid);

        // @dev In NON-default OFT, amountSentLD could be 100, with a 10% fee, the amountReceivedLD amount is 90,
        // therefore amountSentLD CAN differ from amountReceivedLD.

        // @dev Default OFT burns on src.
        _burn(msg.sender, amountSentLD);
    }

    /**
     * @dev Credits tokens to the specified address.
     * @param _to The address to credit the tokens to.
     * @param _amountLD The amount of tokens to credit in local decimals.
     * @dev _srcEid The source chain ID.
     * @return amountReceivedLD The amount of tokens ACTUALLY received in local decimals.
     */
    function _credit(address _to, uint256 _amountLD, uint32 /*_srcEid*/ )
        internal
        virtual
        override
        returns (uint256 amountReceivedLD)
    {
        // @dev Default OFT mints on dst.
        _mint(_to, _amountLD);
        // @dev In the case of NON-default OFT, the _amountLD MIGHT not be == amountReceivedLD.
        return _amountLD;
    }

    /**
     * @dev required by the OZ UUPS module
     * - Setting upgradability control as UPGRADE_ADMIN_ROLE & defaultAdmin
     */
    function _authorizeUpgrade(address newImplementation)
        internal
        virtual
        override
        onlyRoleOrDefaultAdmin(RoleConstant.UPGRADE_ADMIN_ROLE)
    {}

    // VERSIONS
    function getVersion() external override pure virtual returns (uint256) {
        return 2;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.20;

import {IERC1822Proxiable} from "@openzeppelin/contracts/interfaces/draft-IERC1822.sol";
import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol";
import {Initializable} from "./Initializable.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 */
abstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    address private immutable __self = address(this);

    /**
     * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`
     * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,
     * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.
     * If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must
     * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function
     * during an upgrade.
     */
    string public constant UPGRADE_INTERFACE_VERSION = "5.0.0";

    /**
     * @dev The call is from an unauthorized context.
     */
    error UUPSUnauthorizedCallContext();

    /**
     * @dev The storage `slot` is unsupported as a UUID.
     */
    error UUPSUnsupportedProxiableUUID(bytes32 slot);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        _checkProxy();
        _;
    }

    /**
     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be
     * callable on the implementing contract but not through proxies.
     */
    modifier notDelegated() {
        _checkNotDelegated();
        _;
    }

    function __UUPSUpgradeable_init() internal onlyInitializing {
    }

    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
     */
    function proxiableUUID() external view virtual notDelegated returns (bytes32) {
        return ERC1967Utils.IMPLEMENTATION_SLOT;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     *
     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, data);
    }

    /**
     * @dev Reverts if the execution is not performed via delegatecall or the execution
     * context is not of a proxy with an ERC1967-compliant implementation pointing to self.
     * See {_onlyProxy}.
     */
    function _checkProxy() internal view virtual {
        if (
            address(this) == __self || // Must be called through delegatecall
            ERC1967Utils.getImplementation() != __self // Must be called through an active proxy
        ) {
            revert UUPSUnauthorizedCallContext();
        }
    }

    /**
     * @dev Reverts if the execution is performed via delegatecall.
     * See {notDelegated}.
     */
    function _checkNotDelegated() internal view virtual {
        if (address(this) != __self) {
            // Must not be called through delegatecall
            revert UUPSUnauthorizedCallContext();
        }
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;

    /**
     * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.
     *
     * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value
     * is expected to be the implementation slot in ERC1967.
     *
     * Emits an {IERC1967-Upgraded} event.
     */
    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {
        try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {
            if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {
                revert UUPSUnsupportedProxiableUUID(slot);
            }
            ERC1967Utils.upgradeToAndCall(newImplementation, data);
        } catch {
            // The implementation is not UUPS
            revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.20;

/**
 * @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]
 * ```solidity
 * 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 Storage of the initializable contract.
     *
     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
     * when using with upgradeable contracts.
     *
     * @custom:storage-location erc7201:openzeppelin.storage.Initializable
     */
    struct InitializableStorage {
        /**
         * @dev Indicates that the contract has been initialized.
         */
        uint64 _initialized;
        /**
         * @dev Indicates that the contract is in the process of being initialized.
         */
        bool _initializing;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;

    /**
     * @dev The contract is already initialized.
     */
    error InvalidInitialization();

    /**
     * @dev The contract is not initializing.
     */
    error NotInitializing();

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint64 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 in the context of a constructor an `initializer` may be invoked any
     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
     * production.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        // Cache values to avoid duplicated sloads
        bool isTopLevelCall = !$._initializing;
        uint64 initialized = $._initialized;

        // Allowed calls:
        // - initialSetup: the contract is not in the initializing state and no previous version was
        //                 initialized
        // - construction: the contract is initialized at version 1 (no reininitialization) and the
        //                 current contract is just being deployed
        bool initialSetup = initialized == 0 && isTopLevelCall;
        bool construction = initialized == 1 && address(this).code.length == 0;

        if (!initialSetup && !construction) {
            revert InvalidInitialization();
        }
        $._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 2**64 - 1 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint64 version) {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing || $._initialized >= version) {
            revert InvalidInitialization();
        }
        $._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() {
        _checkInitializing();
        _;
    }

    /**
     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
     */
    function _checkInitializing() internal view virtual {
        if (!_isInitializing()) {
            revert NotInitializing();
        }
    }

    /**
     * @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 {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing) {
            revert InvalidInitialization();
        }
        if ($._initialized != type(uint64).max) {
            $._initialized = type(uint64).max;
            emit Initialized(type(uint64).max);
        }
    }

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

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

    /**
     * @dev Returns a pointer to the storage namespace.
     */
    // solhint-disable-next-line var-name-mixedcase
    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
        assembly {
            $.slot := INITIALIZABLE_STORAGE
        }
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

import { OAppUpgradeable, Origin } from "../oapp/OAppUpgradeable.sol";
import { OAppOptionsType3Upgradeable } from "../oapp/libs/OAppOptionsType3Upgradeable.sol";
import { IOAppMsgInspector } from "../oapp/interfaces/IOAppMsgInspector.sol";

import { OAppPreCrimeSimulatorUpgradeable } from "../precrime/OAppPreCrimeSimulatorUpgradeable.sol";

import { IOFT, SendParam, OFTLimit, OFTReceipt, OFTFeeDetail, MessagingReceipt, MessagingFee } from "./interfaces/IOFT.sol";
import { OFTMsgCodec } from "./libs/OFTMsgCodec.sol";
import { OFTComposeMsgCodec } from "./libs/OFTComposeMsgCodec.sol";

/**
 * @title OFTCore
 * @dev Abstract contract for the OftChain (OFT) token.
 */
abstract contract OFTCoreUpgradeable is
    IOFT,
    OAppUpgradeable,
    OAppPreCrimeSimulatorUpgradeable,
    OAppOptionsType3Upgradeable
{
    using OFTMsgCodec for bytes;
    using OFTMsgCodec for bytes32;

    struct OFTCoreStorage {
        // Address of an optional contract to inspect both 'message' and 'options'
        address msgInspector;
    }

    // keccak256(abi.encode(uint256(keccak256("layerzerov2.storage.oftcore")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant OFTCoreStorageLocation =
        0x41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c00;

    // @notice Provides a conversion rate when swapping between denominations of SD and LD
    //      - shareDecimals == SD == shared Decimals
    //      - localDecimals == LD == local decimals
    // @dev Considers that tokens have different decimal amounts on various chains.
    // @dev eg.
    //  For a token
    //      - locally with 4 decimals --> 1.2345 => uint(12345)
    //      - remotely with 2 decimals --> 1.23 => uint(123)
    //      - The conversion rate would be 10 ** (4 - 2) = 100
    //  @dev If you want to send 1.2345 -> (uint 12345), you CANNOT represent that value on the remote,
    //  you can only display 1.23 -> uint(123).
    //  @dev To preserve the dust that would otherwise be lost on that conversion,
    //  we need to unify a denomination that can be represented on ALL chains inside of the OFT mesh
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    uint256 public immutable decimalConversionRate;

    // @notice Msg types that are used to identify the various OFT operations.
    // @dev This can be extended in child contracts for non-default oft operations
    // @dev These values are used in things like combineOptions() in OAppOptionsType3.sol.
    uint16 public constant SEND = 1;
    uint16 public constant SEND_AND_CALL = 2;

    event MsgInspectorSet(address inspector);

    function _getOFTCoreStorage() internal pure returns (OFTCoreStorage storage $) {
        assembly {
            $.slot := OFTCoreStorageLocation
        }
    }

    /**
     * @dev Constructor.
     * @param _localDecimals The decimals of the token on the local chain (this chain).
     * @param _endpoint The address of the LayerZero endpoint.
     * @custom:oz-upgrades-unsafe-allow constructor
     */
    constructor(uint8 _localDecimals, address _endpoint) OAppUpgradeable(_endpoint) {
        if (_localDecimals < sharedDecimals()) revert InvalidLocalDecimals();
        decimalConversionRate = 10 ** (_localDecimals - sharedDecimals());
    }

    /**
     * @dev Initializes the OFTCore contract.
     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.
     *
     * @dev The delegate typically should be set as the owner of the contract.
     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to
     * accommodate the different version of Ownable.
     */
    function __OFTCore_init(address _delegate) internal onlyInitializing {
        __OAppCore_init(_delegate);
    }

    function __OFTCore_init_unchained() internal onlyInitializing {}

    function msgInspector() public view returns (address) {
        OFTCoreStorage storage $ = _getOFTCoreStorage();
        return $.msgInspector;
    }

    /**
     * @dev Retrieves the shared decimals of the OFT.
     * @return The shared decimals of the OFT.
     *
     * @dev Sets an implicit cap on the amount of tokens, over uint64.max() will need some sort of outbound cap / totalSupply cap
     * Lowest common decimal denominator between chains.
     * Defaults to 6 decimal places to provide up to 18,446,744,073,709.551615 units (max uint64).
     * For tokens exceeding this totalSupply(), they will need to override the sharedDecimals function with something smaller.
     * ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615
     */
    function sharedDecimals() public pure virtual returns (uint8) {
        return 6;
    }

    /**
     * @dev Sets the message inspector address for the OFT.
     * @dev Only the admin of the OApp can call this function. control via {_checkAuthorizeOperator()}
     * @param _msgInspector The address of the message inspector.
     *
     * @dev This is an optional contract that can be used to inspect both 'message' and 'options'.
     * @dev Set it to address(0) to disable it, or set it to a contract address to enable it.
     */
    function setMsgInspector(address _msgInspector) public virtual {
        _checkAuthorizeOperator();
        OFTCoreStorage storage $ = _getOFTCoreStorage();
        $.msgInspector = _msgInspector;
        emit MsgInspectorSet(_msgInspector);
    }

    /**
     * @notice Provides a quote for OFT-related operations.
     * @param _sendParam The parameters for the send operation.
     * @return oftLimit The OFT limit information.
     * @return oftFeeDetails The details of OFT fees.
     * @return oftReceipt The OFT receipt information.
     */
    function quoteOFT(
        SendParam calldata _sendParam
    )
        external
        view
        virtual
        returns (OFTLimit memory oftLimit, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory oftReceipt)
    {
        uint256 minAmountLD = 0; // Unused in the default implementation.
        uint256 maxAmountLD = type(uint64).max; // Unused in the default implementation.
        oftLimit = OFTLimit(minAmountLD, maxAmountLD);

        // Unused in the default implementation; reserved for future complex fee details.
        oftFeeDetails = new OFTFeeDetail[](0);

        // @dev This is the same as the send() operation, but without the actual send.
        // - amountSentLD is the amount in local decimals that would be sent from the sender.
        // - amountReceivedLD is the amount in local decimals that will be credited to the recipient on the remote OFT instance.
        // @dev The amountSentLD MIGHT not equal the amount the user actually receives. HOWEVER, the default does.
        (uint256 amountSentLD, uint256 amountReceivedLD) = _debitView(
            _sendParam.amountLD,
            _sendParam.minAmountLD,
            _sendParam.dstEid
        );
        oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);
    }

    /**
     * @notice Provides a quote for the send() operation.
     * @param _sendParam The parameters for the send() operation.
     * @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.
     * @return msgFee The calculated LayerZero messaging fee from the send() operation.
     *
     * @dev MessagingFee: LayerZero msg fee
     *  - nativeFee: The native fee.
     *  - lzTokenFee: The lzToken fee.
     */
    function quoteSend(
        SendParam calldata _sendParam,
        bool _payInLzToken
    ) external view virtual returns (MessagingFee memory msgFee) {
        // @dev mock the amount to receive, this is the same operation used in the send().
        // The quote is as similar as possible to the actual send() operation.
        (, uint256 amountReceivedLD) = _debitView(_sendParam.amountLD, _sendParam.minAmountLD, _sendParam.dstEid);

        // @dev Builds the options and OFT message to quote in the endpoint.
        (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);

        // @dev Calculates the LayerZero fee for the send() operation.
        return _quote(_sendParam.dstEid, message, options, _payInLzToken);
    }

    /**
     * @dev Executes the send operation.
     * @param _sendParam The parameters for the send operation.
     * @param _fee The calculated fee for the send() operation.
     *      - nativeFee: The native fee.
     *      - lzTokenFee: The lzToken fee.
     * @param _refundAddress The address to receive any excess funds.
     * @return msgReceipt The receipt for the send operation.
     * @return oftReceipt The OFT receipt information.
     *
     * @dev MessagingReceipt: LayerZero msg receipt
     *  - guid: The unique identifier for the sent message.
     *  - nonce: The nonce of the sent message.
     *  - fee: The LayerZero fee incurred for the message.
     */
    function send(
        SendParam calldata _sendParam,
        MessagingFee calldata _fee,
        address _refundAddress
    ) external payable virtual returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {
        // @dev Applies the token transfers regarding this send() operation.
        // - amountSentLD is the amount in local decimals that was ACTUALLY sent/debited from the sender.
        // - amountReceivedLD is the amount in local decimals that will be received/credited to the recipient on the remote OFT instance.
        (uint256 amountSentLD, uint256 amountReceivedLD) = _debit(
            _sendParam.amountLD,
            _sendParam.minAmountLD,
            _sendParam.dstEid
        );

        // @dev Builds the options and OFT message to quote in the endpoint.
        (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);

        // @dev Sends the message to the LayerZero endpoint and returns the LayerZero msg receipt.
        msgReceipt = _lzSend(_sendParam.dstEid, message, options, _fee, _refundAddress);
        // @dev Formulate the OFT receipt.
        oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);

        emit OFTSent(msgReceipt.guid, _sendParam.dstEid, msg.sender, amountSentLD, amountReceivedLD);
    }

    /**
     * @dev Internal function to build the message and options.
     * @param _sendParam The parameters for the send() operation.
     * @param _amountLD The amount in local decimals.
     * @return message The encoded message.
     * @return options The encoded options.
     */
    function _buildMsgAndOptions(
        SendParam calldata _sendParam,
        uint256 _amountLD
    ) internal view virtual returns (bytes memory message, bytes memory options) {
        bool hasCompose;
        // @dev This generated message has the msg.sender encoded into the payload so the remote knows who the caller is.
        (message, hasCompose) = OFTMsgCodec.encode(
            _sendParam.to,
            _toSD(_amountLD),
            // @dev Must be include a non empty bytes if you want to compose, EVEN if you dont need it on the remote.
            // EVEN if you dont require an arbitrary payload to be sent... eg. '0x01'
            _sendParam.composeMsg
        );
        // @dev Change the msg type depending if its composed or not.
        uint16 msgType = hasCompose ? SEND_AND_CALL : SEND;
        // @dev Combine the callers _extraOptions with the enforced options via the OAppOptionsType3.
        options = combineOptions(_sendParam.dstEid, msgType, _sendParam.extraOptions);

        OFTCoreStorage storage $ = _getOFTCoreStorage();

        // @dev Optionally inspect the message and options depending if the OApp owner has set a msg inspector.
        // @dev If it fails inspection, needs to revert in the implementation. ie. does not rely on return boolean
        if ($.msgInspector != address(0)) IOAppMsgInspector($.msgInspector).inspect(message, options);
    }

    /**
     * @dev Internal function to handle the receive on the LayerZero endpoint.
     * @param _origin The origin information.
     *  - srcEid: The source chain endpoint ID.
     *  - sender: The sender address from the src chain.
     *  - nonce: The nonce of the LayerZero message.
     * @param _guid The unique identifier for the received LayerZero message.
     * @param _message The encoded message.
     * @dev _executor The address of the executor.
     * @dev _extraData Additional data.
     */
    function _lzReceive(
        Origin calldata _origin,
        bytes32 _guid,
        bytes calldata _message,
        address /*_executor*/, // @dev unused in the default implementation.
        bytes calldata /*_extraData*/ // @dev unused in the default implementation.
    ) internal virtual override {
        // @dev The src sending chain doesnt know the address length on this chain (potentially non-evm)
        // Thus everything is bytes32() encoded in flight.
        address toAddress = _message.sendTo().bytes32ToAddress();
        // @dev Credit the amountLD to the recipient and return the ACTUAL amount the recipient received in local decimals
        uint256 amountReceivedLD = _credit(toAddress, _toLD(_message.amountSD()), _origin.srcEid);

        if (_message.isComposed()) {
            // @dev Proprietary composeMsg format for the OFT.
            bytes memory composeMsg = OFTComposeMsgCodec.encode(
                _origin.nonce,
                _origin.srcEid,
                amountReceivedLD,
                _message.composeMsg()
            );

            // @dev Stores the lzCompose payload that will be executed in a separate tx.
            // Standardizes functionality for executing arbitrary contract invocation on some non-evm chains.
            // @dev The off-chain executor will listen and process the msg based on the src-chain-callers compose options passed.
            // @dev The index is used when a OApp needs to compose multiple msgs on lzReceive.
            // For default OFT implementation there is only 1 compose msg per lzReceive, thus its always 0.
            endpoint.sendCompose(toAddress, _guid, 0, /* the index of the composed message*/ composeMsg);
        }

        emit OFTReceived(_guid, _origin.srcEid, toAddress, amountReceivedLD);
    }

    /**
     * @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.
     * @param _origin The origin information.
     *  - srcEid: The source chain endpoint ID.
     *  - sender: The sender address from the src chain.
     *  - nonce: The nonce of the LayerZero message.
     * @param _guid The unique identifier for the received LayerZero message.
     * @param _message The LayerZero message.
     * @param _executor The address of the off-chain executor.
     * @param _extraData Arbitrary data passed by the msg executor.
     *
     * @dev Enables the preCrime simulator to mock sending lzReceive() messages,
     * routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.
     */
    function _lzReceiveSimulate(
        Origin calldata _origin,
        bytes32 _guid,
        bytes calldata _message,
        address _executor,
        bytes calldata _extraData
    ) internal virtual override {
        _lzReceive(_origin, _guid, _message, _executor, _extraData);
    }

    /**
     * @dev Check if the peer is considered 'trusted' by the OApp.
     * @param _eid The endpoint ID to check.
     * @param _peer The peer to check.
     * @return Whether the peer passed is considered 'trusted' by the OApp.
     *
     * @dev Enables OAppPreCrimeSimulator to check whether a potential Inbound Packet is from a trusted source.
     */
    function isPeer(uint32 _eid, bytes32 _peer) public view virtual override returns (bool) {
        return peers(_eid) == _peer;
    }

    /**
     * @dev Internal function to remove dust from the given local decimal amount.
     * @param _amountLD The amount in local decimals.
     * @return amountLD The amount after removing dust.
     *
     * @dev Prevents the loss of dust when moving amounts between chains with different decimals.
     * @dev eg. uint(123) with a conversion rate of 100 becomes uint(100).
     */
    function _removeDust(uint256 _amountLD) internal view virtual returns (uint256 amountLD) {
        return (_amountLD / decimalConversionRate) * decimalConversionRate;
    }

    /**
     * @dev Internal function to convert an amount from shared decimals into local decimals.
     * @param _amountSD The amount in shared decimals.
     * @return amountLD The amount in local decimals.
     */
    function _toLD(uint64 _amountSD) internal view virtual returns (uint256 amountLD) {
        return _amountSD * decimalConversionRate;
    }

    /**
     * @dev Internal function to convert an amount from local decimals into shared decimals.
     * @param _amountLD The amount in local decimals.
     * @return amountSD The amount in shared decimals.
     */
    function _toSD(uint256 _amountLD) internal view virtual returns (uint64 amountSD) {
        return uint64(_amountLD / decimalConversionRate);
    }

    /**
     * @dev Internal function to mock the amount mutation from a OFT debit() operation.
     * @param _amountLD The amount to send in local decimals.
     * @param _minAmountLD The minimum amount to send in local decimals.
     * @dev _dstEid The destination endpoint ID.
     * @return amountSentLD The amount sent, in local decimals.
     * @return amountReceivedLD The amount to be received on the remote chain, in local decimals.
     *
     * @dev This is where things like fees would be calculated and deducted from the amount to be received on the remote.
     */
    function _debitView(
        uint256 _amountLD,
        uint256 _minAmountLD,
        uint32 /*_dstEid*/
    ) internal view virtual returns (uint256 amountSentLD, uint256 amountReceivedLD) {
        // @dev Remove the dust so nothing is lost on the conversion between chains with different decimals for the token.
        amountSentLD = _removeDust(_amountLD);
        // @dev The amount to send is the same as amount received in the default implementation.
        amountReceivedLD = amountSentLD;

        // @dev Check for slippage.
        if (amountReceivedLD < _minAmountLD) {
            revert SlippageExceeded(amountReceivedLD, _minAmountLD);
        }
    }

    /**
     * @dev Internal function to perform a debit operation.
     * @param _amountLD The amount to send in local decimals.
     * @param _minAmountLD The minimum amount to send in local decimals.
     * @param _dstEid The destination endpoint ID.
     * @return amountSentLD The amount sent in local decimals.
     * @return amountReceivedLD The amount received in local decimals on the remote.
     *
     * @dev Defined here but are intended to be overriden depending on the OFT implementation.
     * @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.
     */
    function _debit(
        uint256 _amountLD,
        uint256 _minAmountLD,
        uint32 _dstEid
    ) internal virtual returns (uint256 amountSentLD, uint256 amountReceivedLD);

    /**
     * @dev Internal function to perform a credit operation.
     * @param _to The address to credit.
     * @param _amountLD The amount to credit in local decimals.
     * @param _srcEid The source endpoint ID.
     * @return amountReceivedLD The amount ACTUALLY received in local decimals.
     *
     * @dev Defined here but are intended to be overriden depending on the OFT implementation.
     * @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.
     */
    function _credit(
        address _to,
        uint256 _amountLD,
        uint32 _srcEid
    ) internal virtual returns (uint256 amountReceivedLD);
}

File 5 of 60 : RoleConstant.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

library RoleConstant {
    /**
     * @dev hashed role string
     * MINTER_ROLE: 0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6
     * BURNER_ROLE: 0x3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a848
     * PAUSER_ROLE: 0x65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a
     * UPGRADE_ADMIN_ROLE: 0xf5e41b69db3149675767a8769b58cb4060b90e5e3d4bab8b1c958708ed9c9259
     * BLACKLISTER_ROLE: 0x98db8a220cd0f09badce9f22d0ba7e93edb3d404448cc3560d391ab096ad16e9
     * MERCHANTS_ROLE: 0xb2b5b7f126fca9c90fed6ed9b87fe3805da60c5b8555ed91e6723b29ec089beb
     */

    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
    bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
    bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
    bytes32 public constant UPGRADE_ADMIN_ROLE =
        keccak256("UPGRADE_ADMIN_ROLE");
    bytes32 public constant BLACKLISTER_ROLE = keccak256("BLACKLISTER_ROLE");
    bytes32 public constant MERCHANTS_ROLE = keccak256("MERCHANTS_ROLE");
}

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {ERC20WithRolesUpgradeable} from "contracts/ERC20WithRolesUpgradeable.sol";
import {RoleConstant} from "contracts/utils/RoleConstant.sol";

/**
 * @title ERC20 Upgradable token with the name 'HexTrustUSD'
 */

contract HexTrustUSD is UUPSUpgradeable, ERC20WithRolesUpgradeable {
    /**
     * @dev Initializing the ERC20, setting name, decimals and symbol;
     * - Setting and saving the token name, symbol and decimals
     * - Setting _owner as DEFAULT_ADMIN_ROLE
     * - Setting role admin of  UPGRADE_ADMIN_ROLE as DEFAULT_ADMIN_ROLE
     * @param _owner - Initial owner
     * @param _name - Token name
     * @param _symbol - Symbol
     * @param _decimals - Decimal
     */
    function initialize(
        address _owner,
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) external initializer nonZA(_owner) {
        __UUPSUpgradeable_init();
        __AccessControlDefaultAdminRules_init(_owner);
        __PausableWithRoles_init();
        __BlacklistableWithRoles_init();
        __ERC20WithRoles_init(_name, _symbol, _decimals);
        __AccessControl_init();
        __Pausable_init();
    }

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() {
        _disableInitializers();
    }

    /**
     * @dev required by the OZ UUPS module
     * - Setting upgradability control as UPGRADE_ADMIN_ROLE
     */
    function _authorizeUpgrade(
        address newImplementation
    )
        internal
        virtual
        override
        onlyRole(RoleConstant.UPGRADE_ADMIN_ROLE)
        whenNotPaused
    {}

    // VERSIONS
    function getVersion() external pure virtual returns (uint256) {
        return 1;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC1822.sol)

pragma solidity ^0.8.20;

/**
 * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
 * proxy whose upgrades are fully controlled by the current implementation.
 */
interface IERC1822Proxiable {
    /**
     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
     * address.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy.
     */
    function proxiableUUID() external view returns (bytes32);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Utils.sol)

pragma solidity ^0.8.20;

import {IBeacon} from "../beacon/IBeacon.sol";
import {Address} from "../../utils/Address.sol";
import {StorageSlot} from "../../utils/StorageSlot.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 */
library ERC1967Utils {
    // We re-declare ERC-1967 events here because they can't be used directly from IERC1967.
    // This will be fixed in Solidity 0.8.21. At that point we should remove these events.
    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Emitted when the beacon is changed.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev The `implementation` of the proxy is invalid.
     */
    error ERC1967InvalidImplementation(address implementation);

    /**
     * @dev The `admin` of the proxy is invalid.
     */
    error ERC1967InvalidAdmin(address admin);

    /**
     * @dev The `beacon` of the proxy is invalid.
     */
    error ERC1967InvalidBeacon(address beacon);

    /**
     * @dev An upgrade function sees `msg.value > 0` that may be lost.
     */
    error ERC1967NonPayable();

    /**
     * @dev Returns the current implementation address.
     */
    function getImplementation() internal view returns (address) {
        return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        if (newImplementation.code.length == 0) {
            revert ERC1967InvalidImplementation(newImplementation);
        }
        StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Performs implementation upgrade with additional setup call if data is nonempty.
     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
     * to avoid stuck value in the contract.
     *
     * Emits an {IERC1967-Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);

        if (data.length > 0) {
            Address.functionDelegateCall(newImplementation, data);
        } else {
            _checkNonPayable();
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Returns the current admin.
     *
     * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using
     * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
     */
    function getAdmin() internal view returns (address) {
        return StorageSlot.getAddressSlot(ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        if (newAdmin == address(0)) {
            revert ERC1967InvalidAdmin(address(0));
        }
        StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {IERC1967-AdminChanged} event.
     */
    function changeAdmin(address newAdmin) internal {
        emit AdminChanged(getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Returns the current beacon.
     */
    function getBeacon() internal view returns (address) {
        return StorageSlot.getAddressSlot(BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        if (newBeacon.code.length == 0) {
            revert ERC1967InvalidBeacon(newBeacon);
        }

        StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;

        address beaconImplementation = IBeacon(newBeacon).implementation();
        if (beaconImplementation.code.length == 0) {
            revert ERC1967InvalidImplementation(beaconImplementation);
        }
    }

    /**
     * @dev Change the beacon and trigger a setup call if data is nonempty.
     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
     * to avoid stuck value in the contract.
     *
     * Emits an {IERC1967-BeaconUpgraded} event.
     *
     * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since
     * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for
     * efficiency.
     */
    function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);

        if (data.length > 0) {
            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
        } else {
            _checkNonPayable();
        }
    }

    /**
     * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract
     * if an upgrade doesn't perform an initialization call.
     */
    function _checkNonPayable() private {
        if (msg.value > 0) {
            revert ERC1967NonPayable();
        }
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

// @dev Import the 'MessagingFee' and 'MessagingReceipt' so it's exposed to OApp implementers
// solhint-disable-next-line no-unused-import
import { OAppSenderUpgradeable, MessagingFee, MessagingReceipt } from "./OAppSenderUpgradeable.sol";
// @dev Import the 'Origin' so it's exposed to OApp implementers
// solhint-disable-next-line no-unused-import
import { OAppReceiverUpgradeable, Origin } from "./OAppReceiverUpgradeable.sol";
import { OAppCoreUpgradeable } from "./OAppCoreUpgradeable.sol";

/**
 * @title OApp
 * @dev Abstract contract serving as the base for OApp implementation, combining OAppSender and OAppReceiver functionality.
 */
abstract contract OAppUpgradeable is OAppSenderUpgradeable, OAppReceiverUpgradeable {
    /**
     * @dev Constructor to initialize the OApp with the provided endpoint and owner.
     * @param _endpoint The address of the LOCAL LayerZero endpoint.
     * @custom:oz-upgrades-unsafe-allow constructor
     */
    constructor(address _endpoint) OAppCoreUpgradeable(_endpoint) {}

    /**
     * @dev Initializes the OApp with the provided delegate.
     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.
     *
     * @dev The delegate typically should be set as the owner of the contract.
     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to
     * accommodate the different version of Ownable.
     */
    function __OApp_init(address _delegate) internal onlyInitializing {
        __OAppCore_init(_delegate);
    }

    function __OApp_init_unchained() internal onlyInitializing {}

    /**
     * @notice Retrieves the OApp version information.
     * @return senderVersion The version of the OAppSender.sol implementation.
     * @return receiverVersion The version of the OAppReceiver.sol implementation.
     */
    function oAppVersion()
        public
        pure
        virtual
        override(OAppSenderUpgradeable, OAppReceiverUpgradeable)
        returns (uint64 senderVersion, uint64 receiverVersion)
    {
        return (SENDER_VERSION, RECEIVER_VERSION);
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import { IOAppOptionsType3, EnforcedOptionParam } from "../interfaces/IOAppOptionsType3.sol";
import {OAuth} from "../../auth/OAuth.sol";

/**
 * @title OAppOptionsType3
 * @dev Abstract contract implementing the IOAppOptionsType3 interface with type 3 options.
 */
abstract contract OAppOptionsType3Upgradeable is IOAppOptionsType3, OAuth, Initializable {
    struct OAppOptionsType3Storage {
        // @dev The "msgType" should be defined in the child contract.
        mapping(uint32 => mapping(uint16 => bytes)) enforcedOptions;
    }

    // keccak256(abi.encode(uint256(keccak256("layerzerov2.storage.oappoptionstype3")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant OAppOptionsType3StorageLocation =
        0x8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea0000;

    uint16 internal constant OPTION_TYPE_3 = 3;

    function _getOAppOptionsType3Storage() internal pure returns (OAppOptionsType3Storage storage $) {
        assembly {
            $.slot := OAppOptionsType3StorageLocation
        }
    }

    /**
     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to
     * accommodate the different version of Ownable.
     */
    function __OAppOptionsType3_init() internal onlyInitializing {}

    function __OAppOptionsType3_init_unchained() internal onlyInitializing {}

    function enforcedOptions(uint32 _eid, uint16 _msgType) public view returns (bytes memory) {
        OAppOptionsType3Storage storage $ = _getOAppOptionsType3Storage();
        return $.enforcedOptions[_eid][_msgType];
    }

    /**
     * @dev Sets the enforced options for specific endpoint and message type combinations.
     * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.
     *
     * @dev Only the admin of the OApp can call this function. control via {_checkAuthorizeOperator()}
     * @dev Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.
     * @dev These enforced options can vary as the potential options/execution on the remote may differ as per the msgType.
     * eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay
     * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().
     */
    function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) public virtual {
        _checkAuthorizeOperator();
        OAppOptionsType3Storage storage $ = _getOAppOptionsType3Storage();
        for (uint256 i = 0; i < _enforcedOptions.length; i++) {
            // @dev Enforced options are only available for optionType 3, as type 1 and 2 dont support combining.
            _assertOptionsType3(_enforcedOptions[i].options);
            $.enforcedOptions[_enforcedOptions[i].eid][_enforcedOptions[i].msgType] = _enforcedOptions[i].options;
        }

        emit EnforcedOptionSet(_enforcedOptions);
    }

    /**
     * @notice Combines options for a given endpoint and message type.
     * @param _eid The endpoint ID.
     * @param _msgType The OAPP message type.
     * @param _extraOptions Additional options passed by the caller.
     * @return options The combination of caller specified options AND enforced options.
     *
     * @dev If there is an enforced lzReceive option:
     * - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether}
     * - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function.
     * @dev This presence of duplicated options is handled off-chain in the verifier/executor.
     */
    function combineOptions(
        uint32 _eid,
        uint16 _msgType,
        bytes calldata _extraOptions
    ) public view virtual returns (bytes memory) {
        OAppOptionsType3Storage storage $ = _getOAppOptionsType3Storage();
        bytes memory enforced = $.enforcedOptions[_eid][_msgType];

        // No enforced options, pass whatever the caller supplied, even if it's empty or legacy type 1/2 options.
        if (enforced.length == 0) return _extraOptions;

        // No caller options, return enforced
        if (_extraOptions.length == 0) return enforced;

        // @dev If caller provided _extraOptions, must be type 3 as its the ONLY type that can be combined.
        if (_extraOptions.length >= 2) {
            _assertOptionsType3(_extraOptions);
            // @dev Remove the first 2 bytes containing the type from the _extraOptions and combine with enforced.
            return bytes.concat(enforced, _extraOptions[2:]);
        }

        // No valid set of options was found.
        revert InvalidOptions(_extraOptions);
    }

    /**
     * @dev Internal function to assert that options are of type 3.
     * @param _options The options to be checked.
     */
    function _assertOptionsType3(bytes calldata _options) internal pure virtual {
        uint16 optionsType = uint16(bytes2(_options[0:2]));
        if (optionsType != OPTION_TYPE_3) revert InvalidOptions(_options);
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

/**
 * @title IOAppMsgInspector
 * @dev Interface for the OApp Message Inspector, allowing examination of message and options contents.
 */
interface IOAppMsgInspector {
    // Custom error message for inspection failure
    error InspectionFailed(bytes message, bytes options);

    /**
     * @notice Allows the inspector to examine LayerZero message contents and optionally throw a revert if invalid.
     * @param _message The message payload to be inspected.
     * @param _options Additional options or parameters for inspection.
     * @return valid A boolean indicating whether the inspection passed (true) or failed (false).
     *
     * @dev Optionally done as a revert, OR use the boolean provided to handle the failure.
     */
    function inspect(bytes calldata _message, bytes calldata _options) external view returns (bool valid);
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import { IPreCrime } from "./interfaces/IPreCrime.sol";
import { IOAppPreCrimeSimulator, InboundPacket, Origin } from "./interfaces/IOAppPreCrimeSimulator.sol";
import {OAuth} from "../auth/OAuth.sol";

/**
 * @title OAppPreCrimeSimulator
 * @dev Abstract contract serving as the base for preCrime simulation functionality in an OApp.
 */
abstract contract OAppPreCrimeSimulatorUpgradeable is IOAppPreCrimeSimulator, OAuth, Initializable {
    struct OAppPreCrimeSimulatorStorage {
        // The address of the preCrime implementation.
        address preCrime;
    }

    // keccak256(abi.encode(uint256(keccak256("layerzerov2.storage.oappprecrimesimulator")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant OAppPreCrimeSimulatorStorageLocation =
        0xefb041d771d6daaa55702fff6eb740d63ba559a75d2d1d3e151c78ff2480b600;

    function _getOAppPreCrimeSimulatorStorage() internal pure returns (OAppPreCrimeSimulatorStorage storage $) {
        assembly {
            $.slot := OAppPreCrimeSimulatorStorageLocation
        }
    }

    /**
     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to
     * accommodate the different version of Ownable.
     */
    function __OAppPreCrimeSimulator_init() internal onlyInitializing {}

    function __OAppPreCrimeSimulator_init_unchained() internal onlyInitializing {}

    function preCrime() external view override returns (address) {
        OAppPreCrimeSimulatorStorage storage $ = _getOAppPreCrimeSimulatorStorage();
        return $.preCrime;
    }

    /**
     * @dev Retrieves the address of the OApp contract.
     * @return The address of the OApp contract.
     *
     * @dev The simulator contract is the base contract for the OApp by default.
     * @dev If the simulator is a separate contract, override this function.
     */
    function oApp() external view virtual returns (address) {
        return address(this);
    }

    /**
     * @dev Sets the preCrime contract address.
     * @dev Only the admin of the OApp can call this function. control via {_checkAuthorizeOperator()}
     * @param _preCrime The address of the preCrime contract.
     */
    function setPreCrime(address _preCrime) public virtual {
        _checkAuthorizeOperator();
        OAppPreCrimeSimulatorStorage storage $ = _getOAppPreCrimeSimulatorStorage();
        $.preCrime = _preCrime;
        emit PreCrimeSet(_preCrime);
    }

    /**
     * @dev Interface for pre-crime simulations. Always reverts at the end with the simulation results.
     * @param _packets An array of InboundPacket objects representing received packets to be delivered.
     *
     * @dev WARNING: MUST revert at the end with the simulation results.
     * @dev Gives the preCrime implementation the ability to mock sending packets to the lzReceive function,
     * WITHOUT actually executing them.
     */
    function lzReceiveAndRevert(InboundPacket[] calldata _packets) public payable virtual {
        for (uint256 i = 0; i < _packets.length; i++) {
            InboundPacket calldata packet = _packets[i];

            // Ignore packets that are not from trusted peers.
            if (!isPeer(packet.origin.srcEid, packet.origin.sender)) continue;

            // @dev Because a verifier is calling this function, it doesnt have access to executor params:
            //  - address _executor
            //  - bytes calldata _extraData
            // preCrime will NOT work for OApps that rely on these two parameters inside of their _lzReceive().
            // They are instead stubbed to default values, address(0) and bytes("")
            // @dev Calling this.lzReceiveSimulate removes ability for assembly return 0 callstack exit,
            // which would cause the revert to be ignored.
            this.lzReceiveSimulate{ value: packet.value }(
                packet.origin,
                packet.guid,
                packet.message,
                packet.executor,
                packet.extraData
            );
        }

        // @dev Revert with the simulation results. msg.sender must implement IPreCrime.buildSimulationResult().
        revert SimulationResult(IPreCrime(msg.sender).buildSimulationResult());
    }

    /**
     * @dev Is effectively an internal function because msg.sender must be address(this).
     * Allows resetting the call stack for 'internal' calls.
     * @param _origin The origin information containing the source endpoint and sender address.
     *  - srcEid: The source chain endpoint ID.
     *  - sender: The sender address on the src chain.
     *  - nonce: The nonce of the message.
     * @param _guid The unique identifier of the packet.
     * @param _message The message payload of the packet.
     * @param _executor The executor address for the packet.
     * @param _extraData Additional data for the packet.
     */
    function lzReceiveSimulate(
        Origin calldata _origin,
        bytes32 _guid,
        bytes calldata _message,
        address _executor,
        bytes calldata _extraData
    ) external payable virtual {
        // @dev Ensure ONLY can be called 'internally'.
        if (msg.sender != address(this)) revert OnlySelf();
        _lzReceiveSimulate(_origin, _guid, _message, _executor, _extraData);
    }

    /**
     * @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.
     * @param _origin The origin information.
     *  - srcEid: The source chain endpoint ID.
     *  - sender: The sender address from the src chain.
     *  - nonce: The nonce of the LayerZero message.
     * @param _guid The GUID of the LayerZero message.
     * @param _message The LayerZero message.
     * @param _executor The address of the off-chain executor.
     * @param _extraData Arbitrary data passed by the msg executor.
     *
     * @dev Enables the preCrime simulator to mock sending lzReceive() messages,
     * routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.
     */
    function _lzReceiveSimulate(
        Origin calldata _origin,
        bytes32 _guid,
        bytes calldata _message,
        address _executor,
        bytes calldata _extraData
    ) internal virtual;

    /**
     * @dev checks if the specified peer is considered 'trusted' by the OApp.
     * @param _eid The endpoint Id to check.
     * @param _peer The peer to check.
     * @return Whether the peer passed is considered 'trusted' by the OApp.
     */
    function isPeer(uint32 _eid, bytes32 _peer) public view virtual returns (bool);
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

import { MessagingReceipt, MessagingFee } from "../../oapp/OAppSenderUpgradeable.sol";

/**
 * @dev Struct representing token parameters for the OFT send() operation.
 */
struct SendParam {
    uint32 dstEid; // Destination endpoint ID.
    bytes32 to; // Recipient address.
    uint256 amountLD; // Amount to send in local decimals.
    uint256 minAmountLD; // Minimum amount to send in local decimals.
    bytes extraOptions; // Additional options supplied by the caller to be used in the LayerZero message.
    bytes composeMsg; // The composed message for the send() operation.
    bytes oftCmd; // The OFT command to be executed, unused in default OFT implementations.
}

/**
 * @dev Struct representing OFT limit information.
 * @dev These amounts can change dynamically and are up the the specific oft implementation.
 */
struct OFTLimit {
    uint256 minAmountLD; // Minimum amount in local decimals that can be sent to the recipient.
    uint256 maxAmountLD; // Maximum amount in local decimals that can be sent to the recipient.
}

/**
 * @dev Struct representing OFT receipt information.
 */
struct OFTReceipt {
    uint256 amountSentLD; // Amount of tokens ACTUALLY debited from the sender in local decimals.
    // @dev In non-default implementations, the amountReceivedLD COULD differ from this value.
    uint256 amountReceivedLD; // Amount of tokens to be received on the remote side.
}

/**
 * @dev Struct representing OFT fee details.
 * @dev Future proof mechanism to provide a standardized way to communicate fees to things like a UI.
 */
struct OFTFeeDetail {
    int256 feeAmountLD; // Amount of the fee in local decimals.
    string description; // Description of the fee.
}

/**
 * @title IOFT
 * @dev Interface for the OftChain (OFT) token.
 * @dev Does not inherit ERC20 to accommodate usage by OFTAdapter as well.
 * @dev This specific interface ID is '0x02e49c2c'.
 */
interface IOFT {
    // Custom error messages
    error InvalidLocalDecimals();
    error SlippageExceeded(uint256 amountLD, uint256 minAmountLD);

    // Events
    event OFTSent(
        // GUID of the OFT message.
        // Destination Endpoint ID.
        // Address of the sender on the src chain.
        // Amount of tokens sent in local decimals.
        // Amount of tokens received in local decimals.
        bytes32 indexed guid,
        uint32 dstEid,
        address indexed fromAddress,
        uint256 amountSentLD,
        uint256 amountReceivedLD
    );
    event OFTReceived(
        // GUID of the OFT message.
        // Source Endpoint ID.
        // Address of the recipient on the dst chain.
        // Amount of tokens received in local decimals.
        bytes32 indexed guid,
        uint32 srcEid,
        address indexed toAddress,
        uint256 amountReceivedLD
    );

    /**
     * @notice Retrieves interfaceID and the version of the OFT.
     * @return interfaceId The interface ID.
     * @return version The version.
     *
     * @dev interfaceId: This specific interface ID is '0x02e49c2c'.
     * @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.
     * @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.
     * ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)
     */
    function oftVersion() external view returns (bytes4 interfaceId, uint64 version);

    /**
     * @notice Retrieves the address of the token associated with the OFT.
     * @return token The address of the ERC20 token implementation.
     */
    function token() external view returns (address);

    /**
     * @notice Indicates whether the OFT contract requires approval of the 'token()' to send.
     * @return requiresApproval Needs approval of the underlying token implementation.
     *
     * @dev Allows things like wallet implementers to determine integration requirements,
     * without understanding the underlying token implementation.
     */
    function approvalRequired() external view returns (bool);

    /**
     * @notice Retrieves the shared decimals of the OFT.
     * @return sharedDecimals The shared decimals of the OFT.
     */
    function sharedDecimals() external view returns (uint8);

    /**
     * @notice Provides a quote for OFT-related operations.
     * @param _sendParam The parameters for the send operation.
     * @return limit The OFT limit information.
     * @return oftFeeDetails The details of OFT fees.
     * @return receipt The OFT receipt information.
     */
    function quoteOFT(
        SendParam calldata _sendParam
    ) external view returns (OFTLimit memory, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory);

    /**
     * @notice Provides a quote for the send() operation.
     * @param _sendParam The parameters for the send() operation.
     * @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.
     * @return fee The calculated LayerZero messaging fee from the send() operation.
     *
     * @dev MessagingFee: LayerZero msg fee
     *  - nativeFee: The native fee.
     *  - lzTokenFee: The lzToken fee.
     */
    function quoteSend(SendParam calldata _sendParam, bool _payInLzToken) external view returns (MessagingFee memory);

    /**
     * @notice Executes the send() operation.
     * @param _sendParam The parameters for the send operation.
     * @param _fee The fee information supplied by the caller.
     *      - nativeFee: The native fee.
     *      - lzTokenFee: The lzToken fee.
     * @param _refundAddress The address to receive any excess funds from fees etc. on the src.
     * @return receipt The LayerZero messaging receipt from the send() operation.
     * @return oftReceipt The OFT receipt information.
     *
     * @dev MessagingReceipt: LayerZero msg receipt
     *  - guid: The unique identifier for the sent message.
     *  - nonce: The nonce of the sent message.
     *  - fee: The LayerZero fee incurred for the message.
     */
    function send(
        SendParam calldata _sendParam,
        MessagingFee calldata _fee,
        address _refundAddress
    ) external payable returns (MessagingReceipt memory, OFTReceipt memory);
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

library OFTMsgCodec {
    // Offset constants for encoding and decoding OFT messages
    uint8 private constant SEND_TO_OFFSET = 32;
    uint8 private constant SEND_AMOUNT_SD_OFFSET = 40;

    /**
     * @dev Encodes an OFT LayerZero message.
     * @param _sendTo The recipient address.
     * @param _amountShared The amount in shared decimals.
     * @param _composeMsg The composed message.
     * @return _msg The encoded message.
     * @return hasCompose A boolean indicating whether the message has a composed payload.
     */
    function encode(
        bytes32 _sendTo,
        uint64 _amountShared,
        bytes memory _composeMsg
    ) internal view returns (bytes memory _msg, bool hasCompose) {
        hasCompose = _composeMsg.length > 0;
        // @dev Remote chains will want to know the composed function caller ie. msg.sender on the src.
        _msg = hasCompose
            ? abi.encodePacked(_sendTo, _amountShared, addressToBytes32(msg.sender), _composeMsg)
            : abi.encodePacked(_sendTo, _amountShared);
    }

    /**
     * @dev Checks if the OFT message is composed.
     * @param _msg The OFT message.
     * @return A boolean indicating whether the message is composed.
     */
    function isComposed(bytes calldata _msg) internal pure returns (bool) {
        return _msg.length > SEND_AMOUNT_SD_OFFSET;
    }

    /**
     * @dev Retrieves the recipient address from the OFT message.
     * @param _msg The OFT message.
     * @return The recipient address.
     */
    function sendTo(bytes calldata _msg) internal pure returns (bytes32) {
        return bytes32(_msg[:SEND_TO_OFFSET]);
    }

    /**
     * @dev Retrieves the amount in shared decimals from the OFT message.
     * @param _msg The OFT message.
     * @return The amount in shared decimals.
     */
    function amountSD(bytes calldata _msg) internal pure returns (uint64) {
        return uint64(bytes8(_msg[SEND_TO_OFFSET:SEND_AMOUNT_SD_OFFSET]));
    }

    /**
     * @dev Retrieves the composed message from the OFT message.
     * @param _msg The OFT message.
     * @return The composed message.
     */
    function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {
        return _msg[SEND_AMOUNT_SD_OFFSET:];
    }

    /**
     * @dev Converts an address to bytes32.
     * @param _addr The address to convert.
     * @return The bytes32 representation of the address.
     */
    function addressToBytes32(address _addr) internal pure returns (bytes32) {
        return bytes32(uint256(uint160(_addr)));
    }

    /**
     * @dev Converts bytes32 to an address.
     * @param _b The bytes32 value to convert.
     * @return The address representation of bytes32.
     */
    function bytes32ToAddress(bytes32 _b) internal pure returns (address) {
        return address(uint160(uint256(_b)));
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

library OFTComposeMsgCodec {
    // Offset constants for decoding composed messages
    uint8 private constant NONCE_OFFSET = 8;
    uint8 private constant SRC_EID_OFFSET = 12;
    uint8 private constant AMOUNT_LD_OFFSET = 44;
    uint8 private constant COMPOSE_FROM_OFFSET = 76;

    /**
     * @dev Encodes a OFT composed message.
     * @param _nonce The nonce value.
     * @param _srcEid The source endpoint ID.
     * @param _amountLD The amount in local decimals.
     * @param _composeMsg The composed message.
     * @return _msg The encoded Composed message.
     */
    function encode(
        uint64 _nonce,
        uint32 _srcEid,
        uint256 _amountLD,
        bytes memory _composeMsg // 0x[composeFrom][composeMsg]
    ) internal pure returns (bytes memory _msg) {
        _msg = abi.encodePacked(_nonce, _srcEid, _amountLD, _composeMsg);
    }

    /**
     * @dev Retrieves the nonce from the composed message.
     * @param _msg The message.
     * @return The nonce value.
     */
    function nonce(bytes calldata _msg) internal pure returns (uint64) {
        return uint64(bytes8(_msg[:NONCE_OFFSET]));
    }

    /**
     * @dev Retrieves the source endpoint ID from the composed message.
     * @param _msg The message.
     * @return The source endpoint ID.
     */
    function srcEid(bytes calldata _msg) internal pure returns (uint32) {
        return uint32(bytes4(_msg[NONCE_OFFSET:SRC_EID_OFFSET]));
    }

    /**
     * @dev Retrieves the amount in local decimals from the composed message.
     * @param _msg The message.
     * @return The amount in local decimals.
     */
    function amountLD(bytes calldata _msg) internal pure returns (uint256) {
        return uint256(bytes32(_msg[SRC_EID_OFFSET:AMOUNT_LD_OFFSET]));
    }

    /**
     * @dev Retrieves the composeFrom value from the composed message.
     * @param _msg The message.
     * @return The composeFrom value.
     */
    function composeFrom(bytes calldata _msg) internal pure returns (bytes32) {
        return bytes32(_msg[AMOUNT_LD_OFFSET:COMPOSE_FROM_OFFSET]);
    }

    /**
     * @dev Retrieves the composed message.
     * @param _msg The message.
     * @return The composed message.
     */
    function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {
        return _msg[COMPOSE_FROM_OFFSET:];
    }

    /**
     * @dev Converts an address to bytes32.
     * @param _addr The address to convert.
     * @return The bytes32 representation of the address.
     */
    function addressToBytes32(address _addr) internal pure returns (bytes32) {
        return bytes32(uint256(uint160(_addr)));
    }

    /**
     * @dev Converts bytes32 to an address.
     * @param _b The bytes32 value to convert.
     * @return The address representation of bytes32.
     */
    function bytes32ToAddress(bytes32 _b) internal pure returns (address) {
        return address(uint160(uint256(_b)));
    }
}

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {ERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import {BlacklistableWithRolesUpgradeable} from "contracts/BlacklistableWithRolesUpgradeable.sol";
import {RoleConstant} from "contracts/utils/RoleConstant.sol";

/**
 * @title ERC20WithRolesUpgradeable
 * @dev ERC20 implementation
 */

abstract contract ERC20WithRolesUpgradeable is
    ERC20Upgradeable,
    BlacklistableWithRolesUpgradeable
{
    /// @custom:storage-location erc7201:ERC20PermitWithRolesStorage
    struct ERC20WithRolesStorage {
        uint8 __decimals;
    }

    // keccak256(abi.encode(uint256(keccak256("storage.erc20withroles")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant ERC20WithRolesStorageLocation =
        0x3ab444d0b836415993da5574d0dceaa00602de23a5d497ad94b3647348c27000;

    function _getERC20WithRolesStorageLocation()
        private
        pure
        returns (ERC20WithRolesStorage storage $)
    {
        assembly {
            $.slot := ERC20WithRolesStorageLocation
        }
    }

    /**
     * @dev Emitted when the token is retrieved from contract
     */
    event TokenRetrieved();

    /**
     * @dev sets admin of MINTER_ROLE,BURNER_ROLE as DEFAULT_ADMIN_ROLE
     * - Setting and saving the token name, symbol
     * @param _name name
     * @param _symbol symbol
     * @param _decimals decimal
     */
    function __ERC20WithRoles_init(
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) internal onlyInitializing {
        ERC20WithRolesStorage storage $ = _getERC20WithRolesStorageLocation();
        __ERC20_init(_name, _symbol);
        $.__decimals = _decimals;
    }

    /**
     * @dev return decimals of the token
     */
    function decimals() public view override returns (uint8) {
        ERC20WithRolesStorage storage $ = _getERC20WithRolesStorageLocation();
        return $.__decimals;
    }

    /**
     * @dev control transfer of token from/to unblacklisted address
     * @param from - Address
     * @param to - Address where token are transferred to
     * @param value - Number of tokens to be transferred
     */
    function _update(
        address from,
        address to,
        uint256 value
    )
        internal
        virtual
        override
        whenNotBlacklisted(from)
        whenNotBlacklisted(to)
        whenNotPaused
    {
        super._update(from, to, value);
    }

    // TOKEN SUPPLY
    /**
     * @dev Mint a new amount of tokens for specific address
     * @param to - Address for recipient
     * @param amount - Number of tokens to be minted
     */
    function mint(
        address to,
        uint256 amount
    ) external virtual onlyRole(RoleConstant.MINTER_ROLE) nonZV(amount) {
        _mint(to, amount);
    }

    /**
     * @dev Remove a certain amount of tokens from burner's balance.
     * @param amount - Number of tokens to be burned
     */
    function burn(
        uint256 amount
    ) external virtual onlyRole(RoleConstant.BURNER_ROLE) nonZV(amount) {
        _burn(msg.sender, amount);
    }

    /**
     * @dev Remove a total amount of tokens from blacklisted account
     * @param blacklistedAccount - address of blacklisted where the funds will be burned
     */
    function burnBlackFunds(
        address blacklistedAccount
    )
        external
        virtual
        onlyRole(RoleConstant.BURNER_ROLE)
        whenBlacklisted(blacklistedAccount)
    {
        uint256 burnAmount = balanceOf(blacklistedAccount);
        super._update(blacklistedAccount, address(0), burnAmount);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.20;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeacon {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {UpgradeableBeacon} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @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 or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * 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.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @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`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) 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 FailedInnerCall();
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(newImplementation.code.length > 0);
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

import { SafeERC20, IERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { MessagingParams, MessagingFee, MessagingReceipt } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol";
import { OAppCoreUpgradeable } from "./OAppCoreUpgradeable.sol";

/**
 * @title OAppSender
 * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.
 */
abstract contract OAppSenderUpgradeable is OAppCoreUpgradeable {
    using SafeERC20 for IERC20;

    // Custom error messages
    error NotEnoughNative(uint256 msgValue);
    error LzTokenUnavailable();

    // @dev The version of the OAppSender implementation.
    // @dev Version is bumped when changes are made to this contract.
    uint64 internal constant SENDER_VERSION = 1;

    /**
     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to
     * accommodate the different version of Ownable.
     */
    function __OAppSender_init() internal onlyInitializing {}

    function __OAppSender_init_unchained() internal onlyInitializing {}

    /**
     * @notice Retrieves the OApp version information.
     * @return senderVersion The version of the OAppSender.sol contract.
     * @return receiverVersion The version of the OAppReceiver.sol contract.
     *
     * @dev Providing 0 as the default for OAppReceiver version. Indicates that the OAppReceiver is not implemented.
     * ie. this is a SEND only OApp.
     * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions
     */
    function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {
        return (SENDER_VERSION, 0);
    }

    /**
     * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation.
     * @param _dstEid The destination endpoint ID.
     * @param _message The message payload.
     * @param _options Additional options for the message.
     * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens.
     * @return fee The calculated MessagingFee for the message.
     *      - nativeFee: The native fee for the message.
     *      - lzTokenFee: The LZ token fee for the message.
     */
    function _quote(
        uint32 _dstEid,
        bytes memory _message,
        bytes memory _options,
        bool _payInLzToken
    ) internal view virtual returns (MessagingFee memory fee) {
        return
            endpoint.quote(
                MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken),
                address(this)
            );
    }

    /**
     * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message.
     * @param _dstEid The destination endpoint ID.
     * @param _message The message payload.
     * @param _options Additional options for the message.
     * @param _fee The calculated LayerZero fee for the message.
     *      - nativeFee: The native fee.
     *      - lzTokenFee: The lzToken fee.
     * @param _refundAddress The address to receive any excess fee values sent to the endpoint.
     * @return receipt The receipt for the sent message.
     *      - guid: The unique identifier for the sent message.
     *      - nonce: The nonce of the sent message.
     *      - fee: The LayerZero fee incurred for the message.
     */
    function _lzSend(
        uint32 _dstEid,
        bytes memory _message,
        bytes memory _options,
        MessagingFee memory _fee,
        address _refundAddress
    ) internal virtual returns (MessagingReceipt memory receipt) {
        // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.
        uint256 messageValue = _payNative(_fee.nativeFee);
        if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);

        return
            endpoint.send{ value: messageValue }(
            // solhint-disable-next-line check-send-result
                MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0),
                _refundAddress
            );
    }

    /**
     * @dev Internal function to pay the native fee associated with the message.
     * @param _nativeFee The native fee to be paid.
     * @return nativeFee The amount of native currency paid.
     *
     * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction,
     * this will need to be overridden because msg.value would contain multiple lzFees.
     * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency.
     * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees.
     * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time.
     */
    function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) {
        if (msg.value != _nativeFee) revert NotEnoughNative(msg.value);
        return _nativeFee;
    }

    /**
     * @dev Internal function to pay the LZ token fee associated with the message.
     * @param _lzTokenFee The LZ token fee to be paid.
     *
     * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint.
     * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend().
     */
    function _payLzToken(uint256 _lzTokenFee) internal virtual {
        // @dev Cannot cache the token because it is not immutable in the endpoint.
        address lzToken = endpoint.lzToken();
        if (lzToken == address(0)) revert LzTokenUnavailable();

        // Pay LZ token fee by sending tokens to the endpoint.
        IERC20(lzToken).safeTransferFrom(msg.sender, address(endpoint), _lzTokenFee);
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

import { IOAppReceiver, Origin } from "./interfaces/IOAppReceiver.sol";
import { OAppCoreUpgradeable } from "./OAppCoreUpgradeable.sol";

/**
 * @title OAppReceiver
 * @dev Abstract contract implementing the ILayerZeroReceiver interface and extending OAppCore for OApp receivers.
 */
abstract contract OAppReceiverUpgradeable is IOAppReceiver, OAppCoreUpgradeable {
    // Custom error message for when the caller is not the registered endpoint/
    error OnlyEndpoint(address addr);

    // @dev The version of the OAppReceiver implementation.
    // @dev Version is bumped when changes are made to this contract.
    uint64 internal constant RECEIVER_VERSION = 1;

    /**
     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to
     * accommodate the different version of Ownable.
     */
    function __OAppReceiver_init() internal onlyInitializing {}

    function __OAppReceiver_init_unchained() internal onlyInitializing {}

    /**
     * @notice Retrieves the OApp version information.
     * @return senderVersion The version of the OAppSender.sol contract.
     * @return receiverVersion The version of the OAppReceiver.sol contract.
     *
     * @dev Providing 0 as the default for OAppSender version. Indicates that the OAppSender is not implemented.
     * ie. this is a RECEIVE only OApp.
     * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions.
     */
    function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {
        return (0, RECEIVER_VERSION);
    }

    /**
     * @notice Retrieves the address responsible for 'sending' composeMsg's to the Endpoint.
     * @return sender The address responsible for 'sending' composeMsg's to the Endpoint.
     *
     * @dev Applications can optionally choose to implement a separate composeMsg sender that is NOT the bridging layer.
     * @dev The default sender IS the OApp implementer.
     */
    function composeMsgSender() public view virtual returns (address sender) {
        return address(this);
    }

    /**
     * @notice Checks if the path initialization is allowed based on the provided origin.
     * @param origin The origin information containing the source endpoint and sender address.
     * @return Whether the path has been initialized.
     *
     * @dev This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received.
     * @dev This defaults to assuming if a peer has been set, its initialized.
     * Can be overridden by the OApp if there is other logic to determine this.
     */
    function allowInitializePath(Origin calldata origin) public view virtual returns (bool) {
        return peers(origin.srcEid) == origin.sender;
    }

    /**
     * @notice Retrieves the next nonce for a given source endpoint and sender address.
     * @dev _srcEid The source endpoint ID.
     * @dev _sender The sender address.
     * @return nonce The next nonce.
     *
     * @dev The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.
     * @dev Is required by the off-chain executor to determine the OApp expects msg execution is ordered.
     * @dev This is also enforced by the OApp.
     * @dev By default this is NOT enabled. ie. nextNonce is hardcoded to return 0.
     */
    function nextNonce(uint32, /*_srcEid*/ bytes32 /*_sender*/) public view virtual returns (uint64 nonce) {
        return 0;
    }

    /**
     * @dev Entry point for receiving messages or packets from the endpoint.
     * @param _origin The origin information containing the source endpoint and sender address.
     *  - srcEid: The source chain endpoint ID.
     *  - sender: The sender address on the src chain.
     *  - nonce: The nonce of the message.
     * @param _guid The unique identifier for the received LayerZero message.
     * @param _message The payload of the received message.
     * @param _executor The address of the executor for the received message.
     * @param _extraData Additional arbitrary data provided by the corresponding executor.
     *
     * @dev Entry point for receiving msg/packet from the LayerZero endpoint.
     */
    function lzReceive(
        Origin calldata _origin,
        bytes32 _guid,
        bytes calldata _message,
        address _executor,
        bytes calldata _extraData
    ) public payable virtual {
        // Ensures that only the endpoint can attempt to lzReceive() messages to this OApp.
        if (address(endpoint) != msg.sender) revert OnlyEndpoint(msg.sender);

        // Ensure that the sender matches the expected peer for the source endpoint.
        if (_getPeerOrRevert(_origin.srcEid) != _origin.sender) revert OnlyPeer(_origin.srcEid, _origin.sender);

        // Call the internal OApp implementation of lzReceive.
        _lzReceive(_origin, _guid, _message, _executor, _extraData);
    }

    /**
     * @dev Internal function to implement lzReceive logic without needing to copy the basic parameter validation.
     */
    function _lzReceive(
        Origin calldata _origin,
        bytes32 _guid,
        bytes calldata _message,
        address _executor,
        bytes calldata _extraData
    ) internal virtual;
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {IOAppCore, ILayerZeroEndpoint} from "./interfaces/IOAppCore.sol";
import {OAuth} from "../auth/OAuth.sol";

/**
 * @title OAppCore
 * @dev Abstract contract implementing the IOAppCore interface with basic OApp configurations.
 */
abstract contract OAppCoreUpgradeable is IOAppCore, OAuth, Initializable {
    struct OAppCoreStorage {
        mapping(uint32 => bytes32) peers;
    }

    // keccak256(abi.encode(uint256(keccak256("layerzerov2.storage.oappcore")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant OAppCoreStorageLocation =
        0x72ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f900;

    function _getOAppCoreStorage() internal pure returns (OAppCoreStorage storage $) {
        assembly {
            $.slot := OAppCoreStorageLocation
        }
    }

    // The LayerZero endpoint associated with the given OApp
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    ILayerZeroEndpoint public immutable endpoint;

    /**
     * @dev Constructor to initialize the OAppCore with the provided endpoint and delegate.
     * @param _endpoint The address of the LOCAL Layer Zero endpoint.
     * @custom:oz-upgrades-unsafe-allow constructor
     */
    constructor(address _endpoint) {
        endpoint = ILayerZeroEndpoint(_endpoint);
    }

    /**
     * @dev Initializes the OAppCore with the provided delegate.
     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.
     *
     * @dev The delegate typically should be set as the owner of the contract.
     * @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to
     * accommodate the different version of Ownable.
     */
    function __OAppCore_init(address _delegate) internal onlyInitializing {
        __OAppCore_init_unchained(_delegate);
    }

    function __OAppCore_init_unchained(address _delegate) internal onlyInitializing {
        _setEndpointDelegate(_delegate);
    }

    /**
     * @dev Expected to be done in initializer
     * @dev Update the OAppCore with the provided delegate.
     * @dev The delegate typically should be set as the owner of the contract.
     * @dev Only the admin of the OApp can call this function. control via {_checkAuthorizeOperator()}
     * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.
     */
    function setEndpointDelegate(address _delegate) external {
        _checkAuthorizeOperator();
        _setEndpointDelegate(_delegate);
    }

    function _setEndpointDelegate(address _delegate) internal {
        if (_delegate == address(0)) revert InvalidDelegate();
        if (_delegate == endpointDelegate()) revert IdenticalDelegate();
        endpoint.setDelegate(_delegate);
    }

    /**
     * @notice Returns the peer address (OApp instance) associated with a specific endpoint.
     * @return The address of the delegate if this OAppCore at endpoint which set via {setEndpointDelegate}
     */
    function endpointDelegate() public view returns (address) {
        return endpoint.delegates(address(this));
    }

    /**
     * @notice Returns the peer address (OApp instance) associated with a specific endpoint.
     * @param _eid The endpoint ID.
     * @return peer The address of the peer associated with the specified endpoint.
     */
    function peers(uint32 _eid) public view override returns (bytes32) {
        OAppCoreStorage storage $ = _getOAppCoreStorage();
        return $.peers[_eid];
    }

    /**
     * @notice Sets the peer address (OApp instance) for a corresponding endpoint.
     * @param _eid The endpoint ID.
     * @param _peer The address of the peer to be associated with the corresponding endpoint.
     *
     * @dev Only the admin of the OApp can call this function. control via {_checkAuthorizeOperator()}
     * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.
     * @dev Set this to bytes32(0) to remove the peer address.
     * @dev Peer is a bytes32 to accommodate non-evm chains.
     */
    function setPeer(uint32 _eid, bytes32 _peer) public virtual {
        _checkAuthorizeOperator();
        OAppCoreStorage storage $ = _getOAppCoreStorage();
        $.peers[_eid] = _peer;
        emit PeerSet(_eid, _peer);
    }

    /**
     * @notice Internal function to get the peer address associated with a specific endpoint; reverts if NOT set.
     * ie. the peer is set to bytes32(0).
     * @param _eid The endpoint ID.
     * @return peer The address of the peer associated with the specified endpoint.
     */
    function _getPeerOrRevert(uint32 _eid) internal view virtual returns (bytes32) {
        OAppCoreStorage storage $ = _getOAppCoreStorage();
        bytes32 peer = $.peers[_eid];
        if (peer == bytes32(0)) revert NoPeer(_eid);
        return peer;
    }

    /**
     * @notice Sets the delegate address for the OApp.
     * @param _delegate The address of the delegate to be set.
     *
     * @dev Only the admin of the OApp can call this function. control via {_checkAuthorizeOperator()}
     * @dev Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.
     */
    function setDelegate(address _delegate) public {
        _checkAuthorizeOperator();
        endpoint.setDelegate(_delegate);
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

/**
 * @dev Struct representing enforced option parameters.
 */
struct EnforcedOptionParam {
    uint32 eid; // Endpoint ID
    uint16 msgType; // Message Type
    bytes options; // Additional options
}

/**
 * @title IOAppOptionsType3
 * @dev Interface for the OApp with Type 3 Options, allowing the setting and combining of enforced options.
 */
interface IOAppOptionsType3 {
    // Custom error message for invalid options
    error InvalidOptions(bytes options);

    // Event emitted when enforced options are set
    event EnforcedOptionSet(EnforcedOptionParam[] _enforcedOptions);

    /**
     * @notice Sets enforced options for specific endpoint and message type combinations.
     * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.
     */
    function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) external;

    /**
     * @notice Combines options for a given endpoint and message type.
     * @param _eid The endpoint ID.
     * @param _msgType The OApp message type.
     * @param _extraOptions Additional options passed by the caller.
     * @return options The combination of caller specified options AND enforced options.
     */
    function combineOptions(
        uint32 _eid,
        uint16 _msgType,
        bytes calldata _extraOptions
    ) external view returns (bytes memory options);
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

/**
 * @title OAuth
 * @dev Abstract contract implementing the IOAuth interface which perform access right for configurations updates.
 */
abstract contract OAuth {
    error NonAuthorizeOperator();
    /**
     * @dev Returns true for authorized operator who has access right to update OApp configurations
     */

    function isAuthorizedOperator(address _address) public view virtual returns (bool);

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to update configuration of the contract. Called by
     * {setDelegate} , {setPeer} ... etc
     *
     */
    function _checkAuthorizeOperator() internal view virtual {
        if (!isAuthorizedOperator(msg.sender)) revert NonAuthorizeOperator();
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;
struct PreCrimePeer {
    uint32 eid;
    bytes32 preCrime;
    bytes32 oApp;
}

// TODO not done yet
interface IPreCrime {
    error OnlyOffChain();

    // for simulate()
    error PacketOversize(uint256 max, uint256 actual);
    error PacketUnsorted();
    error SimulationFailed(bytes reason);

    // for preCrime()
    error SimulationResultNotFound(uint32 eid);
    error InvalidSimulationResult(uint32 eid, bytes reason);
    error CrimeFound(bytes crime);

    function getConfig(bytes[] calldata _packets, uint256[] calldata _packetMsgValues) external returns (bytes memory);

    function simulate(
        bytes[] calldata _packets,
        uint256[] calldata _packetMsgValues
    ) external payable returns (bytes memory);

    function buildSimulationResult() external view returns (bytes memory);

    function preCrime(
        bytes[] calldata _packets,
        uint256[] calldata _packetMsgValues,
        bytes[] calldata _simulations
    ) external;

    function version() external view returns (uint64 major, uint8 minor);
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

// @dev Import the Origin so it's exposed to OAppPreCrimeSimulator implementers.
// solhint-disable-next-line no-unused-import
import { InboundPacket, Origin } from "../libs/Packet.sol";

/**
 * @title IOAppPreCrimeSimulator Interface
 * @dev Interface for the preCrime simulation functionality in an OApp.
 */
interface IOAppPreCrimeSimulator {
    // @dev simulation result used in PreCrime implementation
    error SimulationResult(bytes result);
    error OnlySelf();

    /**
     * @dev Emitted when the preCrime contract address is set.
     * @param preCrimeAddress The address of the preCrime contract.
     */
    event PreCrimeSet(address preCrimeAddress);

    /**
     * @dev Retrieves the address of the preCrime contract implementation.
     * @return The address of the preCrime contract.
     */
    function preCrime() external view returns (address);

    /**
     * @dev Retrieves the address of the OApp contract.
     * @return The address of the OApp contract.
     */
    function oApp() external view returns (address);

    /**
     * @dev Sets the preCrime contract address.
     * @param _preCrime The address of the preCrime contract.
     */
    function setPreCrime(address _preCrime) external;

    /**
     * @dev Mocks receiving a packet, then reverts with a series of data to infer the state/result.
     * @param _packets An array of LayerZero InboundPacket objects representing received packets.
     */
    function lzReceiveAndRevert(InboundPacket[] calldata _packets) external payable;

    /**
     * @dev checks if the specified peer is considered 'trusted' by the OApp.
     * @param _eid The endpoint Id to check.
     * @param _peer The peer to check.
     * @return Whether the peer passed is considered 'trusted' by the OApp.
     */
    function isPeer(uint32 _eid, bytes32 _peer) external view returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import {ContextUpgradeable} from "../../utils/ContextUpgradeable.sol";
import {IERC20Errors} from "@openzeppelin/contracts/interfaces/draft-IERC6093.sol";
import {Initializable} from "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 */
abstract contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20, IERC20Metadata, IERC20Errors {
    /// @custom:storage-location erc7201:openzeppelin.storage.ERC20
    struct ERC20Storage {
        mapping(address account => uint256) _balances;

        mapping(address account => mapping(address spender => uint256)) _allowances;

        uint256 _totalSupply;

        string _name;
        string _symbol;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC20")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant ERC20StorageLocation = 0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00;

    function _getERC20Storage() private pure returns (ERC20Storage storage $) {
        assembly {
            $.slot := ERC20StorageLocation
        }
    }

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {
        __ERC20_init_unchained(name_, symbol_);
    }

    function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
        ERC20Storage storage $ = _getERC20Storage();
        $._name = name_;
        $._symbol = symbol_;
    }

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

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

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

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual returns (uint256) {
        ERC20Storage storage $ = _getERC20Storage();
        return $._totalSupply;
    }

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

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

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

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

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

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _transfer(address from, address to, uint256 value) internal {
        if (from == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        if (to == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(from, to, value);
    }

    /**
     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
     * this function.
     *
     * Emits a {Transfer} event.
     */
    function _update(address from, address to, uint256 value) internal virtual {
        ERC20Storage storage $ = _getERC20Storage();
        if (from == address(0)) {
            // Overflow check required: The rest of the code assumes that totalSupply never overflows
            $._totalSupply += value;
        } else {
            uint256 fromBalance = $._balances[from];
            if (fromBalance < value) {
                revert ERC20InsufficientBalance(from, fromBalance, value);
            }
            unchecked {
                // Overflow not possible: value <= fromBalance <= totalSupply.
                $._balances[from] = fromBalance - value;
            }
        }

        if (to == address(0)) {
            unchecked {
                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
                $._totalSupply -= value;
            }
        } else {
            unchecked {
                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
                $._balances[to] += value;
            }
        }

        emit Transfer(from, to, value);
    }

    /**
     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
     * Relies on the `_update` mechanism
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _mint(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(address(0), account, value);
    }

    /**
     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
     * Relies on the `_update` mechanism.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead
     */
    function _burn(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        _update(account, address(0), value);
    }

    /**
     * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     *
     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
     */
    function _approve(address owner, address spender, uint256 value) internal {
        _approve(owner, spender, value, true);
    }

    /**
     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
     *
     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
     * `Approval` event during `transferFrom` operations.
     *
     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
     * true using the following override:
     * ```
     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
     *     super._approve(owner, spender, value, true);
     * }
     * ```
     *
     * Requirements are the same as {_approve}.
     */
    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
        ERC20Storage storage $ = _getERC20Storage();
        if (owner == address(0)) {
            revert ERC20InvalidApprover(address(0));
        }
        if (spender == address(0)) {
            revert ERC20InvalidSpender(address(0));
        }
        $._allowances[owner][spender] = value;
        if (emitEvent) {
            emit Approval(owner, spender, value);
        }
    }

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

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {PausableWithRolesUpgradeable} from "contracts/PausableWithRolesUpgradeable.sol";
import {RoleConstant} from "contracts/utils/RoleConstant.sol";

/**
 * @title BlacklistableWithRolesUpgradeable
 * @dev Allows users to be blacklisted or unblacklisted by BLACKLISTER_ROLE
 */

abstract contract BlacklistableWithRolesUpgradeable is
    PausableWithRolesUpgradeable
{
    /// @custom:storage-location erc7201:BlacklistableStorage
    struct BlacklistableStorage {
        mapping(address => bool) blacklisted;
    }

    // keccak256(abi.encode(uint256(keccak256("storage.blacklistable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant BlacklistableStorageLocation =
        0x7b8c66b06ab2a5b9694594d3e1497062eaf332a02e6508b6950edd463f4bb000;

    function _getBlacklistableStorageLocation()
        private
        pure
        returns (BlacklistableStorage storage $)
    {
        assembly {
            $.slot := BlacklistableStorageLocation
        }
    }

    /**
     * @dev Emitted when the user is blacklisted
     */
    event AddedBlacklist(address user);

    /**
     * @dev Emitted when the user is removed from blacklist
     */
    event RemovedBlacklist(address user);

    /**
     * @dev Modifier to prevent blacklisting the contract
     */
    modifier notBlacklistThisContract(address addr) {
        if (addr == address(this)) revert NotBlacklistThisContract();
        _;
    }

    /**
     * @dev Modifier to prevent blacklisting the defaultAdmin/owner and BLACKLISTER_ROLE
     */
    modifier notBlacklisterRole(address addr) {
        if (addr == defaultAdmin()) revert BlacklistNotAllowed();
        if (hasRole(RoleConstant.BLACKLISTER_ROLE, addr))
            revert BlacklistNotAllowed();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the user is not blacklisted.
     */
    modifier whenNotBlacklisted(address user) {
        BlacklistableStorage storage $ = _getBlacklistableStorageLocation();
        if ($.blacklisted[user]) revert AlreadyBlacklisted(user);
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the user is already blacklisted.
     */
    modifier whenBlacklisted(address user) {
        BlacklistableStorage storage $ = _getBlacklistableStorageLocation();
        if (!$.blacklisted[user]) revert NotBlacklisted(user);
        _;
    }

    /**
     * @dev The operation failed because the address is already blacklisted
     */
    error AlreadyBlacklisted(address sender);

    /**
     * @dev The operation failed because the address is not blacklisted
     */
    error NotBlacklisted(address sender);

    /**
     * @dev The operation failed because the contract cannot be blacklisted
     */
    error NotBlacklistThisContract();

    /**
     * @dev The operation failed because address can not be blacklisted
     */
    error BlacklistNotAllowed();

    /**
     * @dev Initialize
     */
    function __BlacklistableWithRoles_init() internal onlyInitializing {}

    /**
     * @notice Remove a blacklisted user
     * @param user - The address of the user to be removed from blacklist
     */
    function removeBlacklist(
        address user
    )
        external
        onlyRole(RoleConstant.BLACKLISTER_ROLE)
        nonZA(user)
        whenBlacklisted(user)
    {
        BlacklistableStorage storage $ = _getBlacklistableStorageLocation();
        $.blacklisted[user] = false;
        emit RemovedBlacklist(user);
    }

    /**
     * @notice Add the user in blacklist
     * @param user - The address of the user to be added in blakclist
     */
    function addBlacklist(
        address user
    )
        external
        onlyRole(RoleConstant.BLACKLISTER_ROLE)
        nonZA(user)
        whenNotBlacklisted(user)
        notBlacklistThisContract(user)
        notBlacklisterRole(user)
    {
        BlacklistableStorage storage $ = _getBlacklistableStorageLocation();
        $.blacklisted[user] = true;
        emit AddedBlacklist(user);
    }

    /**
     * @notice Function for check the blacklist status of the user:
     * @param user - Address of the user
     * @return - Boolean value if it's blacklisted or not
     */
    function isBlacklisted(address user) external view returns (bool) {
        BlacklistableStorage storage $ = _getBlacklistableStorageLocation();
        return $.blacklisted[user];
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

import { IMessageLibManager } from "./IMessageLibManager.sol";
import { IMessagingComposer } from "./IMessagingComposer.sol";
import { IMessagingChannel } from "./IMessagingChannel.sol";
import { IMessagingContext } from "./IMessagingContext.sol";

struct MessagingParams {
    uint32 dstEid;
    bytes32 receiver;
    bytes message;
    bytes options;
    bool payInLzToken;
}

struct MessagingReceipt {
    bytes32 guid;
    uint64 nonce;
    MessagingFee fee;
}

struct MessagingFee {
    uint256 nativeFee;
    uint256 lzTokenFee;
}

struct Origin {
    uint32 srcEid;
    bytes32 sender;
    uint64 nonce;
}

interface ILayerZeroEndpointV2 is IMessageLibManager, IMessagingComposer, IMessagingChannel, IMessagingContext {
    event PacketSent(bytes encodedPayload, bytes options, address sendLibrary);

    event PacketVerified(Origin origin, address receiver, bytes32 payloadHash);

    event PacketDelivered(Origin origin, address receiver);

    event LzReceiveAlert(
        address indexed receiver,
        address indexed executor,
        Origin origin,
        bytes32 guid,
        uint256 gas,
        uint256 value,
        bytes message,
        bytes extraData,
        bytes reason
    );

    event LzTokenSet(address token);

    event DelegateSet(address sender, address delegate);

    function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory);

    function send(
        MessagingParams calldata _params,
        address _refundAddress
    ) external payable returns (MessagingReceipt memory);

    function verify(Origin calldata _origin, address _receiver, bytes32 _payloadHash) external;

    function verifiable(Origin calldata _origin, address _receiver) external view returns (bool);

    function initializable(Origin calldata _origin, address _receiver) external view returns (bool);

    function lzReceive(
        Origin calldata _origin,
        address _receiver,
        bytes32 _guid,
        bytes calldata _message,
        bytes calldata _extraData
    ) external payable;

    // oapp can burn messages partially by calling this function with its own business logic if messages are verified in order
    function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external;

    function setLzToken(address _lzToken) external;

    function lzToken() external view returns (address);

    function nativeToken() external view returns (address);

    function setDelegate(address _delegate) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import { ILayerZeroReceiver, Origin } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol";

interface IOAppReceiver is ILayerZeroReceiver {
    /**
     * @notice Retrieves the address responsible for 'sending' composeMsg's to the Endpoint.
     * @return sender The address responsible for 'sending' composeMsg's to the Endpoint.
     *
     * @dev Applications can optionally choose to implement a separate composeMsg sender that is NOT the bridging layer.
     * @dev The default sender IS the OApp implementer.
     */
    function composeMsgSender() external view returns (address sender);
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

import { ILayerZeroEndpoint } from "./ILayerZeroEndpoint.sol";

/**
 * @title IOAppCore
 */
interface IOAppCore {
    // Custom error messages
    error OnlyPeer(uint32 eid, bytes32 sender);
    error NoPeer(uint32 eid);
    error InvalidEndpointCall();
    error InvalidDelegate();
    error IdenticalDelegate();

    // Event emitted when a peer (OApp) is set for a corresponding endpoint
    event PeerSet(uint32 eid, bytes32 peer);

    /**
     * @notice Retrieves the OApp version information.
     * @return senderVersion The version of the OAppSender.sol contract.
     * @return receiverVersion The version of the OAppReceiver.sol contract.
     */
    function oAppVersion() external view returns (uint64 senderVersion, uint64 receiverVersion);

    /**
     * @notice Retrieves the LayerZero endpoint associated with the OApp.
     * @return iEndpoint The LayerZero endpoint as an interface.
     */
    function endpoint() external view returns (ILayerZeroEndpoint iEndpoint);

    /**
     * @notice Retrieves the peer (OApp) associated with a corresponding endpoint.
     * @param _eid The endpoint ID.
     * @return peer The peer address (OApp instance) associated with the corresponding endpoint.
     */
    function peers(uint32 _eid) external view returns (bytes32 peer);

    /**
     * @notice Sets the peer address (OApp instance) for a corresponding endpoint.
     * @param _eid The endpoint ID.
     * @param _peer The address of the peer to be associated with the corresponding endpoint.
     */
    function setPeer(uint32 _eid, bytes32 _peer) external;

    /**
     * @notice Sets the delegate address for the OApp Core.
     * @param _delegate The address of the delegate to be set.
     */
    function setDelegate(address _delegate) external;
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

import { Origin } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol";
import { PacketV1Codec } from "@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol";

/**
 * @title InboundPacket
 * @dev Structure representing an inbound packet received by the contract.
 */
struct InboundPacket {
    Origin origin; // Origin information of the packet.
    uint32 dstEid; // Destination endpointId of the packet.
    address receiver; // Receiver address for the packet.
    bytes32 guid; // Unique identifier of the packet.
    uint256 value; // msg.value of the packet.
    address executor; // Executor address for the packet.
    bytes message; // Message payload of the packet.
    bytes extraData; // Additional arbitrary data for the packet.
}

/**
 * @title PacketDecoder
 * @dev Library for decoding LayerZero packets.
 */
library PacketDecoder {
    using PacketV1Codec for bytes;

    /**
     * @dev Decode an inbound packet from the given packet data.
     * @param _packet The packet data to decode.
     * @return packet An InboundPacket struct representing the decoded packet.
     */
    function decode(bytes calldata _packet) internal pure returns (InboundPacket memory packet) {
        packet.origin = Origin(_packet.srcEid(), _packet.sender(), _packet.nonce());
        packet.dstEid = _packet.dstEid();
        packet.receiver = _packet.receiverB20();
        packet.guid = _packet.guid();
        packet.message = _packet.message();
    }

    /**
     * @dev Decode multiple inbound packets from the given packet data and associated message values.
     * @param _packets An array of packet data to decode.
     * @param _packetMsgValues An array of associated message values for each packet.
     * @return packets An array of InboundPacket structs representing the decoded packets.
     */
    function decode(
        bytes[] calldata _packets,
        uint256[] memory _packetMsgValues
    ) internal pure returns (InboundPacket[] memory packets) {
        packets = new InboundPacket[](_packets.length);
        for (uint256 i = 0; i < _packets.length; i++) {
            bytes calldata packet = _packets[i];
            packets[i] = PacketDecoder.decode(packet);
            // @dev Allows the verifier to specify the msg.value that gets passed in lzReceive.
            packets[i].value = _packetMsgValues[i];
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)

pragma solidity ^0.8.20;
import {Initializable} from "../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;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {AccessControlDefaultAdminRulesUpgradeable} from "contracts/AccessControlDefaultAdminRulesUpgradeable.sol";
import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol";
import {Context} from "contracts/utils/Context.sol";
import {RoleConstant} from "contracts/utils/RoleConstant.sol";

/**
 * @title PausableWithRolesUpgradeable
 * @dev Allows contract to be paused by PAUSER_ROLE
 */

abstract contract PausableWithRolesUpgradeable is
    Context,
    PausableUpgradeable,
    AccessControlDefaultAdminRulesUpgradeable
{
    /**
     * @dev initialize
     */
    function __PausableWithRoles_init() internal onlyInitializing {}

    /**
     * @dev Triggers stopped state.
     */
    function pause() external virtual onlyRole(RoleConstant.PAUSER_ROLE) {
        _pause();
    }

    /**
     * @dev Returns to normal state.
     */
    function unpause() external virtual onlyRole(RoleConstant.PAUSER_ROLE) {
        _unpause();
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

struct SetConfigParam {
    uint32 eid;
    uint32 configType;
    bytes config;
}

interface IMessageLibManager {
    struct Timeout {
        address lib;
        uint256 expiry;
    }

    event LibraryRegistered(address newLib);
    event DefaultSendLibrarySet(uint32 eid, address newLib);
    event DefaultReceiveLibrarySet(uint32 eid, address newLib);
    event DefaultReceiveLibraryTimeoutSet(uint32 eid, address oldLib, uint256 expiry);
    event SendLibrarySet(address sender, uint32 eid, address newLib);
    event ReceiveLibrarySet(address receiver, uint32 eid, address newLib);
    event ReceiveLibraryTimeoutSet(address receiver, uint32 eid, address oldLib, uint256 timeout);

    function registerLibrary(address _lib) external;

    function isRegisteredLibrary(address _lib) external view returns (bool);

    function getRegisteredLibraries() external view returns (address[] memory);

    function setDefaultSendLibrary(uint32 _eid, address _newLib) external;

    function defaultSendLibrary(uint32 _eid) external view returns (address);

    function setDefaultReceiveLibrary(uint32 _eid, address _newLib, uint256 _gracePeriod) external;

    function defaultReceiveLibrary(uint32 _eid) external view returns (address);

    function setDefaultReceiveLibraryTimeout(uint32 _eid, address _lib, uint256 _expiry) external;

    function defaultReceiveLibraryTimeout(uint32 _eid) external view returns (address lib, uint256 expiry);

    function isSupportedEid(uint32 _eid) external view returns (bool);

    function isValidReceiveLibrary(address _receiver, uint32 _eid, address _lib) external view returns (bool);

    /// ------------------- OApp interfaces -------------------
    function setSendLibrary(address _oapp, uint32 _eid, address _newLib) external;

    function getSendLibrary(address _sender, uint32 _eid) external view returns (address lib);

    function isDefaultSendLibrary(address _sender, uint32 _eid) external view returns (bool);

    function setReceiveLibrary(address _oapp, uint32 _eid, address _newLib, uint256 _gracePeriod) external;

    function getReceiveLibrary(address _receiver, uint32 _eid) external view returns (address lib, bool isDefault);

    function setReceiveLibraryTimeout(address _oapp, uint32 _eid, address _lib, uint256 _expiry) external;

    function receiveLibraryTimeout(address _receiver, uint32 _eid) external view returns (address lib, uint256 expiry);

    function setConfig(address _oapp, address _lib, SetConfigParam[] calldata _params) external;

    function getConfig(
        address _oapp,
        address _lib,
        uint32 _eid,
        uint32 _configType
    ) external view returns (bytes memory config);
}

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

interface IMessagingComposer {
    event ComposeSent(address from, address to, bytes32 guid, uint16 index, bytes message);
    event ComposeDelivered(address from, address to, bytes32 guid, uint16 index);
    event LzComposeAlert(
        address indexed from,
        address indexed to,
        address indexed executor,
        bytes32 guid,
        uint16 index,
        uint256 gas,
        uint256 value,
        bytes message,
        bytes extraData,
        bytes reason
    );

    function composeQueue(
        address _from,
        address _to,
        bytes32 _guid,
        uint16 _index
    ) external view returns (bytes32 messageHash);

    function sendCompose(address _to, bytes32 _guid, uint16 _index, bytes calldata _message) external;

    function lzCompose(
        address _from,
        address _to,
        bytes32 _guid,
        uint16 _index,
        bytes calldata _message,
        bytes calldata _extraData
    ) external payable;
}

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

interface IMessagingChannel {
    event InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce);
    event PacketNilified(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);
    event PacketBurnt(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);

    function eid() external view returns (uint32);

    // this is an emergency function if a message cannot be verified for some reasons
    // required to provide _nextNonce to avoid race condition
    function skip(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce) external;

    function nilify(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;

    function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;

    function nextGuid(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (bytes32);

    function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);

    function outboundNonce(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (uint64);

    function inboundPayloadHash(
        address _receiver,
        uint32 _srcEid,
        bytes32 _sender,
        uint64 _nonce
    ) external view returns (bytes32);

    function lazyInboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);
}

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

interface IMessagingContext {
    function isSendingMessage() external view returns (bool);

    function getSendContext() external view returns (uint32 dstEid, address sender);
}

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

import { Origin } from "./ILayerZeroEndpointV2.sol";

interface ILayerZeroReceiver {
    function allowInitializePath(Origin calldata _origin) external view returns (bool);

    function nextNonce(uint32 _eid, bytes32 _sender) external view returns (uint64);

    function lzReceive(
        Origin calldata _origin,
        bytes32 _guid,
        bytes calldata _message,
        address _executor,
        bytes calldata _extraData
    ) external payable;
}

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;
import { ILayerZeroEndpointV2 } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol";

interface ILayerZeroEndpoint is ILayerZeroEndpointV2 {
    function delegates(address oapp) external view returns (address);
}

// SPDX-License-Identifier: LZBL-1.2

pragma solidity ^0.8.20;

import { Packet } from "../../interfaces/ISendLib.sol";
import { AddressCast } from "../../libs/AddressCast.sol";

library PacketV1Codec {
    using AddressCast for address;
    using AddressCast for bytes32;

    uint8 internal constant PACKET_VERSION = 1;

    // header (version + nonce + path)
    // version
    uint256 private constant PACKET_VERSION_OFFSET = 0;
    //    nonce
    uint256 private constant NONCE_OFFSET = 1;
    //    path
    uint256 private constant SRC_EID_OFFSET = 9;
    uint256 private constant SENDER_OFFSET = 13;
    uint256 private constant DST_EID_OFFSET = 45;
    uint256 private constant RECEIVER_OFFSET = 49;
    // payload (guid + message)
    uint256 private constant GUID_OFFSET = 81; // keccak256(nonce + path)
    uint256 private constant MESSAGE_OFFSET = 113;

    function encode(Packet memory _packet) internal pure returns (bytes memory encodedPacket) {
        encodedPacket = abi.encodePacked(
            PACKET_VERSION,
            _packet.nonce,
            _packet.srcEid,
            _packet.sender.toBytes32(),
            _packet.dstEid,
            _packet.receiver,
            _packet.guid,
            _packet.message
        );
    }

    function encodePacketHeader(Packet memory _packet) internal pure returns (bytes memory) {
        return
            abi.encodePacked(
                PACKET_VERSION,
                _packet.nonce,
                _packet.srcEid,
                _packet.sender.toBytes32(),
                _packet.dstEid,
                _packet.receiver
            );
    }

    function encodePayload(Packet memory _packet) internal pure returns (bytes memory) {
        return abi.encodePacked(_packet.guid, _packet.message);
    }

    function header(bytes calldata _packet) internal pure returns (bytes calldata) {
        return _packet[0:GUID_OFFSET];
    }

    function version(bytes calldata _packet) internal pure returns (uint8) {
        return uint8(bytes1(_packet[PACKET_VERSION_OFFSET:NONCE_OFFSET]));
    }

    function nonce(bytes calldata _packet) internal pure returns (uint64) {
        return uint64(bytes8(_packet[NONCE_OFFSET:SRC_EID_OFFSET]));
    }

    function srcEid(bytes calldata _packet) internal pure returns (uint32) {
        return uint32(bytes4(_packet[SRC_EID_OFFSET:SENDER_OFFSET]));
    }

    function sender(bytes calldata _packet) internal pure returns (bytes32) {
        return bytes32(_packet[SENDER_OFFSET:DST_EID_OFFSET]);
    }

    function senderAddressB20(bytes calldata _packet) internal pure returns (address) {
        return sender(_packet).toAddress();
    }

    function dstEid(bytes calldata _packet) internal pure returns (uint32) {
        return uint32(bytes4(_packet[DST_EID_OFFSET:RECEIVER_OFFSET]));
    }

    function receiver(bytes calldata _packet) internal pure returns (bytes32) {
        return bytes32(_packet[RECEIVER_OFFSET:GUID_OFFSET]);
    }

    function receiverB20(bytes calldata _packet) internal pure returns (address) {
        return receiver(_packet).toAddress();
    }

    function guid(bytes calldata _packet) internal pure returns (bytes32) {
        return bytes32(_packet[GUID_OFFSET:MESSAGE_OFFSET]);
    }

    function message(bytes calldata _packet) internal pure returns (bytes calldata) {
        return bytes(_packet[MESSAGE_OFFSET:]);
    }

    function payload(bytes calldata _packet) internal pure returns (bytes calldata) {
        return bytes(_packet[GUID_OFFSET:]);
    }

    function payloadHash(bytes calldata _packet) internal pure returns (bytes32) {
        return keccak256(payload(_packet));
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {IAccessControlDefaultAdminRules} from "./interface/IAccessControlDefaultAdminRules.sol";
import {AccessControlUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol";
import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {IERC5313} from "@openzeppelin/contracts/interfaces/IERC5313.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

/**
 * @dev Forked from https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/access/extensions/AccessControlDefaultAdminRulesUpgradeable.sol
 * @dev Extension of {AccessControl} that allows specifying special rules to manage
 * the `DEFAULT_ADMIN_ROLE` holder, which is a sensitive role with special permissions
 * over other roles that may potentially have privileged rights in the system.
 *
 * Changes:
 * 1. Change initializers to remove initialDelay
 * 2. Remove time delay related functions: _pendingDefaultAdminSchedule, _currentDelay, _pendingDelay, _pendingDelaySchedule
 * defaultAdminDelay, pendingDefaultAdminDelay, defaultAdminDelayIncreaseWait, changeDefaultAdminDelay, _changeDefaultAdminDelay
 * changeDefaultAdminDelay, _changeDefaultAdminDelay, rollbackDefaultAdminDelay, _rollbackDefaultAdminDelay
 * _delayChangeWait, _setPendingDelay, _isScheduleSet, _hasSchedulePassed
 * 3. Remove renounceRole() function
 * 4. Remove _pendingDefaultAdminSchedule from pendingDefaultAdmin function
 * 5. Remove time delay elements from _beginDefaultAdminTransfer and _setPendingDefaultAdmin
 * 7. Change _acceptDefaultAdminTransfer to remove time delay elements
 */

abstract contract AccessControlDefaultAdminRulesUpgradeable is
    Initializable,
    IAccessControlDefaultAdminRules,
    IERC5313,
    AccessControlUpgradeable
{
    /// @custom:storage-location erc7201:openzeppelin.storage.AccessControlDefaultAdminRules
    struct AccessControlDefaultAdminRulesStorage {
        // pending admin pair read/written together frequently
        address _pendingDefaultAdmin;
        address _currentDefaultAdmin;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.AccessControlDefaultAdminRules")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant AccessControlDefaultAdminRulesStorageLocation =
        0xeef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698400;

    function _getAccessControlDefaultAdminRulesStorage()
        private
        pure
        returns (AccessControlDefaultAdminRulesStorage storage $)
    {
        assembly {
            $.slot := AccessControlDefaultAdminRulesStorageLocation
        }
    }

    /**
     * @dev Sets the initial values for {defaultAdmin} address.
     */
    function __AccessControlDefaultAdminRules_init(
        address initialDefaultAdmin
    ) internal onlyInitializing {
        __AccessControlDefaultAdminRules_init_unchained(initialDefaultAdmin);
    }

    function __AccessControlDefaultAdminRules_init_unchained(
        address initialDefaultAdmin
    ) internal onlyInitializing {
        if (initialDefaultAdmin == address(0)) {
            revert AccessControlInvalidDefaultAdmin(address(0));
        }
        _grantRole(DEFAULT_ADMIN_ROLE, initialDefaultAdmin);
    }

    /**
     * @dev Throws if called by any account other than the _currentDefaultAdmin.
     */
    modifier onlyDefaultAdmin() {
        if (!isDefaultAdmin(_msgSender())) revert AccessControlNonDefaultAdmin();
        _;
    }

    /**
     * @dev Throws if called by any account other than the _currentDefaultAdmin or with given role
     */
    modifier onlyRoleOrDefaultAdmin(bytes32 role) {
        if (!isDefaultAdmin(_msgSender())) {
            _checkRole(role);
        }
        _;
    }

    /**
     * @dev check if input address equals _currentDefaultAdmin
     */
    function isDefaultAdmin(address _address) public view virtual returns (bool) {
        return defaultAdmin() == _address;
    }

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

    /**
     * @dev See {IERC5313-owner}.
     */
    function owner() public view virtual returns (address) {
        return defaultAdmin();
    }

    ///
    /// Override AccessControl role management
    ///

    /**
     * @dev See {AccessControl-grantRole}. Reverts for `DEFAULT_ADMIN_ROLE`.
     */
    function grantRole(
        bytes32 role,
        address account
    ) public virtual override(AccessControlUpgradeable, IAccessControl) {
        if (role == DEFAULT_ADMIN_ROLE) {
            revert AccessControlEnforcedDefaultAdminRules();
        }
        super.grantRole(role, account);
    }

    /**
     * @dev See {AccessControl-revokeRole}. Reverts for `DEFAULT_ADMIN_ROLE`.
     */
    function revokeRole(
        bytes32 role,
        address account
    ) public virtual override(AccessControlUpgradeable, IAccessControl) {
        if (role == DEFAULT_ADMIN_ROLE) {
            revert AccessControlEnforcedDefaultAdminRules();
        }
        super.revokeRole(role, account);
    }

    /**
     * @dev See {AccessControl-_grantRole}.
     *
     * For `DEFAULT_ADMIN_ROLE`, it only allows granting if there isn't already a {defaultAdmin}
     *
     * NOTE: Exposing this function through another mechanism may make the `DEFAULT_ADMIN_ROLE`
     * assignable again. Make sure to guarantee this is the expected behavior in your implementation.
     */
    function _grantRole(
        bytes32 role,
        address account
    ) internal virtual override returns (bool) {
        AccessControlDefaultAdminRulesStorage
            storage $ = _getAccessControlDefaultAdminRulesStorage();
        if (role == DEFAULT_ADMIN_ROLE) {
            if (defaultAdmin() != address(0)) {
                revert AccessControlEnforcedDefaultAdminRules();
            }
            $._currentDefaultAdmin = account;
        }
        return super._grantRole(role, account);
    }

    /**
     * @dev See {AccessControl-_revokeRole}.
     */
    function _revokeRole(
        bytes32 role,
        address account
    ) internal virtual override returns (bool) {
        AccessControlDefaultAdminRulesStorage
            storage $ = _getAccessControlDefaultAdminRulesStorage();
        if (role == DEFAULT_ADMIN_ROLE && account == defaultAdmin()) {
            delete $._currentDefaultAdmin;
        }
        return super._revokeRole(role, account);
    }

    /**
     * @dev See {AccessControl-_setRoleAdmin}. Reverts for `DEFAULT_ADMIN_ROLE`.
     */
    function _setRoleAdmin(
        bytes32 role,
        bytes32 adminRole
    ) internal virtual override {
        if (role == DEFAULT_ADMIN_ROLE) {
            revert AccessControlEnforcedDefaultAdminRules();
        }
        super._setRoleAdmin(role, adminRole);
    }

    ///
    /// AccessControlDefaultAdminRules accessors
    ///

    /**
     * @inheritdoc IAccessControlDefaultAdminRules
     */
    function defaultAdmin() public view virtual returns (address) {
        AccessControlDefaultAdminRulesStorage
            storage $ = _getAccessControlDefaultAdminRulesStorage();
        return $._currentDefaultAdmin;
    }

    /**
     * @inheritdoc IAccessControlDefaultAdminRules
     */
    function pendingDefaultAdmin()
        public
        view
        virtual
        returns (address newAdmin)
    {
        AccessControlDefaultAdminRulesStorage
            storage $ = _getAccessControlDefaultAdminRulesStorage();
        return $._pendingDefaultAdmin;
    }

    ///
    /// AccessControlDefaultAdminRules public and internal setters for defaultAdmin/pendingDefaultAdmin
    ///

    /**
     * @inheritdoc IAccessControlDefaultAdminRules
     */
    function beginDefaultAdminTransfer(
        address newAdmin
    ) public virtual onlyRole(DEFAULT_ADMIN_ROLE) {
        _beginDefaultAdminTransfer(newAdmin);
    }

    /**
     * @dev See {beginDefaultAdminTransfer}.
     *
     * Internal function without access restriction.
     */
    function _beginDefaultAdminTransfer(address newAdmin) internal virtual {
        _setPendingDefaultAdmin(newAdmin);
        emit DefaultAdminTransferScheduled(newAdmin);
    }

    /**
     * @inheritdoc IAccessControlDefaultAdminRules
     */
    function cancelDefaultAdminTransfer()
        public
        virtual
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        _cancelDefaultAdminTransfer();
    }

    /**
     * @dev See {cancelDefaultAdminTransfer}.
     *
     * Internal function without access restriction.
     */
    function _cancelDefaultAdminTransfer() internal virtual {
        _setPendingDefaultAdmin(address(0));
    }

    /**
     * @inheritdoc IAccessControlDefaultAdminRules
     */
    function acceptDefaultAdminTransfer() public virtual {
        address newDefaultAdmin = pendingDefaultAdmin();
        if (_msgSender() != newDefaultAdmin) {
            // Enforce newDefaultAdmin explicit acceptance.
            revert AccessControlInvalidDefaultAdmin(_msgSender());
        }
        _acceptDefaultAdminTransfer();
    }

    /**
     * @dev See {acceptDefaultAdminTransfer}.
     *
     * Internal function without access restriction.
     */
    function _acceptDefaultAdminTransfer() internal virtual {
        AccessControlDefaultAdminRulesStorage
            storage $ = _getAccessControlDefaultAdminRulesStorage();
        address newAdmin = pendingDefaultAdmin();
        _revokeRole(DEFAULT_ADMIN_ROLE, defaultAdmin());
        _grantRole(DEFAULT_ADMIN_ROLE, newAdmin);
        delete $._pendingDefaultAdmin;
    }

    ///
    /// Private setters
    ///

    /**
     * @dev Setter of pending admin
     *
     * May emit a DefaultAdminTransferCanceled event.
     */
    function _setPendingDefaultAdmin(address newAdmin) private {
        AccessControlDefaultAdminRulesStorage
            storage $ = _getAccessControlDefaultAdminRulesStorage();
        $._pendingDefaultAdmin = newAdmin;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {Initializable} from "../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 {
    /// @custom:storage-location erc7201:openzeppelin.storage.Pausable
    struct PausableStorage {
        bool _paused;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Pausable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant PausableStorageLocation = 0xcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300;

    function _getPausableStorage() private pure returns (PausableStorage storage $) {
        assembly {
            $.slot := PausableStorageLocation
        }
    }

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

    /**
     * @dev The operation failed because the contract is paused.
     */
    error EnforcedPause();

    /**
     * @dev The operation failed because the contract is not paused.
     */
    error ExpectedPause();

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

    function __Pausable_init_unchained() internal onlyInitializing {
        PausableStorage storage $ = _getPausableStorage();
        $._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) {
        PausableStorage storage $ = _getPausableStorage();
        return $._paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        if (paused()) {
            revert EnforcedPause();
        }
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        if (!paused()) {
            revert ExpectedPause();
        }
    }

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

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

File 49 of 60 : Context.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

abstract contract Context {
    /**
     * @dev The operation failed because the address is already zero address
     */
    error ZeroAddress();

    /**
     * @dev The operation failed because it is zero value
     */
    error ZeroValue();

    /**
     * @dev Modifier to prevent calling zero address
     */
    modifier nonZA(address addr) {
        if (addr == address(0)) revert ZeroAddress();
        _;
    }

    /**
     * @dev Modifier to prevent zero value
     */
    modifier nonZV(uint256 amount) {
        if (amount == 0) revert ZeroValue();
        _;
    }
}

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

import { MessagingFee } from "./ILayerZeroEndpointV2.sol";
import { IMessageLib } from "./IMessageLib.sol";

struct Packet {
    uint64 nonce;
    uint32 srcEid;
    address sender;
    uint32 dstEid;
    bytes32 receiver;
    bytes32 guid;
    bytes message;
}

interface ISendLib is IMessageLib {
    function send(
        Packet calldata _packet,
        bytes calldata _options,
        bool _payInLzToken
    ) external returns (MessagingFee memory, bytes memory encodedPacket);

    function quote(
        Packet calldata _packet,
        bytes calldata _options,
        bool _payInLzToken
    ) external view returns (MessagingFee memory);

    function setTreasury(address _treasury) external;

    function withdrawFee(address _to, uint256 _amount) external;

    function withdrawLzTokenFee(address _lzToken, address _to, uint256 _amount) external;
}

// SPDX-License-Identifier: LZBL-1.2

pragma solidity ^0.8.20;

library AddressCast {
    error AddressCast_InvalidSizeForAddress();
    error AddressCast_InvalidAddress();

    function toBytes32(bytes calldata _addressBytes) internal pure returns (bytes32 result) {
        if (_addressBytes.length > 32) revert AddressCast_InvalidAddress();
        result = bytes32(_addressBytes);
        unchecked {
            uint256 offset = 32 - _addressBytes.length;
            result = result >> (offset * 8);
        }
    }

    function toBytes32(address _address) internal pure returns (bytes32 result) {
        result = bytes32(uint256(uint160(_address)));
    }

    function toBytes(bytes32 _addressBytes32, uint256 _size) internal pure returns (bytes memory result) {
        if (_size == 0 || _size > 32) revert AddressCast_InvalidSizeForAddress();
        result = new bytes(_size);
        unchecked {
            uint256 offset = 256 - _size * 8;
            assembly {
                mstore(add(result, 32), shl(offset, _addressBytes32))
            }
        }
    }

    function toAddress(bytes32 _addressBytes32) internal pure returns (address result) {
        result = address(uint160(uint256(_addressBytes32)));
    }

    function toAddress(bytes calldata _addressBytes) internal pure returns (address result) {
        if (_addressBytes.length != 20) revert AddressCast_InvalidAddress();
        result = address(bytes20(_addressBytes));
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol";

/**
 * @dev External interface of AccessControlDefaultAdminRules declared to support ERC165 detection.
 * @dev Forked from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/3e6c86392c97fbc30d3d20a378a6f58beba08eba/contracts/access/extensions/IAccessControlDefaultAdminRules.sol
 * Changes:
 * 1. Remove AccessControlEnforcedDefaultAdminDelay error
 * 2. Remove acceptSchedule from event DefaultAdminTransferScheduled
 * 3. Remove DefaultAdminDelayChangeScheduled/DefaultAdminDelayChangeCanceled event
 * 5. Remove acceptSchedule from pendingDefaultAdmin function
 * 6. Remove defaultAdminDelay/pendingDefaultAdminDelay/changeDefaultAdminDelay/rollbackDefaultAdminDelay/defaultAdminDelayIncreaseWait function
 */
interface IAccessControlDefaultAdminRules is IAccessControl {
    /**
     * @dev The new default admin is not a valid default admin.
     */
    error AccessControlInvalidDefaultAdmin(address defaultAdmin);

    /**
     * @dev At least one of the following rules was violated:
     *
     * - The `DEFAULT_ADMIN_ROLE` must only be managed by itself.
     * - The `DEFAULT_ADMIN_ROLE` must only be held by one account at the time.
     * - Any `DEFAULT_ADMIN_ROLE` transfer must be in two delayed steps.
     */
    error AccessControlEnforcedDefaultAdminRules();
    /**
     * @dev Message Sender is not
     *
     * - The `DEFAULT_ADMIN_ROLE` must only be managed by itself.
     * - The `DEFAULT_ADMIN_ROLE` must only be held by one account at the time.
     * - Any `DEFAULT_ADMIN_ROLE` transfer must be in two delayed steps.
     */
    error AccessControlNonDefaultAdmin();

    /**
     * @dev Emitted when a {defaultAdmin} transfer is started, setting `newAdmin` as the next
     * address to become the {defaultAdmin} by calling {acceptDefaultAdminTransfer}
     */
    event DefaultAdminTransferScheduled(address indexed newAdmin);

    /**
     * @dev Emitted when a {pendingDefaultAdmin} is reset if it was never accepted
     */
    event DefaultAdminTransferCanceled();

    /**
     * @dev Returns the address of the current `DEFAULT_ADMIN_ROLE` holder.
     */
    function defaultAdmin() external view returns (address);

    /**
     * @dev Returns `newAdmin` address
     *
     * `newAdmin` will be able to accept the {defaultAdmin} role
     * by calling {acceptDefaultAdminTransfer}, completing the role transfer.
     *
     * NOTE: A zero address `newAdmin` means that {defaultAdmin} is being renounced.
     */
    function pendingDefaultAdmin() external view returns (address newAdmin);

    /**
     * @dev Starts a {defaultAdmin} transfer by setting a {pendingDefaultAdmin}
     *
     * Requirements:
     *
     * - Only can be called by the current {defaultAdmin}.
     *
     * Emits a DefaultAdminRoleChangeStarted event.
     */
    function beginDefaultAdminTransfer(address newAdmin) external;

    /**
     * @dev Cancels a {defaultAdmin} transfer previously started with {beginDefaultAdminTransfer}.
     *
     * A {pendingDefaultAdmin} not yet accepted can also be cancelled with this function.
     *
     * Requirements:
     *
     * - Only can be called by the current {defaultAdmin}.
     *
     * May emit a DefaultAdminTransferCanceled event.
     */
    function cancelDefaultAdminTransfer() external;

    /**
     * @dev Completes a {defaultAdmin} transfer previously started with {beginDefaultAdminTransfer}.
     *
     * After calling the function:
     *
     * - `DEFAULT_ADMIN_ROLE` should be granted to the caller.
     * - `DEFAULT_ADMIN_ROLE` should be revoked from the previous holder.
     * - {pendingDefaultAdmin} should be reset to zero values.
     *
     * Requirements:
     *
     * - Only can be called by the {pendingDefaultAdmin}'s `newAdmin`.
     */
    function acceptDefaultAdminTransfer() external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)

pragma solidity ^0.8.20;

import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol";
import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {ERC165Upgradeable} from "../utils/introspection/ERC165Upgradeable.sol";
import {Initializable} from "../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:
 *
 * ```solidity
 * 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}:
 *
 * ```solidity
 * 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. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControl, ERC165Upgradeable {
    struct RoleData {
        mapping(address account => bool) hasRole;
        bytes32 adminRole;
    }

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;


    /// @custom:storage-location erc7201:openzeppelin.storage.AccessControl
    struct AccessControlStorage {
        mapping(bytes32 role => RoleData) _roles;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.AccessControl")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant AccessControlStorageLocation = 0x02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800;

    function _getAccessControlStorage() private pure returns (AccessControlStorage storage $) {
        assembly {
            $.slot := AccessControlStorageLocation
        }
    }

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with an {AccessControlUnauthorizedAccount} error including the required role.
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    function __AccessControl_init() internal onlyInitializing {
    }

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

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

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
     * is missing `role`.
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert AccessControlUnauthorizedAccount(account, role);
        }
    }

    /**
     * @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 returns (bytes32) {
        AccessControlStorage storage $ = _getAccessControlStorage();
        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 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 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 `callerConfirmation`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address callerConfirmation) public virtual {
        if (callerConfirmation != _msgSender()) {
            revert AccessControlBadConfirmation();
        }

        _revokeRole(role, callerConfirmation);
    }

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

    /**
     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
        AccessControlStorage storage $ = _getAccessControlStorage();
        if (!hasRole(role, account)) {
            $._roles[role].hasRole[account] = true;
            emit RoleGranted(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
        AccessControlStorage storage $ = _getAccessControlStorage();
        if (hasRole(role, account)) {
            $._roles[role].hasRole[account] = false;
            emit RoleRevoked(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)

pragma solidity ^0.8.20;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev The `account` is missing a role.
     */
    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);

    /**
     * @dev The caller of a function is not the expected one.
     *
     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
     */
    error AccessControlBadConfirmation();

    /**
     * @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.
     */
    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 `callerConfirmation`.
     */
    function renounceRole(bytes32 role, address callerConfirmation) external;
}

File 55 of 60 : SafeCast.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.

pragma solidity ^0.8.20;

/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeCast {
    /**
     * @dev Value doesn't fit in an uint of `bits` size.
     */
    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);

    /**
     * @dev An int value doesn't fit in an uint of `bits` size.
     */
    error SafeCastOverflowedIntToUint(int256 value);

    /**
     * @dev Value doesn't fit in an int of `bits` size.
     */
    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);

    /**
     * @dev An uint value doesn't fit in an int of `bits` size.
     */
    error SafeCastOverflowedUintToInt(uint256 value);

    /**
     * @dev Returns the downcasted uint248 from uint256, reverting on
     * overflow (when the input is greater than largest uint248).
     *
     * Counterpart to Solidity's `uint248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     */
    function toUint248(uint256 value) internal pure returns (uint248) {
        if (value > type(uint248).max) {
            revert SafeCastOverflowedUintDowncast(248, value);
        }
        return uint248(value);
    }

    /**
     * @dev Returns the downcasted uint240 from uint256, reverting on
     * overflow (when the input is greater than largest uint240).
     *
     * Counterpart to Solidity's `uint240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     */
    function toUint240(uint256 value) internal pure returns (uint240) {
        if (value > type(uint240).max) {
            revert SafeCastOverflowedUintDowncast(240, value);
        }
        return uint240(value);
    }

    /**
     * @dev Returns the downcasted uint232 from uint256, reverting on
     * overflow (when the input is greater than largest uint232).
     *
     * Counterpart to Solidity's `uint232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     */
    function toUint232(uint256 value) internal pure returns (uint232) {
        if (value > type(uint232).max) {
            revert SafeCastOverflowedUintDowncast(232, value);
        }
        return uint232(value);
    }

    /**
     * @dev Returns the downcasted uint224 from uint256, reverting on
     * overflow (when the input is greater than largest uint224).
     *
     * Counterpart to Solidity's `uint224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     */
    function toUint224(uint256 value) internal pure returns (uint224) {
        if (value > type(uint224).max) {
            revert SafeCastOverflowedUintDowncast(224, value);
        }
        return uint224(value);
    }

    /**
     * @dev Returns the downcasted uint216 from uint256, reverting on
     * overflow (when the input is greater than largest uint216).
     *
     * Counterpart to Solidity's `uint216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     */
    function toUint216(uint256 value) internal pure returns (uint216) {
        if (value > type(uint216).max) {
            revert SafeCastOverflowedUintDowncast(216, value);
        }
        return uint216(value);
    }

    /**
     * @dev Returns the downcasted uint208 from uint256, reverting on
     * overflow (when the input is greater than largest uint208).
     *
     * Counterpart to Solidity's `uint208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     */
    function toUint208(uint256 value) internal pure returns (uint208) {
        if (value > type(uint208).max) {
            revert SafeCastOverflowedUintDowncast(208, value);
        }
        return uint208(value);
    }

    /**
     * @dev Returns the downcasted uint200 from uint256, reverting on
     * overflow (when the input is greater than largest uint200).
     *
     * Counterpart to Solidity's `uint200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     */
    function toUint200(uint256 value) internal pure returns (uint200) {
        if (value > type(uint200).max) {
            revert SafeCastOverflowedUintDowncast(200, value);
        }
        return uint200(value);
    }

    /**
     * @dev Returns the downcasted uint192 from uint256, reverting on
     * overflow (when the input is greater than largest uint192).
     *
     * Counterpart to Solidity's `uint192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     */
    function toUint192(uint256 value) internal pure returns (uint192) {
        if (value > type(uint192).max) {
            revert SafeCastOverflowedUintDowncast(192, value);
        }
        return uint192(value);
    }

    /**
     * @dev Returns the downcasted uint184 from uint256, reverting on
     * overflow (when the input is greater than largest uint184).
     *
     * Counterpart to Solidity's `uint184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     */
    function toUint184(uint256 value) internal pure returns (uint184) {
        if (value > type(uint184).max) {
            revert SafeCastOverflowedUintDowncast(184, value);
        }
        return uint184(value);
    }

    /**
     * @dev Returns the downcasted uint176 from uint256, reverting on
     * overflow (when the input is greater than largest uint176).
     *
     * Counterpart to Solidity's `uint176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     */
    function toUint176(uint256 value) internal pure returns (uint176) {
        if (value > type(uint176).max) {
            revert SafeCastOverflowedUintDowncast(176, value);
        }
        return uint176(value);
    }

    /**
     * @dev Returns the downcasted uint168 from uint256, reverting on
     * overflow (when the input is greater than largest uint168).
     *
     * Counterpart to Solidity's `uint168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     */
    function toUint168(uint256 value) internal pure returns (uint168) {
        if (value > type(uint168).max) {
            revert SafeCastOverflowedUintDowncast(168, value);
        }
        return uint168(value);
    }

    /**
     * @dev Returns the downcasted uint160 from uint256, reverting on
     * overflow (when the input is greater than largest uint160).
     *
     * Counterpart to Solidity's `uint160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     */
    function toUint160(uint256 value) internal pure returns (uint160) {
        if (value > type(uint160).max) {
            revert SafeCastOverflowedUintDowncast(160, value);
        }
        return uint160(value);
    }

    /**
     * @dev Returns the downcasted uint152 from uint256, reverting on
     * overflow (when the input is greater than largest uint152).
     *
     * Counterpart to Solidity's `uint152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     */
    function toUint152(uint256 value) internal pure returns (uint152) {
        if (value > type(uint152).max) {
            revert SafeCastOverflowedUintDowncast(152, value);
        }
        return uint152(value);
    }

    /**
     * @dev Returns the downcasted uint144 from uint256, reverting on
     * overflow (when the input is greater than largest uint144).
     *
     * Counterpart to Solidity's `uint144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     */
    function toUint144(uint256 value) internal pure returns (uint144) {
        if (value > type(uint144).max) {
            revert SafeCastOverflowedUintDowncast(144, value);
        }
        return uint144(value);
    }

    /**
     * @dev Returns the downcasted uint136 from uint256, reverting on
     * overflow (when the input is greater than largest uint136).
     *
     * Counterpart to Solidity's `uint136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     */
    function toUint136(uint256 value) internal pure returns (uint136) {
        if (value > type(uint136).max) {
            revert SafeCastOverflowedUintDowncast(136, value);
        }
        return uint136(value);
    }

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        if (value > type(uint128).max) {
            revert SafeCastOverflowedUintDowncast(128, value);
        }
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint120 from uint256, reverting on
     * overflow (when the input is greater than largest uint120).
     *
     * Counterpart to Solidity's `uint120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     */
    function toUint120(uint256 value) internal pure returns (uint120) {
        if (value > type(uint120).max) {
            revert SafeCastOverflowedUintDowncast(120, value);
        }
        return uint120(value);
    }

    /**
     * @dev Returns the downcasted uint112 from uint256, reverting on
     * overflow (when the input is greater than largest uint112).
     *
     * Counterpart to Solidity's `uint112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     */
    function toUint112(uint256 value) internal pure returns (uint112) {
        if (value > type(uint112).max) {
            revert SafeCastOverflowedUintDowncast(112, value);
        }
        return uint112(value);
    }

    /**
     * @dev Returns the downcasted uint104 from uint256, reverting on
     * overflow (when the input is greater than largest uint104).
     *
     * Counterpart to Solidity's `uint104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     */
    function toUint104(uint256 value) internal pure returns (uint104) {
        if (value > type(uint104).max) {
            revert SafeCastOverflowedUintDowncast(104, value);
        }
        return uint104(value);
    }

    /**
     * @dev Returns the downcasted uint96 from uint256, reverting on
     * overflow (when the input is greater than largest uint96).
     *
     * Counterpart to Solidity's `uint96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     */
    function toUint96(uint256 value) internal pure returns (uint96) {
        if (value > type(uint96).max) {
            revert SafeCastOverflowedUintDowncast(96, value);
        }
        return uint96(value);
    }

    /**
     * @dev Returns the downcasted uint88 from uint256, reverting on
     * overflow (when the input is greater than largest uint88).
     *
     * Counterpart to Solidity's `uint88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     */
    function toUint88(uint256 value) internal pure returns (uint88) {
        if (value > type(uint88).max) {
            revert SafeCastOverflowedUintDowncast(88, value);
        }
        return uint88(value);
    }

    /**
     * @dev Returns the downcasted uint80 from uint256, reverting on
     * overflow (when the input is greater than largest uint80).
     *
     * Counterpart to Solidity's `uint80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     */
    function toUint80(uint256 value) internal pure returns (uint80) {
        if (value > type(uint80).max) {
            revert SafeCastOverflowedUintDowncast(80, value);
        }
        return uint80(value);
    }

    /**
     * @dev Returns the downcasted uint72 from uint256, reverting on
     * overflow (when the input is greater than largest uint72).
     *
     * Counterpart to Solidity's `uint72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     */
    function toUint72(uint256 value) internal pure returns (uint72) {
        if (value > type(uint72).max) {
            revert SafeCastOverflowedUintDowncast(72, value);
        }
        return uint72(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        if (value > type(uint64).max) {
            revert SafeCastOverflowedUintDowncast(64, value);
        }
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint56 from uint256, reverting on
     * overflow (when the input is greater than largest uint56).
     *
     * Counterpart to Solidity's `uint56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     */
    function toUint56(uint256 value) internal pure returns (uint56) {
        if (value > type(uint56).max) {
            revert SafeCastOverflowedUintDowncast(56, value);
        }
        return uint56(value);
    }

    /**
     * @dev Returns the downcasted uint48 from uint256, reverting on
     * overflow (when the input is greater than largest uint48).
     *
     * Counterpart to Solidity's `uint48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     */
    function toUint48(uint256 value) internal pure returns (uint48) {
        if (value > type(uint48).max) {
            revert SafeCastOverflowedUintDowncast(48, value);
        }
        return uint48(value);
    }

    /**
     * @dev Returns the downcasted uint40 from uint256, reverting on
     * overflow (when the input is greater than largest uint40).
     *
     * Counterpart to Solidity's `uint40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     */
    function toUint40(uint256 value) internal pure returns (uint40) {
        if (value > type(uint40).max) {
            revert SafeCastOverflowedUintDowncast(40, value);
        }
        return uint40(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        if (value > type(uint32).max) {
            revert SafeCastOverflowedUintDowncast(32, value);
        }
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint24 from uint256, reverting on
     * overflow (when the input is greater than largest uint24).
     *
     * Counterpart to Solidity's `uint24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     */
    function toUint24(uint256 value) internal pure returns (uint24) {
        if (value > type(uint24).max) {
            revert SafeCastOverflowedUintDowncast(24, value);
        }
        return uint24(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        if (value > type(uint16).max) {
            revert SafeCastOverflowedUintDowncast(16, value);
        }
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        if (value > type(uint8).max) {
            revert SafeCastOverflowedUintDowncast(8, value);
        }
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        if (value < 0) {
            revert SafeCastOverflowedIntToUint(value);
        }
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int248 from int256, reverting on
     * overflow (when the input is less than smallest int248 or
     * greater than largest int248).
     *
     * Counterpart to Solidity's `int248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     */
    function toInt248(int256 value) internal pure returns (int248 downcasted) {
        downcasted = int248(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(248, value);
        }
    }

    /**
     * @dev Returns the downcasted int240 from int256, reverting on
     * overflow (when the input is less than smallest int240 or
     * greater than largest int240).
     *
     * Counterpart to Solidity's `int240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     */
    function toInt240(int256 value) internal pure returns (int240 downcasted) {
        downcasted = int240(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(240, value);
        }
    }

    /**
     * @dev Returns the downcasted int232 from int256, reverting on
     * overflow (when the input is less than smallest int232 or
     * greater than largest int232).
     *
     * Counterpart to Solidity's `int232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     */
    function toInt232(int256 value) internal pure returns (int232 downcasted) {
        downcasted = int232(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(232, value);
        }
    }

    /**
     * @dev Returns the downcasted int224 from int256, reverting on
     * overflow (when the input is less than smallest int224 or
     * greater than largest int224).
     *
     * Counterpart to Solidity's `int224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     */
    function toInt224(int256 value) internal pure returns (int224 downcasted) {
        downcasted = int224(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(224, value);
        }
    }

    /**
     * @dev Returns the downcasted int216 from int256, reverting on
     * overflow (when the input is less than smallest int216 or
     * greater than largest int216).
     *
     * Counterpart to Solidity's `int216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     */
    function toInt216(int256 value) internal pure returns (int216 downcasted) {
        downcasted = int216(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(216, value);
        }
    }

    /**
     * @dev Returns the downcasted int208 from int256, reverting on
     * overflow (when the input is less than smallest int208 or
     * greater than largest int208).
     *
     * Counterpart to Solidity's `int208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     */
    function toInt208(int256 value) internal pure returns (int208 downcasted) {
        downcasted = int208(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(208, value);
        }
    }

    /**
     * @dev Returns the downcasted int200 from int256, reverting on
     * overflow (when the input is less than smallest int200 or
     * greater than largest int200).
     *
     * Counterpart to Solidity's `int200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     */
    function toInt200(int256 value) internal pure returns (int200 downcasted) {
        downcasted = int200(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(200, value);
        }
    }

    /**
     * @dev Returns the downcasted int192 from int256, reverting on
     * overflow (when the input is less than smallest int192 or
     * greater than largest int192).
     *
     * Counterpart to Solidity's `int192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     */
    function toInt192(int256 value) internal pure returns (int192 downcasted) {
        downcasted = int192(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(192, value);
        }
    }

    /**
     * @dev Returns the downcasted int184 from int256, reverting on
     * overflow (when the input is less than smallest int184 or
     * greater than largest int184).
     *
     * Counterpart to Solidity's `int184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     */
    function toInt184(int256 value) internal pure returns (int184 downcasted) {
        downcasted = int184(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(184, value);
        }
    }

    /**
     * @dev Returns the downcasted int176 from int256, reverting on
     * overflow (when the input is less than smallest int176 or
     * greater than largest int176).
     *
     * Counterpart to Solidity's `int176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     */
    function toInt176(int256 value) internal pure returns (int176 downcasted) {
        downcasted = int176(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(176, value);
        }
    }

    /**
     * @dev Returns the downcasted int168 from int256, reverting on
     * overflow (when the input is less than smallest int168 or
     * greater than largest int168).
     *
     * Counterpart to Solidity's `int168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     */
    function toInt168(int256 value) internal pure returns (int168 downcasted) {
        downcasted = int168(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(168, value);
        }
    }

    /**
     * @dev Returns the downcasted int160 from int256, reverting on
     * overflow (when the input is less than smallest int160 or
     * greater than largest int160).
     *
     * Counterpart to Solidity's `int160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     */
    function toInt160(int256 value) internal pure returns (int160 downcasted) {
        downcasted = int160(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(160, value);
        }
    }

    /**
     * @dev Returns the downcasted int152 from int256, reverting on
     * overflow (when the input is less than smallest int152 or
     * greater than largest int152).
     *
     * Counterpart to Solidity's `int152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     */
    function toInt152(int256 value) internal pure returns (int152 downcasted) {
        downcasted = int152(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(152, value);
        }
    }

    /**
     * @dev Returns the downcasted int144 from int256, reverting on
     * overflow (when the input is less than smallest int144 or
     * greater than largest int144).
     *
     * Counterpart to Solidity's `int144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     */
    function toInt144(int256 value) internal pure returns (int144 downcasted) {
        downcasted = int144(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(144, value);
        }
    }

    /**
     * @dev Returns the downcasted int136 from int256, reverting on
     * overflow (when the input is less than smallest int136 or
     * greater than largest int136).
     *
     * Counterpart to Solidity's `int136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     */
    function toInt136(int256 value) internal pure returns (int136 downcasted) {
        downcasted = int136(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(136, value);
        }
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toInt128(int256 value) internal pure returns (int128 downcasted) {
        downcasted = int128(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(128, value);
        }
    }

    /**
     * @dev Returns the downcasted int120 from int256, reverting on
     * overflow (when the input is less than smallest int120 or
     * greater than largest int120).
     *
     * Counterpart to Solidity's `int120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     */
    function toInt120(int256 value) internal pure returns (int120 downcasted) {
        downcasted = int120(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(120, value);
        }
    }

    /**
     * @dev Returns the downcasted int112 from int256, reverting on
     * overflow (when the input is less than smallest int112 or
     * greater than largest int112).
     *
     * Counterpart to Solidity's `int112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     */
    function toInt112(int256 value) internal pure returns (int112 downcasted) {
        downcasted = int112(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(112, value);
        }
    }

    /**
     * @dev Returns the downcasted int104 from int256, reverting on
     * overflow (when the input is less than smallest int104 or
     * greater than largest int104).
     *
     * Counterpart to Solidity's `int104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     */
    function toInt104(int256 value) internal pure returns (int104 downcasted) {
        downcasted = int104(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(104, value);
        }
    }

    /**
     * @dev Returns the downcasted int96 from int256, reverting on
     * overflow (when the input is less than smallest int96 or
     * greater than largest int96).
     *
     * Counterpart to Solidity's `int96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     */
    function toInt96(int256 value) internal pure returns (int96 downcasted) {
        downcasted = int96(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(96, value);
        }
    }

    /**
     * @dev Returns the downcasted int88 from int256, reverting on
     * overflow (when the input is less than smallest int88 or
     * greater than largest int88).
     *
     * Counterpart to Solidity's `int88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     */
    function toInt88(int256 value) internal pure returns (int88 downcasted) {
        downcasted = int88(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(88, value);
        }
    }

    /**
     * @dev Returns the downcasted int80 from int256, reverting on
     * overflow (when the input is less than smallest int80 or
     * greater than largest int80).
     *
     * Counterpart to Solidity's `int80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     */
    function toInt80(int256 value) internal pure returns (int80 downcasted) {
        downcasted = int80(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(80, value);
        }
    }

    /**
     * @dev Returns the downcasted int72 from int256, reverting on
     * overflow (when the input is less than smallest int72 or
     * greater than largest int72).
     *
     * Counterpart to Solidity's `int72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     */
    function toInt72(int256 value) internal pure returns (int72 downcasted) {
        downcasted = int72(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(72, value);
        }
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toInt64(int256 value) internal pure returns (int64 downcasted) {
        downcasted = int64(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(64, value);
        }
    }

    /**
     * @dev Returns the downcasted int56 from int256, reverting on
     * overflow (when the input is less than smallest int56 or
     * greater than largest int56).
     *
     * Counterpart to Solidity's `int56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     */
    function toInt56(int256 value) internal pure returns (int56 downcasted) {
        downcasted = int56(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(56, value);
        }
    }

    /**
     * @dev Returns the downcasted int48 from int256, reverting on
     * overflow (when the input is less than smallest int48 or
     * greater than largest int48).
     *
     * Counterpart to Solidity's `int48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     */
    function toInt48(int256 value) internal pure returns (int48 downcasted) {
        downcasted = int48(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(48, value);
        }
    }

    /**
     * @dev Returns the downcasted int40 from int256, reverting on
     * overflow (when the input is less than smallest int40 or
     * greater than largest int40).
     *
     * Counterpart to Solidity's `int40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     */
    function toInt40(int256 value) internal pure returns (int40 downcasted) {
        downcasted = int40(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(40, value);
        }
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toInt32(int256 value) internal pure returns (int32 downcasted) {
        downcasted = int32(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(32, value);
        }
    }

    /**
     * @dev Returns the downcasted int24 from int256, reverting on
     * overflow (when the input is less than smallest int24 or
     * greater than largest int24).
     *
     * Counterpart to Solidity's `int24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     */
    function toInt24(int256 value) internal pure returns (int24 downcasted) {
        downcasted = int24(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(24, value);
        }
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toInt16(int256 value) internal pure returns (int16 downcasted) {
        downcasted = int16(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(16, value);
        }
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     */
    function toInt8(int256 value) internal pure returns (int8 downcasted) {
        downcasted = int8(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(8, value);
        }
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
        if (value > uint256(type(int256).max)) {
            revert SafeCastOverflowedUintToInt(value);
        }
        return int256(value);
    }
}

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

pragma solidity ^0.8.20;

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

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

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

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

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

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

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

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

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

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

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

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

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

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

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

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

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

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

            uint256 twos = denominator & (0 - denominator);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 57 of 60 : IERC5313.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5313.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface for the Light Contract Ownership Standard.
 *
 * A standardized minimal interface required to identify an account that controls a contract
 */
interface IERC5313 {
    /**
     * @dev Gets the address of the owner.
     */
    function owner() external view returns (address);
}

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";

import { SetConfigParam } from "./IMessageLibManager.sol";

enum MessageLibType {
    Send,
    Receive,
    SendAndReceive
}

interface IMessageLib is IERC165 {
    function setConfig(address _oapp, SetConfigParam[] calldata _config) external;

    function getConfig(uint32 _eid, address _oapp, uint32 _configType) external view returns (bytes memory config);

    function isSupportedEid(uint32 _eid) external view returns (bool);

    // message libs of same major version are compatible
    function version() external view returns (uint64 major, uint8 minor, uint8 endpointVersion);

    function messageLibType() external view returns (MessageLibType);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {Initializable} from "../../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);
 * }
 * ```
 */
abstract contract ERC165Upgradeable is Initializable, IERC165 {
    function __ERC165_init() internal onlyInitializing {
    }

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @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 IERC165 {
    /**
     * @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);
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/",
    "@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/",
    "solidity-bytes-utils/=node_modules/solidity-bytes-utils/",
    "hardhat-deploy/=node_modules/hardhat-deploy/",
    "@layerzerolabs/lz-evm-protocol-v2/=node_modules/@layerzerolabs/lz-evm-protocol-v2/",
    "@layerzerolabs/lz-evm-messagelib-v2/=node_modules/@layerzerolabs/lz-evm-messagelib-v2/",
    "@layerzerolabs/lz-evm-v1-0.7/=node_modules/@layerzerolabs/lz-evm-v1-0.7/",
    "forge-std/=lib/forge-std/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 20000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "evmVersion": "shanghai",
  "viaIR": false,
  "libraries": {}
}

Contract ABI

API
[{"inputs":[{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"address","name":"_lzEndpoint","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[],"name":"AccessControlEnforcedDefaultAdminRules","type":"error"},{"inputs":[{"internalType":"address","name":"defaultAdmin","type":"address"}],"name":"AccessControlInvalidDefaultAdmin","type":"error"},{"inputs":[],"name":"AccessControlNonDefaultAdmin","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"AlreadyBlacklisted","type":"error"},{"inputs":[],"name":"BlacklistNotAllowed","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"IdenticalDelegate","type":"error"},{"inputs":[],"name":"InvalidDelegate","type":"error"},{"inputs":[],"name":"InvalidEndpointCall","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"InvalidLocalDecimals","type":"error"},{"inputs":[{"internalType":"bytes","name":"options","type":"bytes"}],"name":"InvalidOptions","type":"error"},{"inputs":[],"name":"LzTokenUnavailable","type":"error"},{"inputs":[{"internalType":"uint32","name":"eid","type":"uint32"}],"name":"NoPeer","type":"error"},{"inputs":[],"name":"NonAuthorizeOperator","type":"error"},{"inputs":[],"name":"NotBlacklistThisContract","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"NotBlacklisted","type":"error"},{"inputs":[{"internalType":"uint256","name":"msgValue","type":"uint256"}],"name":"NotEnoughNative","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"OnlyEndpoint","type":"error"},{"inputs":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"}],"name":"OnlyPeer","type":"error"},{"inputs":[],"name":"OnlySelf","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[{"internalType":"bytes","name":"result","type":"bytes"}],"name":"SimulationResult","type":"error"},{"inputs":[{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"}],"name":"SlippageExceeded","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroValue","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"AddedBlacklist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[],"name":"DefaultAdminTransferCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"}],"name":"DefaultAdminTransferScheduled","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"uint16","name":"msgType","type":"uint16"},{"internalType":"bytes","name":"options","type":"bytes"}],"indexed":false,"internalType":"struct EnforcedOptionParam[]","name":"_enforcedOptions","type":"tuple[]"}],"name":"EnforcedOptionSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"inspector","type":"address"}],"name":"MsgInspectorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"guid","type":"bytes32"},{"indexed":false,"internalType":"uint32","name":"srcEid","type":"uint32"},{"indexed":true,"internalType":"address","name":"toAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountReceivedLD","type":"uint256"}],"name":"OFTReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"guid","type":"bytes32"},{"indexed":false,"internalType":"uint32","name":"dstEid","type":"uint32"},{"indexed":true,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountSentLD","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountReceivedLD","type":"uint256"}],"name":"OFTSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"eid","type":"uint32"},{"indexed":false,"internalType":"bytes32","name":"peer","type":"bytes32"}],"name":"PeerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"preCrimeAddress","type":"address"}],"name":"PreCrimeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"RemovedBlacklist","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":[],"name":"TokenRetrieved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SEND","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SEND_AND_CALL","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"addBlacklist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"origin","type":"tuple"}],"name":"allowInitializePath","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"approvalRequired","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"beginDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"blacklistedAccount","type":"address"}],"name":"burnBlackFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"uint16","name":"_msgType","type":"uint16"},{"internalType":"bytes","name":"_extraOptions","type":"bytes"}],"name":"combineOptions","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"composeMsgSender","outputs":[{"internalType":"address","name":"sender","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimalConversionRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endpoint","outputs":[{"internalType":"contract ILayerZeroEndpoint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endpointDelegate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"uint16","name":"_msgType","type":"uint16"}],"name":"enforcedOptions","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVersion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","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":"_owner","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"_decimals","type":"uint8"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initializeV2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isAuthorizedOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"isBlacklisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isDefaultAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"bytes32","name":"_peer","type":"bytes32"}],"name":"isPeer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"address","name":"_executor","type":"address"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"lzReceive","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"origin","type":"tuple"},{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"bytes32","name":"guid","type":"bytes32"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"address","name":"executor","type":"address"},{"internalType":"bytes","name":"message","type":"bytes"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct InboundPacket[]","name":"_packets","type":"tuple[]"}],"name":"lzReceiveAndRevert","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"address","name":"_executor","type":"address"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"lzReceiveSimulate","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"msgInspector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"nextNonce","outputs":[{"internalType":"uint64","name":"nonce","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oApp","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oAppVersion","outputs":[{"internalType":"uint64","name":"senderVersion","type":"uint64"},{"internalType":"uint64","name":"receiverVersion","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"oftVersion","outputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"},{"internalType":"uint64","name":"version","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","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":"uint32","name":"_eid","type":"uint32"}],"name":"peers","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingDefaultAdmin","outputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"preCrime","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"bytes","name":"extraOptions","type":"bytes"},{"internalType":"bytes","name":"composeMsg","type":"bytes"},{"internalType":"bytes","name":"oftCmd","type":"bytes"}],"internalType":"struct SendParam","name":"_sendParam","type":"tuple"}],"name":"quoteOFT","outputs":[{"components":[{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"uint256","name":"maxAmountLD","type":"uint256"}],"internalType":"struct OFTLimit","name":"oftLimit","type":"tuple"},{"components":[{"internalType":"int256","name":"feeAmountLD","type":"int256"},{"internalType":"string","name":"description","type":"string"}],"internalType":"struct OFTFeeDetail[]","name":"oftFeeDetails","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"amountSentLD","type":"uint256"},{"internalType":"uint256","name":"amountReceivedLD","type":"uint256"}],"internalType":"struct OFTReceipt","name":"oftReceipt","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"bytes","name":"extraOptions","type":"bytes"},{"internalType":"bytes","name":"composeMsg","type":"bytes"},{"internalType":"bytes","name":"oftCmd","type":"bytes"}],"internalType":"struct SendParam","name":"_sendParam","type":"tuple"},{"internalType":"bool","name":"_payInLzToken","type":"bool"}],"name":"quoteSend","outputs":[{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"msgFee","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"removeBlacklist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"bytes","name":"extraOptions","type":"bytes"},{"internalType":"bytes","name":"composeMsg","type":"bytes"},{"internalType":"bytes","name":"oftCmd","type":"bytes"}],"internalType":"struct SendParam","name":"_sendParam","type":"tuple"},{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"_fee","type":"tuple"},{"internalType":"address","name":"_refundAddress","type":"address"}],"name":"send","outputs":[{"components":[{"internalType":"bytes32","name":"guid","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"},{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"fee","type":"tuple"}],"internalType":"struct MessagingReceipt","name":"msgReceipt","type":"tuple"},{"components":[{"internalType":"uint256","name":"amountSentLD","type":"uint256"},{"internalType":"uint256","name":"amountReceivedLD","type":"uint256"}],"internalType":"struct OFTReceipt","name":"oftReceipt","type":"tuple"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegate","type":"address"}],"name":"setDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegate","type":"address"}],"name":"setEndpointDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"uint16","name":"msgType","type":"uint16"},{"internalType":"bytes","name":"options","type":"bytes"}],"internalType":"struct EnforcedOptionParam[]","name":"_enforcedOptions","type":"tuple[]"}],"name":"setEnforcedOptions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_msgInspector","type":"address"}],"name":"setMsgInspector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"bytes32","name":"_peer","type":"bytes32"}],"name":"setPeer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_preCrime","type":"address"}],"name":"setPreCrime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sharedDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"}]

0x60e06040523060805234801562000014575f80fd5b506040516200612b3803806200612b83398101604081905262000037916200015e565b8181808062000045620000aa565b6001600160a01b031660a05250600660ff8316101562000078576040516301e9714b60e41b815260040160405180910390fd5b62000085600683620001bd565b6200009290600a620002d8565b60c05250620000a29050620000aa565b5050620002ef565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff1615620000fb5760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146200015b5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f806040838503121562000170575f80fd5b825160ff8116811462000181575f80fd5b60208401519092506001600160a01b03811681146200019e575f80fd5b809150509250929050565b634e487b7160e01b5f52601160045260245ffd5b60ff8281168282160390811115620001d957620001d9620001a9565b92915050565b600181815b808511156200021f57815f1904821115620002035762000203620001a9565b808516156200021157918102915b93841c9390800290620001e4565b509250929050565b5f826200023757506001620001d9565b816200024557505f620001d9565b81600181146200025e5760028114620002695762000289565b6001915050620001d9565b60ff8411156200027d576200027d620001a9565b50506001821b620001d9565b5060208310610133831016604e8410600b8410161715620002ae575081810a620001d9565b620002ba8383620001df565b805f1904821115620002d057620002d0620001a9565b029392505050565b5f620002e860ff84168362000227565b9392505050565b60805160a05160c051615db6620003755f395f8181610ad601528181613c4501528181613cb7015261403601525f81816108ac015281816110b501528181611d52015281816123fd01528181612bf2015281816130a2015281816138d70152818161430601526143d601525f81816132aa015281816132d301526134d00152615db65ff3fe608060405260043610610469575f3560e01c8063800c038411610251578063b98bd0701161013c578063d4243885116100b7578063eb91e65111610087578063fc0c546a1161006d578063fc0c546a146107bb578063fe575a8714610df9578063ff7bd03d14610e4f575f80fd5b8063eb91e65114610dbb578063f6d2ee8614610dda575f80fd5b8063d424388514610d06578063d547741f14610d25578063d602b9fd14610d44578063dd62ed3e14610d58575f80fd5b8063c7c7f5b31161010c578063cefc1429116100f2578063cefc142914610ccb578063cf6eefb714610cdf578063d045a0dc14610cf3575f80fd5b8063c7c7f5b314610c8b578063ca5eb5e114610cac575f80fd5b8063b98bd07014610bea578063bb0b6a5314610c09578063bc70b35414610c59578063bd815db014610c78575f80fd5b80639cfe42da116101cc578063ad3cb1cc1161019c578063b731ea0a11610182578063b731ea0a14610bc2578063b8ab367014610bd6578063b92d0eff146107bb575f80fd5b8063ad3cb1cc14610b5b578063b1d1f19014610ba3575f80fd5b80639cfe42da14610af85780639f68b96414610b17578063a217fddf14610b29578063a9059cbb14610b3c575f80fd5b8063857749b01161022157806391d148541161020757806391d1485414610a4e57806395d89b4114610ab1578063963efcaa14610ac5575f80fd5b8063857749b014610a275780638da5cb5b14610a3a575f80fd5b8063800c03841461099957806382d52c1e146109b85780638456cb59146109d757806384ef8ffc146109eb575f80fd5b806336568abe11610371578063592aad4a116102ec5780635e280f11116102bc5780636fc1b31e116102a25780636fc1b31e146108ed57806370a082311461090c5780637d25a05e1461095f575f80fd5b80635e280f111461089b578063634e93da146108ce575f80fd5b8063592aad4a146108005780635a0dfe4d1461081f5780635c975abb146108735780635cd8a76b14610887575f80fd5b806342966c681161034157806352ae28791161032757806352ae2879146107bb57806352d1902d146107cd5780635535d461146107e1575f80fd5b806342966c68146107895780634f1ef286146107a8575f80fd5b806336568abe1461070b5780633b6f743b1461072a5780633f4ba83a1461075657806340c10f191461076a575f80fd5b8063156a0d0f1161040157806323b872dd116103d15780632f2ff15d116103b75780632f2ff15d146106a7578063313ce567146106c65780633400288b146106ec575f80fd5b806323b872dd1461063b578063248a9ca31461065a575f80fd5b8063156a0d0f1461059457806317442b70146105d457806318160ddd146105f45780631f5e133414610627575f80fd5b80630d8e6e2c1161043c5780630d8e6e2c1461050f578063111ecdad1461052c57806313137d6514610558578063134d4f251461056d575f80fd5b806301ffc9a71461046d57806306fdde03146104a1578063095ea7b3146104c25780630d35b415146104e1575b5f80fd5b348015610478575f80fd5b5061048c6104873660046149b6565b610e6e565b60405190151581526020015b60405180910390f35b3480156104ac575f80fd5b506104b5610ec9565b6040516104989190614a60565b3480156104cd575f80fd5b5061048c6104dc366004614a86565b610f9c565b3480156104ec575f80fd5b506105006104fb366004614ac6565b610fb3565b60405161049893929190614af8565b34801561051a575f80fd5b5060025b604051908152602001610498565b348015610537575f80fd5b5061054061107f565b6040516001600160a01b039091168152602001610498565b61056b610566366004614c02565b6110b3565b005b348015610578575f80fd5b50610581600281565b60405161ffff9091168152602001610498565b34801561059f575f80fd5b50604080517f02e49c2c0000000000000000000000000000000000000000000000000000000081526001602082015201610498565b3480156105df575f80fd5b50604080516001808252602082015201610498565b3480156105ff575f80fd5b507f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace025461051e565b348015610632575f80fd5b50610581600181565b348015610646575f80fd5b5061048c610655366004614c9b565b6111a5565b348015610665575f80fd5b5061051e610674366004614cd9565b5f9081527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602052604090206001015490565b3480156106b2575f80fd5b5061056b6106c1366004614cf0565b6111ca565b3480156106d1575f80fd5b506106da61120f565b60405160ff9091168152602001610498565b3480156106f7575f80fd5b5061056b610706366004614d36565b61123d565b348015610716575f80fd5b5061056b610725366004614cf0565b6112bb565b348015610735575f80fd5b50610749610744366004614d5d565b61130c565b6040516104989190614da1565b348015610761575f80fd5b5061056b611370565b348015610775575f80fd5b5061056b610784366004614a86565b6113a5565b348015610794575f80fd5b5061056b6107a3366004614cd9565b611419565b61056b6107b6366004614edd565b611487565b3480156107c6575f80fd5b5030610540565b3480156107d8575f80fd5b5061051e6114a2565b3480156107ec575f80fd5b506104b56107fb366004614f4e565b6114d0565b34801561080b575f80fd5b5061048c61081a366004614f7f565b6115a8565b34801561082a575f80fd5b5061048c610839366004614d36565b63ffffffff919091165f9081527f72ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f90060205260409020541490565b34801561087e575f80fd5b5061048c6115f4565b348015610892575f80fd5b5061056b61161c565b3480156108a6575f80fd5b506105407f000000000000000000000000000000000000000000000000000000000000000081565b3480156108d9575f80fd5b5061056b6108e8366004614f7f565b611780565b3480156108f8575f80fd5b5061056b610907366004614f7f565b611793565b348015610917575f80fd5b5061051e610926366004614f7f565b6001600160a01b03165f9081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00602052604090205490565b34801561096a575f80fd5b50610980610979366004614d36565b5f92915050565b60405167ffffffffffffffff9091168152602001610498565b3480156109a4575f80fd5b5061056b6109b3366004614f7f565b61181f565b3480156109c3575f80fd5b5061048c6109d2366004614f7f565b611915565b3480156109e2575f80fd5b5061056b611964565b3480156109f6575f80fd5b507feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401546001600160a01b0316610540565b348015610a32575f80fd5b5060066106da565b348015610a45575f80fd5b50610540611996565b348015610a59575f80fd5b5061048c610a68366004614cf0565b5f9182527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602090815260408084206001600160a01b0393909316845291905290205460ff1690565b348015610abc575f80fd5b506104b56119cd565b348015610ad0575f80fd5b5061051e7f000000000000000000000000000000000000000000000000000000000000000081565b348015610b03575f80fd5b5061056b610b12366004614f7f565b611a1e565b348015610b22575f80fd5b505f61048c565b348015610b34575f80fd5b5061051e5f81565b348015610b47575f80fd5b5061048c610b56366004614a86565b611cdc565b348015610b66575f80fd5b506104b56040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b348015610bae575f80fd5b5061056b610bbd366004614f7f565b611ce9565b348015610bcd575f80fd5b50610540611cfa565b348015610be1575f80fd5b50610540611d22565b348015610bf5575f80fd5b5061056b610c04366004614fdb565b611dc3565b348015610c14575f80fd5b5061051e610c2336600461501a565b63ffffffff165f9081527f72ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f900602052604090205490565b348015610c64575f80fd5b506104b5610c73366004615033565b611f3f565b61056b610c86366004614fdb565b6120f0565b610c9e610c99366004615090565b6122c6565b604051610498929190615117565b348015610cb7575f80fd5b5061056b610cc6366004614f7f565b6123bd565b348015610cd6575f80fd5b5061056b612450565b348015610cea575f80fd5b506105406124a7565b61056b610d01366004614c02565b6124cf565b348015610d11575f80fd5b5061056b610d20366004614f7f565b612517565b348015610d30575f80fd5b5061056b610d3f366004614cf0565b6125a3565b348015610d4f575f80fd5b5061056b6125e4565b348015610d63575f80fd5b5061051e610d72366004615169565b6001600160a01b039182165f9081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace016020908152604080832093909416825291909152205490565b348015610dc6575f80fd5b5061056b610dd5366004614f7f565b61263a565b348015610de5575f80fd5b5061056b610df43660046151b3565b6127c0565b348015610e04575f80fd5b5061048c610e13366004614f7f565b6001600160a01b03165f9081527f7b8c66b06ab2a5b9694594d3e1497062eaf332a02e6508b6950edd463f4bb000602052604090205460ff1690565b348015610e5a575f80fd5b5061048c610e6936600461523c565b6129b6565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f30315e45000000000000000000000000000000000000000000000000000000001480610ec35750610ec3826129d3565b92915050565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0380546060917f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0091610f1a90615256565b80601f0160208091040260200160405190810160405280929190818152602001828054610f4690615256565b8015610f915780601f10610f6857610100808354040283529160200191610f91565b820191905f5260205f20905b815481529060010190602001808311610f7457829003601f168201915b505050505091505090565b5f33610fa9818585612a69565b5060019392505050565b604080518082019091525f80825260208201526060610fe360405180604001604052805f81526020015f81525090565b6040805180820182525f80825267ffffffffffffffff60208084018290528451838152908101909452919550918261103d565b604080518082019091525f8152606060208201528152602001906001900390816110165790505b5093505f80611061604089013560608a013561105c60208c018c61501a565b612a76565b60408051808201909152918252602082015296989597505050505050565b5f807f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c005b546001600160a01b031692915050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316331461111c576040517f91ac5e4f0000000000000000000000000000000000000000000000000000000081523360048201526024015b60405180910390fd5b6020870180359061113690611131908a61501a565b612ad2565b1461118d57611148602088018861501a565b6040517fc26bebcc00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015260208801356024820152604401611113565b61119c87878787878787612b47565b50505050505050565b5f336111b2858285612cbe565b6111bd858585612d8a565b60019150505b9392505050565b81611201576040517f3fc3c27a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61120b8282612e19565b5050565b5f807f3ab444d0b836415993da5574d0dceaa00602de23a5d497ad94b3647348c270005b5460ff1692915050565b611245612e5c565b63ffffffff82165f8181527f72ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f900602081815260409283902085905582519384528301849052917f238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98b91015b60405180910390a1505050565b6001600160a01b03811633146112fd576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113078282612e9d565b505050565b604080518082019091525f80825260208201525f61133a6040850135606086013561105c602088018861501a565b9150505f806113498684612f33565b909250905061136661135e602088018861501a565b83838861308d565b9695505050505050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61139a8161316b565b6113a2613175565b50565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66113cf8161316b565b81805f03611409576040517f7c946ed700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114138484613205565b50505050565b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a8486114438161316b565b81805f0361147d576040517f7c946ed700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113073384613252565b61148f61329f565b6114988261336f565b61120b82826133a6565b5f6114ab6134c5565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b63ffffffff82165f9081527f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea00006020818152604080842061ffff861685529091529091208054606092919061152390615256565b80601f016020809104026020016040519081016040528092919081815260200182805461154f90615256565b801561159a5780601f106115715761010080835404028352916020019161159a565b820191905f5260205f20905b81548152906001019060200180831161157d57829003601f168201915b505050505091505092915050565b5f816001600160a01b03166115e47feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401546001600160a01b031690565b6001600160a01b03161492915050565b5f807fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300611233565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0080546002919068010000000000000000900460ff168061166b5750805467ffffffffffffffff808416911610155b156116a2576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80547fffffffffffffffffffffffffffffffffffffffffffffff0000000000000000001667ffffffffffffffff831617680100000000000000001781556117186117137feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401546001600160a01b031690565b613527565b80547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2906020015b60405180910390a15050565b5f61178a8161316b565b61120b82613538565b61179b612e5c565b7f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c0080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03831690811782556040519081527ff0be4f1e87349231d80c36b33f9e8639658eeaf474014dee15a3e6a4d441419790602001611774565b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a8486118498161316b565b6001600160a01b0382165f9081527f7b8c66b06ab2a5b9694594d3e1497062eaf332a02e6508b6950edd463f4bb000602081905260409091205483919060ff166118ca576040517f7be883790000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401611113565b6001600160a01b0384165f9081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace006020526040812054905061190e855f836135c0565b5050505050565b5f61191f826115a8565b80610ec357506001600160a01b0382165f9081527f8a4e186c39d296611a904175dcd95ac65fbb3fdc6198c38720787c32d4f01b04602052604090205460ff16610ec3565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61198e8161316b565b6113a2613725565b5f6119c87feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401546001600160a01b031690565b905090565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0480546060917f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0091610f1a90615256565b7f98db8a220cd0f09badce9f22d0ba7e93edb3d404448cc3560d391ab096ad16e9611a488161316b565b816001600160a01b038116611a89576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0383165f9081527f7b8c66b06ab2a5b9694594d3e1497062eaf332a02e6508b6950edd463f4bb000602081905260409091205484919060ff1615611b0b576040517fb1ac0d980000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401611113565b84306001600160a01b03821603611b4e576040517fe7b27ea400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b85611b807feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401546001600160a01b031690565b6001600160a01b0316816001600160a01b031603611bca576040517f31e2e7f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0381165f9081527fba39ff88303b67403ef6ce215a3cb34436a2cd98e55dc83fb141a9b583782051602052604090205460ff1615611c3b576040517f31e2e7f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f7b8c66b06ab2a5b9694594d3e1497062eaf332a02e6508b6950edd463f4bb0006001600160a01b0389165f818152602083815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590519182529192507f86c048150dfc5def3c35f7bc81582956dd964e56d8c028c9f4f5e978bb203c31910160405180910390a15050505050505050565b5f33610fa9818585612d8a565b611cf1612e5c565b6113a28161379e565b5f807fefb041d771d6daaa55702fff6eb740d63ba559a75d2d1d3e151c78ff2480b6006110a3565b6040517f587cde1e0000000000000000000000000000000000000000000000000000000081523060048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063587cde1e90602401602060405180830381865afa158015611d9f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119c891906152a1565b611dcb612e5c565b7f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea00005f5b82811015611f0d57611e30848483818110611e0b57611e0b6152bc565b9050602002810190611e1d91906152e9565b611e2b906040810190615325565b613830565b838382818110611e4257611e426152bc565b9050602002810190611e5491906152e9565b611e62906040810190615325565b835f878786818110611e7657611e766152bc565b9050602002810190611e8891906152e9565b611e9690602081019061501a565b63ffffffff1663ffffffff1681526020019081526020015f205f878786818110611ec257611ec26152bc565b9050602002810190611ed491906152e9565b611ee5906040810190602001615386565b61ffff16815260208101919091526040015f2091611f049190836153e3565b50600101611dee565b507fbe4864a8e820971c0247f5992e2da559595f7bf076a21cb5928d443d2a13b67483836040516112ae929190615540565b63ffffffff84165f9081527f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea00006020818152604080842061ffff88168552909152822080546060939190611f9190615256565b80601f0160208091040260200160405190810160405280929190818152602001828054611fbd90615256565b80156120085780601f10611fdf57610100808354040283529160200191612008565b820191905f5260205f20905b815481529060010190602001808311611feb57829003601f168201915b5050505050905080515f036120575784848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152509295506120e8945050505050565b5f8490036120685791506120e89050565b600284106120b25761207a8585613830565b806120888560028189615679565b60405160200161209a939291906156a0565b604051602081830303815290604052925050506120e8565b84846040517f9a6d49cd0000000000000000000000000000000000000000000000000000000081526004016111139291906156c6565b949350505050565b5f5b81811015612212573683838381811061210d5761210d6152bc565b905060200281019061211f91906156d9565b9050612170612131602083018361501a565b602083013563ffffffff919091165f9081527f72ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f90060205260409020541490565b61217a575061220a565b3063d045a0dc60c08301358360a0810135612199610100830183615325565b6121aa610100890160e08a01614f7f565b6121b86101208a018a615325565b6040518963ffffffff1660e01b81526004016121da9796959493929190615720565b5f604051808303818588803b1580156121f1575f80fd5b505af1158015612203573d5f803e3d5ffd5b5050505050505b6001016120f2565b50336001600160a01b0316638e9e70996040518163ffffffff1660e01b81526004015f60405180830381865afa15801561224e573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261229391908101906157a6565b6040517f8351eea70000000000000000000000000000000000000000000000000000000081526004016111139190614a60565b6122ce614972565b604080518082019091525f80825260208201525f80612302604088013560608901356122fd60208b018b61501a565b61388a565b915091505f806123128984612f33565b909250905061233e61232760208b018b61501a565b8383612338368d90038d018d61580f565b8b6138a6565b60408051808201909152858152602080820186905282519298509096503391907f85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a9061238c908d018d61501a565b6040805163ffffffff909216825260208201899052810187905260600160405180910390a350505050935093915050565b6123c5612e5c565b6040517fca5eb5e10000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063ca5eb5e1906024015f604051808303815f87803b15801561243e575f80fd5b505af115801561190e573d5f803e3d5ffd5b5f6124596124a7565b9050336001600160a01b0382161461249f576040517fc22c8022000000000000000000000000000000000000000000000000000000008152336004820152602401611113565b6113a26139ac565b5f807feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d86984006110a3565b333014612508576040517f14d4a4e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61119c8787878787878761118d565b61251f612e5c565b7fefb041d771d6daaa55702fff6eb740d63ba559a75d2d1d3e151c78ff2480b60080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03831690811782556040519081527fd48d879cef83a1c0bdda516f27b13ddb1b3f8bbac1c9e1511bb2a659c242776090602001611774565b816125da576040517f3fc3c27a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61120b8282613a47565b5f6125ee8161316b565b6113a27feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d869840080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b7f98db8a220cd0f09badce9f22d0ba7e93edb3d404448cc3560d391ab096ad16e96126648161316b565b816001600160a01b0381166126a5576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0383165f9081527f7b8c66b06ab2a5b9694594d3e1497062eaf332a02e6508b6950edd463f4bb000602081905260409091205484919060ff16612726576040517f7be883790000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401611113565b6001600160a01b0385165f8181527f7b8c66b06ab2a5b9694594d3e1497062eaf332a02e6508b6950edd463f4bb000602081815260409283902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690558251938452915190927f90792cb7177eb70be35a14e39400d4143370da97f528237fd2b069e408ca68fb92908290030190a1505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff165f8115801561280a5750825b90505f8267ffffffffffffffff1660011480156128265750303b155b905081158015612834575080155b1561286b576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84547fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000016600117855583156128cc5784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16680100000000000000001785555b886001600160a01b03811661290d576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612915613a8a565b61291e8a613a92565b612926613a8a565b61292e613a8a565b612939898989613aa3565b612941613a8a565b612949613b0a565b5083156129ab5784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050565b5f602082018035906129cc90610c23908561501a565b1492915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b000000000000000000000000000000000000000000000000000000001480610ec357507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610ec3565b6113078383836001613b1a565b5f80612a8185613c42565b915081905083811015612aca576040517f71c4efed0000000000000000000000000000000000000000000000000000000081526004810182905260248101859052604401611113565b935093915050565b63ffffffff81165f9081527f72ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f90060208190526040822054806111c3576040517ff6ff4fb700000000000000000000000000000000000000000000000000000000815263ffffffff85166004820152602401611113565b5f612b58612b558787613c78565b90565b90505f612b8382612b71612b6c8a8a613c8f565b613cb1565b612b7e60208d018d61501a565b613ce6565b90506028861115612c5c575f612bbf612ba260608c0160408d0161583f565b612baf60208d018d61501a565b84612bba8c8c613cf9565b613d43565b6040517f7cb590120000000000000000000000000000000000000000000000000000000081529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690637cb5901290612c2d9086908d905f90879060040161585a565b5f604051808303815f87803b158015612c44575f80fd5b505af1158015612c56573d5f803e3d5ffd5b50505050505b6001600160a01b038216887fefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c612c9560208d018d61501a565b6040805163ffffffff9092168252602082018690520160405180910390a3505050505050505050565b6001600160a01b038381165f9081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146114135781811015612d7c576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401611113565b61141384848484035f613b1a565b6001600160a01b038316612dcc576040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081525f6004820152602401611113565b6001600160a01b038216612e0e576040517fec442f050000000000000000000000000000000000000000000000000000000081525f6004820152602401611113565b611307838383613d75565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020526040902060010154612e528161316b565b6114138383613e8c565b612e6533611915565b612e9b576040517f22a17c1c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b5f7feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d869840083158015612ef957507feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401546001600160a01b038481169116145b15612f29576001810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b6120e88484613f65565b6060805f612f8e8560200135612f4886614030565b612f5560a0890189615325565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061405b92505050565b90935090505f81612fa0576001612fa3565b60025b9050612fc3612fb5602088018861501a565b82610c7360808a018a615325565b7f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c008054919450906001600160a01b0316156130835780546040517f043a78eb0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063043a78eb90613042908890889060040161588b565b602060405180830381865afa15801561305d573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061308191906158af565b505b5050509250929050565b604080518082019091525f80825260208201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ddc28c586040518060a001604052808863ffffffff1681526020016130ef89612ad2565b8152602001878152602001868152602001851515815250306040518363ffffffff1660e01b81526004016131249291906158ca565b6040805180830381865afa15801561313e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613162919061598e565b95945050505050565b6113a281336140ed565b61317d614179565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a150565b6001600160a01b038216613247576040517fec442f050000000000000000000000000000000000000000000000000000000081525f6004820152602401611113565b61120b5f8383613d75565b6001600160a01b038216613294576040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081525f6004820152602401611113565b61120b825f83613d75565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061333857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661332c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614155b15612e9b576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7ff5e41b69db3149675767a8769b58cb4060b90e5e3d4bab8b1c958708ed9c9259613399336115a8565b61120b5761120b8161316b565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561341e575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261341b918101906159a8565b60015b61345f576040517f4c9c8ce30000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401611113565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146134bb576040517faa1d49a400000000000000000000000000000000000000000000000000000000815260048101829052602401611113565b61130783836141b7565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614612e9b576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61352f61420c565b6113a281614273565b7feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d869840080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383161790556040516001600160a01b038216907f0e01a4b69474f241b165e228db95ec6d2b1f878242a2388a9aea177873b5b4c0905f90a250565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace006001600160a01b03841661360d5781816002015f82825461360291906159ec565b909155506136969050565b6001600160a01b0384165f9081526020829052604090205482811015613678576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03861660048201526024810182905260448101849052606401611113565b6001600160a01b0385165f9081526020839052604090209083900390555b6001600160a01b0383166136b45760028101805483900390556136d2565b6001600160a01b0383165f9081526020829052604090208054830190555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161371791815260200190565b60405180910390a350505050565b61372d614284565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258336131e7565b6001600160a01b0381166137de576040517fb586360400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6137e6611d22565b6001600160a01b0316816001600160a01b0316036123c5576040517fa1198ce100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f61383e6002828486615679565b613847916159ff565b60f01c9050600381146113075782826040517f9a6d49cd0000000000000000000000000000000000000000000000000000000081526004016111139291906156c6565b5f80613897858585612a76565b9092509050612aca3383613252565b6138ae614972565b5f6138bb845f01516142c3565b6020850151909150156138d5576138d58460200151614303565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632637a450826040518060a001604052808b63ffffffff1681526020016139258c612ad2565b81526020018a81526020018981526020015f8960200151111515815250866040518463ffffffff1660e01b81526004016139609291906158ca565b60806040518083038185885af115801561397c573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906139a19190615a47565b979650505050505050565b7feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d86984005f6139d66124a7565b9050613a125f613a0d7feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401546001600160a01b031690565b612e9d565b50613a1d5f82613e8c565b505080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020526040902060010154613a808161316b565b6114138383612e9d565b612e9b61420c565b613a9a61420c565b6113a2816143fb565b613aab61420c565b7f3ab444d0b836415993da5574d0dceaa00602de23a5d497ad94b3647348c27000613ad6848461444f565b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff929092169190911790555050565b613b1261420c565b612e9b614461565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace006001600160a01b038516613b7d576040517fe602df050000000000000000000000000000000000000000000000000000000081525f6004820152602401611113565b6001600160a01b038416613bbf576040517f94280d620000000000000000000000000000000000000000000000000000000081525f6004820152602401611113565b6001600160a01b038086165f9081526001830160209081526040808320938816835292905220839055811561190e57836001600160a01b0316856001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051613c3391815260200190565b60405180910390a35050505050565b5f7f0000000000000000000000000000000000000000000000000000000000000000613c6e8184615aad565b610ec39190615ae5565b5f613c866020828486615679565b6111c391615afc565b5f613c9e602860208486615679565b613ca791615b38565b60c01c9392505050565b5f610ec37f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff8416615ae5565b5f613cf18484613205565b509092915050565b6060613d088260288186615679565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250929695505050505050565b606084848484604051602001613d5c9493929190615b7e565b6040516020818303038152906040529050949350505050565b6001600160a01b0383165f9081527f7b8c66b06ab2a5b9694594d3e1497062eaf332a02e6508b6950edd463f4bb000602081905260409091205484919060ff1615613df7576040517fb1ac0d980000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401611113565b6001600160a01b0384165f9081527f7b8c66b06ab2a5b9694594d3e1497062eaf332a02e6508b6950edd463f4bb000602081905260409091205485919060ff1615613e79576040517fb1ac0d980000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401611113565b613e81614284565b61119c8787876135c0565b5f7feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d869840083613f5b575f613ee57feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401546001600160a01b031690565b6001600160a01b031614613f25576040517f3fc3c27a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0385161790555b6120e884846144b2565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602081815260408084206001600160a01b038616855290915282205460ff1615614027575f848152602082815260408083206001600160a01b038716808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339287917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a46001915050610ec3565b5f915050610ec3565b5f610ec37f000000000000000000000000000000000000000000000000000000000000000083615aad565b80516060901515806140bc5784846040516020016140a892919091825260c01b7fffffffffffffffff00000000000000000000000000000000000000000000000016602082015260280190565b6040516020818303038152906040526140e3565b848433856040516020016140d39493929190615bfb565b6040516020818303038152906040525b9150935093915050565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602090815260408083206001600160a01b038516845290915290205460ff1661120b576040517fe2517d3f0000000000000000000000000000000000000000000000000000000081526001600160a01b038216600482015260248101839052604401611113565b6141816115f4565b612e9b576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6141c082614593565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a280511561420457611307828261463a565b61120b6146a3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff16612e9b576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61427b61420c565b6113a2816146db565b61428c6115f4565b15612e9b576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8134146142ff576040517f9f704120000000000000000000000000000000000000000000000000000000008152346004820152602401611113565b5090565b5f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e4fe1d946040518163ffffffff1660e01b8152600401602060405180830381865afa158015614360573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061438491906152a1565b90506001600160a01b0381166143c6576040517f5373352a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61120b6001600160a01b038216337f0000000000000000000000000000000000000000000000000000000000000000856146e3565b61440361420c565b6001600160a01b038116614445576040517fc22c80220000000000000000000000000000000000000000000000000000000081525f6004820152602401611113565b61120b5f82613e8c565b61445761420c565b61120b828261476b565b61446961420c565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602081815260408084206001600160a01b038616855290915282205460ff16614027575f848152602082815260408083206001600160a01b0387168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556145493390565b6001600160a01b0316836001600160a01b0316857f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a46001915050610ec3565b806001600160a01b03163b5f036145e1576040517f4c9c8ce30000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152602401611113565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516146569190615c53565b5f60405180830381855af49150503d805f811461468e576040519150601f19603f3d011682016040523d82523d5f602084013e614693565b606091505b50915091506131628583836147ce565b3415612e9b576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611cf161420c565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052611413908590614843565b61477361420c565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace007f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace036147bf8482615c64565b50600481016114138382615c64565b6060826147e3576147de826148bd565b6111c3565b81511580156147fa57506001600160a01b0384163b155b1561483c576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401611113565b50806111c3565b5f6148576001600160a01b038416836148ff565b905080515f1415801561487b57508080602001905181019061487991906158af565b155b15611307576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401611113565b8051156148cd5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60606111c383835f845f80856001600160a01b031684866040516149239190615c53565b5f6040518083038185875af1925050503d805f811461495d576040519150601f19603f3d011682016040523d82523d5f602084013e614962565b606091505b50915091506113668683836147ce565b60405180606001604052805f80191681526020015f67ffffffffffffffff1681526020016149b160405180604001604052805f81526020015f81525090565b905290565b5f602082840312156149c6575f80fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146111c3575f80fd5b5f5b83811015614a0f5781810151838201526020016149f7565b50505f910152565b5f8151808452614a2e8160208601602086016149f5565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081525f6111c36020830184614a17565b6001600160a01b03811681146113a2575f80fd5b5f8060408385031215614a97575f80fd5b8235614aa281614a72565b946020939093013593505050565b5f60e08284031215614ac0575f80fd5b50919050565b5f60208284031215614ad6575f80fd5b813567ffffffffffffffff811115614aec575f80fd5b6120e884828501614ab0565b83518152602080850151908201525f60a08201604060a0604085015281865180845260c08601915060c08160051b870101935060208089015f5b83811015614b8f578887037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff40018552815180518852830151838801879052614b7c87890182614a17565b9750509382019390820190600101614b32565b505087516060880152505050602085015160808501525090506120e8565b5f60608284031215614ac0575f80fd5b5f8083601f840112614bcd575f80fd5b50813567ffffffffffffffff811115614be4575f80fd5b602083019150836020828501011115614bfb575f80fd5b9250929050565b5f805f805f805f60e0888a031215614c18575f80fd5b614c228989614bad565b965060608801359550608088013567ffffffffffffffff80821115614c45575f80fd5b614c518b838c01614bbd565b909750955060a08a01359150614c6682614a72565b90935060c08901359080821115614c7b575f80fd5b50614c888a828b01614bbd565b989b979a50959850939692959293505050565b5f805f60608486031215614cad575f80fd5b8335614cb881614a72565b92506020840135614cc881614a72565b929592945050506040919091013590565b5f60208284031215614ce9575f80fd5b5035919050565b5f8060408385031215614d01575f80fd5b823591506020830135614d1381614a72565b809150509250929050565b803563ffffffff81168114614d31575f80fd5b919050565b5f8060408385031215614d47575f80fd5b614aa283614d1e565b80151581146113a2575f80fd5b5f8060408385031215614d6e575f80fd5b823567ffffffffffffffff811115614d84575f80fd5b614d9085828601614ab0565b9250506020830135614d1381614d50565b815181526020808301519082015260408101610ec3565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040805190810167ffffffffffffffff81118282101715614e0857614e08614db8565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715614e5557614e55614db8565b604052919050565b5f67ffffffffffffffff821115614e7657614e76614db8565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b5f614eb4614eaf84614e5d565b614e0e565b9050828152838383011115614ec7575f80fd5b828260208301375f602084830101529392505050565b5f8060408385031215614eee575f80fd5b8235614ef981614a72565b9150602083013567ffffffffffffffff811115614f14575f80fd5b8301601f81018513614f24575f80fd5b614f3385823560208401614ea2565b9150509250929050565b803561ffff81168114614d31575f80fd5b5f8060408385031215614f5f575f80fd5b614f6883614d1e565b9150614f7660208401614f3d565b90509250929050565b5f60208284031215614f8f575f80fd5b81356111c381614a72565b5f8083601f840112614faa575f80fd5b50813567ffffffffffffffff811115614fc1575f80fd5b6020830191508360208260051b8501011115614bfb575f80fd5b5f8060208385031215614fec575f80fd5b823567ffffffffffffffff811115615002575f80fd5b61500e85828601614f9a565b90969095509350505050565b5f6020828403121561502a575f80fd5b6111c382614d1e565b5f805f8060608587031215615046575f80fd5b61504f85614d1e565b935061505d60208601614f3d565b9250604085013567ffffffffffffffff811115615078575f80fd5b61508487828801614bbd565b95989497509550505050565b5f805f83850360808112156150a3575f80fd5b843567ffffffffffffffff8111156150b9575f80fd5b6150c587828801614ab0565b94505060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0820112156150f7575f80fd5b50602084019150606084013561510c81614a72565b809150509250925092565b5f60c0820190508351825267ffffffffffffffff60208501511660208301526040840151615152604084018280518252602090810151910152565b5082516080830152602083015160a08301526111c3565b5f806040838503121561517a575f80fd5b823561518581614a72565b91506020830135614d1381614a72565b5f82601f8301126151a4575f80fd5b6111c383833560208501614ea2565b5f805f80608085870312156151c6575f80fd5b84356151d181614a72565b9350602085013567ffffffffffffffff808211156151ed575f80fd5b6151f988838901615195565b9450604087013591508082111561520e575f80fd5b5061521b87828801615195565b925050606085013560ff81168114615231575f80fd5b939692955090935050565b5f6060828403121561524c575f80fd5b6111c38383614bad565b600181811c9082168061526a57607f821691505b602082108103614ac0577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f602082840312156152b1575f80fd5b81516111c381614a72565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f82357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa183360301811261531b575f80fd5b9190910192915050565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112615358575f80fd5b83018035915067ffffffffffffffff821115615372575f80fd5b602001915036819003821315614bfb575f80fd5b5f60208284031215615396575f80fd5b6111c382614f3d565b601f82111561130757805f5260205f20601f840160051c810160208510156153c45750805b601f840160051c820191505b8181101561190e575f81556001016153d0565b67ffffffffffffffff8311156153fb576153fb614db8565b61540f836154098354615256565b8361539f565b5f601f84116001811461545f575f85156154295750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b17835561190e565b5f838152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08716915b828110156154ac578685013582556020948501946001909201910161548c565b50868210156154e7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60208082528181018390525f906040808401600586901b8501820187855b8881101561566b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc088840301845281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa18b36030181126155be575f80fd5b8a01606063ffffffff6155d083614d1e565b16855261ffff6155e1898401614f3d565b1688860152868201357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1833603018112615619575f80fd5b90910187810191903567ffffffffffffffff811115615636575f80fd5b803603831315615644575f80fd5b818887015261565682870182856154f9565b9689019695505050918601915060010161555e565b509098975050505050505050565b5f8085851115615687575f80fd5b83861115615693575f80fd5b5050820193919092039150565b5f84516156b18184602089016149f5565b8201838582375f930192835250909392505050565b602081525f6120e86020830184866154f9565b5f82357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec183360301811261531b575f80fd5b67ffffffffffffffff811681146113a2575f80fd5b63ffffffff61572e89614d1e565b168152602088013560208201525f604089013561574a8161570b565b67ffffffffffffffff811660408401525087606083015260e0608083015261577660e0830187896154f9565b6001600160a01b03861660a084015282810360c08401526157988185876154f9565b9a9950505050505050505050565b5f602082840312156157b6575f80fd5b815167ffffffffffffffff8111156157cc575f80fd5b8201601f810184136157dc575f80fd5b80516157ea614eaf82614e5d565b8181528560208385010111156157fe575f80fd5b6131628260208301602086016149f5565b5f6040828403121561581f575f80fd5b615827614de5565b82358152602083013560208201528091505092915050565b5f6020828403121561584f575f80fd5b81356111c38161570b565b6001600160a01b038516815283602082015261ffff83166040820152608060608201525f6113666080830184614a17565b604081525f61589d6040830185614a17565b82810360208401526131628185614a17565b5f602082840312156158bf575f80fd5b81516111c381614d50565b6040815263ffffffff8351166040820152602083015160608201525f604084015160a060808401526158ff60e0840182614a17565b905060608501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08483030160a085015261593a8282614a17565b60809690960151151560c08501525050506001600160a01b039190911660209091015290565b5f60408284031215615970575f80fd5b615978614de5565b9050815181526020820151602082015292915050565b5f6040828403121561599e575f80fd5b6111c38383615960565b5f602082840312156159b8575f80fd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820180821115610ec357610ec36159bf565b7fffff0000000000000000000000000000000000000000000000000000000000008135818116916002851015615a3f5780818660020360031b1b83161692505b505092915050565b5f60808284031215615a57575f80fd5b6040516060810181811067ffffffffffffffff82111715615a7a57615a7a614db8565b604052825181526020830151615a8f8161570b565b6020820152615aa18460408501615960565b60408201529392505050565b5f82615ae0577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b8082028115828204841417610ec357610ec36159bf565b80356020831015610ec3577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7fffffffffffffffff0000000000000000000000000000000000000000000000008135818116916008851015615a3f5760089490940360031b84901b1690921692915050565b7fffffffffffffffff0000000000000000000000000000000000000000000000008560c01b1681527fffffffff000000000000000000000000000000000000000000000000000000008460e01b16600882015282600c8201525f8251615beb81602c8501602087016149f5565b91909101602c0195945050505050565b8481527fffffffffffffffff0000000000000000000000000000000000000000000000008460c01b1660208201528260288201525f8251615c438160488501602087016149f5565b9190910160480195945050505050565b5f825161531b8184602087016149f5565b815167ffffffffffffffff811115615c7e57615c7e614db8565b615c9281615c8c8454615256565b8461539f565b602080601f831160018114615ce4575f8415615cae5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555615d78565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015615d3057888601518255948401946001909101908401615d11565b5085821015615d6c57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b505060018460011b0185555b50505050505056fea2646970667358221220ba1847ebafaa6f4c086c3ee2f193f2e2da511220c3fd7d0928ff4897f45168ac64736f6c6343000817003300000000000000000000000000000000000000000000000000000000000000120000000000000000000000006edce65403992e310a62460808c4b910d972f10f

Deployed Bytecode

0x608060405260043610610469575f3560e01c8063800c038411610251578063b98bd0701161013c578063d4243885116100b7578063eb91e65111610087578063fc0c546a1161006d578063fc0c546a146107bb578063fe575a8714610df9578063ff7bd03d14610e4f575f80fd5b8063eb91e65114610dbb578063f6d2ee8614610dda575f80fd5b8063d424388514610d06578063d547741f14610d25578063d602b9fd14610d44578063dd62ed3e14610d58575f80fd5b8063c7c7f5b31161010c578063cefc1429116100f2578063cefc142914610ccb578063cf6eefb714610cdf578063d045a0dc14610cf3575f80fd5b8063c7c7f5b314610c8b578063ca5eb5e114610cac575f80fd5b8063b98bd07014610bea578063bb0b6a5314610c09578063bc70b35414610c59578063bd815db014610c78575f80fd5b80639cfe42da116101cc578063ad3cb1cc1161019c578063b731ea0a11610182578063b731ea0a14610bc2578063b8ab367014610bd6578063b92d0eff146107bb575f80fd5b8063ad3cb1cc14610b5b578063b1d1f19014610ba3575f80fd5b80639cfe42da14610af85780639f68b96414610b17578063a217fddf14610b29578063a9059cbb14610b3c575f80fd5b8063857749b01161022157806391d148541161020757806391d1485414610a4e57806395d89b4114610ab1578063963efcaa14610ac5575f80fd5b8063857749b014610a275780638da5cb5b14610a3a575f80fd5b8063800c03841461099957806382d52c1e146109b85780638456cb59146109d757806384ef8ffc146109eb575f80fd5b806336568abe11610371578063592aad4a116102ec5780635e280f11116102bc5780636fc1b31e116102a25780636fc1b31e146108ed57806370a082311461090c5780637d25a05e1461095f575f80fd5b80635e280f111461089b578063634e93da146108ce575f80fd5b8063592aad4a146108005780635a0dfe4d1461081f5780635c975abb146108735780635cd8a76b14610887575f80fd5b806342966c681161034157806352ae28791161032757806352ae2879146107bb57806352d1902d146107cd5780635535d461146107e1575f80fd5b806342966c68146107895780634f1ef286146107a8575f80fd5b806336568abe1461070b5780633b6f743b1461072a5780633f4ba83a1461075657806340c10f191461076a575f80fd5b8063156a0d0f1161040157806323b872dd116103d15780632f2ff15d116103b75780632f2ff15d146106a7578063313ce567146106c65780633400288b146106ec575f80fd5b806323b872dd1461063b578063248a9ca31461065a575f80fd5b8063156a0d0f1461059457806317442b70146105d457806318160ddd146105f45780631f5e133414610627575f80fd5b80630d8e6e2c1161043c5780630d8e6e2c1461050f578063111ecdad1461052c57806313137d6514610558578063134d4f251461056d575f80fd5b806301ffc9a71461046d57806306fdde03146104a1578063095ea7b3146104c25780630d35b415146104e1575b5f80fd5b348015610478575f80fd5b5061048c6104873660046149b6565b610e6e565b60405190151581526020015b60405180910390f35b3480156104ac575f80fd5b506104b5610ec9565b6040516104989190614a60565b3480156104cd575f80fd5b5061048c6104dc366004614a86565b610f9c565b3480156104ec575f80fd5b506105006104fb366004614ac6565b610fb3565b60405161049893929190614af8565b34801561051a575f80fd5b5060025b604051908152602001610498565b348015610537575f80fd5b5061054061107f565b6040516001600160a01b039091168152602001610498565b61056b610566366004614c02565b6110b3565b005b348015610578575f80fd5b50610581600281565b60405161ffff9091168152602001610498565b34801561059f575f80fd5b50604080517f02e49c2c0000000000000000000000000000000000000000000000000000000081526001602082015201610498565b3480156105df575f80fd5b50604080516001808252602082015201610498565b3480156105ff575f80fd5b507f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace025461051e565b348015610632575f80fd5b50610581600181565b348015610646575f80fd5b5061048c610655366004614c9b565b6111a5565b348015610665575f80fd5b5061051e610674366004614cd9565b5f9081527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602052604090206001015490565b3480156106b2575f80fd5b5061056b6106c1366004614cf0565b6111ca565b3480156106d1575f80fd5b506106da61120f565b60405160ff9091168152602001610498565b3480156106f7575f80fd5b5061056b610706366004614d36565b61123d565b348015610716575f80fd5b5061056b610725366004614cf0565b6112bb565b348015610735575f80fd5b50610749610744366004614d5d565b61130c565b6040516104989190614da1565b348015610761575f80fd5b5061056b611370565b348015610775575f80fd5b5061056b610784366004614a86565b6113a5565b348015610794575f80fd5b5061056b6107a3366004614cd9565b611419565b61056b6107b6366004614edd565b611487565b3480156107c6575f80fd5b5030610540565b3480156107d8575f80fd5b5061051e6114a2565b3480156107ec575f80fd5b506104b56107fb366004614f4e565b6114d0565b34801561080b575f80fd5b5061048c61081a366004614f7f565b6115a8565b34801561082a575f80fd5b5061048c610839366004614d36565b63ffffffff919091165f9081527f72ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f90060205260409020541490565b34801561087e575f80fd5b5061048c6115f4565b348015610892575f80fd5b5061056b61161c565b3480156108a6575f80fd5b506105407f0000000000000000000000006edce65403992e310a62460808c4b910d972f10f81565b3480156108d9575f80fd5b5061056b6108e8366004614f7f565b611780565b3480156108f8575f80fd5b5061056b610907366004614f7f565b611793565b348015610917575f80fd5b5061051e610926366004614f7f565b6001600160a01b03165f9081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00602052604090205490565b34801561096a575f80fd5b50610980610979366004614d36565b5f92915050565b60405167ffffffffffffffff9091168152602001610498565b3480156109a4575f80fd5b5061056b6109b3366004614f7f565b61181f565b3480156109c3575f80fd5b5061048c6109d2366004614f7f565b611915565b3480156109e2575f80fd5b5061056b611964565b3480156109f6575f80fd5b507feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401546001600160a01b0316610540565b348015610a32575f80fd5b5060066106da565b348015610a45575f80fd5b50610540611996565b348015610a59575f80fd5b5061048c610a68366004614cf0565b5f9182527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602090815260408084206001600160a01b0393909316845291905290205460ff1690565b348015610abc575f80fd5b506104b56119cd565b348015610ad0575f80fd5b5061051e7f000000000000000000000000000000000000000000000000000000e8d4a5100081565b348015610b03575f80fd5b5061056b610b12366004614f7f565b611a1e565b348015610b22575f80fd5b505f61048c565b348015610b34575f80fd5b5061051e5f81565b348015610b47575f80fd5b5061048c610b56366004614a86565b611cdc565b348015610b66575f80fd5b506104b56040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b348015610bae575f80fd5b5061056b610bbd366004614f7f565b611ce9565b348015610bcd575f80fd5b50610540611cfa565b348015610be1575f80fd5b50610540611d22565b348015610bf5575f80fd5b5061056b610c04366004614fdb565b611dc3565b348015610c14575f80fd5b5061051e610c2336600461501a565b63ffffffff165f9081527f72ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f900602052604090205490565b348015610c64575f80fd5b506104b5610c73366004615033565b611f3f565b61056b610c86366004614fdb565b6120f0565b610c9e610c99366004615090565b6122c6565b604051610498929190615117565b348015610cb7575f80fd5b5061056b610cc6366004614f7f565b6123bd565b348015610cd6575f80fd5b5061056b612450565b348015610cea575f80fd5b506105406124a7565b61056b610d01366004614c02565b6124cf565b348015610d11575f80fd5b5061056b610d20366004614f7f565b612517565b348015610d30575f80fd5b5061056b610d3f366004614cf0565b6125a3565b348015610d4f575f80fd5b5061056b6125e4565b348015610d63575f80fd5b5061051e610d72366004615169565b6001600160a01b039182165f9081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace016020908152604080832093909416825291909152205490565b348015610dc6575f80fd5b5061056b610dd5366004614f7f565b61263a565b348015610de5575f80fd5b5061056b610df43660046151b3565b6127c0565b348015610e04575f80fd5b5061048c610e13366004614f7f565b6001600160a01b03165f9081527f7b8c66b06ab2a5b9694594d3e1497062eaf332a02e6508b6950edd463f4bb000602052604090205460ff1690565b348015610e5a575f80fd5b5061048c610e6936600461523c565b6129b6565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f30315e45000000000000000000000000000000000000000000000000000000001480610ec35750610ec3826129d3565b92915050565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0380546060917f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0091610f1a90615256565b80601f0160208091040260200160405190810160405280929190818152602001828054610f4690615256565b8015610f915780601f10610f6857610100808354040283529160200191610f91565b820191905f5260205f20905b815481529060010190602001808311610f7457829003601f168201915b505050505091505090565b5f33610fa9818585612a69565b5060019392505050565b604080518082019091525f80825260208201526060610fe360405180604001604052805f81526020015f81525090565b6040805180820182525f80825267ffffffffffffffff60208084018290528451838152908101909452919550918261103d565b604080518082019091525f8152606060208201528152602001906001900390816110165790505b5093505f80611061604089013560608a013561105c60208c018c61501a565b612a76565b60408051808201909152918252602082015296989597505050505050565b5f807f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c005b546001600160a01b031692915050565b7f0000000000000000000000006edce65403992e310a62460808c4b910d972f10f6001600160a01b0316331461111c576040517f91ac5e4f0000000000000000000000000000000000000000000000000000000081523360048201526024015b60405180910390fd5b6020870180359061113690611131908a61501a565b612ad2565b1461118d57611148602088018861501a565b6040517fc26bebcc00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015260208801356024820152604401611113565b61119c87878787878787612b47565b50505050505050565b5f336111b2858285612cbe565b6111bd858585612d8a565b60019150505b9392505050565b81611201576040517f3fc3c27a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61120b8282612e19565b5050565b5f807f3ab444d0b836415993da5574d0dceaa00602de23a5d497ad94b3647348c270005b5460ff1692915050565b611245612e5c565b63ffffffff82165f8181527f72ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f900602081815260409283902085905582519384528301849052917f238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98b91015b60405180910390a1505050565b6001600160a01b03811633146112fd576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113078282612e9d565b505050565b604080518082019091525f80825260208201525f61133a6040850135606086013561105c602088018861501a565b9150505f806113498684612f33565b909250905061136661135e602088018861501a565b83838861308d565b9695505050505050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61139a8161316b565b6113a2613175565b50565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66113cf8161316b565b81805f03611409576040517f7c946ed700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114138484613205565b50505050565b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a8486114438161316b565b81805f0361147d576040517f7c946ed700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113073384613252565b61148f61329f565b6114988261336f565b61120b82826133a6565b5f6114ab6134c5565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b63ffffffff82165f9081527f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea00006020818152604080842061ffff861685529091529091208054606092919061152390615256565b80601f016020809104026020016040519081016040528092919081815260200182805461154f90615256565b801561159a5780601f106115715761010080835404028352916020019161159a565b820191905f5260205f20905b81548152906001019060200180831161157d57829003601f168201915b505050505091505092915050565b5f816001600160a01b03166115e47feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401546001600160a01b031690565b6001600160a01b03161492915050565b5f807fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300611233565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0080546002919068010000000000000000900460ff168061166b5750805467ffffffffffffffff808416911610155b156116a2576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80547fffffffffffffffffffffffffffffffffffffffffffffff0000000000000000001667ffffffffffffffff831617680100000000000000001781556117186117137feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401546001600160a01b031690565b613527565b80547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2906020015b60405180910390a15050565b5f61178a8161316b565b61120b82613538565b61179b612e5c565b7f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c0080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03831690811782556040519081527ff0be4f1e87349231d80c36b33f9e8639658eeaf474014dee15a3e6a4d441419790602001611774565b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a8486118498161316b565b6001600160a01b0382165f9081527f7b8c66b06ab2a5b9694594d3e1497062eaf332a02e6508b6950edd463f4bb000602081905260409091205483919060ff166118ca576040517f7be883790000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401611113565b6001600160a01b0384165f9081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace006020526040812054905061190e855f836135c0565b5050505050565b5f61191f826115a8565b80610ec357506001600160a01b0382165f9081527f8a4e186c39d296611a904175dcd95ac65fbb3fdc6198c38720787c32d4f01b04602052604090205460ff16610ec3565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61198e8161316b565b6113a2613725565b5f6119c87feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401546001600160a01b031690565b905090565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0480546060917f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0091610f1a90615256565b7f98db8a220cd0f09badce9f22d0ba7e93edb3d404448cc3560d391ab096ad16e9611a488161316b565b816001600160a01b038116611a89576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0383165f9081527f7b8c66b06ab2a5b9694594d3e1497062eaf332a02e6508b6950edd463f4bb000602081905260409091205484919060ff1615611b0b576040517fb1ac0d980000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401611113565b84306001600160a01b03821603611b4e576040517fe7b27ea400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b85611b807feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401546001600160a01b031690565b6001600160a01b0316816001600160a01b031603611bca576040517f31e2e7f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0381165f9081527fba39ff88303b67403ef6ce215a3cb34436a2cd98e55dc83fb141a9b583782051602052604090205460ff1615611c3b576040517f31e2e7f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f7b8c66b06ab2a5b9694594d3e1497062eaf332a02e6508b6950edd463f4bb0006001600160a01b0389165f818152602083815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590519182529192507f86c048150dfc5def3c35f7bc81582956dd964e56d8c028c9f4f5e978bb203c31910160405180910390a15050505050505050565b5f33610fa9818585612d8a565b611cf1612e5c565b6113a28161379e565b5f807fefb041d771d6daaa55702fff6eb740d63ba559a75d2d1d3e151c78ff2480b6006110a3565b6040517f587cde1e0000000000000000000000000000000000000000000000000000000081523060048201525f907f0000000000000000000000006edce65403992e310a62460808c4b910d972f10f6001600160a01b03169063587cde1e90602401602060405180830381865afa158015611d9f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119c891906152a1565b611dcb612e5c565b7f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea00005f5b82811015611f0d57611e30848483818110611e0b57611e0b6152bc565b9050602002810190611e1d91906152e9565b611e2b906040810190615325565b613830565b838382818110611e4257611e426152bc565b9050602002810190611e5491906152e9565b611e62906040810190615325565b835f878786818110611e7657611e766152bc565b9050602002810190611e8891906152e9565b611e9690602081019061501a565b63ffffffff1663ffffffff1681526020019081526020015f205f878786818110611ec257611ec26152bc565b9050602002810190611ed491906152e9565b611ee5906040810190602001615386565b61ffff16815260208101919091526040015f2091611f049190836153e3565b50600101611dee565b507fbe4864a8e820971c0247f5992e2da559595f7bf076a21cb5928d443d2a13b67483836040516112ae929190615540565b63ffffffff84165f9081527f8d2bda5d9f6ffb5796910376005392955773acee5548d0fcdb10e7c264ea00006020818152604080842061ffff88168552909152822080546060939190611f9190615256565b80601f0160208091040260200160405190810160405280929190818152602001828054611fbd90615256565b80156120085780601f10611fdf57610100808354040283529160200191612008565b820191905f5260205f20905b815481529060010190602001808311611feb57829003601f168201915b5050505050905080515f036120575784848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152509295506120e8945050505050565b5f8490036120685791506120e89050565b600284106120b25761207a8585613830565b806120888560028189615679565b60405160200161209a939291906156a0565b604051602081830303815290604052925050506120e8565b84846040517f9a6d49cd0000000000000000000000000000000000000000000000000000000081526004016111139291906156c6565b949350505050565b5f5b81811015612212573683838381811061210d5761210d6152bc565b905060200281019061211f91906156d9565b9050612170612131602083018361501a565b602083013563ffffffff919091165f9081527f72ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f90060205260409020541490565b61217a575061220a565b3063d045a0dc60c08301358360a0810135612199610100830183615325565b6121aa610100890160e08a01614f7f565b6121b86101208a018a615325565b6040518963ffffffff1660e01b81526004016121da9796959493929190615720565b5f604051808303818588803b1580156121f1575f80fd5b505af1158015612203573d5f803e3d5ffd5b5050505050505b6001016120f2565b50336001600160a01b0316638e9e70996040518163ffffffff1660e01b81526004015f60405180830381865afa15801561224e573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261229391908101906157a6565b6040517f8351eea70000000000000000000000000000000000000000000000000000000081526004016111139190614a60565b6122ce614972565b604080518082019091525f80825260208201525f80612302604088013560608901356122fd60208b018b61501a565b61388a565b915091505f806123128984612f33565b909250905061233e61232760208b018b61501a565b8383612338368d90038d018d61580f565b8b6138a6565b60408051808201909152858152602080820186905282519298509096503391907f85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a9061238c908d018d61501a565b6040805163ffffffff909216825260208201899052810187905260600160405180910390a350505050935093915050565b6123c5612e5c565b6040517fca5eb5e10000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301527f0000000000000000000000006edce65403992e310a62460808c4b910d972f10f169063ca5eb5e1906024015f604051808303815f87803b15801561243e575f80fd5b505af115801561190e573d5f803e3d5ffd5b5f6124596124a7565b9050336001600160a01b0382161461249f576040517fc22c8022000000000000000000000000000000000000000000000000000000008152336004820152602401611113565b6113a26139ac565b5f807feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d86984006110a3565b333014612508576040517f14d4a4e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61119c8787878787878761118d565b61251f612e5c565b7fefb041d771d6daaa55702fff6eb740d63ba559a75d2d1d3e151c78ff2480b60080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03831690811782556040519081527fd48d879cef83a1c0bdda516f27b13ddb1b3f8bbac1c9e1511bb2a659c242776090602001611774565b816125da576040517f3fc3c27a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61120b8282613a47565b5f6125ee8161316b565b6113a27feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d869840080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b7f98db8a220cd0f09badce9f22d0ba7e93edb3d404448cc3560d391ab096ad16e96126648161316b565b816001600160a01b0381166126a5576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0383165f9081527f7b8c66b06ab2a5b9694594d3e1497062eaf332a02e6508b6950edd463f4bb000602081905260409091205484919060ff16612726576040517f7be883790000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401611113565b6001600160a01b0385165f8181527f7b8c66b06ab2a5b9694594d3e1497062eaf332a02e6508b6950edd463f4bb000602081815260409283902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690558251938452915190927f90792cb7177eb70be35a14e39400d4143370da97f528237fd2b069e408ca68fb92908290030190a1505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff165f8115801561280a5750825b90505f8267ffffffffffffffff1660011480156128265750303b155b905081158015612834575080155b1561286b576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84547fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000016600117855583156128cc5784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16680100000000000000001785555b886001600160a01b03811661290d576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612915613a8a565b61291e8a613a92565b612926613a8a565b61292e613a8a565b612939898989613aa3565b612941613a8a565b612949613b0a565b5083156129ab5784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050565b5f602082018035906129cc90610c23908561501a565b1492915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b000000000000000000000000000000000000000000000000000000001480610ec357507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610ec3565b6113078383836001613b1a565b5f80612a8185613c42565b915081905083811015612aca576040517f71c4efed0000000000000000000000000000000000000000000000000000000081526004810182905260248101859052604401611113565b935093915050565b63ffffffff81165f9081527f72ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f90060208190526040822054806111c3576040517ff6ff4fb700000000000000000000000000000000000000000000000000000000815263ffffffff85166004820152602401611113565b5f612b58612b558787613c78565b90565b90505f612b8382612b71612b6c8a8a613c8f565b613cb1565b612b7e60208d018d61501a565b613ce6565b90506028861115612c5c575f612bbf612ba260608c0160408d0161583f565b612baf60208d018d61501a565b84612bba8c8c613cf9565b613d43565b6040517f7cb590120000000000000000000000000000000000000000000000000000000081529091506001600160a01b037f0000000000000000000000006edce65403992e310a62460808c4b910d972f10f1690637cb5901290612c2d9086908d905f90879060040161585a565b5f604051808303815f87803b158015612c44575f80fd5b505af1158015612c56573d5f803e3d5ffd5b50505050505b6001600160a01b038216887fefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c612c9560208d018d61501a565b6040805163ffffffff9092168252602082018690520160405180910390a3505050505050505050565b6001600160a01b038381165f9081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146114135781811015612d7c576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401611113565b61141384848484035f613b1a565b6001600160a01b038316612dcc576040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081525f6004820152602401611113565b6001600160a01b038216612e0e576040517fec442f050000000000000000000000000000000000000000000000000000000081525f6004820152602401611113565b611307838383613d75565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020526040902060010154612e528161316b565b6114138383613e8c565b612e6533611915565b612e9b576040517f22a17c1c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b5f7feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d869840083158015612ef957507feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401546001600160a01b038481169116145b15612f29576001810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b6120e88484613f65565b6060805f612f8e8560200135612f4886614030565b612f5560a0890189615325565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061405b92505050565b90935090505f81612fa0576001612fa3565b60025b9050612fc3612fb5602088018861501a565b82610c7360808a018a615325565b7f41db8a78b0206aba5c54bcbfc2bda0d84082a84eb88e680379a57b9e9f653c008054919450906001600160a01b0316156130835780546040517f043a78eb0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063043a78eb90613042908890889060040161588b565b602060405180830381865afa15801561305d573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061308191906158af565b505b5050509250929050565b604080518082019091525f80825260208201527f0000000000000000000000006edce65403992e310a62460808c4b910d972f10f6001600160a01b031663ddc28c586040518060a001604052808863ffffffff1681526020016130ef89612ad2565b8152602001878152602001868152602001851515815250306040518363ffffffff1660e01b81526004016131249291906158ca565b6040805180830381865afa15801561313e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613162919061598e565b95945050505050565b6113a281336140ed565b61317d614179565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a150565b6001600160a01b038216613247576040517fec442f050000000000000000000000000000000000000000000000000000000081525f6004820152602401611113565b61120b5f8383613d75565b6001600160a01b038216613294576040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081525f6004820152602401611113565b61120b825f83613d75565b306001600160a01b037f000000000000000000000000a619cdcb5d3581b30c94146671c53562e8418d9716148061333857507f000000000000000000000000a619cdcb5d3581b30c94146671c53562e8418d976001600160a01b031661332c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614155b15612e9b576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7ff5e41b69db3149675767a8769b58cb4060b90e5e3d4bab8b1c958708ed9c9259613399336115a8565b61120b5761120b8161316b565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561341e575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261341b918101906159a8565b60015b61345f576040517f4c9c8ce30000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401611113565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146134bb576040517faa1d49a400000000000000000000000000000000000000000000000000000000815260048101829052602401611113565b61130783836141b7565b306001600160a01b037f000000000000000000000000a619cdcb5d3581b30c94146671c53562e8418d971614612e9b576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61352f61420c565b6113a281614273565b7feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d869840080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383161790556040516001600160a01b038216907f0e01a4b69474f241b165e228db95ec6d2b1f878242a2388a9aea177873b5b4c0905f90a250565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace006001600160a01b03841661360d5781816002015f82825461360291906159ec565b909155506136969050565b6001600160a01b0384165f9081526020829052604090205482811015613678576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03861660048201526024810182905260448101849052606401611113565b6001600160a01b0385165f9081526020839052604090209083900390555b6001600160a01b0383166136b45760028101805483900390556136d2565b6001600160a01b0383165f9081526020829052604090208054830190555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161371791815260200190565b60405180910390a350505050565b61372d614284565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258336131e7565b6001600160a01b0381166137de576040517fb586360400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6137e6611d22565b6001600160a01b0316816001600160a01b0316036123c5576040517fa1198ce100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f61383e6002828486615679565b613847916159ff565b60f01c9050600381146113075782826040517f9a6d49cd0000000000000000000000000000000000000000000000000000000081526004016111139291906156c6565b5f80613897858585612a76565b9092509050612aca3383613252565b6138ae614972565b5f6138bb845f01516142c3565b6020850151909150156138d5576138d58460200151614303565b7f0000000000000000000000006edce65403992e310a62460808c4b910d972f10f6001600160a01b0316632637a450826040518060a001604052808b63ffffffff1681526020016139258c612ad2565b81526020018a81526020018981526020015f8960200151111515815250866040518463ffffffff1660e01b81526004016139609291906158ca565b60806040518083038185885af115801561397c573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906139a19190615a47565b979650505050505050565b7feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d86984005f6139d66124a7565b9050613a125f613a0d7feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401546001600160a01b031690565b612e9d565b50613a1d5f82613e8c565b505080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020526040902060010154613a808161316b565b6114138383612e9d565b612e9b61420c565b613a9a61420c565b6113a2816143fb565b613aab61420c565b7f3ab444d0b836415993da5574d0dceaa00602de23a5d497ad94b3647348c27000613ad6848461444f565b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff929092169190911790555050565b613b1261420c565b612e9b614461565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace006001600160a01b038516613b7d576040517fe602df050000000000000000000000000000000000000000000000000000000081525f6004820152602401611113565b6001600160a01b038416613bbf576040517f94280d620000000000000000000000000000000000000000000000000000000081525f6004820152602401611113565b6001600160a01b038086165f9081526001830160209081526040808320938816835292905220839055811561190e57836001600160a01b0316856001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051613c3391815260200190565b60405180910390a35050505050565b5f7f000000000000000000000000000000000000000000000000000000e8d4a51000613c6e8184615aad565b610ec39190615ae5565b5f613c866020828486615679565b6111c391615afc565b5f613c9e602860208486615679565b613ca791615b38565b60c01c9392505050565b5f610ec37f000000000000000000000000000000000000000000000000000000e8d4a5100067ffffffffffffffff8416615ae5565b5f613cf18484613205565b509092915050565b6060613d088260288186615679565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250929695505050505050565b606084848484604051602001613d5c9493929190615b7e565b6040516020818303038152906040529050949350505050565b6001600160a01b0383165f9081527f7b8c66b06ab2a5b9694594d3e1497062eaf332a02e6508b6950edd463f4bb000602081905260409091205484919060ff1615613df7576040517fb1ac0d980000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401611113565b6001600160a01b0384165f9081527f7b8c66b06ab2a5b9694594d3e1497062eaf332a02e6508b6950edd463f4bb000602081905260409091205485919060ff1615613e79576040517fb1ac0d980000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401611113565b613e81614284565b61119c8787876135c0565b5f7feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d869840083613f5b575f613ee57feef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401546001600160a01b031690565b6001600160a01b031614613f25576040517f3fc3c27a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0385161790555b6120e884846144b2565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602081815260408084206001600160a01b038616855290915282205460ff1615614027575f848152602082815260408083206001600160a01b038716808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339287917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a46001915050610ec3565b5f915050610ec3565b5f610ec37f000000000000000000000000000000000000000000000000000000e8d4a5100083615aad565b80516060901515806140bc5784846040516020016140a892919091825260c01b7fffffffffffffffff00000000000000000000000000000000000000000000000016602082015260280190565b6040516020818303038152906040526140e3565b848433856040516020016140d39493929190615bfb565b6040516020818303038152906040525b9150935093915050565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602090815260408083206001600160a01b038516845290915290205460ff1661120b576040517fe2517d3f0000000000000000000000000000000000000000000000000000000081526001600160a01b038216600482015260248101839052604401611113565b6141816115f4565b612e9b576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6141c082614593565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a280511561420457611307828261463a565b61120b6146a3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff16612e9b576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61427b61420c565b6113a2816146db565b61428c6115f4565b15612e9b576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8134146142ff576040517f9f704120000000000000000000000000000000000000000000000000000000008152346004820152602401611113565b5090565b5f7f0000000000000000000000006edce65403992e310a62460808c4b910d972f10f6001600160a01b031663e4fe1d946040518163ffffffff1660e01b8152600401602060405180830381865afa158015614360573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061438491906152a1565b90506001600160a01b0381166143c6576040517f5373352a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61120b6001600160a01b038216337f0000000000000000000000006edce65403992e310a62460808c4b910d972f10f856146e3565b61440361420c565b6001600160a01b038116614445576040517fc22c80220000000000000000000000000000000000000000000000000000000081525f6004820152602401611113565b61120b5f82613e8c565b61445761420c565b61120b828261476b565b61446961420c565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602081815260408084206001600160a01b038616855290915282205460ff16614027575f848152602082815260408083206001600160a01b0387168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556145493390565b6001600160a01b0316836001600160a01b0316857f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a46001915050610ec3565b806001600160a01b03163b5f036145e1576040517f4c9c8ce30000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152602401611113565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516146569190615c53565b5f60405180830381855af49150503d805f811461468e576040519150601f19603f3d011682016040523d82523d5f602084013e614693565b606091505b50915091506131628583836147ce565b3415612e9b576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611cf161420c565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052611413908590614843565b61477361420c565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace007f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace036147bf8482615c64565b50600481016114138382615c64565b6060826147e3576147de826148bd565b6111c3565b81511580156147fa57506001600160a01b0384163b155b1561483c576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401611113565b50806111c3565b5f6148576001600160a01b038416836148ff565b905080515f1415801561487b57508080602001905181019061487991906158af565b155b15611307576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401611113565b8051156148cd5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60606111c383835f845f80856001600160a01b031684866040516149239190615c53565b5f6040518083038185875af1925050503d805f811461495d576040519150601f19603f3d011682016040523d82523d5f602084013e614962565b606091505b50915091506113668683836147ce565b60405180606001604052805f80191681526020015f67ffffffffffffffff1681526020016149b160405180604001604052805f81526020015f81525090565b905290565b5f602082840312156149c6575f80fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146111c3575f80fd5b5f5b83811015614a0f5781810151838201526020016149f7565b50505f910152565b5f8151808452614a2e8160208601602086016149f5565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081525f6111c36020830184614a17565b6001600160a01b03811681146113a2575f80fd5b5f8060408385031215614a97575f80fd5b8235614aa281614a72565b946020939093013593505050565b5f60e08284031215614ac0575f80fd5b50919050565b5f60208284031215614ad6575f80fd5b813567ffffffffffffffff811115614aec575f80fd5b6120e884828501614ab0565b83518152602080850151908201525f60a08201604060a0604085015281865180845260c08601915060c08160051b870101935060208089015f5b83811015614b8f578887037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff40018552815180518852830151838801879052614b7c87890182614a17565b9750509382019390820190600101614b32565b505087516060880152505050602085015160808501525090506120e8565b5f60608284031215614ac0575f80fd5b5f8083601f840112614bcd575f80fd5b50813567ffffffffffffffff811115614be4575f80fd5b602083019150836020828501011115614bfb575f80fd5b9250929050565b5f805f805f805f60e0888a031215614c18575f80fd5b614c228989614bad565b965060608801359550608088013567ffffffffffffffff80821115614c45575f80fd5b614c518b838c01614bbd565b909750955060a08a01359150614c6682614a72565b90935060c08901359080821115614c7b575f80fd5b50614c888a828b01614bbd565b989b979a50959850939692959293505050565b5f805f60608486031215614cad575f80fd5b8335614cb881614a72565b92506020840135614cc881614a72565b929592945050506040919091013590565b5f60208284031215614ce9575f80fd5b5035919050565b5f8060408385031215614d01575f80fd5b823591506020830135614d1381614a72565b809150509250929050565b803563ffffffff81168114614d31575f80fd5b919050565b5f8060408385031215614d47575f80fd5b614aa283614d1e565b80151581146113a2575f80fd5b5f8060408385031215614d6e575f80fd5b823567ffffffffffffffff811115614d84575f80fd5b614d9085828601614ab0565b9250506020830135614d1381614d50565b815181526020808301519082015260408101610ec3565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040805190810167ffffffffffffffff81118282101715614e0857614e08614db8565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715614e5557614e55614db8565b604052919050565b5f67ffffffffffffffff821115614e7657614e76614db8565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b5f614eb4614eaf84614e5d565b614e0e565b9050828152838383011115614ec7575f80fd5b828260208301375f602084830101529392505050565b5f8060408385031215614eee575f80fd5b8235614ef981614a72565b9150602083013567ffffffffffffffff811115614f14575f80fd5b8301601f81018513614f24575f80fd5b614f3385823560208401614ea2565b9150509250929050565b803561ffff81168114614d31575f80fd5b5f8060408385031215614f5f575f80fd5b614f6883614d1e565b9150614f7660208401614f3d565b90509250929050565b5f60208284031215614f8f575f80fd5b81356111c381614a72565b5f8083601f840112614faa575f80fd5b50813567ffffffffffffffff811115614fc1575f80fd5b6020830191508360208260051b8501011115614bfb575f80fd5b5f8060208385031215614fec575f80fd5b823567ffffffffffffffff811115615002575f80fd5b61500e85828601614f9a565b90969095509350505050565b5f6020828403121561502a575f80fd5b6111c382614d1e565b5f805f8060608587031215615046575f80fd5b61504f85614d1e565b935061505d60208601614f3d565b9250604085013567ffffffffffffffff811115615078575f80fd5b61508487828801614bbd565b95989497509550505050565b5f805f83850360808112156150a3575f80fd5b843567ffffffffffffffff8111156150b9575f80fd5b6150c587828801614ab0565b94505060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0820112156150f7575f80fd5b50602084019150606084013561510c81614a72565b809150509250925092565b5f60c0820190508351825267ffffffffffffffff60208501511660208301526040840151615152604084018280518252602090810151910152565b5082516080830152602083015160a08301526111c3565b5f806040838503121561517a575f80fd5b823561518581614a72565b91506020830135614d1381614a72565b5f82601f8301126151a4575f80fd5b6111c383833560208501614ea2565b5f805f80608085870312156151c6575f80fd5b84356151d181614a72565b9350602085013567ffffffffffffffff808211156151ed575f80fd5b6151f988838901615195565b9450604087013591508082111561520e575f80fd5b5061521b87828801615195565b925050606085013560ff81168114615231575f80fd5b939692955090935050565b5f6060828403121561524c575f80fd5b6111c38383614bad565b600181811c9082168061526a57607f821691505b602082108103614ac0577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f602082840312156152b1575f80fd5b81516111c381614a72565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f82357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa183360301811261531b575f80fd5b9190910192915050565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112615358575f80fd5b83018035915067ffffffffffffffff821115615372575f80fd5b602001915036819003821315614bfb575f80fd5b5f60208284031215615396575f80fd5b6111c382614f3d565b601f82111561130757805f5260205f20601f840160051c810160208510156153c45750805b601f840160051c820191505b8181101561190e575f81556001016153d0565b67ffffffffffffffff8311156153fb576153fb614db8565b61540f836154098354615256565b8361539f565b5f601f84116001811461545f575f85156154295750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b17835561190e565b5f838152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08716915b828110156154ac578685013582556020948501946001909201910161548c565b50868210156154e7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60208082528181018390525f906040808401600586901b8501820187855b8881101561566b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc088840301845281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa18b36030181126155be575f80fd5b8a01606063ffffffff6155d083614d1e565b16855261ffff6155e1898401614f3d565b1688860152868201357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1833603018112615619575f80fd5b90910187810191903567ffffffffffffffff811115615636575f80fd5b803603831315615644575f80fd5b818887015261565682870182856154f9565b9689019695505050918601915060010161555e565b509098975050505050505050565b5f8085851115615687575f80fd5b83861115615693575f80fd5b5050820193919092039150565b5f84516156b18184602089016149f5565b8201838582375f930192835250909392505050565b602081525f6120e86020830184866154f9565b5f82357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec183360301811261531b575f80fd5b67ffffffffffffffff811681146113a2575f80fd5b63ffffffff61572e89614d1e565b168152602088013560208201525f604089013561574a8161570b565b67ffffffffffffffff811660408401525087606083015260e0608083015261577660e0830187896154f9565b6001600160a01b03861660a084015282810360c08401526157988185876154f9565b9a9950505050505050505050565b5f602082840312156157b6575f80fd5b815167ffffffffffffffff8111156157cc575f80fd5b8201601f810184136157dc575f80fd5b80516157ea614eaf82614e5d565b8181528560208385010111156157fe575f80fd5b6131628260208301602086016149f5565b5f6040828403121561581f575f80fd5b615827614de5565b82358152602083013560208201528091505092915050565b5f6020828403121561584f575f80fd5b81356111c38161570b565b6001600160a01b038516815283602082015261ffff83166040820152608060608201525f6113666080830184614a17565b604081525f61589d6040830185614a17565b82810360208401526131628185614a17565b5f602082840312156158bf575f80fd5b81516111c381614d50565b6040815263ffffffff8351166040820152602083015160608201525f604084015160a060808401526158ff60e0840182614a17565b905060608501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08483030160a085015261593a8282614a17565b60809690960151151560c08501525050506001600160a01b039190911660209091015290565b5f60408284031215615970575f80fd5b615978614de5565b9050815181526020820151602082015292915050565b5f6040828403121561599e575f80fd5b6111c38383615960565b5f602082840312156159b8575f80fd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820180821115610ec357610ec36159bf565b7fffff0000000000000000000000000000000000000000000000000000000000008135818116916002851015615a3f5780818660020360031b1b83161692505b505092915050565b5f60808284031215615a57575f80fd5b6040516060810181811067ffffffffffffffff82111715615a7a57615a7a614db8565b604052825181526020830151615a8f8161570b565b6020820152615aa18460408501615960565b60408201529392505050565b5f82615ae0577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b8082028115828204841417610ec357610ec36159bf565b80356020831015610ec3577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7fffffffffffffffff0000000000000000000000000000000000000000000000008135818116916008851015615a3f5760089490940360031b84901b1690921692915050565b7fffffffffffffffff0000000000000000000000000000000000000000000000008560c01b1681527fffffffff000000000000000000000000000000000000000000000000000000008460e01b16600882015282600c8201525f8251615beb81602c8501602087016149f5565b91909101602c0195945050505050565b8481527fffffffffffffffff0000000000000000000000000000000000000000000000008460c01b1660208201528260288201525f8251615c438160488501602087016149f5565b9190910160480195945050505050565b5f825161531b8184602087016149f5565b815167ffffffffffffffff811115615c7e57615c7e614db8565b615c9281615c8c8454615256565b8461539f565b602080601f831160018114615ce4575f8415615cae5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555615d78565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015615d3057888601518255948401946001909101908401615d11565b5085821015615d6c57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b505060018460011b0185555b50505050505056fea2646970667358221220ba1847ebafaa6f4c086c3ee2f193f2e2da511220c3fd7d0928ff4897f45168ac64736f6c63430008170033

Deployed Bytecode Sourcemap

703:4398:4:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4265:257:0;;;;;;;;;;-1:-1:-1;4265:257:0;;;;;:::i;:::-;;:::i;:::-;;;516:14:60;;509:22;491:41;;479:2;464:18;4265:257:0;;;;;;;;3011:144:41;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;5505:186::-;;;;;;;;;;-1:-1:-1;5505:186:41;;;;;:::i;:::-;;:::i;5778:1258:20:-;;;;;;;;;;-1:-1:-1;5778:1258:20;;;;;:::i;:::-;;:::i;:::-;;;;;;;;;:::i;5003:96:4:-;;;;;;;;;;-1:-1:-1;5091:1:4;5003:96;;;4064:25:60;;;4052:2;4037:18;5003:96:4;3918:177:60;3931:149:20;;;;;;;;;;;;;:::i;:::-;;;-1:-1:-1;;;;;4264:55:60;;;4246:74;;4234:2;4219:18;3931:149:20;4100:226:60;4333:708:11;;;;;;:::i;:::-;;:::i;:::-;;2587:40:20;;;;;;;;;;;;2626:1;2587:40;;;;;6069:6:60;6057:19;;;6039:38;;6027:2;6012:18;2587:40:20;5895:188:60;1827:140:4;;;;;;;;;;-1:-1:-1;1827:140:4;;;1934:22;6258:98:60;;1958:1:4;6387:2:60;6372:18;;6365:59;6231:18;1827:140:4;6088:342:60;1923:257:13;;;;;;;;;;-1:-1:-1;1923:257:13;;;887:1:12;6642:34:60;;;6707:2;6692:18;;6685:43;6578:18;1923:257:13;6435:299:60;4191:152:41;;;;;;;;;;-1:-1:-1;4322:14:41;;4191:152;;2550:31:20;;;;;;;;;;;;2580:1;2550:31;;6251:244:41;;;;;;;;;;-1:-1:-1;6251:244:41;;;;;:::i;:::-;;:::i;4759:191:38:-;;;;;;;;;;-1:-1:-1;4759:191:38;;;;;:::i;:::-;4824:7;4919:14;;;2920:28;4919:14;;;;;:24;;;;4759:191;4834:298:0;;;;;;;;;;-1:-1:-1;4834:298:0;;;;;:::i;:::-;;:::i;1813:172:2:-;;;;;;;;;;;;;:::i;:::-;;;8059:4:60;8047:17;;;8029:36;;8017:2;8002:18;1813:172:2;7887:184:60;4238:227:10;;;;;;;;;;-1:-1:-1;4238:227:10;;;;;:::i;:::-;;:::i;6348:245:38:-;;;;;;;;;;-1:-1:-1;6348:245:38;;;;;:::i;:::-;;:::i;7487:774:20:-;;;;;;;;;;-1:-1:-1;7487:774:20;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;946:98:5:-;;;;;;;;;;;;;:::i;2691:164:2:-;;;;;;;;;;-1:-1:-1;2691:164:2;;;;;:::i;:::-;;:::i;2999:152::-;;;;;;;;;;-1:-1:-1;2999:152:2;;;;;:::i;:::-;;:::i;4158:214:40:-;;;;;;:::i;:::-;;:::i;2014:93:24:-;;;;;;;;;;-1:-1:-1;2095:4:24;2014:93;;3705:134:40;;;;;;;;;;;;;:::i;1527:222:19:-;;;;;;;;;;-1:-1:-1;1527:222:19;;;;;:::i;:::-;;:::i;4071:127:0:-;;;;;;;;;;-1:-1:-1;4071:127:0;;;;;:::i;:::-;;:::i;15680:132:20:-;;;;;;;;;;-1:-1:-1;15680:132:20;;;;;:::i;:::-;3661:13:10;;;;;15762:4:20;3661:13:10;;;918:23;3661:13;;;;;;15785:20:20;;15680:132;2692:145:43;;;;;;;;;;;;;:::i;1195:117:4:-;;;;;;;;;;;;;:::i;1090:44:10:-;;;;;;;;;;;;;;;8170:164:0;;;;;;;;;;-1:-1:-1;8170:164:0;;;;;:::i;:::-;;:::i;5225:247:20:-;;;;;;;;;;-1:-1:-1;5225:247:20;;;;;:::i;:::-;;:::i;4401:171:41:-;;;;;;;;;;-1:-1:-1;4401:171:41;;;;;:::i;:::-;-1:-1:-1;;;;;4545:20:41;4466:7;4545:20;;;2359;4545;;;;;;;4401:171;3472:128:11;;;;;;;;;;-1:-1:-1;3472:128:11;;;;;:::i;:::-;3561:12;3472:128;;;;;;;;12861:18:60;12849:31;;;12831:50;;12819:2;12804:18;3472:128:11;12687:200:60;3331:324:2;;;;;;;;;;-1:-1:-1;3331:324:2;;;;;:::i;:::-;;:::i;2796:186:4:-;;;;;;;;;;-1:-1:-1;2796:186:4;;;;;:::i;:::-;;:::i;793:94:5:-;;;;;;;;;;;;;:::i;7405:223:0:-;;;;;;;;;;-1:-1:-1;7599:22:0;;-1:-1:-1;;;;;7599:22:0;7405:223;;4687:87:20;;;;;;;;;;-1:-1:-1;4766:1:20;4687:87;;4578:93:0;;;;;;;;;;;;;:::i;3732:207:38:-;;;;;;;;;;-1:-1:-1;3732:207:38;;;;;:::i;:::-;3809:4;3901:14;;;2920:28;3901:14;;;;;;;;-1:-1:-1;;;;;3901:31:38;;;;;;;;;;;;;;;3732:207;3268:148:41;;;;;;;;;;;;;:::i;2244:46:20:-;;;;;;;;;;;;;;;3675:399:1;;;;;;;;;;-1:-1:-1;3675:399:1;;;;;:::i;:::-;;:::i;2580:94:4:-;;;;;;;;;;-1:-1:-1;2639:4:4;2580:94;;2317:49:38;;;;;;;;;;-1:-1:-1;2317:49:38;2362:4;2317:49;;4767:178:41;;;;;;;;;;-1:-1:-1;4767:178:41;;;;;:::i;:::-;;:::i;1819:58:40:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2557:140:10;;;;;;;;;;-1:-1:-1;2557:140:10;;;;;:::i;:::-;;:::i;1542:180:24:-;;;;;;;;;;;;;:::i;3168:115:10:-;;;;;;;;;;;;;:::i;2542:625:19:-;;;;;;;;;;-1:-1:-1;2542:625:19;;;;;:::i;:::-;;:::i;3518:163:10:-;;;;;;;;;;-1:-1:-1;3518:163:10;;;;;:::i;:::-;3661:13;;3576:7;3661:13;;;918:23;3661:13;;;;;;;3518:163;3926:1058:19;;;;;;;;;;-1:-1:-1;3926:1058:19;;;;;:::i;:::-;;:::i;3052:1333:24:-;;;;;;:::i;:::-;;:::i;8949:1316:20:-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;;:::i;5392:130:10:-;;;;;;;;;;-1:-1:-1;5392:130:10;;;;;:::i;:::-;;:::i;9174:340:0:-;;;;;;;;;;;;;:::i;7701:275::-;;;;;;;;;;;;;:::i;5033:409:24:-;;;;;;:::i;:::-;;:::i;2342:251::-;;;;;;;;;;-1:-1:-1;2342:251:24;;;;;:::i;:::-;;:::i;5232:300:0:-;;;;;;;;;;-1:-1:-1;5232:300:0;;;;;:::i;:::-;;:::i;8709:156::-;;;;;;;;;;;;;:::i;5003:195:41:-;;;;;;;;;;-1:-1:-1;5003:195:41;;;;;:::i;:::-;-1:-1:-1;;;;;5162:20:41;;;5083:7;5162:20;;;:13;:20;;;;;;;;:29;;;;;;;;;;;;;5003:195;3212:330:1;;;;;;;;;;-1:-1:-1;3212:330:1;;;;;:::i;:::-;;:::i;950:460:3:-;;;;;;;;;;-1:-1:-1;950:460:3;;;;;:::i;:::-;;:::i;4263:186:1:-;;;;;;;;;;-1:-1:-1;4263:186:1;;;;;:::i;:::-;-1:-1:-1;;;;;4423:19:1;4323:4;4423:19;;;992:28;4423:19;;;;;;;;;4263:186;2736:149:11;;;;;;;;;;-1:-1:-1;2736:149:11;;;;;:::i;:::-;;:::i;4265:257:0:-;4364:4;4399:64;;;4414:49;4399:64;;:116;;;4479:36;4503:11;4479:23;:36::i;:::-;4380:135;4265:257;-1:-1:-1;;4265:257:0:o;3011:144:41:-;3141:7;3134:14;;3056:13;;2359:20;;3134:14;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3011:144;:::o;5505:186::-;5578:4;966:10:42;5632:31:41;966:10:42;5648:7:41;5657:5;5632:8;:31::i;:::-;-1:-1:-1;5680:4:41;;5505:186;-1:-1:-1;;;5505:186:41:o;5778:1258:20:-;-1:-1:-1;;;;;;;;;;;;;;;;;5930:35:20;5967:28;-1:-1:-1;;;;;;;;;;;;;;;;;;;5967:28:20;6185:34;;;;;;;;-1:-1:-1;6185:34:20;;;6107:16;6185:34;;;;;;;6336:21;;;;;;;;;;;6185:34;;-1:-1:-1;;;6336:21:20;;;-1:-1:-1;;;;;;;;;;;;;;;;;6336:21:20;;;;;;;;;;;;;;;-1:-1:-1;6320:37:20;-1:-1:-1;6794:20:20;;6844:120;6868:19;;;;6901:22;;;;6937:17;;;;6868:10;6937:17;:::i;:::-;6844:10;:120::i;:::-;6987:42;;;;;;;;;;;;;;;;5778:1258;;;;-1:-1:-1;;;;;;5778:1258:20:o;3931:149::-;3976:7;;2803:22;4022:20;4059:14;-1:-1:-1;;;;;4059:14:20;;3931:149;-1:-1:-1;;3931:149:20:o;4333:708:11:-;4646:8;-1:-1:-1;;;;;4638:31:11;4659:10;4638:31;4634:68;;4678:24;;;;;4691:10;4678:24;;;4246:74:60;4219:18;;4678:24:11;;;;;;;;4634:68;4838:14;;;;;;4802:32;;4819:14;;4838:7;4819:14;:::i;:::-;4802:16;:32::i;:::-;:50;4798:103;;4870:14;;;;:7;:14;:::i;:::-;4861:40;;;;;18743:10:60;18731:23;;;4861:40:11;;;18713:42:60;4886:14:11;;;;18771:18:60;;;18764:34;18686:18;;4861:40:11;18541:263:60;4798:103:11;4975:59;4986:7;4995:5;5002:8;;5012:9;5023:10;;4975;:59::i;:::-;4333:708;;;;;;;:::o;6251:244:41:-;6338:4;966:10:42;6394:37:41;6410:4;966:10:42;6425:5:41;6394:15;:37::i;:::-;6441:26;6451:4;6457:2;6461:5;6441:9;:26::i;:::-;6484:4;6477:11;;;6251:244;;;;;;:::o;4834:298:0:-;4986:4;4982:104;;5035:40;;;;;;;;;;;;;;4982:104;5095:30;5111:4;5117:7;5095:15;:30::i;:::-;4834:298;;:::o;1813:172:2:-;1863:5;;1061:29;1914:35;1966:12;;;;1813:172;-1:-1:-1;;1813:172:2:o;4238:227:10:-;4308:25;:23;:25::i;:::-;4402:13;;;4343:25;4402:13;;;918:23;4402:13;;;;;;;;;:21;;;4438:20;;18713:42:60;;;18771:18;;18764:34;;;918:23:10;4438:20;;18686:18:60;4438:20:10;;;;;;;;4298:167;4238:227;;:::o;6348:245:38:-;-1:-1:-1;;;;;6441:34:38;;966:10:42;6441:34:38;6437:102;;6498:30;;;;;;;;;;;;;;6437:102;6549:37;6561:4;6567:18;6549:11;:37::i;:::-;;6348:245;;:::o;7487:774:20:-;-1:-1:-1;;;;;;;;;;;;;;;;;7821:24:20;7849:74;7860:19;;;;7881:22;;;;7905:17;;;;7860:10;7905:17;:::i;7849:74::-;7818:105;;;8012:20;8034;8058:49;8078:10;8090:16;8058:19;:49::i;:::-;8011:96;;-1:-1:-1;8011:96:20;-1:-1:-1;8196:58:20;8203:17;;;;:10;:17;:::i;:::-;8222:7;8231;8240:13;8196:6;:58::i;:::-;8189:65;7487:774;-1:-1:-1;;;;;;7487:774:20:o;946:98:5:-;844:24:8;3191:16:38;3202:4;3191:10;:16::i;:::-;1027:10:5::1;:8;:10::i;:::-;946:98:::0;:::o;2691:164:2:-;708:24:8;3191:16:38;3202:4;3191:10;:16::i;:::-;2813:6:2::1;587::7;597:1;587:11:::0;583:35:::1;;607:11;;;;;;;;;;;;;;583:35;2831:17:2::2;2837:2;2841:6;2831:5;:17::i;:::-;3217:1:38::1;2691:164:2::0;;;:::o;2999:152::-;776:24:8;3191:16:38;3202:4;3191:10;:16::i;:::-;3101:6:2::1;587::7;597:1;587:11:::0;583:35:::1;;607:11;;;;;;;;;;;;;;583:35;3119:25:2::2;3125:10;3137:6;3119:5;:25::i;4158:214:40:-:0;2653:13;:11;:13::i;:::-;4273:36:::1;4291:17;4273;:36::i;:::-;4319:46;4341:17;4360:4;4319:21;:46::i;3705:134::-:0;3774:7;2924:20;:18;:20::i;:::-;-1:-1:-1;1327:66:49::1;3705:134:40::0;:::o;1527:222:19:-;1709:23;;;1627:33;1709:23;;;1151:31;1709:23;;;;;;;;:33;;;;;;;;;;;1702:40;;1603:12;;1151:31;1709:33;1702:40;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1527:222;;;;:::o;4071:127:0:-;4142:4;4183:8;-1:-1:-1;;;;;4165:26:0;:14;7599:22;;-1:-1:-1;;;;;7599:22:0;;7405:223;4165:14;-1:-1:-1;;;;;4165:26:0;;;4071:127;-1:-1:-1;;4071:127:0:o;2692:145:43:-;2739:4;;1270:23;2783:21;1147:162;1195:117:4;8870:21:39;6431:15;;1258:1:4;;8870:21:39;6431:15;;;;;;:44;;-1:-1:-1;6450:14:39;;:25;;;;:14;;:25;;6431:44;6427:105;;;6498:23;;;;;;;;;;;;;;6427:105;6541:24;;6575:22;;6541:24;;;6575:22;;;;;1275:30:4::1;1290:14;7599:22:0::0;;-1:-1:-1;;;;;7599:22:0;;7405:223;1290:14:4::1;1275;:30::i;:::-;6618:23:39::0;;;;;;6656:20;;12861:18:60;12849:31;;12831:50;;6656:20:39;;12819:2:60;12804:18;6656:20:39;;;;;;;;6291:392;1195:117:4;:::o;8170:164:0:-;2362:4:38;3191:16;2362:4;3191:10;:16::i;:::-;8291:36:0::1;8318:8;8291:26;:36::i;5225:247:20:-:0;5298:25;:23;:25::i;:::-;2803:22;5390:30;;;;-1:-1:-1;;;;;5390:30:20;;;;;;;5435;;4246:74:60;;;5435:30:20;;4234:2:60;4219:18;5435:30:20;4100:226:60;3331:324:2;776:24:8;3191:16:38;3202:4;3191:10;:16::i;:::-;-1:-1:-1;;;;;2372:19:1;::::1;2290:30;2372:19:::0;;;992:28;2372:19:::1;::::0;;;;;;;;3497:18:2;;992:28:1;2372:19:::1;;2367:53;;2400:20;::::0;::::1;::::0;;-1:-1:-1;;;;;4264:55:60;;2400:20:1::1;::::0;::::1;4246:74:60::0;4219:18;;2400:20:1::1;4100:226:60::0;2367:53:1::1;-1:-1:-1::0;;;;;4545:20:41;;3531:18:2::2;4545:20:41::0;;;2359;4545;;;;;;3531:50:2::2;;3591:57;3605:18;3633:1;3637:10;3591:13;:57::i;:::-;3521:134;2280:158:1::1;3217:1:38;3331:324:2::0;;:::o;2796:186:4:-;2874:4;2897:24;2912:8;2897:14;:24::i;:::-;:78;;;-1:-1:-1;;;;;;3901:31:38;;3809:4;3901:31;;;:14;;:31;:14;:31;;;;;2925:50:4;3732:207:38;793:94:5;844:24:8;3191:16:38;3202:4;3191:10;:16::i;:::-;872:8:5::1;:6;:8::i;4578:93:0:-:0;4624:7;4650:14;7599:22;;-1:-1:-1;;;;;7599:22:0;;7405:223;4650:14;4643:21;;4578:93;:::o;3268:148:41:-;3400:9;3393:16;;3315:13;;2359:20;;3393:16;;;:::i;3675:399:1:-;1007:29:8;3191:16:38;3202:4;3191:10;:16::i;:::-;3804:4:1;-1:-1:-1;;;;;419:18:7;::::1;415:44;;446:13;;;;;;;;;;;;;;415:44;-1:-1:-1::0;;;;;2057:19:1;::::2;1976:30;2057:19:::0;;;992:28;2057:19:::2;::::0;;;;;;;;3837:4;;992:28;2057:19:::2;;2053:56;;;2085:24;::::0;::::2;::::0;;-1:-1:-1;;;;;4264:55:60;;2085:24:1::2;::::0;::::2;4246:74:60::0;4219:18;;2085:24:1::2;4100:226:60::0;2053:56:1::2;3876:4:::0;1419::::3;-1:-1:-1::0;;;;;1403:21:1;::::3;::::0;1399:60:::3;;1433:26;;;;;;;;;;;;;;1399:60;3909:4:::4;1652:14;7599:22:0::0;;-1:-1:-1;;;;;7599:22:0;;7405:223;1652:14:1::4;-1:-1:-1::0;;;;;1644:22:1::4;:4;-1:-1:-1::0;;;;;1644:22:1::4;::::0;1640:56:::4;;1675:21;;;;;;;;;;;;;;1640:56;-1:-1:-1::0;;;;;3901:31:38;;3809:4;3901:31;;;:14;;:31;:14;:31;;;;;1706:90:1::4;;;1775:21;;;;;;;;;;;;;;1706:90;3929:30:::5;992:28:::0;-1:-1:-1;;;;;4006:19:1;::::5;:13;:19:::0;;;::::5;::::0;;;;;;;;:26;;;::::5;4028:4;4006:26;::::0;;4047:20;;4246:74:60;;;4006:19:1;;-1:-1:-1;4047:20:1::5;::::0;4219:18:60;4047:20:1::5;;;;;;;3919:155;1469:1:::4;2119::::3;1966:161:::2;469:1:7;3217::38::1;3675:399:1::0;;:::o;4767:178:41:-;4836:4;966:10:42;4890:27:41;966:10:42;4907:2:41;4911:5;4890:9;:27::i;2557:140:10:-;2624:25;:23;:25::i;:::-;2659:31;2680:9;2659:20;:31::i;1542:180:24:-;1594:7;;1151:36;1654:34;1001:202;3168:115:10;3243:33;;;;;3270:4;3243:33;;;4246:74:60;3217:7:10;;3243:8;-1:-1:-1;;;;;3243:18:10;;;;4219::60;;3243:33:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;2542:625:19:-;2644:25;:23;:25::i;:::-;1151:31;2679:33;2754:356;2774:27;;;2754:356;;;2936:48;2956:16;;2973:1;2956:19;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;:27;;;;;;;:::i;:::-;2936:19;:48::i;:::-;3072:16;;3089:1;3072:19;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;:27;;;;;;;:::i;:::-;2998:1;:17;3016:16;;3033:1;3016:19;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;:23;;;;;;;:::i;:::-;2998:42;;;;;;;;;;;;;;;:71;3041:16;;3058:1;3041:19;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;:27;;;;;;;;;:::i;:::-;2998:71;;;;;;;;;;;;;-1:-1:-1;2998:71:19;;:101;;;:71;:101;:::i;:::-;-1:-1:-1;2803:3:19;;2754:356;;;;3125:35;3143:16;;3125:35;;;;;;;:::i;3926:1058::-;4192:23;;;4093:33;4192:23;;;1151:31;4192:23;;;;;;;;:33;;;;;;;;;;4168:57;;4069:12;;4093:33;4192;4168:57;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4354:8;:15;4373:1;4354:20;4350:46;;4383:13;;4376:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;4376:20:19;;-1:-1:-1;4376:20:19;;-1:-1:-1;;;;;4376:20:19;4350:46;4481:1;4457:25;;;4453:46;;4491:8;-1:-1:-1;4484:15:19;;-1:-1:-1;4484:15:19;4453:46;4646:1;4622:25;;4618:267;;4663:34;4683:13;;4663:19;:34::i;:::-;4846:8;4856:17;:13;4870:1;4856:13;;:17;:::i;:::-;4833:41;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;4826:48;;;;;;4618:267;4963:13;;4948:29;;;;;;;;;;;;:::i;3926:1058::-;;;;;;;:::o;3052:1333:24:-;3153:9;3148:1037;3168:19;;;3148:1037;;;3208:29;3240:8;;3249:1;3240:11;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;3208:43;-1:-1:-1;3334:50:24;3341:20;;;;3208:43;3341:20;:::i;:::-;3363;;;;3661:13:10;;;;;15762:4:20;3661:13:10;;;918:23;3661:13;;;;;;15785:20:20;;15680:132;3334:50:24;3329:65;;3386:8;;;3329:65;3956:4;:22;3987:12;;;;:6;4050:11;;;;4079:14;;;;3987:6;4079:14;:::i;:::-;4111:15;;;;;;;;:::i;:::-;4144:16;;;;:6;:16;:::i;:::-;3956:218;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3194:991;3148:1037;3189:3;;3148:1037;;;;4342:10;-1:-1:-1;;;;;4332:43:24;;:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4315:63;;;;;;;;;;;:::i;8949:1316:20:-;9110:34;;:::i;:::-;-1:-1:-1;;;;;;;;;;;;;;;;;9508:20:20;;9558:116;9578:19;;;;9611:22;;;;9647:17;;;;9578:10;9647:17;:::i;:::-;9558:6;:116::i;:::-;9507:167;;;;9763:20;9785;9809:49;9829:10;9841:16;9809:19;:49::i;:::-;9762:96;;-1:-1:-1;9762:96:20;-1:-1:-1;9981:66:20;9989:17;;;;:10;:17;:::i;:::-;10008:7;10017;9981:66;;;;;;;10026:4;9981:66;:::i;:::-;10032:14;9981:7;:66::i;:::-;10113:42;;;;;;;;;;;;;;;;;;;10179:15;;9968:79;;-1:-1:-1;10113:42:20;;-1:-1:-1;10215:10:20;;10179:15;10171:87;;10196:17;;;;:10;:17;:::i;:::-;10171:87;;;28759:10:60;28747:23;;;28729:42;;28802:2;28787:18;;28780:34;;;28830:18;;28823:34;;;28717:2;28702:18;10171:87:20;;;;;;;9176:1089;;;;8949:1316;;;;;;:::o;5392:130:10:-;5449:25;:23;:25::i;:::-;5484:31;;;;;-1:-1:-1;;;;;4264:55:60;;;5484:31:10;;;4246:74:60;5484:8:10;:20;;;;4219:18:60;;5484:31:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9174:340:0;9237:23;9263:21;:19;:21::i;:::-;9237:47;-1:-1:-1;966:10:42;-1:-1:-1;;;;;9298:31:0;;;9294:175;;9412:46;;;;;966:10:42;9412:46:0;;;4246:74:60;4219:18;;9412:46:0;4100:226:60;9294:175:0;9478:29;:27;:29::i;7701:275::-;7793:16;;2813:45;7887:43;2618:256;5033:409:24;5312:10;5334:4;5312:27;5308:50;;5348:10;;;;;;;;;;;;;;5308:50;5368:67;5387:7;5396:5;5403:8;;5413:9;5424:10;;5368:18;:67::i;2342:251::-;2407:25;:23;:25::i;:::-;1151:36;2527:22;;;;-1:-1:-1;;;;;2527:22:24;;;;;;;2564;;4246:74:60;;;2564:22:24;;4234:2:60;4219:18;2564:22:24;4100:226:60;5232:300:0;5385:4;5381:104;;5434:40;;;;;;;;;;;;;;5381:104;5494:31;5511:4;5517:7;5494:16;:31::i;8709:156::-;2362:4:38;3191:16;2362:4;3191:10;:16::i;:::-;8829:29:0::1;2813:45:::0;10360:33;;;;;;659:142:9;3212:330:1;1007:29:8;3191:16:38;3202:4;3191:10;:16::i;:::-;3344:4:1;-1:-1:-1;;;;;419:18:7;::::1;415:44;;446:13;;;;;;;;;;;;;;415:44;-1:-1:-1::0;;;;;2372:19:1;::::2;2290:30;2372:19:::0;;;992:28;2372:19:::2;::::0;;;;;;;;3374:4;;992:28;2372:19:::2;;2367:53;;2400:20;::::0;::::2;::::0;;-1:-1:-1;;;;;4264:55:60;;2400:20:1::2;::::0;::::2;4246:74:60::0;4219:18;;2400:20:1::2;4100:226:60::0;2367:53:1::2;-1:-1:-1::0;;;;;3471:19:1;::::3;3394:30;3471:19:::0;;;992:28;3471:19:::3;::::0;;;;;;;;:27;;;::::3;::::0;;3513:22;;4246:74:60;;;3513:22:1;;992:28;;3513:22:::3;::::0;;;;;;;::::3;3384:158;2280::::2;469:1:7;3217::38::1;3212:330:1::0;;:::o;950:460:3:-;8870:21:39;4302:15;;;;;;;4301:16;;4348:14;;4158:30;4726:16;;:34;;;;;4746:14;4726:34;4706:54;;4770:17;4790:11;:16;;4805:1;4790:16;:50;;;;-1:-1:-1;4818:4:39;4810:25;:30;4790:50;4770:70;;4856:12;4855:13;:30;;;;;4873:12;4872:13;4855:30;4851:91;;;4908:23;;;;;;;;;;;;;;4851:91;4951:18;;;;4968:1;4951:18;;;4979:67;;;;5013:22;;;;;;;;4979:67;1112:6:3;-1:-1:-1;;;;;419:18:7;::::1;415:44;;446:13;;;;;;;;;;;;;;415:44;1130:24:3::2;:22;:24::i;:::-;1164:45;1202:6;1164:37;:45::i;:::-;1219:26;:24;:26::i;:::-;1255:31;:29;:31::i;:::-;1296:48;1318:5;1325:7;1334:9;1296:21;:48::i;:::-;1354:22;:20;:22::i;:::-;1386:17;:15;:17::i;:::-;5055:1:39::1;5070:14:::0;5066:101;;;5100:23;;;;;;5142:14;;-1:-1:-1;12831:50:60;;5142:14:39;;12819:2:60;12804:18;5142:14:39;;;;;;;5066:101;4092:1081;;;;;950:460:3;;;;:::o;2736:149:11:-;2818:4;2865:13;;;;;;2841:20;;2847:13;;2865:6;2847:13;:::i;2841:20::-;:37;;2736:149;-1:-1:-1;;2736:149:11:o;3443:202:38:-;3528:4;3551:47;;;3566:32;3551:47;;:87;;-1:-1:-1;1148:25:44;1133:40;;;;3602:36:38;1034:146:44;10264:128:41;10348:37;10357:5;10364:7;10373:5;10380:4;10348:8;:37::i;17697:668:20:-;17839:20;17861:24;18035:22;18047:9;18035:11;:22::i;:::-;18020:37;;18183:12;18164:31;;18265:12;18246:16;:31;18242:117;;;18300:48;;;;;;;;29256:25:60;;;29297:18;;;29290:34;;;29229:18;;18300:48:20;29082:248:60;18242:117:20;17697:668;;;;;;:::o;4763:257:10:-;4926:13;;;4833:7;4926:13;;;918:23;4926:13;;;;;;;;;4949:43;;4980:12;;;;;29509:10:60;29497:23;;4980:12:10;;;29479:42:60;29452:18;;4980:12:10;29335:192:60;12473:1806:20;12950:17;12970:36;:17;:8;;:15;:17::i;:::-;2891:2:23;2780:123;12970:36:20;12950:56;;13139:24;13166:62;13174:9;13185:26;13191:19;:8;;:17;:19::i;:::-;13185:5;:26::i;:::-;13213:14;;;;:7;:14;:::i;:::-;13166:7;:62::i;:::-;13139:89;-1:-1:-1;243:2:23;-1:-1:-1;;13239:955:20;;;13343:23;13369:175;13412:13;;;;;;;;:::i;:::-;13443:14;;;;:7;:14;:::i;:::-;13475:16;13509:21;:8;;:19;:21::i;:::-;13369:25;:175::i;:::-;14091:92;;;;;13343:201;;-1:-1:-1;;;;;;14091:8:20;:20;;;;:92;;14112:9;;14123:5;;14130:1;;13343:201;;14091:92;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13266:928;13239:955;-1:-1:-1;;;;;14209:63:20;;14221:5;14209:63;14228:14;;;;:7;:14;:::i;:::-;14209:63;;;18743:10:60;18731:23;;;18713:42;;18786:2;18771:18;;18764:34;;;18686:18;14209:63:20;;;;;;;12776:1503;;12473:1806;;;;;;;:::o;11993:477:41:-;-1:-1:-1;;;;;5162:20:41;;;12092:24;5162:20;;;:13;:20;;;;;;;;:29;;;;;;;;;;12178:17;12158:37;;12154:310;;12234:5;12215:16;:24;12211:130;;;12266:60;;;;;-1:-1:-1;;;;;30777:55:60;;12266:60:41;;;30759:74:60;30849:18;;;30842:34;;;30892:18;;;30885:34;;;30732:18;;12266:60:41;30557:368:60;12211:130:41;12382:57;12391:5;12398:7;12426:5;12407:16;:24;12433:5;12382:8;:57::i;6868:300::-;-1:-1:-1;;;;;6951:18:41;;6947:86;;6992:30;;;;;7019:1;6992:30;;;4246:74:60;4219:18;;6992:30:41;4100:226:60;6947:86:41;-1:-1:-1;;;;;7046:16:41;;7042:86;;7085:32;;;;;7114:1;7085:32;;;4246:74:60;4219:18;;7085:32:41;4100:226:60;7042:86:41;7137:24;7145:4;7151:2;7155:5;7137:7;:24::i;5246:136:38:-;4824:7;4919:14;;;2920:28;4919:14;;;;;:24;;;3191:16;3202:4;3191:10;:16::i;:::-;5350:25:::1;5361:4;5367:7;5350:10;:25::i;659:142:9:-:0;731:32;752:10;731:20;:32::i;:::-;726:68;;772:22;;;;;;;;;;;;;;726:68;659:142::o;6483:410:0:-;6592:4;2813:45;6727:26;;:55;;;;-1:-1:-1;7599:22:0;;-1:-1:-1;;;;;6757:25:0;;;7599:22;;6757:25;6727:55;6723:115;;;6805:22;;;6798:29;;;;;;6723:115;6854:32;6872:4;6878:7;6854:17;:32::i;10559:1396:20:-;10691:20;10713;10745:15;10916:324;10948:10;:13;;;10975:16;10981:9;10975:5;:16::i;:::-;11209:21;;;;:10;:21;:::i;:::-;10916:324;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;10916:18:20;;-1:-1:-1;;;10916:324:20:i;:::-;10892:348;;-1:-1:-1;10892:348:20;-1:-1:-1;11320:14:20;10892:348;11337:33;;2580:1;11337:33;;;2626:1;11337:33;11320:50;-1:-1:-1;11492:67:20;11507:17;;;;:10;:17;:::i;:::-;11526:7;11535:23;;;;:10;:23;:::i;11492:67::-;2803:22;11859:14;;11482:77;;-1:-1:-1;2803:22:20;-1:-1:-1;;;;;11859:14:20;:28;11855:93;;11907:14;;11889:59;;;;;-1:-1:-1;;;;;11907:14:20;;;;11889:41;;:59;;11931:7;;11940;;11889:59;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;11855:93;10735:1220;;;10559:1396;;;;;:::o;2393:391:12:-;-1:-1:-1;;;;;;;;;;;;;;;;;2614:8:12;-1:-1:-1;;;;;2614:14:12;;2646:86;;;;;;;;2662:7;2646:86;;;;;;2671:25;2688:7;2671:16;:25::i;:::-;2646:86;;;;2698:8;2646:86;;;;2708:8;2646:86;;;;2718:13;2646:86;;;;;2758:4;2614:163;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;2595:182;2393:391;-1:-1:-1;;;;;2393:391:12:o;4148:103:38:-;4214:30;4225:4;966:10:42;4214::38;:30::i;3674:178:43:-;2563:16;:14;:16::i;:::-;1270:23;3791:17;;;::::1;::::0;;3823:22:::1;966:10:42::0;3832:12:43::1;3823:22;::::0;-1:-1:-1;;;;;4264:55:60;;;4246:74;;4234:2;4219:18;3823:22:43::1;;;;;;;3722:130;3674:178::o:0;8996:208:41:-;-1:-1:-1;;;;;9066:21:41;;9062:91;;9110:32;;;;;9139:1;9110:32;;;4246:74:60;4219:18;;9110:32:41;4100:226:60;9062:91:41;9162:35;9178:1;9182:7;9191:5;9162:7;:35::i;9522:206::-;-1:-1:-1;;;;;9592:21:41;;9588:89;;9636:30;;;;;9663:1;9636:30;;;4246:74:60;4219:18;;9636:30:41;4100:226:60;9588:89:41;9686:35;9694:7;9711:1;9715:5;9686:7;:35::i;4599:312:40:-;4679:4;-1:-1:-1;;;;;4688:6:40;4671:23;;;:120;;;4785:6;-1:-1:-1;;;;;4749:42:40;:32;1327:66:49;2035:53;-1:-1:-1;;;;;2035:53:49;;1957:138;4749:32:40;-1:-1:-1;;;;;4749:42:40;;;4671:120;4654:251;;;4865:29;;;;;;;;;;;;;;4807:174:4;927:31:8;3898:28:0;966:10:42;4071:127:0;:::i;3898:28::-;3893:76;;3942:16;3953:4;3942:10;:16::i;6052:538:40:-;6169:17;-1:-1:-1;;;;;6151:50:40;;:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6151:52:40;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;6147:437;;6513:60;;;;;-1:-1:-1;;;;;4264:55:60;;6513:60:40;;;4246:74:60;4219:18;;6513:60:40;4100:226:60;6147:437:40;1327:66:49;6245:40:40;;6241:120;;6312:34;;;;;;;;4064:25:60;;;4037:18;;6312:34:40;3918:177:60;6241:120:40;6374:54;6404:17;6423:4;6374:29;:54::i;5028:213::-;5102:4;-1:-1:-1;;;;;5111:6:40;5094:23;;5090:145;;5195:29;;;;;;;;;;;;;;3743:112:20;6931:20:39;:18;:20::i;:::-;3822:26:20::1;3838:9;3822:15;:26::i;8461:175:0:-:0;2813:45;10360:33;;;;-1:-1:-1;;;;;10360:33:0;;;;;8590:39;;-1:-1:-1;;;;;8590:39:0;;;;;;;;8461:175;:::o;7483:1170:41:-;2359:20;-1:-1:-1;;;;;7625:18:41;;7621:546;;7779:5;7761:1;:14;;;:23;;;;;;;:::i;:::-;;;;-1:-1:-1;7621:546:41;;-1:-1:-1;7621:546:41;;-1:-1:-1;;;;;7837:17:41;;7815:19;7837:17;;;;;;;;;;;7872:19;;;7868:115;;;7918:50;;;;;-1:-1:-1;;;;;30777:55:60;;7918:50:41;;;30759:74:60;30849:18;;;30842:34;;;30892:18;;;30885:34;;;30732:18;;7918:50:41;30557:368:60;7868:115:41;-1:-1:-1;;;;;8103:17:41;;:11;:17;;;;;;;;;;8123:19;;;;8103:39;;7621:546;-1:-1:-1;;;;;8181:16:41;;8177:429;;8344:14;;;:23;;;;;;;8177:429;;;-1:-1:-1;;;;;8557:15:41;;:11;:15;;;;;;;;;;:24;;;;;;8177:429;8636:2;-1:-1:-1;;;;;8621:25:41;8630:4;-1:-1:-1;;;;;8621:25:41;;8640:5;8621:25;;;;4064::60;;4052:2;4037:18;;3918:177;8621:25:41;;;;;;;;7558:1095;7483:1170;;;:::o;3366:176:43:-;2316:19;:17;:19::i;:::-;1270:23;3484:16;;;::::1;3496:4;3484:16;::::0;;3515:20:::1;966:10:42::0;3522:12:43::1;887:96:42::0;2703:242:10;-1:-1:-1;;;;;2775:23:10;;2771:53;;2807:17;;;;;;;;;;;;;;2771:53;2851:18;:16;:18::i;:::-;-1:-1:-1;;;;;2838:31:10;:9;-1:-1:-1;;;;;2838:31:10;;2834:63;;2878:19;;;;;;;;;;;;;;5124:218:19;5210:18;5245:13;5256:1;5210:18;5245:8;;:13;:::i;:::-;5238:21;;;:::i;:::-;5231:29;;;-1:-1:-1;1003:1:19;5274:28;;5270:65;;5326:8;;5311:24;;;;;;;;;;;;:::i;3407:555:4:-;3547:20;3569:24;3644:44;3655:9;3666:12;3680:7;3644:10;:44::i;:::-;3609:79;;-1:-1:-1;3609:79:4;-1:-1:-1;3924:31:4;3930:10;3609:79;3924:5;:31::i;3543:766:12:-;3744:31;;:::i;:::-;3909:20;3932:26;3943:4;:14;;;3932:10;:26::i;:::-;3972:15;;;;3909:49;;-1:-1:-1;3972:19:12;3968:53;;3993:28;4005:4;:15;;;3993:11;:28::i;:::-;4051:8;-1:-1:-1;;;;;4051:13:12;;4073:12;4164:92;;;;;;;;4180:7;4164:92;;;;;;4189:25;4206:7;4189:16;:25::i;:::-;4164:92;;;;4216:8;4164:92;;;;4226:8;4164:92;;;;4254:1;4236:4;:15;;;:19;4164:92;;;;;4274:14;4051:251;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4032:270;3543:766;-1:-1:-1;;;;;;;3543:766:12:o;9642:374:0:-;2813:45;9708:59;9842:21;:19;:21::i;:::-;9823:40;-1:-1:-1;9873:47:0;2362:4:38;9905:14:0;7599:22;;-1:-1:-1;;;;;7599:22:0;;7405:223;9905:14;9873:11;:47::i;:::-;-1:-1:-1;9930:40:0;2362:4:38;9961:8:0;9930:10;:40::i;:::-;-1:-1:-1;;9980:29:0;;;;;;9642:374::o;5662:138:38:-;4824:7;4919:14;;;2920:28;4919:14;;;;;:24;;;3191:16;3202:4;3191:10;:16::i;:::-;5767:26:::1;5779:4;5785:7;5767:11;:26::i;2968:67:40:-:0;6931:20:39;:18;:20::i;2960:201:0:-;6931:20:39;:18;:20::i;:::-;3086:68:0::1;3134:19;3086:47;:68::i;1444:306:2:-:0;6931:20:39;:18;:20::i;:::-;1061:29:2;1681:28:::1;1694:5:::0;1701:7;1681:12:::1;:28::i;:::-;1719:24:::0;;;::::1;;::::0;;;::::1;::::0;;;::::1;::::0;;-1:-1:-1;;1444:306:2:o;1836:97:43:-;6931:20:39;:18;:20::i;:::-;1899:27:43::1;:25;:27::i;11224:487:41:-:0;2359:20;-1:-1:-1;;;;;11389:19:41;;11385:89;;11431:32;;;;;11460:1;11431:32;;;4246:74:60;4219:18;;11431:32:41;4100:226:60;11385:89:41;-1:-1:-1;;;;;11487:21:41;;11483:90;;11531:31;;;;;11559:1;11531:31;;;4246:74:60;4219:18;;11531:31:41;4100:226:60;11483:90:41;-1:-1:-1;;;;;11582:20:41;;;;;;;:13;;;:20;;;;;;;;:29;;;;;;;;;:37;;;11629:76;;;;11679:7;-1:-1:-1;;;;;11663:31:41;11672:5;-1:-1:-1;;;;;11663:31:41;;11688:5;11663:31;;;;4064:25:60;;4052:2;4037:18;;3918:177;11663:31:41;;;;;;;;11322:389;11224:487;;;;:::o;16206:172:20:-;16277:16;16350:21;16313:33;16350:21;16313:9;:33;:::i;:::-;16312:59;;;;:::i;1573:123:23:-;1633:7;1667:21;188:2;1633:7;1667:4;;:21;:::i;:::-;1659:30;;;:::i;1874:152::-;1936:6;1975:42;243:2;188;1975:4;;:42;:::i;:::-;1968:50;;;:::i;:::-;1961:58;;;1874:152;-1:-1:-1;;;1874:152:23:o;16602:139:20:-;16666:16;16701:33;16713:21;16701:33;;;;:::i;4297:369:4:-;4434:24;4516:21;4522:3;4527:9;4516:5;:21::i;:::-;-1:-1:-1;4650:9:4;;4297:369;-1:-1:-1;;4297:369:4:o;2186:130:23:-;2250:12;2281:28;:4;243:2;2281:4;;:28;:::i;:::-;2274:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2274:35:23;;2186:130;-1:-1:-1;;;;;;2186:130:23:o;640:284:22:-;824:17;877:6;885:7;894:9;905:11;860:57;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;853:64;;640:284;;;;;;:::o;2219:275:2:-;-1:-1:-1;;;;;2057:19:1;;1976:30;2057:19;;;992:28;2057:19;;;;;;;;;2384:4:2;;992:28:1;2057:19;;2053:56;;;2085:24;;;;;-1:-1:-1;;;;;4264:55:60;;2085:24:1;;;4246:74:60;4219:18;;2085:24:1;4100:226:60;2053:56:1;-1:-1:-1;;;;;2057:19:1;::::1;1976:30;2057:19:::0;;;992:28;2057:19:::1;::::0;;;;;;;;2417:2:2;;992:28:1;2057:19:::1;;2053:56;;;2085:24;::::0;::::1;::::0;;-1:-1:-1;;;;;4264:55:60;;2085:24:1::1;::::0;::::1;4246:74:60::0;4219:18;;2085:24:1::1;4100:226:60::0;2053:56:1::1;2316:19:43::2;:17;:19::i;:::-;2457:30:2::3;2471:4;2477:2;2481:5;2457:13;:30::i;5907:509:0:-:0;6015:4;2813:45;6150:4;6146:216;;6222:1;6196:14;7599:22;;-1:-1:-1;;;;;7599:22:0;;7405:223;6196:14;-1:-1:-1;;;;;6196:28:0;;6192:114;;6251:40;;;;;;;;;;;;;;6192:114;6319:22;;;:32;;;;-1:-1:-1;;;;;6319:32:0;;;;;6146:216;6378:31;6395:4;6401:7;6378:16;:31::i;7892:388:38:-;7970:4;3901:14;;;2920:28;3901:14;;;;;;;;-1:-1:-1;;;;;3901:31:38;;;;;;;;;;;;8055:219;;;8131:5;8097:14;;;;;;;;;;;-1:-1:-1;;;;;8097:31:38;;;;;;;;;;:39;;;;;;8155:40;966:10:42;;8097:14:38;;8155:40;;8131:5;8155:40;8216:4;8209:11;;;;;8055:219;8258:5;8251:12;;;;;16965:147:20;17030:15;17071:33;17083:21;17071:9;:33;:::i;598:506:23:-;791:18;;732:17;;791:22;;;934:163;;1074:7;1083:13;1057:40;;;;;;;;36623:19:60;;;36680:3;36676:16;36694:66;36672:89;36667:2;36658:12;;36651:111;36787:2;36778:12;;36468:328;1057:40:23;;;;;;;;;;;;;934:163;;;976:7;985:13;1017:10;1030:11;959:83;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;934:163;927:170;;598:506;;;;;;:::o;4381:197:38:-;3809:4;3901:14;;;2920:28;3901:14;;;;;;;;-1:-1:-1;;;;;3901:31:38;;;;;;;;;;;;4464:108;;4514:47;;;;;-1:-1:-1;;;;;37568:55:60;;4514:47:38;;;37550:74:60;37640:18;;;37633:34;;;37523:18;;4514:47:38;37376:297:60;3105:126:43;3168:8;:6;:8::i;:::-;3163:62;;3199:15;;;;;;;;;;;;;;2779:335:49;2870:37;2889:17;2870:18;:37::i;:::-;2922:27;;-1:-1:-1;;;;;2922:27:49;;;;;;;;2964:11;;:15;2960:148;;2995:53;3024:17;3043:4;2995:28;:53::i;2960:148::-;3079:18;:16;:18::i;7084:141:39:-;8870:21;8560:40;;;;;;7146:73;;7191:17;;;;;;;;;;;;;;1890:123:10;6931:20:39;:18;:20::i;:::-;1970:36:10::1;1996:9;1970:25;:36::i;2905:128:43:-:0;2970:8;:6;:8::i;:::-;2966:61;;;3001:15;;;;;;;;;;;;;;5005:191:12;5071:17;5117:10;5104:9;:23;5100:62;;5136:26;;;;;5152:9;5136:26;;;4064:25:60;4037:18;;5136:26:12;3918:177:60;5100:62:12;-1:-1:-1;5179:10:12;5005:191::o;5573:410::-;5726:15;5744:8;-1:-1:-1;;;;;5744:16:12;;:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;5726:36;-1:-1:-1;;;;;;5776:21:12;;5772:54;;5806:20;;;;;;;;;;;;;;5772:54;5900:76;-1:-1:-1;;;;;5900:32:12;;5933:10;5953:8;5964:11;5900:32;:76::i;3167:318:0:-;6931:20:39;:18;:20::i;:::-;-1:-1:-1;;;;;3307:33:0;::::1;3303:115;;3363:44;::::0;::::1;::::0;;3404:1:::1;3363:44;::::0;::::1;4246:74:60::0;4219:18;;3363:44:0::1;4100:226:60::0;3303:115:0::1;3427:51;2362:4:38;3458:19:0::0;3427:10:::1;:51::i;2577:147:41:-:0;6931:20:39;:18;:20::i;:::-;2679:38:41::1;2702:5;2709:7;2679:22;:38::i;1939:156:43:-:0;6931:20:39;:18;:20::i;:::-;1270:23:43;2071:17;;;::::1;::::0;;1939:156::o;7270:387:38:-;7347:4;3901:14;;;2920:28;3901:14;;;;;;;;-1:-1:-1;;;;;3901:31:38;;;;;;;;;;;;7432:219;;7475:8;:14;;;;;;;;;;;-1:-1:-1;;;;;7475:31:38;;;;;;;;;:38;;;;7509:4;7475:38;;;7559:12;966:10:42;;887:96;7559:12:38;-1:-1:-1;;;;;7532:40:38;7550:7;-1:-1:-1;;;;;7532:40:38;7544:4;7532:40;;;;;;;;;;7593:4;7586:11;;;;;2186:281:49;2263:17;-1:-1:-1;;;;;2263:29:49;;2296:1;2263:34;2259:119;;2320:47;;;;;-1:-1:-1;;;;;4264:55:60;;2320:47:49;;;4246:74:60;4219:18;;2320:47:49;4100:226:60;2259:119:49;1327:66;2387:73;;;;-1:-1:-1;;;;;2387:73:49;;;;;;;;;;2186:281::o;4106:253:55:-;4189:12;4214;4228:23;4255:6;-1:-1:-1;;;;;4255:19:55;4275:4;4255:25;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4213:67;;;;4297:55;4324:6;4332:7;4341:10;4297:26;:55::i;6598:122:49:-;6648:9;:13;6644:70;;6684:19;;;;;;;;;;;;;;2019:128:10;6931:20:39;:18;:20::i;1702:188:54:-;1829:53;;;-1:-1:-1;;;;;38251:15:60;;;1829:53:54;;;38233:34:60;38303:15;;38283:18;;;38276:43;38335:18;;;;38328:34;;;1829:53:54;;;;;;;;;;38145:18:60;;;;1829:53:54;;;;;;;;;;;;;;1802:81;;1822:5;;1802:19;:81::i;2730:216:41:-;6931:20:39;:18;:20::i;:::-;2359::41;2895:7;:15:::1;2905:5:::0;2895:7;:15:::1;:::i;:::-;-1:-1:-1::0;2920:9:41::1;::::0;::::1;:19;2932:7:::0;2920:9;:19:::1;:::i;4625:582:55:-:0;4769:12;4798:7;4793:408;;4821:19;4829:10;4821:7;:19::i;:::-;4793:408;;;5045:17;;:22;:49;;;;-1:-1:-1;;;;;;5071:18:55;;;:23;5045:49;5041:119;;;5121:24;;;;;-1:-1:-1;;;;;4264:55:60;;5121:24:55;;;4246:74:60;4219:18;;5121:24:55;4100:226:60;5041:119:55;-1:-1:-1;5180:10:55;5173:17;;4059:629:54;4478:23;4504:33;-1:-1:-1;;;;;4504:27:54;;4532:4;4504:27;:33::i;:::-;4478:59;;4551:10;:17;4572:1;4551:22;;:57;;;;;4589:10;4578:30;;;;;;;;;;;;:::i;:::-;4577:31;4551:57;4547:135;;;4631:40;;;;;-1:-1:-1;;;;;4264:55:60;;4631:40:54;;;4246:74:60;4219:18;;4631:40:54;4100:226:60;5743:516:55;5874:17;;:21;5870:383;;6102:10;6096:17;6158:15;6145:10;6141:2;6137:19;6130:44;5870:383;6225:17;;;;;;;;;;;;;;2705:151;2780:12;2811:38;2833:6;2841:4;2847:1;2780:12;3421;3435:23;3462:6;-1:-1:-1;;;;;3462:11:55;3481:5;3488:4;3462:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3420:73;;;;3510:55;3537:6;3545:7;3554:10;3510:26;:55::i;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;14:332:60:-;72:6;125:2;113:9;104:7;100:23;96:32;93:52;;;141:1;138;131:12;93:52;180:9;167:23;230:66;223:5;219:78;212:5;209:89;199:117;;312:1;309;302:12;543:250;628:1;638:113;652:6;649:1;646:13;638:113;;;728:11;;;722:18;709:11;;;702:39;674:2;667:10;638:113;;;-1:-1:-1;;785:1:60;767:16;;760:27;543:250::o;798:330::-;840:3;878:5;872:12;905:6;900:3;893:19;921:76;990:6;983:4;978:3;974:14;967:4;960:5;956:16;921:76;:::i;:::-;1042:2;1030:15;1047:66;1026:88;1017:98;;;;1117:4;1013:109;;798:330;-1:-1:-1;;798:330:60:o;1133:220::-;1282:2;1271:9;1264:21;1245:4;1302:45;1343:2;1332:9;1328:18;1320:6;1302:45;:::i;1358:154::-;-1:-1:-1;;;;;1437:5:60;1433:54;1426:5;1423:65;1413:93;;1502:1;1499;1492:12;1517:315;1585:6;1593;1646:2;1634:9;1625:7;1621:23;1617:32;1614:52;;;1662:1;1659;1652:12;1614:52;1701:9;1688:23;1720:31;1745:5;1720:31;:::i;:::-;1770:5;1822:2;1807:18;;;;1794:32;;-1:-1:-1;;;1517:315:60:o;1837:158::-;1899:5;1944:3;1935:6;1930:3;1926:16;1922:26;1919:46;;;1961:1;1958;1951:12;1919:46;-1:-1:-1;1983:6:60;1837:158;-1:-1:-1;1837:158:60:o;2000:360::-;2088:6;2141:2;2129:9;2120:7;2116:23;2112:32;2109:52;;;2157:1;2154;2147:12;2109:52;2197:9;2184:23;2230:18;2222:6;2219:30;2216:50;;;2262:1;2259;2252:12;2216:50;2285:69;2346:7;2337:6;2326:9;2322:22;2285:69;:::i;2519:1394::-;2439:12;;2427:25;;2501:4;2490:16;;;2484:23;2468:14;;;2461:47;2885:4;2933:3;2918:19;;3010:2;3048:3;3043:2;3032:9;3028:18;3021:31;3072:6;3107;3101:13;3138:6;3130;3123:22;3176:3;3165:9;3161:19;3154:26;;3239:3;3229:6;3226:1;3222:14;3211:9;3207:30;3203:40;3189:54;;3262:4;3301;3293:6;3289:17;3324:1;3334:487;3348:6;3345:1;3342:13;3334:487;;;3413:22;;;3437:66;3409:95;3397:108;;3528:13;;3569:9;;3554:25;;3618:11;;3612:18;3650:15;;;3643:27;;;3693:48;3725:15;;;3612:18;3693:48;:::i;:::-;3683:58;-1:-1:-1;;3799:12:60;;;;3764:15;;;;3370:1;3363:9;3334:487;;;-1:-1:-1;;2439:12:60;;3903:2;3888:18;;2427:25;-1:-1:-1;;;2501:4:60;2490:16;;2484:23;2468:14;;;2461:47;-1:-1:-1;3838:6:60;-1:-1:-1;3853:54:60;2365:149;4331:154;4390:5;4435:2;4426:6;4421:3;4417:16;4413:25;4410:45;;;4451:1;4448;4441:12;4490:347;4541:8;4551:6;4605:3;4598:4;4590:6;4586:17;4582:27;4572:55;;4623:1;4620;4613:12;4572:55;-1:-1:-1;4646:20:60;;4689:18;4678:30;;4675:50;;;4721:1;4718;4711:12;4675:50;4758:4;4750:6;4746:17;4734:29;;4810:3;4803:4;4794:6;4786;4782:19;4778:30;4775:39;4772:59;;;4827:1;4824;4817:12;4772:59;4490:347;;;;;:::o;4842:1048::-;4985:6;4993;5001;5009;5017;5025;5033;5086:3;5074:9;5065:7;5061:23;5057:33;5054:53;;;5103:1;5100;5093:12;5054:53;5126;5171:7;5160:9;5126:53;:::i;:::-;5116:63;;5226:2;5215:9;5211:18;5198:32;5188:42;;5281:3;5270:9;5266:19;5253:33;5305:18;5346:2;5338:6;5335:14;5332:34;;;5362:1;5359;5352:12;5332:34;5401:58;5451:7;5442:6;5431:9;5427:22;5401:58;:::i;:::-;5478:8;;-1:-1:-1;5375:84:60;-1:-1:-1;5563:3:60;5548:19;;5535:33;;-1:-1:-1;5577:31:60;5535:33;5577:31;:::i;:::-;5627:5;;-1:-1:-1;5685:3:60;5670:19;;5657:33;;5702:16;;;5699:36;;;5731:1;5728;5721:12;5699:36;;5770:60;5822:7;5811:8;5800:9;5796:24;5770:60;:::i;:::-;4842:1048;;;;-1:-1:-1;4842:1048:60;;-1:-1:-1;4842:1048:60;;;;5744:86;;-1:-1:-1;;;4842:1048:60:o;6739:456::-;6816:6;6824;6832;6885:2;6873:9;6864:7;6860:23;6856:32;6853:52;;;6901:1;6898;6891:12;6853:52;6940:9;6927:23;6959:31;6984:5;6959:31;:::i;:::-;7009:5;-1:-1:-1;7066:2:60;7051:18;;7038:32;7079:33;7038:32;7079:33;:::i;:::-;6739:456;;7131:7;;-1:-1:-1;;;7185:2:60;7170:18;;;;7157:32;;6739:456::o;7200:180::-;7259:6;7312:2;7300:9;7291:7;7287:23;7283:32;7280:52;;;7328:1;7325;7318:12;7280:52;-1:-1:-1;7351:23:60;;7200:180;-1:-1:-1;7200:180:60:o;7567:315::-;7635:6;7643;7696:2;7684:9;7675:7;7671:23;7667:32;7664:52;;;7712:1;7709;7702:12;7664:52;7748:9;7735:23;7725:33;;7808:2;7797:9;7793:18;7780:32;7821:31;7846:5;7821:31;:::i;:::-;7871:5;7861:15;;;7567:315;;;;;:::o;8076:163::-;8143:20;;8203:10;8192:22;;8182:33;;8172:61;;8229:1;8226;8219:12;8172:61;8076:163;;;:::o;8244:252::-;8311:6;8319;8372:2;8360:9;8351:7;8347:23;8343:32;8340:52;;;8388:1;8385;8378:12;8340:52;8411:28;8429:9;8411:28;:::i;8501:118::-;8587:5;8580:13;8573:21;8566:5;8563:32;8553:60;;8609:1;8606;8599:12;8624:489;8718:6;8726;8779:2;8767:9;8758:7;8754:23;8750:32;8747:52;;;8795:1;8792;8785:12;8747:52;8835:9;8822:23;8868:18;8860:6;8857:30;8854:50;;;8900:1;8897;8890:12;8854:50;8923:69;8984:7;8975:6;8964:9;8960:22;8923:69;:::i;:::-;8913:79;;;9042:2;9031:9;9027:18;9014:32;9055:28;9077:5;9055:28;:::i;9118:257::-;2439:12;;2427:25;;2501:4;2490:16;;;2484:23;2468:14;;;2461:47;9312:2;9297:18;;9324:45;2365:149;9565:184;9617:77;9614:1;9607:88;9714:4;9711:1;9704:15;9738:4;9735:1;9728:15;9754:251;9826:2;9820:9;;;9856:15;;9901:18;9886:34;;9922:22;;;9883:62;9880:88;;;9948:18;;:::i;:::-;9984:2;9977:22;9754:251;:::o;10010:334::-;10081:2;10075:9;10137:2;10127:13;;10142:66;10123:86;10111:99;;10240:18;10225:34;;10261:22;;;10222:62;10219:88;;;10287:18;;:::i;:::-;10323:2;10316:22;10010:334;;-1:-1:-1;10010:334:60:o;10349:245::-;10397:4;10430:18;10422:6;10419:30;10416:56;;;10452:18;;:::i;:::-;-1:-1:-1;10509:2:60;10497:15;10514:66;10493:88;10583:4;10489:99;;10349:245::o;10599:336::-;10663:5;10692:52;10708:35;10736:6;10708:35;:::i;:::-;10692:52;:::i;:::-;10683:61;;10767:6;10760:5;10753:21;10807:3;10798:6;10793:3;10789:16;10786:25;10783:45;;;10824:1;10821;10814:12;10783:45;10873:6;10868:3;10861:4;10854:5;10850:16;10837:43;10927:1;10920:4;10911:6;10904:5;10900:18;10896:29;10889:40;10599:336;;;;;:::o;10940:584::-;11017:6;11025;11078:2;11066:9;11057:7;11053:23;11049:32;11046:52;;;11094:1;11091;11084:12;11046:52;11133:9;11120:23;11152:31;11177:5;11152:31;:::i;:::-;11202:5;-1:-1:-1;11258:2:60;11243:18;;11230:32;11285:18;11274:30;;11271:50;;;11317:1;11314;11307:12;11271:50;11340:22;;11393:4;11385:13;;11381:27;-1:-1:-1;11371:55:60;;11422:1;11419;11412:12;11371:55;11445:73;11510:7;11505:2;11492:16;11487:2;11483;11479:11;11445:73;:::i;:::-;11435:83;;;10940:584;;;;;:::o;11529:159::-;11596:20;;11656:6;11645:18;;11635:29;;11625:57;;11678:1;11675;11668:12;11693:256;11759:6;11767;11820:2;11808:9;11799:7;11795:23;11791:32;11788:52;;;11836:1;11833;11826:12;11788:52;11859:28;11877:9;11859:28;:::i;:::-;11849:38;;11906:37;11939:2;11928:9;11924:18;11906:37;:::i;:::-;11896:47;;11693:256;;;;;:::o;12177:247::-;12236:6;12289:2;12277:9;12268:7;12264:23;12260:32;12257:52;;;12305:1;12302;12295:12;12257:52;12344:9;12331:23;12363:31;12388:5;12363:31;:::i;12892:395::-;12983:8;12993:6;13047:3;13040:4;13032:6;13028:17;13024:27;13014:55;;13065:1;13062;13055:12;13014:55;-1:-1:-1;13088:20:60;;13131:18;13120:30;;13117:50;;;13163:1;13160;13153:12;13117:50;13200:4;13192:6;13188:17;13176:29;;13260:3;13253:4;13243:6;13240:1;13236:14;13228:6;13224:27;13220:38;13217:47;13214:67;;;13277:1;13274;13267:12;13292:504;13417:6;13425;13478:2;13466:9;13457:7;13453:23;13449:32;13446:52;;;13494:1;13491;13484:12;13446:52;13534:9;13521:23;13567:18;13559:6;13556:30;13553:50;;;13599:1;13596;13589:12;13553:50;13638:98;13728:7;13719:6;13708:9;13704:22;13638:98;:::i;:::-;13755:8;;13612:124;;-1:-1:-1;13292:504:60;-1:-1:-1;;;;13292:504:60:o;13801:184::-;13859:6;13912:2;13900:9;13891:7;13887:23;13883:32;13880:52;;;13928:1;13925;13918:12;13880:52;13951:28;13969:9;13951:28;:::i;13990:553::-;14076:6;14084;14092;14100;14153:2;14141:9;14132:7;14128:23;14124:32;14121:52;;;14169:1;14166;14159:12;14121:52;14192:28;14210:9;14192:28;:::i;:::-;14182:38;;14239:37;14272:2;14261:9;14257:18;14239:37;:::i;:::-;14229:47;;14327:2;14316:9;14312:18;14299:32;14354:18;14346:6;14343:30;14340:50;;;14386:1;14383;14376:12;14340:50;14425:58;14475:7;14466:6;14455:9;14451:22;14425:58;:::i;:::-;13990:553;;;;-1:-1:-1;14502:8:60;-1:-1:-1;;;;13990:553:60:o;15051:716::-;15189:6;15197;15205;15249:9;15240:7;15236:23;15279:3;15275:2;15271:12;15268:32;;;15296:1;15293;15286:12;15268:32;15336:9;15323:23;15369:18;15361:6;15358:30;15355:50;;;15401:1;15398;15391:12;15355:50;15424:69;15485:7;15476:6;15465:9;15461:22;15424:69;:::i;:::-;15414:79;;;15586:2;15517:66;15513:2;15509:75;15505:84;15502:104;;;15602:1;15599;15592:12;15502:104;;15640:2;15629:9;15625:18;15615:28;;15693:2;15682:9;15678:18;15665:32;15706:31;15731:5;15706:31;:::i;:::-;15756:5;15746:15;;;15051:716;;;;;:::o;15772:613::-;16016:4;16058:3;16047:9;16043:19;16035:27;;16095:6;16089:13;16078:9;16071:32;16171:18;16163:4;16155:6;16151:17;16145:24;16141:49;16134:4;16123:9;16119:20;16112:79;16238:4;16230:6;16226:17;16220:24;16253:62;16309:4;16298:9;16294:20;16280:12;2439;;2427:25;;2501:4;2490:16;;;2484:23;2468:14;;2461:47;2365:149;16253:62;-1:-1:-1;2439:12:60;;16374:3;16359:19;;2427:25;2501:4;2490:16;;2484:23;2468:14;;;2461:47;16324:55;2365:149;16390:388;16458:6;16466;16519:2;16507:9;16498:7;16494:23;16490:32;16487:52;;;16535:1;16532;16525:12;16487:52;16574:9;16561:23;16593:31;16618:5;16593:31;:::i;:::-;16643:5;-1:-1:-1;16700:2:60;16685:18;;16672:32;16713:33;16672:32;16713:33;:::i;16783:221::-;16826:5;16879:3;16872:4;16864:6;16860:17;16856:27;16846:55;;16897:1;16894;16887:12;16846:55;16919:79;16994:3;16985:6;16972:20;16965:4;16957:6;16953:17;16919:79;:::i;17009:844::-;17113:6;17121;17129;17137;17190:3;17178:9;17169:7;17165:23;17161:33;17158:53;;;17207:1;17204;17197:12;17158:53;17246:9;17233:23;17265:31;17290:5;17265:31;:::i;:::-;17315:5;-1:-1:-1;17371:2:60;17356:18;;17343:32;17394:18;17424:14;;;17421:34;;;17451:1;17448;17441:12;17421:34;17474:50;17516:7;17507:6;17496:9;17492:22;17474:50;:::i;:::-;17464:60;;17577:2;17566:9;17562:18;17549:32;17533:48;;17606:2;17596:8;17593:16;17590:36;;;17622:1;17619;17612:12;17590:36;;17645:52;17689:7;17678:8;17667:9;17663:24;17645:52;:::i;:::-;17635:62;;;17749:2;17738:9;17734:18;17721:32;17797:4;17788:7;17784:18;17775:7;17772:31;17762:59;;17817:1;17814;17807:12;17762:59;17009:844;;;;-1:-1:-1;17009:844:60;;-1:-1:-1;;17009:844:60:o;17858:236::-;17943:6;17996:2;17984:9;17975:7;17971:23;17967:32;17964:52;;;18012:1;18009;18002:12;17964:52;18035:53;18080:7;18069:9;18035:53;:::i;18099:437::-;18178:1;18174:12;;;;18221;;;18242:61;;18296:4;18288:6;18284:17;18274:27;;18242:61;18349:2;18341:6;18338:14;18318:18;18315:38;18312:218;;18386:77;18383:1;18376:88;18487:4;18484:1;18477:15;18515:4;18512:1;18505:15;18809:251;18879:6;18932:2;18920:9;18911:7;18907:23;18903:32;18900:52;;;18948:1;18945;18938:12;18900:52;18980:9;18974:16;18999:31;19024:5;18999:31;:::i;19065:184::-;19117:77;19114:1;19107:88;19214:4;19211:1;19204:15;19238:4;19235:1;19228:15;19254:395;19359:4;19417:11;19404:25;19507:66;19496:8;19480:14;19476:29;19472:102;19452:18;19448:127;19438:155;;19589:1;19586;19579:12;19438:155;19610:33;;;;;19254:395;-1:-1:-1;;19254:395:60:o;19654:580::-;19731:4;19737:6;19797:11;19784:25;19887:66;19876:8;19860:14;19856:29;19852:102;19832:18;19828:127;19818:155;;19969:1;19966;19959:12;19818:155;19996:33;;20048:20;;;-1:-1:-1;20091:18:60;20080:30;;20077:50;;;20123:1;20120;20113:12;20077:50;20156:4;20144:17;;-1:-1:-1;20187:14:60;20183:27;;;20173:38;;20170:58;;;20224:1;20221;20214:12;20239:184;20297:6;20350:2;20338:9;20329:7;20325:23;20321:32;20318:52;;;20366:1;20363;20356:12;20318:52;20389:28;20407:9;20389:28;:::i;20553:517::-;20654:2;20649:3;20646:11;20643:421;;;20690:5;20687:1;20680:16;20734:4;20731:1;20721:18;20804:2;20792:10;20788:19;20785:1;20781:27;20775:4;20771:38;20840:4;20828:10;20825:20;20822:47;;;-1:-1:-1;20863:4:60;20822:47;20918:2;20913:3;20909:12;20906:1;20902:20;20896:4;20892:31;20882:41;;20973:81;20991:2;20984:5;20981:13;20973:81;;;21050:1;21036:16;;21017:1;21006:13;20973:81;;21306:1313;21428:18;21423:3;21420:27;21417:53;;;21450:18;;:::i;:::-;21479:93;21568:3;21528:38;21560:4;21554:11;21528:38;:::i;:::-;21522:4;21479:93;:::i;:::-;21598:1;21623:2;21618:3;21615:11;21640:1;21635:726;;;;22405:1;22422:3;22419:93;;;-1:-1:-1;22478:19:60;;;22465:33;22419:93;21212:66;21203:1;21199:11;;;21195:84;21191:89;21181:100;21287:1;21283:11;;;21178:117;22525:78;;21608:1005;;21635:726;20500:1;20493:14;;;20537:4;20524:18;;21680:66;21671:76;;;21844:229;21858:7;21855:1;21852:14;21844:229;;;21947:19;;;21934:33;21919:49;;22054:4;22039:20;;;;22007:1;21995:14;;;;21874:12;21844:229;;;21848:3;22101;22092:7;22089:16;22086:219;;;22221:66;22215:3;22209;22206:1;22202:11;22198:21;22194:94;22190:99;22177:9;22172:3;22168:19;22155:33;22151:139;22143:6;22136:155;22086:219;;;22348:1;22342:3;22339:1;22335:11;22331:19;22325:4;22318:33;21608:1005;;21306:1313;;;:::o;22624:325::-;22712:6;22707:3;22700:19;22764:6;22757:5;22750:4;22745:3;22741:14;22728:43;;22816:1;22809:4;22800:6;22795:3;22791:16;22787:27;22780:38;22682:3;22938:4;22868:66;22863:2;22855:6;22851:15;22847:88;22842:3;22838:98;22834:109;22827:116;;22624:325;;;;:::o;22954:1951::-;23211:2;23263:21;;;23236:18;;;23319:22;;;23182:4;;23360:2;23378:18;;;23442:1;23438:14;;;23423:30;;23419:39;;23481:6;23182:4;23515:1361;23529:6;23526:1;23523:13;23515:1361;;;23618:66;23606:9;23598:6;23594:22;23590:95;23585:3;23578:108;23738:6;23725:20;23825:66;23816:6;23800:14;23796:27;23792:100;23772:18;23768:125;23758:153;;23907:1;23904;23897:12;23758:153;23937:31;;23991:4;24053:10;24027:24;23937:31;24027:24;:::i;:::-;24023:41;24015:6;24008:57;24141:6;24106:33;24135:2;24128:5;24124:14;24106:33;:::i;:::-;24102:46;24097:2;24089:6;24085:15;24078:71;24214:2;24207:5;24203:14;24190:28;24299:66;24291:5;24275:14;24271:26;24267:99;24245:20;24241:126;24231:154;;24381:1;24378;24371:12;24231:154;24413:32;;;24521:16;;;;-1:-1:-1;24472:21:60;24564:18;24553:30;;24550:50;;;24596:1;24593;24586:12;24550:50;24649:6;24633:14;24629:27;24620:7;24616:41;24613:61;;;24670:1;24667;24660:12;24613:61;24711:2;24706;24698:6;24694:15;24687:27;24737:59;24792:2;24784:6;24780:15;24772:6;24763:7;24737:59;:::i;:::-;24854:12;;;;24727:69;-1:-1:-1;;;24819:15:60;;;;-1:-1:-1;23551:1:60;23544:9;23515:1361;;;-1:-1:-1;24893:6:60;;22954:1951;-1:-1:-1;;;;;;;;22954:1951:60:o;24910:331::-;25015:9;25026;25068:8;25056:10;25053:24;25050:44;;;25090:1;25087;25080:12;25050:44;25119:6;25109:8;25106:20;25103:40;;;25139:1;25136;25129:12;25103:40;-1:-1:-1;;25165:23:60;;;25210:25;;;;;-1:-1:-1;24910:331:60:o;25246:476::-;25437:3;25475:6;25469:13;25491:66;25550:6;25545:3;25538:4;25530:6;25526:17;25491:66;:::i;:::-;25579:16;;25632:6;25624;25579:16;25604:35;25696:1;25658:18;;25685:13;;;-1:-1:-1;25658:18:60;;25246:476;-1:-1:-1;;;25246:476:60:o;25727:244::-;25884:2;25873:9;25866:21;25847:4;25904:61;25961:2;25950:9;25946:18;25938:6;25930;25904:61;:::i;25976:389::-;26075:4;26133:11;26120:25;26223:66;26212:8;26196:14;26192:29;26188:102;26168:18;26164:127;26154:155;;26305:1;26302;26295:12;26370:129;26455:18;26448:5;26444:30;26437:5;26434:41;26424:69;;26489:1;26486;26479:12;26504:1015;26882:10;26855:25;26873:6;26855:25;:::i;:::-;26851:42;26840:9;26833:61;26957:4;26949:6;26945:17;26932:31;26925:4;26914:9;26910:20;26903:61;26814:4;27011;27003:6;26999:17;26986:31;27026:30;27050:5;27026:30;:::i;:::-;27105:18;27098:5;27094:30;27087:4;27076:9;27072:20;27065:60;;27161:6;27156:2;27145:9;27141:18;27134:34;27205:3;27199;27188:9;27184:19;27177:32;27232:62;27289:3;27278:9;27274:19;27266:6;27258;27232:62;:::i;:::-;-1:-1:-1;;;;;27335:6:60;27331:55;27325:3;27314:9;27310:19;27303:84;27436:9;27428:6;27424:22;27418:3;27407:9;27403:19;27396:51;27464:49;27506:6;27498;27490;27464:49;:::i;:::-;27456:57;26504:1015;-1:-1:-1;;;;;;;;;;26504:1015:60:o;27524:647::-;27603:6;27656:2;27644:9;27635:7;27631:23;27627:32;27624:52;;;27672:1;27669;27662:12;27624:52;27705:9;27699:16;27738:18;27730:6;27727:30;27724:50;;;27770:1;27767;27760:12;27724:50;27793:22;;27846:4;27838:13;;27834:27;-1:-1:-1;27824:55:60;;27875:1;27872;27865:12;27824:55;27904:2;27898:9;27929:48;27945:31;27973:2;27945:31;:::i;27929:48::-;28000:2;27993:5;27986:17;28040:7;28035:2;28030;28026;28022:11;28018:20;28015:33;28012:53;;;28061:1;28058;28051:12;28012:53;28074:67;28138:2;28133;28126:5;28122:14;28117:2;28113;28109:11;28074:67;:::i;28176:348::-;28265:6;28318:2;28306:9;28297:7;28293:23;28289:32;28286:52;;;28334:1;28331;28324:12;28286:52;28360:22;;:::i;:::-;28418:9;28405:23;28398:5;28391:38;28489:2;28478:9;28474:18;28461:32;28456:2;28449:5;28445:14;28438:56;28513:5;28503:15;;;28176:348;;;;:::o;29532:245::-;29590:6;29643:2;29631:9;29622:7;29618:23;29614:32;29611:52;;;29659:1;29656;29649:12;29611:52;29698:9;29685:23;29717:30;29741:5;29717:30;:::i;29782:502::-;-1:-1:-1;;;;;30024:6:60;30020:55;30009:9;30002:74;30112:6;30107:2;30096:9;30092:18;30085:34;30167:6;30159;30155:19;30150:2;30139:9;30135:18;30128:47;30211:3;30206:2;30195:9;30191:18;30184:31;29983:4;30232:46;30273:3;30262:9;30258:19;30250:6;30232:46;:::i;30930:379::-;31123:2;31112:9;31105:21;31086:4;31149:45;31190:2;31179:9;31175:18;31167:6;31149:45;:::i;:::-;31242:9;31234:6;31230:22;31225:2;31214:9;31210:18;31203:50;31270:33;31296:6;31288;31270:33;:::i;31314:245::-;31381:6;31434:2;31422:9;31413:7;31409:23;31405:32;31402:52;;;31450:1;31447;31440:12;31402:52;31482:9;31476:16;31501:28;31523:5;31501:28;:::i;31564:973::-;31787:2;31776:9;31769:21;31845:10;31836:6;31830:13;31826:30;31821:2;31810:9;31806:18;31799:58;31911:4;31903:6;31899:17;31893:24;31888:2;31877:9;31873:18;31866:52;31750:4;31965:2;31957:6;31953:15;31947:22;32006:4;32000:3;31989:9;31985:19;31978:33;32034:52;32081:3;32070:9;32066:19;32052:12;32034:52;:::i;:::-;32020:66;;32135:2;32127:6;32123:15;32117:22;32205:66;32193:9;32185:6;32181:22;32177:95;32170:4;32159:9;32155:20;32148:125;32296:41;32330:6;32314:14;32296:41;:::i;:::-;32406:3;32394:16;;;;32388:23;32381:31;32374:39;32368:3;32353:19;;32346:68;-1:-1:-1;;;;;;;;32475:55:60;;;;32468:4;32453:20;;;32446:85;32282:55;31564:973::o;32542:284::-;32612:5;32660:4;32648:9;32643:3;32639:19;32635:30;32632:50;;;32678:1;32675;32668:12;32632:50;32700:22;;:::i;:::-;32691:31;;32751:9;32745:16;32738:5;32731:31;32815:2;32804:9;32800:18;32794:25;32789:2;32782:5;32778:14;32771:49;32542:284;;;;:::o;32831:259::-;32931:6;32984:2;32972:9;32963:7;32959:23;32955:32;32952:52;;;33000:1;32997;32990:12;32952:52;33023:61;33076:7;33065:9;33023:61;:::i;33095:184::-;33165:6;33218:2;33206:9;33197:7;33193:23;33189:32;33186:52;;;33234:1;33231;33224:12;33186:52;-1:-1:-1;33257:16:60;;33095:184;-1:-1:-1;33095:184:60:o;33284:::-;33336:77;33333:1;33326:88;33433:4;33430:1;33423:15;33457:4;33454:1;33447:15;33473:125;33538:9;;;33559:10;;;33556:36;;;33572:18;;:::i;33603:369::-;33761:66;33723:19;;33845:11;;;;33876:1;33868:10;;33865:101;;;33953:2;33947;33940:3;33937:1;33933:11;33930:1;33926:19;33922:28;33918:2;33914:37;33910:46;33901:55;;33865:101;;;33603:369;;;;:::o;33977:683::-;34081:6;34134:3;34122:9;34113:7;34109:23;34105:33;34102:53;;;34151:1;34148;34141:12;34102:53;34184:2;34178:9;34226:4;34218:6;34214:17;34297:6;34285:10;34282:22;34261:18;34249:10;34246:34;34243:62;34240:88;;;34308:18;;:::i;:::-;34344:2;34337:22;34383:16;;34368:32;;34443:2;34428:18;;34422:25;34456:30;34422:25;34456:30;:::i;:::-;34514:2;34502:15;;34495:30;34558:70;34620:7;34615:2;34600:18;;34558:70;:::i;:::-;34553:2;34541:15;;34534:95;34545:6;33977:683;-1:-1:-1;;;33977:683:60:o;34665:274::-;34705:1;34731;34721:189;;34766:77;34763:1;34756:88;34867:4;34864:1;34857:15;34895:4;34892:1;34885:15;34721:189;-1:-1:-1;34924:9:60;;34665:274::o;34944:168::-;35017:9;;;35048;;35065:15;;;35059:22;;35045:37;35035:71;;35086:18;;:::i;35117:315::-;35237:19;;35276:2;35268:11;;35265:161;;;35348:66;35337:2;35333:12;;;35330:1;35326:20;35322:93;35311:105;35117:315;;;;:::o;35437:369::-;35595:66;35557:19;;35679:11;;;;35710:1;35702:10;;35699:101;;;35771:1;35767:11;;;;35764:1;35760:19;35756:28;;;35748:37;35744:46;;;;35437:369;-1:-1:-1;;35437:369:60:o;35811:652::-;36072:66;36063:6;36058:3;36054:16;36050:89;36045:3;36038:102;36191:66;36182:6;36177:3;36173:16;36169:89;36165:1;36160:3;36156:11;36149:110;36289:6;36284:2;36279:3;36275:12;36268:28;36020:3;36325:6;36319:13;36341:75;36409:6;36404:2;36399:3;36395:12;36388:4;36380:6;36376:17;36341:75;:::i;:::-;36436:16;;;;36454:2;36432:25;;35811:652;-1:-1:-1;;;;;35811:652:60:o;36801:570::-;37042:6;37037:3;37030:19;37101:66;37092:6;37087:3;37083:16;37079:89;37074:2;37069:3;37065:12;37058:111;37199:6;37194:2;37189:3;37185:12;37178:28;37012:3;37235:6;37229:13;37251:73;37317:6;37312:2;37307:3;37303:12;37298:2;37290:6;37286:15;37251:73;:::i;:::-;37344:16;;;;37362:2;37340:25;;36801:570;-1:-1:-1;;;;;36801:570:60:o;37678:287::-;37807:3;37845:6;37839:13;37861:66;37920:6;37915:3;37908:4;37900:6;37896:17;37861:66;:::i;38373:1462::-;38499:3;38493:10;38526:18;38518:6;38515:30;38512:56;;;38548:18;;:::i;:::-;38577:96;38666:6;38626:38;38658:4;38652:11;38626:38;:::i;:::-;38620:4;38577:96;:::i;:::-;38728:4;;38785:2;38774:14;;38802:1;38797:781;;;;39622:1;39639:6;39636:89;;;-1:-1:-1;39691:19:60;;;39685:26;39636:89;21212:66;21203:1;21199:11;;;21195:84;21191:89;21181:100;21287:1;21283:11;;;21178:117;39738:81;;38767:1062;;38797:781;20500:1;20493:14;;;20537:4;20524:18;;38845:66;38833:79;;;39009:236;39023:7;39020:1;39017:14;39009:236;;;39112:19;;;39106:26;39091:42;;39204:27;;;;39172:1;39160:14;;;;39039:19;;39009:236;;;39013:3;39273:6;39264:7;39261:19;39258:261;;;39334:19;;;39328:26;39435:66;39417:1;39413:14;;;39429:3;39409:24;39405:97;39401:102;39386:118;39371:134;;39258:261;;;39565:1;39556:6;39553:1;39549:14;39545:22;39539:4;39532:36;38767:1062;;;;;38373:1462;;:::o

Swarm Source

ipfs://ba1847ebafaa6f4c086c3ee2f193f2e2da511220c3fd7d0928ff4897f45168ac

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

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