HYPE Price: $22.66 (+2.35%)
 

Overview

HYPE Balance

HyperEVM LogoHyperEVM LogoHyperEVM Logo0 HYPE

HYPE Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To

There are no matching entries

> 10 Token Transfers found.

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Cross-Chain Transactions
Loading...
Loading

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

Contract Name:
HyperLiquidComposer_V1

Compiler Version
v0.8.22+commit.4fc1097e

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion, MIT license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 29 : HyperLiquidComposer_V1.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;

import { HyperLiquidComposer } from "@layerzerolabs/hyperliquid-composer/contracts/HyperLiquidComposer.sol";
import { RecoverableComposer } from "@layerzerolabs/hyperliquid-composer/contracts/extensions/RecoverableComposer.sol";

/**
 * @title HyperLiquidComposer_V1
 * @author LayerZero Labs (shankars99)
 * @dev This contract is a composer that allows transfers of ERC20 and HYPE tokens to a target address on hypercore.
 * @dev This contract does NOT refund dust to the receiver because we do not expect any due to truncation of sharedDecimals.
 * @dev Incase of dust, you would have to implement dust refunds to the receiver in:
 *      `_transferERC20ToHyperCore` and `_transferNativeToHyperCore`
 *
 * @dev Disclaimer: If the token's evm total supply exceeds the asset bridge's balance when scaled to EVM, it is possible
 *      that the composer will not be able to send the tokens to the receiver address on hypercore due to bridge consumption.
 *      Tokens would instead be returned to the sender address on HyperEVM. Front-end handling is recommended.
 */
contract HyperLiquidComposer_V1 is HyperLiquidComposer, RecoverableComposer {
    /**
     * @notice Constructor for the HyperLiquidComposer
     * @param _oft The address of the OFT
     * @param _hlIndexId The HyperLiquid core spot's index value
     * @param _assetDecimalDiff The difference in decimals between the HyperEVM's ERC20 and the HyperLiquid HIP-1 token
     *                 (i.e. 18 decimals on evm and 6 on HyperLiquid would be 18 - 6 = 12)
     * @param _recoveryAddress The address that will be authorized to perform recovery operations
     */
    constructor(
        address _oft,
        uint64 _hlIndexId,
        int8 _assetDecimalDiff,
        address _recoveryAddress
    ) HyperLiquidComposer(_oft, _hlIndexId, _assetDecimalDiff) RecoverableComposer(_recoveryAddress) {}
}

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

import { SafeERC20, IERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import { IOFT } from "@layerzerolabs/oft-evm/contracts/interfaces/IOFT.sol";
import { ICoreWriter } from "../interfaces/ICoreWriter.sol";
import { IRecoverableComposer } from "../interfaces/IRecoverableComposer.sol";

import { HyperLiquidComposerCodec } from "../library/HyperLiquidComposerCodec.sol";
import { HyperLiquidComposer } from "../HyperLiquidComposer.sol";

/**
 * @title Recoverable Composer
 * @author LayerZero Labs (@shankars99)
 * @notice Extension contract providing emergency recovery functionality for HyperLiquid Composer
 * @dev Abstract contract that adds recovery mechanisms for both HyperEVM and HyperCore assets
 * @dev Allows authorized recovery of stuck tokens from both EVM side and Core side of the bridge
 * @dev Should be inherited by HyperLiquidComposer implementations that require emergency recovery
 */
abstract contract RecoverableComposer is HyperLiquidComposer, IRecoverableComposer {
    using SafeERC20 for IERC20;
    using HyperLiquidComposerCodec for uint64;

    /**
     * @notice Restricts access to recovery operations to the designated recovery address
     * @dev Ensures only authorized personnel can perform emergency recovery operations
     */
    modifier onlyRecoveryAddress() {
        if (msg.sender != RECOVERY_ADDRESS) revert NotRecoveryAddress();
        _;
    }

    /// @notice Constant indicating a full transfer of available balance
    uint256 public constant FULL_TRANSFER = 0;

    /// @notice Core index ID for USDC on HyperLiquid
    uint64 public constant USDC_CORE_INDEX = 0;

    /// @notice Address authorized to perform recovery operations
    address public immutable RECOVERY_ADDRESS;

    /**
     * @notice Constructor for RecoverableComposer
     * @param _recoveryAddress Address that will be authorized to perform recovery operations
     */
    constructor(address _recoveryAddress) {
        RECOVERY_ADDRESS = _recoveryAddress;
    }

    /**
     * @notice Retrieves ERC20 tokens from HyperCore back to the asset bridge address
     * @dev Transfers tokens from the composer's HyperCore balance to the OFT asset bridge
     * @dev Can only be called by the recovery address
     * @param _coreAmount Amount of tokens to retrieve in HyperCore decimals, or FULL_TRANSFER for all
     */
    function retrieveCoreERC20(uint64 _coreAmount) public onlyRecoveryAddress {
        uint64 maxTransferAmt = _getMaxTransferAmount(ERC20_CORE_INDEX_ID, _coreAmount);

        _submitCoreWriterTransfer(ERC20_ASSET_BRIDGE, ERC20_CORE_INDEX_ID, maxTransferAmt);
        emit Retrieved(ERC20_CORE_INDEX_ID, maxTransferAmt, ERC20_ASSET_BRIDGE);
    }

    /**
     * @notice Retrieves HYPE tokens from HyperCore back to the HYPE asset bridge address
     * @dev Transfers HYPE tokens from the composer's HyperCore balance to the HYPE asset bridge
     * @dev Can only be called by the recovery address
     * @param _coreAmount Amount of HYPE tokens to retrieve in HyperCore decimals, or FULL_TRANSFER for all
     */
    function retrieveCoreHYPE(uint64 _coreAmount) public onlyRecoveryAddress {
        uint64 maxTransferAmt = _getMaxTransferAmount(NATIVE_CORE_INDEX_ID, _coreAmount);

        _submitCoreWriterTransfer(NATIVE_ASSET_BRIDGE, NATIVE_CORE_INDEX_ID, maxTransferAmt);
        emit Retrieved(NATIVE_CORE_INDEX_ID, maxTransferAmt, NATIVE_ASSET_BRIDGE);
    }

    /**
     * @notice Retrieves USDC tokens from HyperCore to a specified address
     * @dev Transfers USDC tokens from the composer's HyperCore balance to the specified address
     * @dev Can only be called by the recovery address
     * @param _coreAmount Amount of USDC tokens to retrieve in HyperCore decimals, or FULL_TRANSFER for all
     * @param _to Destination address to receive the retrieved USDC tokens
     */
    function retrieveCoreUSDC(uint64 _coreAmount, address _to) public onlyRecoveryAddress {
        uint64 maxTransferAmt = _getMaxTransferAmount(USDC_CORE_INDEX, _coreAmount);

        _submitCoreWriterTransfer(_to, USDC_CORE_INDEX, maxTransferAmt);
        emit Retrieved(USDC_CORE_INDEX, maxTransferAmt, _to);
    }

    /**
     * @notice Recovers ERC20 tokens from HyperEVM to the recovery address
     * @dev Convenience function that recovers tokens to the recovery address
     * @dev Can only be called by the recovery address
     * @param _evmAmount Amount of ERC20 tokens to recover in EVM decimals, or FULL_TRANSFER for all
     */
    function recoverEvmERC20(uint256 _evmAmount) public onlyRecoveryAddress {
        uint256 recoverAmt = _evmAmount == FULL_TRANSFER ? IERC20(ERC20).balanceOf(address(this)) : _evmAmount;

        IERC20(ERC20).safeTransfer(RECOVERY_ADDRESS, recoverAmt);
        emit Recovered(RECOVERY_ADDRESS, recoverAmt);
    }

    /**
     * @notice Recovers native tokens from HyperEVM to the recovery address
     * @dev Convenience function that recovers native tokens to the recovery address
     * @dev Can only be called by the recovery address
     * @param _evmAmount Amount of native tokens to recover in wei, or FULL_TRANSFER for all
     */
    function recoverEvmNative(uint256 _evmAmount) public onlyRecoveryAddress {
        uint256 recoverAmt = _evmAmount == FULL_TRANSFER ? address(this).balance : _evmAmount;

        (bool success, ) = RECOVERY_ADDRESS.call{ value: recoverAmt }("");
        if (!success) revert TransferFailed();
        emit Recovered(RECOVERY_ADDRESS, recoverAmt);
    }

    /**
     * @notice Internal function to calculate the maximum transferable amount
     * @dev Validates that the requested amount doesn't exceed available balance
     * @param _coreIndexId The core index ID of the token to check
     * @param _coreAmount The requested amount to transfer, or FULL_TRANSFER for all available
     * @return The actual amount that can be transferred
     */
    function _getMaxTransferAmount(uint64 _coreIndexId, uint64 _coreAmount) internal view returns (uint64) {
        uint64 maxTransferAmt = spotBalance(address(this), _coreIndexId).total;
        if (_coreAmount > maxTransferAmt) {
            revert MaxRetrieveAmountExceeded(maxTransferAmt, _coreAmount);
        }
        return _coreAmount == FULL_TRANSFER ? maxTransferAmt : _coreAmount;
    }
}

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

import { IOFT, SendParam, MessagingFee } from "@layerzerolabs/oft-evm/contracts/interfaces/IOFT.sol";
import { SafeERC20, IERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { OFTComposeMsgCodec } from "@layerzerolabs/oft-evm/contracts/libs/OFTComposeMsgCodec.sol";
import { IOAppCore } from "@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppCore.sol";
import { IOAppComposer } from "@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppComposer.sol";
import { HyperLiquidCore } from "./HyperLiquidCore.sol";

import { HyperLiquidComposerCodec } from "./library/HyperLiquidComposerCodec.sol";

import { IHyperLiquidComposer, IHyperAssetAmount, FailedMessage } from "./interfaces/IHyperLiquidComposer.sol";

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

/**
 * @title Hyperliquid Composer
 * @author LayerZero Labs (@shankars99)
 * @notice This contract is a composer that allows transfers of ERC20 and HYPE tokens to a target address on hypercore.
 * @dev This address needs to be "activated" on hypercore post deployment
 * @dev This contract does NOT refund dust to the receiver on HyperEVM because we do not expect any due to truncation of sharedDecimals.
            In the off-chance that you have dust you would have to implement dust refunds to the receiver in:
            `_transferERC20ToHyperCore` and `_transferNativeToHyperCore`
 * @dev Disclaimer: If your token's evm total supply exceeds your asset bridge's balance when scaled to EVM, it is possible that the 
            composer will not be able to send the tokens to the receiver address on hypercore due to bridge consumption. 
            Tokens would instead be returned to the sender address on HyperEVM.
 */
contract HyperLiquidComposer is HyperLiquidCore, ReentrancyGuard, IHyperLiquidComposer, IOAppComposer {
    using SafeERC20 for IERC20;
    using HyperLiquidComposerCodec for *; /// @dev applies to bytes, bytes32, uint256, uint64

    uint256 public constant VALID_COMPOSE_MSG_LEN = 64; /// @dev abi.encode(uint256,address) = 32+32

    /// @dev decimal difference having range [-2,18] is defined by hyperliquid in their docs
    int8 public constant MIN_DECIMAL_DIFF = -2;
    int8 public constant MAX_DECIMAL_DIFF = 18;

    address public immutable ENDPOINT;
    address public immutable OFT;

    address public immutable NATIVE_ASSET_BRIDGE;
    int8 public immutable NATIVE_DECIMAL_DIFF;
    uint64 public immutable NATIVE_CORE_INDEX_ID;

    address public immutable ERC20;
    address public immutable ERC20_ASSET_BRIDGE;
    int8 public immutable ERC20_DECIMAL_DIFF;
    uint64 public immutable ERC20_CORE_INDEX_ID;

    mapping(bytes32 guid => FailedMessage) public failedMessages;

    /**
     * @param _oft The OFT contract address associated with this composer
     * @param _coreIndexId The core index id of the HyperLiquid L1 contract
     * @param _assetDecimalDiff The difference in decimals between the HyperEVM OFT deployment and HyperLiquid L1 HIP-1 listing
     */
    constructor(address _oft, uint64 _coreIndexId, int8 _assetDecimalDiff) {
        if (_oft == address(0)) revert InvalidOFTAddress();

        if (_assetDecimalDiff < MIN_DECIMAL_DIFF || _assetDecimalDiff > MAX_DECIMAL_DIFF)
            revert InvalidDecimalDiff(_assetDecimalDiff, MIN_DECIMAL_DIFF, MAX_DECIMAL_DIFF);

        ENDPOINT = address(IOAppCore(_oft).endpoint());

        OFT = _oft;

        uint64 hypeCoreIndex = block.chainid == HYPE_CHAIN_ID_MAINNET
            ? HYPE_CORE_INDEX_MAINNET
            : HYPE_CORE_INDEX_TESTNET;

        NATIVE_ASSET_BRIDGE = HYPE_ASSET_BRIDGE;
        NATIVE_DECIMAL_DIFF = HYPE_DECIMAL_DIFF;
        NATIVE_CORE_INDEX_ID = hypeCoreIndex;

        ERC20 = IOFT(OFT).token();
        ERC20_ASSET_BRIDGE = _coreIndexId.into_assetBridgeAddress();
        ERC20_DECIMAL_DIFF = _assetDecimalDiff;
        ERC20_CORE_INDEX_ID = _coreIndexId;
    }

    /**
     * @notice Handles LayerZero compose operations for hypercore transfers with refund to source and refund on hyperevm functionality
     * @dev This composer is designed to handle refunds to source to an EOA address and NOT a contract
     * @dev If the HyperCore receiver is a contract on hyperevm, it is expected that you can control token balance via CoreWriter
     * @param _oft The address of the OFT contract.
     * @param _message The encoded message content, expected to contain a composeMsg that decodes to type: (address receiver, uint256 msgValue)
     */
    function lzCompose(
        address _oft,
        bytes32 _guid,
        bytes calldata _message,
        address /*_executor*/,
        bytes calldata /*_extraData*/
    ) external payable virtual override nonReentrant {
        if (msg.sender != ENDPOINT) revert OnlyEndpoint();
        if (OFT != _oft) revert InvalidComposeCaller(address(OFT), _oft);

        /// @dev Since these are populated by the OFT contract, we can safely assume they are always decodeable
        uint256 amountLD = OFTComposeMsgCodec.amountLD(_message);
        bytes memory composeMsgEncoded = OFTComposeMsgCodec.composeMsg(_message);

        /// @dev Decode message to get receiver and perform hypercore transfers, store in failedMessages if decode fails
        try this.decodeMessage(composeMsgEncoded) returns (uint256 _minMsgValue, address _to) {
            if (msg.value < _minMsgValue) revert InsufficientMsgValue(msg.value, _minMsgValue);

            uint256 minGas = msg.value > 0 ? MIN_GAS_WITH_VALUE() : MIN_GAS();

            /// @dev Gas check before executing hypercore precompile operations. Can be retried from the endpoint with sufficient gas.
            /// @dev Contracts would need to called with more gas than this to account for the code above this line.
            if (gasleft() < minGas) revert InsufficientGas(gasleft(), minGas);

            /// @dev If HyperEVM -> HyperCore fails for HYPE OR ERC20 then we do a complete refund to the receiver on hyperevm
            /// @dev try...catch to safeguard against possible breaking hyperliquid pre-compile changes
            try this.handleTransfersToHyperCore{ value: msg.value }(_to, amountLD) {} catch {
                _refundToHyperEvm(_to, amountLD);
            }
        } catch {
            SendParam memory refundSendParam;
            refundSendParam.dstEid = OFTComposeMsgCodec.srcEid(_message);
            refundSendParam.to = OFTComposeMsgCodec.composeFrom(_message);
            refundSendParam.amountLD = amountLD;

            failedMessages[_guid] = FailedMessage({ refundSendParam: refundSendParam, msgValue: msg.value });
            emit FailedMessageDecode(_guid, refundSendParam.to, msg.value, composeMsgEncoded);
        }
    }

    /**
     * @notice Decodes the compose message to extract minMsgValue and receiver address
     * @param _composeMessage The encoded compose message
     * @return minMsgValue - The minimum message value required
     * @return to - The receiver address
     */
    function decodeMessage(bytes calldata _composeMessage) external pure returns (uint256 minMsgValue, address to) {
        if (_composeMessage.length != VALID_COMPOSE_MSG_LEN) revert ComposeMsgLengthNot64Bytes(_composeMessage.length);

        (minMsgValue, to) = abi.decode(_composeMessage, (uint256, address));
    }

    /**
     * @dev Transfers native and erc20 to HyperCore via asset bridge, then to receiver via CoreWriter. Returns dust to HyperEVM.
     * @dev If either fails then we complete refund the user on HyperEVM
     * @dev Default behavior checks if the user is activated on HyperCore in ERC20 transfer, if not then revert this call
     * @dev If the user requests for more funds than the asset bridge's balance we revert
     */
    function handleTransfersToHyperCore(address _to, uint256 _amountLD) external payable {
        if (msg.sender != address(this)) revert OnlySelf(msg.sender);

        /// @dev Move ERC20 tokens into hyper core.
        _transferERC20ToHyperCore(_to, _amountLD);

        /// @dev Move native funds into hyper core.
        if (msg.value > 0) _transferNativeToHyperCore(_to);
    }

    /**
     * @notice Transfers ERC20 tokens to HyperCore
     * @notice Checks if the receiver's address is activated on HyperCore
     * @notice If the user requests for more funds than the asset bridge's balance we revert
     * @param _to The address to receive tokens on HyperCore
     * @param _amountLD The amount of tokens to transfer in LayerZero decimals
     */
    function _transferERC20ToHyperCore(address _to, uint256 _amountLD) internal virtual {
        IHyperAssetAmount memory amounts = quoteHyperCoreAmount(
            ERC20_CORE_INDEX_ID,
            ERC20_DECIMAL_DIFF,
            ERC20_ASSET_BRIDGE,
            _amountLD
        );

        /// @dev Moving tokens to asset bridge credits the coreAccount of composer with the tokens.
        /// @dev The write call then moves coreSpot tokens from the composer to receiver
        if (amounts.evm != 0) {
            /// @dev This reverts if the user is not activated in the default case, else it simply returns `amounts.core`
            uint64 coreAmount = _getFinalCoreAmount(_to, amounts.core);

            // Transfer the tokens to the composer's address on HyperCore
            IERC20(ERC20).safeTransfer(ERC20_ASSET_BRIDGE, amounts.evm);

            _submitCoreWriterTransfer(_to, ERC20_CORE_INDEX_ID, coreAmount);
        }
    }

    /**
     * @notice Transfers native HYPE tokens to HyperCore
     * @notice If the user requests for more funds than the asset bridge's balance we revert
     * @param _to The address to receive tokens on HyperCore
     */
    function _transferNativeToHyperCore(address _to) internal virtual {
        IHyperAssetAmount memory amounts = quoteHyperCoreAmount(
            NATIVE_CORE_INDEX_ID,
            NATIVE_DECIMAL_DIFF,
            NATIVE_ASSET_BRIDGE,
            msg.value
        );

        if (amounts.evm != 0) {
            // Transfer the HYPE tokens to the composer's address on HyperCore
            (bool success, ) = payable(NATIVE_ASSET_BRIDGE).call{ value: amounts.evm }("");
            if (!success) revert NativeTransferFailed(amounts.evm);

            _submitCoreWriterTransfer(_to, NATIVE_CORE_INDEX_ID, amounts.core);
        }
    }

    /**
     * @notice Checks if the receiver's address is activated on HyperCore
     * @notice To be overriden on FeeToken or other implementations since this can be used to activate tokens
     * @dev Default behavior is to revert if the user's account is NOT activated
     * @param _to The address to check
     * @param _coreAmount The core amount to transfer
     * @return The final core amount to transfer (same as _coreAmount in default impl)
     */
    function _getFinalCoreAmount(address _to, uint64 _coreAmount) internal view virtual returns (uint64) {
        if (!coreUserExists(_to).exists) revert CoreUserNotActivated();
        return _coreAmount;
    }

    /**
     * @notice External function to quote the conversion of evm tokens to hypercore tokens
     * @param _coreIndexId The core index id of the token to transfer
     * @param _decimalDiff The decimal difference of evmDecimals - coreDecimals
     * @param _bridgeAddress The asset bridge address of the token to transfer
     * @param _amountLD The number of tokens that the composer received (pre-dusted) that we are trying to send
     * @return IHyperAssetAmount - The amount of tokens to send to HyperCore (scaled on evm), dust (to be refunded), and the swap amount (of the tokens scaled on hypercore)
     */
    function quoteHyperCoreAmount(
        uint64 _coreIndexId,
        int8 _decimalDiff,
        address _bridgeAddress,
        uint256 _amountLD
    ) public view returns (IHyperAssetAmount memory) {
        uint64 bridgeBalance = spotBalance(_bridgeAddress, _coreIndexId).total;
        return _amountLD.into_hyperAssetAmount(bridgeBalance, _decimalDiff);
    }

    /**
     * @notice Handles refunds to HyperEVM for both HYPE and ERC20 tokens to the initial recipient
     * @param _refundAddress The address to refund tokens to
     * @param _amountLD The amount of ERC20 tokens to refund
     */
    function _refundToHyperEvm(address _refundAddress, uint256 _amountLD) internal virtual {
        if (msg.value != 0) {
            (bool success1, ) = _refundAddress.call{ value: msg.value }("");
            if (!success1) {
                (bool success2, ) = tx.origin.call{ value: msg.value }("");
                if (!success2) revert NativeTransferFailed(msg.value);
            }
        }

        if (_amountLD != 0) IERC20(ERC20).safeTransfer(_refundAddress, _amountLD);
    }

    /**
     * @notice Refunds failed messages to the source chain
     * @param _guid The GUID of the failed message to refund
     */
    function refundToSrc(bytes32 _guid) external payable virtual {
        FailedMessage memory failedMessage = failedMessages[_guid];
        if (failedMessage.refundSendParam.dstEid == 0) revert FailedMessageNotFound(_guid);

        delete failedMessages[_guid];

        uint256 totalMsgValue = failedMessage.msgValue + msg.value;

        /// @dev Triggers a refund via the OFT with the refundSendParam for the ERC20 amt
        /// @dev msg.value, if any was passed is used to pay the layerzero message fee and excess refunded to tx.origin
        IOFT(OFT).send{ value: totalMsgValue }(
            failedMessage.refundSendParam,
            MessagingFee(totalMsgValue, 0),
            tx.origin
        );

        emit RefundSuccessful(_guid);
    }

    /**
     * @dev Minimum gas to be supplied to the composer contract for execution to prevent Out of Gas.
     * @dev This is used when the compose message does NOT have msg.value to send user funds to the receiver on core.
     * @dev This is the minimum gas amt for the compose operations which means the contract should be called with some more gas.
     * @return The minimum gas amount
     */
    function MIN_GAS() public virtual returns (uint256) {
        return 150_000;
    }

    /**
     * @dev Minimum gas to be supplied to the composer contract for execution to prevent Out of Gas.
     * @dev This is used when the compose message has msg.value to send user funds to the receiver on core.
     * @dev This is the minimum gas amt for the compose operations which means the contract should be called with some more gas.
     * @return The minimum gas amount
     */
    function MIN_GAS_WITH_VALUE() public virtual returns (uint256) {
        return 200_000;
    }

    receive() external payable {}
}

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

import { ICoreWriter } from "./interfaces/ICoreWriter.sol";

struct SpotBalance {
    uint64 total;
    uint64 hold; // Unused in this implementation
    uint64 entryNtl; // Unused in this implementation
}

struct CoreUserExists {
    bool exists;
}

/**
 * @title HyperLiquidCore
 * @author Hyperliquid + LayerZero Labs (@shankars99)
 * @notice This contract is a reduced and combined form of the L1Read and CoreWriter precompiles from the Hyperliquid team.
 */
abstract contract HyperLiquidCore {
    // Chain IDs
    // https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/hyperevm#mainnet
    uint256 internal constant HYPE_CHAIN_ID_MAINNET = 999;

    // Core Indexes
    // https://app.hyperliquid-testnet.xyz/explorer/token/0x7317beb7cceed72ef0b346074cc8e7ab
    uint64 internal constant HYPE_CORE_INDEX_TESTNET = 1105;
    // https://app.hyperliquid.xyz/explorer/token/0x0d01dc56dcaaca66ad901c959b4011ec
    uint64 internal constant HYPE_CORE_INDEX_MAINNET = 150;

    /// @dev uint8 HYPE_EVM_DECIMALS = 18;
    /// @dev uint8 HYPE_CORE_DECIMALS = 8;
    int8 internal constant HYPE_DECIMAL_DIFF = 10; // Pre-computed for gas efficiency
    address internal constant HYPE_ASSET_BRIDGE = 0x2222222222222222222222222222222222222222;

    // Precompile Addresses
    address internal constant HLP_CORE_WRITER = 0x3333333333333333333333333333333333333333;
    address internal constant SPOT_BALANCE_PRECOMPILE_ADDRESS = 0x0000000000000000000000000000000000000801;
    address internal constant CORE_USER_EXISTS_PRECOMPILE_ADDRESS = 0x0000000000000000000000000000000000000810;

    /// @dev Pre-computed headers for gas efficiency
    /// @dev bytes1 CORE_WRITER_VERSION = 0x01;
    /// @dev bytes3 SPOT_SEND_ACTION_ID = 0x000006;
    bytes4 public constant SPOT_SEND_HEADER = 0x01000006; // Pre-computed concatenation

    function spotBalance(address user, uint64 token) public view returns (SpotBalance memory) {
        (bool success, bytes memory result) = SPOT_BALANCE_PRECOMPILE_ADDRESS.staticcall(abi.encode(user, token));
        require(success, "SpotBalance precompile call failed");
        return abi.decode(result, (SpotBalance));
    }

    function coreUserExists(address user) public view returns (CoreUserExists memory) {
        (bool success, bytes memory result) = CORE_USER_EXISTS_PRECOMPILE_ADDRESS.staticcall(abi.encode(user));
        require(success, "Core user exists precompile call failed");
        return abi.decode(result, (CoreUserExists));
    }

    /**
     * @notice Transfers tokens on HyperCore using the CoreWriter precompile
     * @param _to The address to receive tokens on HyperCore
     * @param _coreIndex The core index of the token
     * @param _coreAmount The amount to transfer on HyperCore
     */
    function _submitCoreWriterTransfer(address _to, uint64 _coreIndex, uint64 _coreAmount) internal virtual {
        bytes memory action = abi.encode(_to, _coreIndex, _coreAmount);
        bytes memory payload = abi.encodePacked(SPOT_SEND_HEADER, action);
        /// Transfers HYPE tokens from the composer address on HyperCore to the _to via the SpotSend precompile
        ICoreWriter(HLP_CORE_WRITER).sendRawAction(payload);
    }
}

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

interface ICoreWriter {
    event RawAction(address indexed user, bytes data);

    function sendRawAction(bytes calldata data) external;
}

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

import { SendParam } from "@layerzerolabs/oft-evm/contracts/interfaces/IOFT.sol";

struct IHyperAssetAmount {
    uint256 evm;
    uint64 core;
    uint64 coreBalanceAssetBridge;
}

struct FailedMessage {
    SendParam refundSendParam;
    uint256 msgValue;
}

interface IHyperLiquidComposer {
    /// ----------------------------------- EVENTS -----------------------------------
    event RefundSuccessful(bytes32 indexed guid);

    event FailedMessageDecode(bytes32 indexed guid, bytes32 sender, uint256 msgValue, bytes composeMessage);

    event CompleteRefund();
    event RefundHyperEVM(address indexed receiver, uint256 indexed amountERC20, uint256 indexed amountHYPE);

    /// ----------------------------------- ERRORS -----------------------------------
    error InsufficientGas(uint256 gasLeft, uint256 minGas);

    error InvalidOFTAddress();
    error InvalidDecimalDiff(int8 decimalDiff, int8 minDecimalDiff, int8 maxDecimalDiff);

    error OnlyEndpoint();
    error InvalidComposeCaller(address internalOFTAddress, address receivedOFTAddress);
    error OnlySelf(address caller);

    error InsufficientMsgValue(uint256 msgValue, uint256 requiredValue);
    error ComposeMsgLengthNot64Bytes(uint256 length);

    error CoreUserNotActivated();
    error NativeTransferFailed(uint256 amount);

    error SpotBalanceReadFailed(address user, uint64 tokenId);

    error FailedMessageNotFound(bytes32 guid);

    /// ------------------------ CONSTANTS/VARIABLES/FUNCTIONS ------------------------
    function MIN_GAS() external returns (uint256);
    function MIN_GAS_WITH_VALUE() external returns (uint256);

    function VALID_COMPOSE_MSG_LEN() external view returns (uint256);

    function ENDPOINT() external view returns (address);
    function OFT() external view returns (address);
    function ERC20() external view returns (address);

    function decodeMessage(bytes calldata composeMessage) external pure returns (uint256 minMsgValue, address receiver);

    function refundToSrc(bytes32 guid) external payable;

    function quoteHyperCoreAmount(
        uint64 coreIndexId,
        int8 decimalDiff,
        address bridgeAddress,
        uint256 amountLD
    ) external view returns (IHyperAssetAmount memory);
}

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

/**
 * @title IRecoverable Composer Interface
 * @author LayerZero Labs
 * @notice Interface for emergency recovery functionality in HyperLiquid Composer
 * @dev Defines the public API for recovery mechanisms for both HyperEVM and HyperCore assets
 */
interface IRecoverableComposer {
    error MaxRetrieveAmountExceeded(uint256 maxAmount, uint256 requestedAmount);
    error NotRecoveryAddress();
    error TransferFailed();

    /// @dev Retrieved is the process of moving tokens at the composer from HyperCore to HyperEVM
    event Retrieved(uint64 indexed coreIndexId, uint256 amount, address indexed to);
    /// @dev Recovery is the process of pulling tokens from the composer on hyperevm to the recovery address
    event Recovered(address indexed to, uint256 amount);

    /**
     * @notice Constant indicating a full transfer of available balance
     * @return The constant value (0) representing full transfer
     */
    function FULL_TRANSFER() external view returns (uint256);

    /**
     * @notice Core index ID for USDC on HyperLiquid
     * @return The USDC core index ID
     */
    function USDC_CORE_INDEX() external view returns (uint64);

    /**
     * @notice Address authorized to perform recovery operations
     * @return The recovery address
     */
    function RECOVERY_ADDRESS() external view returns (address);

    /**
     * @notice Retrieves ERC20 tokens from HyperCore back to the asset bridge address
     * @dev Transfers tokens from the composer's HyperCore balance to the OFT asset bridge
     * @dev Can only be called by the recovery address
     * @param _coreAmount Amount of tokens to retrieve in HyperCore decimals, or FULL_TRANSFER for all
     */
    function retrieveCoreERC20(uint64 _coreAmount) external;

    /**
     * @notice Retrieves HYPE tokens from HyperCore back to the HYPE asset bridge address
     * @dev Transfers HYPE tokens from the composer's HyperCore balance to the HYPE asset bridge
     * @dev Can only be called by the recovery address
     * @param _coreAmount Amount of HYPE tokens to retrieve in HyperCore decimals, or FULL_TRANSFER for all
     */
    function retrieveCoreHYPE(uint64 _coreAmount) external;

    /**
     * @notice Retrieves USDC tokens from HyperCore to a specified address
     * @dev Transfers USDC tokens from the composer's HyperCore balance to the specified address
     * @dev Can only be called by the recovery address
     * @param _coreAmount Amount of USDC tokens to retrieve in HyperCore decimals, or FULL_TRANSFER for all
     * @param _to Destination address to receive the retrieved USDC tokens
     */
    function retrieveCoreUSDC(uint64 _coreAmount, address _to) external;

    /**
     * @notice Recovers ERC20 tokens from HyperEVM to the recovery address
     * @dev Convenience function that recovers tokens to the recovery address
     * @dev Can only be called by the recovery address
     * @param _evmAmount Amount of ERC20 tokens to recover in EVM decimals, or FULL_TRANSFER for all
     */
    function recoverEvmERC20(uint256 _evmAmount) external;

    /**
     * @notice Recovers native tokens from HyperEVM to the recovery address
     * @dev Convenience function that recovers native tokens to the recovery address
     * @dev Can only be called by the recovery address
     * @param _evmAmount Amount of native tokens to recover in wei, or FULL_TRANSFER for all
     */
    function recoverEvmNative(uint256 _evmAmount) external;
}

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

import { IHyperAssetAmount } from "../interfaces/IHyperLiquidComposer.sol";

/**
 * @title HyperLiquidComposerCodec
 * @author LayerZero Labs (@shankars99)
 * @notice Library for computing hyperliquid asset bridges, and converting between EVM and HyperCore amounts
 */
library HyperLiquidComposerCodec {
    error TransferAmtExceedsAssetBridgeBalance(uint256 amt, uint256 maxAmt);

    /// @dev The base asset bridge address is the address of the HyperLiquid L1 contract
    /// @dev This is the address that the OFT contract will transfer the tokens to when we want to send tokens to HyperLiquid L1
    /// @dev https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/hyperevm/hypercore-less-than-greater-than-hyperevm-transfers#system-addresses
    address public constant BASE_ASSET_BRIDGE_ADDRESS = 0x2000000000000000000000000000000000000000;
    uint256 public constant BASE_ASSET_BRIDGE_ADDRESS_UINT256 = uint256(uint160(BASE_ASSET_BRIDGE_ADDRESS));

    /**
     * @notice Converts a core index id to an asset bridge address
     * @notice This function is called by the HyperLiquidComposer contract
     * @param _coreIndexId The core index id to convert
     * @return _assetBridgeAddress The asset bridge address
     */
    function into_assetBridgeAddress(uint64 _coreIndexId) internal pure returns (address) {
        return address(uint160(BASE_ASSET_BRIDGE_ADDRESS_UINT256 + _coreIndexId));
    }

    /**
     * @notice Converts an asset bridge address to a core index id
     * @param _assetBridgeAddress The asset bridge address to convert
     * @return _coreIndexId The core index id
     */
    function into_tokenId(address _assetBridgeAddress) internal pure returns (uint64) {
        return uint64(uint160(_assetBridgeAddress) - BASE_ASSET_BRIDGE_ADDRESS_UINT256);
    }

    /**
     * @notice Converts an amount and an asset to a evm amount and core amount
     * @notice This function is called by the HyperLiquidComposer contract
     * @param _amount The amount to convert
     * @param _assetBridgeSupply The maximum amount transferable capped by the number of tokens located on the HyperCore's side of the asset bridge
     * @param _decimalDiff The decimal difference of evmDecimals - coreDecimals
     * @return IHyperAssetAmount memory - The evm amount and core amount
     */
    function into_hyperAssetAmount(
        uint256 _amount,
        uint64 _assetBridgeSupply,
        int8 _decimalDiff
    ) internal pure returns (IHyperAssetAmount memory) {
        uint256 amountEVM;
        uint64 amountCore;

        /// @dev HyperLiquid decimal conversion: Scale EVM (u256,evmDecimals) -> Core (u64,coreDecimals)
        /// @dev Core amount is guaranteed to be within u64 range.
        if (_decimalDiff > 0) {
            (amountEVM, amountCore) = into_hyperAssetAmount_decimal_difference_gt_zero(
                _amount,
                _assetBridgeSupply,
                uint8(_decimalDiff)
            );
        } else {
            (amountEVM, amountCore) = into_hyperAssetAmount_decimal_difference_leq_zero(
                _amount,
                _assetBridgeSupply,
                uint8(-1 * _decimalDiff)
            );
        }

        return IHyperAssetAmount({ evm: amountEVM, core: amountCore, coreBalanceAssetBridge: _assetBridgeSupply });
    }

    /**
     * @notice Computes hyperAssetAmount when EVM decimals > Core decimals
     * @notice This function is called by the HyperLiquidComposer contract
     * @param _amount The amount to convert
     * @param _maxTransferableCoreAmount The maximum transferrable amount capped by the asset bridge has range [0,u64.max]
     * @param _decimalDiff The decimal difference between HyperEVM and HyperCore
     * @return amountEVM The EVM amount
     * @return amountCore The core amount
     */
    function into_hyperAssetAmount_decimal_difference_gt_zero(
        uint256 _amount,
        uint64 _maxTransferableCoreAmount,
        uint8 _decimalDiff
    ) internal pure returns (uint256 amountEVM, uint64 amountCore) {
        uint256 scale = 10 ** _decimalDiff;
        uint256 maxAmt = _maxTransferableCoreAmount * scale;

        unchecked {
            /// @dev Strip out dust from _amount so that _amount and maxEvmAmountFromCoreMax have a maximum of _decimalDiff starting 0s
            amountEVM = _amount - (_amount % scale); // Safe: dustAmt = _amount % scale, so dust <= _amount

            if (amountEVM > maxAmt) revert TransferAmtExceedsAssetBridgeBalance(amountEVM, maxAmt);

            /// @dev Safe: Guaranteed to be in the range of [0, u64.max] because it is upperbounded by uint64 maxAmt
            amountCore = uint64(amountEVM / scale);
        }
    }

    /**
     * @notice Computes hyperAssetAmount when EVM decimals < Core decimals and 0
     * @notice This function is called by the HyperLiquidComposer contract
     * @param _amount The amount to convert
     * @param _maxTransferableCoreAmount The maximum transferrable amount capped by the asset bridge
     * @param _decimalDiff The decimal difference between HyperEVM and HyperCore
     * @return amountEVM The EVM amount
     * @return amountCore The core amount
     */
    function into_hyperAssetAmount_decimal_difference_leq_zero(
        uint256 _amount,
        uint64 _maxTransferableCoreAmount,
        uint8 _decimalDiff
    ) internal pure returns (uint256 amountEVM, uint64 amountCore) {
        uint256 scale = 10 ** _decimalDiff;
        uint256 maxAmt = _maxTransferableCoreAmount / scale;

        unchecked {
            amountEVM = _amount;

            /// @dev When `Core > EVM` there will be no opening dust to strip out since all tokens in evm can be represented on core
            /// @dev Safe: Bound amountEvm to the range of [0, evmscaled u64.max]
            if (_amount > maxAmt) revert TransferAmtExceedsAssetBridgeBalance(amountEVM, maxAmt);

            /// @dev Safe: Guaranteed to be in the range of [0, u64.max] because it is upperbounded by uint64 maxAmt
            amountCore = uint64(amountEVM * scale);
        }
    }
}

File 9 of 29 : ILayerZeroComposer.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

/**
 * @title ILayerZeroComposer
 */
interface ILayerZeroComposer {
    /**
     * @notice Composes a LayerZero message from an OApp.
     * @dev To ensure non-reentrancy, implementers of this interface MUST assert msg.sender is the corresponding EndpointV2 contract (i.e., onlyEndpointV2).
     * @param _from The address initiating the composition, typically the OApp where the lzReceive was called.
     * @param _guid The unique identifier for the corresponding LayerZero src/dst tx.
     * @param _message The composed message payload in bytes. NOT necessarily the same payload passed via lzReceive.
     * @param _executor The address of the executor for the composed message.
     * @param _extraData Additional arbitrary data in bytes passed by the entity who executes the lzCompose.
     */
    function lzCompose(
        address _from,
        bytes32 _guid,
        bytes calldata _message,
        address _executor,
        bytes calldata _extraData
    ) external payable;
}

// 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.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 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 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 IMessagingContext {
    function isSendingMessage() external view returns (bool);

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

File 15 of 29 : IOAppComposer.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

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

/**
 * @title IOAppComposer
 * @dev This interface defines the OApp Composer, allowing developers to inherit only the OApp package without the protocol.
 */
// solhint-disable-next-line no-empty-blocks
interface IOAppComposer is ILayerZeroComposer {}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

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

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

    // 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 (ILayerZeroEndpointV2 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 { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { IOAppCore, ILayerZeroEndpointV2 } from "./interfaces/IOAppCore.sol";

/**
 * @title OAppCore
 * @dev Abstract contract implementing the IOAppCore interface with basic OApp configurations.
 */
abstract contract OAppCore is IOAppCore, Ownable {
    // The LayerZero endpoint associated with the given OApp
    ILayerZeroEndpointV2 public immutable endpoint;

    // Mapping to store peers associated with corresponding endpoints
    mapping(uint32 eid => bytes32 peer) public peers;

    /**
     * @dev Constructor to initialize the OAppCore with the provided endpoint and delegate.
     * @param _endpoint The address of the LOCAL Layer Zero endpoint.
     * @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.
     */
    constructor(address _endpoint, address _delegate) {
        endpoint = ILayerZeroEndpointV2(_endpoint);

        if (_delegate == address(0)) revert InvalidDelegate();
        endpoint.setDelegate(_delegate);
    }

    /**
     * @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 owner/admin of the OApp can call this function.
     * @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 onlyOwner {
        _setPeer(_eid, _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.
     *
     * @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) internal virtual {
        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) {
        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 owner/admin of the OApp can call this function.
     * @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 onlyOwner {
        endpoint.setDelegate(_delegate);
    }
}

// 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 { OAppCore } from "./OAppCore.sol";

/**
 * @title OAppSender
 * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.
 */
abstract contract OAppSender is OAppCore {
    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;

    /**
     * @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
            // solhint-disable-next-line check-send-result
            endpoint.send{ value: messageValue }(
                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 { MessagingReceipt, MessagingFee } from "@layerzerolabs/oapp-evm/contracts/oapp/OAppSender.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 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(
        bytes32 indexed guid, // GUID of the OFT message.
        uint32 dstEid, // Destination Endpoint ID.
        address indexed fromAddress, // Address of the sender on the src chain.
        uint256 amountSentLD, // Amount of tokens sent in local decimals.
        uint256 amountReceivedLD // Amount of tokens received in local decimals.
    );
    event OFTReceived(
        bytes32 indexed guid, // GUID of the OFT message.
        uint32 srcEid, // Source Endpoint ID.
        address indexed toAddress, // Address of the recipient on the dst chain.
        uint256 amountReceivedLD // Amount of tokens received in local decimals.
    );

    /**
     * @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 the fee breakdown and settings data for an OFT. Unused in the default implementation.
     * @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 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 for 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 for 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
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)

pragma solidity ^0.8.20;

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

/**
 * @title IERC1363
 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
 *
 * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
 * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
 */
interface IERC1363 is IERC20, IERC165 {
    /*
     * Note: the ERC-165 identifier for this interface is 0xb0202a11.
     * 0xb0202a11 ===
     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^
     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
     */

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @param data Additional data with no specified format, sent in call to `spender`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}

File 23 of 29 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)

pragma solidity ^0.8.20;

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

File 24 of 29 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)

pragma solidity ^0.8.20;

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

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

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
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.3.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

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

/**
 * @title SafeERC20
 * @dev Wrappers around ERC-20 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 {
    /**
     * @dev An operation with an ERC-20 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 Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
     */
    function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
        return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
     */
    function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
        return _callOptionalReturnBool(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.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    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.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    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.
     *
     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
     * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
     * set here.
     */
    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 Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            safeTransfer(token, to, value);
        } else if (!token.transferAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferFromAndCallRelaxed(
        IERC1363 token,
        address from,
        address to,
        uint256 value,
        bytes memory data
    ) internal {
        if (to.code.length == 0) {
            safeTransferFrom(token, from, to, value);
        } else if (!token.transferFromAndCall(from, to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
     * once without retrying, and relies on the returned value to be true.
     *
     * Reverts if the returned value is other than `true`.
     */
    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            forceApprove(token, to, value);
        } else if (!token.approveAndCall(to, value, data)) {
            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 {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            // bubble errors
            if iszero(success) {
                let ptr := mload(0x40)
                returndatacopy(ptr, 0, returndatasize())
                revert(ptr, returndatasize())
            }
            returnSize := returndatasize()
            returnValue := mload(0)
        }

        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
            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 silently catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        bool success;
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            returnSize := returndatasize()
            returnValue := mload(0)
        }
        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
    }
}

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

pragma solidity ^0.8.20;

/**
 * @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 Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

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

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * 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[ERC 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);
}

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

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
 * consider using {ReentrancyGuardTransient} instead.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_oft","type":"address"},{"internalType":"uint64","name":"_hlIndexId","type":"uint64"},{"internalType":"int8","name":"_assetDecimalDiff","type":"int8"},{"internalType":"address","name":"_recoveryAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ComposeMsgLengthNot64Bytes","type":"error"},{"inputs":[],"name":"CoreUserNotActivated","type":"error"},{"inputs":[{"internalType":"bytes32","name":"guid","type":"bytes32"}],"name":"FailedMessageNotFound","type":"error"},{"inputs":[{"internalType":"uint256","name":"gasLeft","type":"uint256"},{"internalType":"uint256","name":"minGas","type":"uint256"}],"name":"InsufficientGas","type":"error"},{"inputs":[{"internalType":"uint256","name":"msgValue","type":"uint256"},{"internalType":"uint256","name":"requiredValue","type":"uint256"}],"name":"InsufficientMsgValue","type":"error"},{"inputs":[{"internalType":"address","name":"internalOFTAddress","type":"address"},{"internalType":"address","name":"receivedOFTAddress","type":"address"}],"name":"InvalidComposeCaller","type":"error"},{"inputs":[{"internalType":"int8","name":"decimalDiff","type":"int8"},{"internalType":"int8","name":"minDecimalDiff","type":"int8"},{"internalType":"int8","name":"maxDecimalDiff","type":"int8"}],"name":"InvalidDecimalDiff","type":"error"},{"inputs":[],"name":"InvalidOFTAddress","type":"error"},{"inputs":[{"internalType":"uint256","name":"maxAmount","type":"uint256"},{"internalType":"uint256","name":"requestedAmount","type":"uint256"}],"name":"MaxRetrieveAmountExceeded","type":"error"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"NativeTransferFailed","type":"error"},{"inputs":[],"name":"NotRecoveryAddress","type":"error"},{"inputs":[],"name":"OnlyEndpoint","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"OnlySelf","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint64","name":"tokenId","type":"uint64"}],"name":"SpotBalanceReadFailed","type":"error"},{"inputs":[{"internalType":"uint256","name":"amt","type":"uint256"},{"internalType":"uint256","name":"maxAmt","type":"uint256"}],"name":"TransferAmtExceedsAssetBridgeBalance","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"anonymous":false,"inputs":[],"name":"CompleteRefund","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"guid","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"sender","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"msgValue","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"composeMessage","type":"bytes"}],"name":"FailedMessageDecode","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Recovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"uint256","name":"amountERC20","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"amountHYPE","type":"uint256"}],"name":"RefundHyperEVM","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"guid","type":"bytes32"}],"name":"RefundSuccessful","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"coreIndexId","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Retrieved","type":"event"},{"inputs":[],"name":"ENDPOINT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERC20","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERC20_ASSET_BRIDGE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERC20_CORE_INDEX_ID","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERC20_DECIMAL_DIFF","outputs":[{"internalType":"int8","name":"","type":"int8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FULL_TRANSFER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_DECIMAL_DIFF","outputs":[{"internalType":"int8","name":"","type":"int8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_DECIMAL_DIFF","outputs":[{"internalType":"int8","name":"","type":"int8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_GAS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"MIN_GAS_WITH_VALUE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"NATIVE_ASSET_BRIDGE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_CORE_INDEX_ID","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_DECIMAL_DIFF","outputs":[{"internalType":"int8","name":"","type":"int8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OFT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RECOVERY_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SPOT_SEND_HEADER","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDC_CORE_INDEX","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VALID_COMPOSE_MSG_LEN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"coreUserExists","outputs":[{"components":[{"internalType":"bool","name":"exists","type":"bool"}],"internalType":"struct CoreUserExists","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_composeMessage","type":"bytes"}],"name":"decodeMessage","outputs":[{"internalType":"uint256","name":"minMsgValue","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"guid","type":"bytes32"}],"name":"failedMessages","outputs":[{"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":"refundSendParam","type":"tuple"},{"internalType":"uint256","name":"msgValue","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amountLD","type":"uint256"}],"name":"handleTransfersToHyperCore","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_oft","type":"address"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"address","name":"","type":"address"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"lzCompose","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_coreIndexId","type":"uint64"},{"internalType":"int8","name":"_decimalDiff","type":"int8"},{"internalType":"address","name":"_bridgeAddress","type":"address"},{"internalType":"uint256","name":"_amountLD","type":"uint256"}],"name":"quoteHyperCoreAmount","outputs":[{"components":[{"internalType":"uint256","name":"evm","type":"uint256"},{"internalType":"uint64","name":"core","type":"uint64"},{"internalType":"uint64","name":"coreBalanceAssetBridge","type":"uint64"}],"internalType":"struct IHyperAssetAmount","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_evmAmount","type":"uint256"}],"name":"recoverEvmERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_evmAmount","type":"uint256"}],"name":"recoverEvmNative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_guid","type":"bytes32"}],"name":"refundToSrc","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_coreAmount","type":"uint64"}],"name":"retrieveCoreERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_coreAmount","type":"uint64"}],"name":"retrieveCoreHYPE","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_coreAmount","type":"uint64"},{"internalType":"address","name":"_to","type":"address"}],"name":"retrieveCoreUSDC","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint64","name":"token","type":"uint64"}],"name":"spotBalance","outputs":[{"components":[{"internalType":"uint64","name":"total","type":"uint64"},{"internalType":"uint64","name":"hold","type":"uint64"},{"internalType":"uint64","name":"entryNtl","type":"uint64"}],"internalType":"struct SpotBalance","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

0x6101c06040523480156200001257600080fd5b50604051620030583803806200305883398101604081905262000035916200027e565b6001600055808484846001600160a01b038316620000665760405163c23419a560e01b815260040160405180910390fd5b600119600082900b12806200007f57506012600082900b135b15620000b75760405163470eb46160e01b8152600082900b600482015260011960248201526012604482015260640160405180910390fd5b826001600160a01b0316635e280f116040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000f6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200011c9190620002f7565b6001600160a01b03908116608052831660a0526000466103e714620001445761045162000147565b60965b73222222222222222222222222222222222222222260c052600a60e0526001600160401b0381166101005260a05160408051637e062a3560e11b815290519293506001600160a01b039091169163fc0c546a916004808201926020929091908290030181865afa158015620001c0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001e69190620002f7565b6001600160a01b031661012052620002076001600160401b03841662000244565b6001600160a01b039081166101405260009290920b61016052506001600160401b0390911661018052919091166101a05250620003409350505050565b60006200025f6001600160401b0383166001609d1b6200031e565b92915050565b6001600160a01b03811681146200027b57600080fd5b50565b600080600080608085870312156200029557600080fd5b8451620002a28162000265565b60208601519094506001600160401b0381168114620002c057600080fd5b8093505060408501518060000b8114620002d957600080fd5b6060860151909250620002ec8162000265565b939692955090935050565b6000602082840312156200030a57600080fd5b8151620003178162000265565b9392505050565b808201808211156200025f57634e487b7160e01b600052601160045260246000fd5b60805160a05160c05160e05161010051610120516101405161016051610180516101a051612b99620004bf6000396000818161039b0152818161073601528181610cb201528181610db701528181610dde01528181610e4e015281816113d401528181611428015281816114ba01526118d101526000818161070901528181610e9301528181610ee001528181610f3101528181611dad0152611e8f0152600081816105650152611dce0152600081816106d501528181610ebf01528181610f0701528181611def0152611e640152600081816105fb01528181610d1301528181610d9501528181611d7f0152611e410152600081816105990152818161077b015281816107c80152818161081901528181611ec10152611fd00152600081816104600152611ee2015260008181610367015281816107a7015281816107ef01528181611f030152611f440152600081816102d201528181610b7e0152818161157d01526115c101526000818161042c01526115330152612b996000f3fe6080604052600436106101dc5760003560e01c80639dbfb13f11610102578063cebb512011610095578063eff7f2fd11610064578063eff7f2fd1461069b578063f2f7141f146106b0578063f34ec5e0146106c3578063fa69dc7b146106f757600080fd5b8063cebb51201461063d578063d0a1026014610652578063d3af0cc114610665578063e648f9291461067b57600080fd5b8063b20bffdc116100d1578063b20bffdc14610587578063c37bcb4c146105d3578063cc4aa204146105e9578063ce362c051461061d57600080fd5b80639dbfb13f146104a2578063a4e7f8bd146104d3578063a69610d114610501578063a754403e1461055357600080fd5b806320d2c9511161017a578063643a114e11610149578063643a114e146103fa5780636fad06f51461041a57806371139d6c1461044e5780638d91e5621461048257600080fd5b806320d2c9511461033f578063574ad4a8146103555780635ab870b414610389578063634d45b2146103bd57600080fd5b806319180904116101b6578063191809041461025a5780631cd666901461026d5780631ed0993d146102c05780631f8164d91461030c57600080fd5b806301a29d9a146101e857806303a9437e1461020a57806317a15d4e1461023757600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b506102086102033660046121ec565b61072b565b005b34801561021657600080fd5b5061021f601281565b60405160009190910b81526020015b60405180910390f35b34801561024357600080fd5b5061024c600081565b60405190815260200161022e565b610208610268366004612209565b61088b565b34801561027957600080fd5b5061028d610288366004612237565b610c2a565b60408051825181526020808401516001600160401b0390811691830191909152928201519092169082015260600161022e565b3480156102cc57600080fd5b506102f47f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161022e565b34801561031857600080fd5b506103266280000360e11b81565b6040516001600160e01b0319909116815260200161022e565b34801561034b57600080fd5b50620249f061024c565b34801561036157600080fd5b506102f47f000000000000000000000000000000000000000000000000000000000000000081565b34801561039557600080fd5b506102f47f000000000000000000000000000000000000000000000000000000000000000081565b3480156103c957600080fd5b506103dd6103d83660046122d7565b610c69565b604080519283526001600160a01b0390911660208301520161022e565b34801561040657600080fd5b50610208610415366004612209565b610ca7565b34801561042657600080fd5b506102f47f000000000000000000000000000000000000000000000000000000000000000081565b34801561045a57600080fd5b5061021f7f000000000000000000000000000000000000000000000000000000000000000081565b34801561048e57600080fd5b5061020861049d3660046121ec565b610e43565b3480156104ae57600080fd5b506104c26104bd366004612318565b610f97565b60405190511515815260200161022e565b3480156104df57600080fd5b506104f36104ee366004612209565b61109b565b60405161022e9291906123fb565b34801561050d57600080fd5b5061052161051c36600461241d565b6112a6565b6040805182516001600160401b039081168252602080850151821690830152928201519092169082015260600161022e565b34801561055f57600080fd5b5061021f7f000000000000000000000000000000000000000000000000000000000000000081565b34801561059357600080fd5b506105bb7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160401b03909116815260200161022e565b3480156105df57600080fd5b5062030d4061024c565b3480156105f557600080fd5b506102f47f000000000000000000000000000000000000000000000000000000000000000081565b34801561062957600080fd5b50610208610638366004612209565b6113c9565b34801561064957600080fd5b5061024c604081565b610208610660366004612456565b611520565b34801561067157600080fd5b5061021f60011981565b34801561068757600080fd5b506102086106963660046124f6565b6118c6565b3480156106a757600080fd5b506105bb600081565b6102086106be366004612524565b611979565b3480156106cf57600080fd5b506102f47f000000000000000000000000000000000000000000000000000000000000000081565b34801561070357600080fd5b506105bb7f000000000000000000000000000000000000000000000000000000000000000081565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610774576040516320a6214d60e21b815260040160405180910390fd5b60006107a07f0000000000000000000000000000000000000000000000000000000000000000836119b7565b90506107ed7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000083611a23565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160401b03167f174ca337da6511fd085fea54a16895b8aa4cbb0cddbbeaae3a0f581d8f49f6c88360405161087f91906001600160401b0391909116815260200190565b60405180910390a35050565b6000818152600160208190526040808320815161012081018352815463ffffffff1692810192835292810154606084015260028101546080840152600381015460a0840152600481018054919284929091849160c0850191906108ed90612550565b80601f016020809104026020016040519081016040528092919081815260200182805461091990612550565b80156109665780601f1061093b57610100808354040283529160200191610966565b820191906000526020600020905b81548152906001019060200180831161094957829003601f168201915b5050505050815260200160058201805461097f90612550565b80601f01602080910402602001604051908101604052809291908181526020018280546109ab90612550565b80156109f85780601f106109cd576101008083540402835291602001916109f8565b820191906000526020600020905b8154815290600101906020018083116109db57829003601f168201915b50505050508152602001600682018054610a1190612550565b80601f0160208091040260200160405190810160405280929190818152602001828054610a3d90612550565b8015610a8a5780601f10610a5f57610100808354040283529160200191610a8a565b820191906000526020600020905b815481529060010190602001808311610a6d57829003601f168201915b5050509190925250505081526007919091015460209091015280515190915063ffffffff16600003610ad7576040516302e5218d60e21b8152600481018390526024015b60405180910390fd5b60008281526001602081905260408220805463ffffffff191681559081018290556002810182905560038101829055908181610b166004830182612181565b610b24600583016000612181565b610b32600683016000612181565b5050600782016000905550506000348260200151610b50919061259a565b825160408051808201825283815260006020820152905163c7c7f5b360e01b81529293506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169263c7c7f5b3928592610bb59232906004016125ad565b60c06040518083038185885af1158015610bd3573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610bf89190612678565b505060405183907fd41d02272333251e6367f747c63d5cc227dcac6b0c799067569e80a30f9da36990600090a2505050565b6040805160608101825260008082526020820181905291810182905290610c5184876112a6565b519050610c5f838287611afa565b9695505050505050565b60008060408314610c9057604051632b701db160e01b815260048101849052602401610ace565b610c9c838501856126e4565b909590945092505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610cf0576040516320a6214d60e21b815260040160405180910390fd5b60008115610cfe5781610d86565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610d62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d869190612709565b9050610ddc6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f000000000000000000000000000000000000000000000000000000000000000083611b84565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa2882604051610e3791815260200190565b60405180910390a25050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610e8c576040516320a6214d60e21b815260040160405180910390fd5b6000610eb87f0000000000000000000000000000000000000000000000000000000000000000836119b7565b9050610f057f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000083611a23565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160401b03167f174ca337da6511fd085fea54a16895b8aa4cbb0cddbbeaae3a0f581d8f49f6c88360405161087f91906001600160401b0391909116815260200190565b604080516020810190915260008152604080516001600160a01b03841660208201526000918291610810910160408051601f1981840301815290829052610fdd91612722565b600060405180830381855afa9150503d8060008114611018576040519150601f19603f3d011682016040523d82523d6000602084013e61101d565b606091505b50915091508161107f5760405162461bcd60e51b815260206004820152602760248201527f436f726520757365722065786973747320707265636f6d70696c652063616c6c6044820152660819985a5b195960ca1b6064820152608401610ace565b80806020019051810190611093919061273e565b949350505050565b600160208181526000928352604092839020835160e081018552815463ffffffff168152928101549183019190915260028101549282019290925260038201546060820152600482018054839160808401916110f690612550565b80601f016020809104026020016040519081016040528092919081815260200182805461112290612550565b801561116f5780601f106111445761010080835404028352916020019161116f565b820191906000526020600020905b81548152906001019060200180831161115257829003601f168201915b5050505050815260200160058201805461118890612550565b80601f01602080910402602001604051908101604052809291908181526020018280546111b490612550565b80156112015780601f106111d657610100808354040283529160200191611201565b820191906000526020600020905b8154815290600101906020018083116111e457829003601f168201915b5050505050815260200160068201805461121a90612550565b80601f016020809104026020016040519081016040528092919081815260200182805461124690612550565b80156112935780601f1061126857610100808354040283529160200191611293565b820191906000526020600020905b81548152906001019060200180831161127657829003601f168201915b5050509190925250505060079091015482565b6040805160608101825260008082526020820181905291810191909152604080516001600160a01b03851660208201526001600160401b0384169181019190915260009081906108019060600160408051601f198184030181529082905261130d91612722565b600060405180830381855afa9150503d8060008114611348576040519150601f19603f3d011682016040523d82523d6000602084013e61134d565b606091505b5091509150816113aa5760405162461bcd60e51b815260206004820152602260248201527f53706f7442616c616e636520707265636f6d70696c652063616c6c206661696c604482015261195960f21b6064820152608401610ace565b808060200190518101906113be919061278e565b925050505b92915050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611412576040516320a6214d60e21b815260040160405180910390fd5b600081156114205781611422565b475b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168260405160006040518083038185875af1925050503d8060008114611491576040519150601f19603f3d011682016040523d82523d6000602084013e611496565b606091505b50509050806114b8576040516312171d8360e31b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa288360405161151391815260200190565b60405180910390a2505050565b611528611bdb565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461157157604051630fd72cd960e31b815260040160405180910390fd5b866001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316146115f657604051636459ab6360e11b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015288166024820152604401610ace565b60006116028686611c05565b905060006116108787611c1e565b6040516331a6a2d960e11b8152909150309063634d45b2906116369084906004016127e2565b6040805180830381865afa92505050801561166e575060408051601f3d908101601f1916820190925261166b918101906127f5565b60015b6117d4576116bb6040518060e00160405280600063ffffffff1681526020016000801916815260200160008152602001600081526020016060815260200160608152602001606081525090565b6116c58888611c69565b63ffffffff1681526116d78888611c8c565b602082810191909152604080830185905280518082018252838152348184015260008c815260018085529083902082518051825463ffffffff191663ffffffff909116178255948501519181019190915591830151600283015560608301516003830155608083015190929082906004820190611754908261286a565b5060a08201516005820190611769908261286a565b5060c0820151600682019061177e908261286a565b50505060208201518160070155905050887f387fc8f821460fa8221428c9f4dc1f6d5db4f6a0a01f33dbeaa8cebd95e5d144826020015134856040516117c693929190612929565b60405180910390a2506118b1565b813410156117fe57604051631f2dda7760e21b815234600482015260248101839052604401610ace565b600080341161181057620249f0611815565b62030d405b9050805a1015611844575a6040516323e228cb60e01b8152600481019190915260248101829052604401610ace565b60405163f2f7141f60e01b81526001600160a01b038316600482015260248101869052309063f2f7141f9034906044016000604051808303818588803b15801561188d57600080fd5b505af19350505050801561189f575060015b6118ad576118ad8286611c9c565b5050505b50506118bd6001600055565b50505050505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461190f576040516320a6214d60e21b815260040160405180910390fd5b600061191c6000846119b7565b905061192a82600083611a23565b6040516001600160401b03821681526001600160a01b038316906000907f174ca337da6511fd085fea54a16895b8aa4cbb0cddbbeaae3a0f581d8f49f6c89060200160405180910390a3505050565b33301461199a5760405162a19dbf60e81b8152336004820152602401610ace565b6119a48282611da6565b34156119b3576119b382611eba565b5050565b6000806119c430856112a6565b5190506001600160401b038082169084161115611a075760405163133c5d1160e31b81526001600160401b03808316600483015284166024820152604401610ace565b6001600160401b03831615611a1c5782611093565b9392505050565b604080516001600160a01b03851660208201526001600160401b038481168284015283166060808301919091528251808303909101815260808201909252600090611a7a906280000360e11b90849060a001612951565b60408051601f19818403018152908290526317938e1360e01b82529150733333333333333333333333333333333333333333906317938e1390611ac19084906004016127e2565b600060405180830381600087803b158015611adb57600080fd5b505af1158015611aef573d6000803e3d6000fd5b505050505050505050565b604080516060810182526000808252602082018190529181019190915260008060008460000b1315611b3b57611b31868686611ff9565b9092509050611b57565b611b518686611b4c87600019612982565b61207c565b90925090505b604080516060810182529283526001600160401b0391821660208401529085169082015290509392505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611bd69084906120e1565b505050565b600260005403611bfe57604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b6000611c15602c600c84866129a9565b611a1c916129d3565b6060611c2d82604c81866129a9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929695505050505050565b6000611c79600c600884866129a9565b611c82916129f1565b60e01c9392505050565b6000611c15604c602c84866129a9565b3415611d6c576000826001600160a01b03163460405160006040518083038185875af1925050503d8060008114611cef576040519150601f19603f3d011682016040523d82523d6000602084013e611cf4565b606091505b5050905080611d6a57604051600090329034908381818185875af1925050503d8060008114611d3f576040519150601f19603f3d011682016040523d82523d6000602084013e611d44565b606091505b5050905080611d6857604051633ba3ce9960e11b8152346004820152602401610ace565b505b505b80156119b3576119b36001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168383611b84565b6000611e147f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000085610c2a565b805190915015611bd6576000611e2e848360200151612152565b8251909150611e89906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016907f000000000000000000000000000000000000000000000000000000000000000090611b84565b611eb4847f000000000000000000000000000000000000000000000000000000000000000083611a23565b50505050565b6000611f287f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000034610c2a565b8051909150156119b35780516040516000916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016918381818185875af1925050503d8060008114611f9d576040519150601f19603f3d011682016040523d82523d6000602084013e611fa2565b606091505b5050905080611fca578151604051633ba3ce9960e11b81526004810191909152602401610ace565b611bd6837f00000000000000000000000000000000000000000000000000000000000000008460200151611a23565b6000808061200884600a612b05565b9050600061201f826001600160401b038816612b14565b905081878161203057612030612b2b565b06870393508084111561206057604051639a0c830f60e01b81526004810185905260248101829052604401610ace565b81848161206f5761206f612b2b565b0492505050935093915050565b6000808061208b84600a612b05565b905060006120a2826001600160401b038816612b41565b9050869350808711156120d257604051639a0c830f60e01b81526004810185905260248101829052604401610ace565b81840292505050935093915050565b600080602060008451602086016000885af180612104576040513d6000823e3d81fd5b50506000513d9150811561211c578060011415612129565b6001600160a01b0384163b155b15611eb457604051635274afe760e01b81526001600160a01b0385166004820152602401610ace565b600061215d83610f97565b5161217b57604051635ee78a7560e11b815260040160405180910390fd5b50919050565b50805461218d90612550565b6000825580601f1061219d575050565b601f0160209004906000526020600020908101906121bb91906121be565b50565b5b808211156121d357600081556001016121bf565b5090565b6001600160401b03811681146121bb57600080fd5b6000602082840312156121fe57600080fd5b8135611a1c816121d7565b60006020828403121561221b57600080fd5b5035919050565b6001600160a01b03811681146121bb57600080fd5b6000806000806080858703121561224d57600080fd5b8435612258816121d7565b93506020850135600081900b811461226f57600080fd5b9250604085013561227f81612222565b9396929550929360600135925050565b60008083601f8401126122a157600080fd5b5081356001600160401b038111156122b857600080fd5b6020830191508360208285010111156122d057600080fd5b9250929050565b600080602083850312156122ea57600080fd5b82356001600160401b0381111561230057600080fd5b61230c8582860161228f565b90969095509350505050565b60006020828403121561232a57600080fd5b8135611a1c81612222565b60005b83811015612350578181015183820152602001612338565b50506000910152565b60008151808452612371816020860160208601612335565b601f01601f19169290920160200192915050565b63ffffffff81511682526020810151602083015260408101516040830152606081015160608301526000608082015160e060808501526123c860e0850182612359565b905060a083015184820360a08601526123e18282612359565b91505060c083015184820360c08601526113be8282612359565b60408152600061240e6040830185612385565b90508260208301529392505050565b6000806040838503121561243057600080fd5b823561243b81612222565b9150602083013561244b816121d7565b809150509250929050565b600080600080600080600060a0888a03121561247157600080fd5b873561247c81612222565b96506020880135955060408801356001600160401b038082111561249f57600080fd5b6124ab8b838c0161228f565b909750955060608a013591506124c082612222565b909350608089013590808211156124d657600080fd5b506124e38a828b0161228f565b989b979a50959850939692959293505050565b6000806040838503121561250957600080fd5b8235612514816121d7565b9150602083013561244b81612222565b6000806040838503121561253757600080fd5b823561254281612222565b946020939093013593505050565b600181811c9082168061256457607f821691505b60208210810361217b57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156113c3576113c3612584565b6080815260006125c06080830186612385565b8451602084810191909152909401516040830152506001600160a01b0391909116606090910152919050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715612624576126246125ec565b60405290565b60006040828403121561263c57600080fd5b604051604081018181106001600160401b038211171561265e5761265e6125ec565b604052825181526020928301519281019290925250919050565b60008082840360c081121561268c57600080fd5b608081121561269a57600080fd5b506126a3612602565b8351815260208401516126b5816121d7565b60208201526126c7856040860161262a565b604082015291506126db846080850161262a565b90509250929050565b600080604083850312156126f757600080fd5b82359150602083013561244b81612222565b60006020828403121561271b57600080fd5b5051919050565b60008251612734818460208701612335565b9190910192915050565b60006020828403121561275057600080fd5b604051602081018181106001600160401b0382111715612772576127726125ec565b6040528251801515811461278557600080fd5b81529392505050565b6000606082840312156127a057600080fd5b6127a8612602565b82516127b3816121d7565b815260208301516127c3816121d7565b602082015260408301516127d6816121d7565b60408201529392505050565b602081526000611a1c6020830184612359565b6000806040838503121561280857600080fd5b82519150602083015161244b81612222565b601f821115611bd6576000816000526020600020601f850160051c810160208610156128435750805b601f850160051c820191505b818110156128625782815560010161284f565b505050505050565b81516001600160401b03811115612883576128836125ec565b612897816128918454612550565b8461281a565b602080601f8311600181146128cc57600084156128b45750858301515b600019600386901b1c1916600185901b178555612862565b600085815260208120601f198616915b828110156128fb578886015182559484019460019091019084016128dc565b50858210156129195787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b8381528260208201526060604082015260006129486060830184612359565b95945050505050565b6001600160e01b0319831681528151600090612974816004850160208701612335565b919091016004019392505050565b60008260000b8260000b028060000b91508082146129a2576129a2612584565b5092915050565b600080858511156129b957600080fd5b838611156129c657600080fd5b5050820193919092039150565b803560208310156113c357600019602084900360031b1b1692915050565b6001600160e01b03198135818116916004851015612a195780818660040360031b1b83161692505b505092915050565b600181815b80851115612a5c578160001904821115612a4257612a42612584565b80851615612a4f57918102915b93841c9390800290612a26565b509250929050565b600082612a73575060016113c3565b81612a80575060006113c3565b8160018114612a965760028114612aa057612abc565b60019150506113c3565b60ff841115612ab157612ab1612584565b50506001821b6113c3565b5060208310610133831016604e8410600b8410161715612adf575081810a6113c3565b612ae98383612a21565b8060001904821115612afd57612afd612584565b029392505050565b6000611a1c60ff841683612a64565b80820281158282048414176113c3576113c3612584565b634e487b7160e01b600052601260045260246000fd5b600082612b5e57634e487b7160e01b600052601260045260246000fd5b50049056fea26469706673582212206e5efe9b8ddf95a0ffeccfe2ef1a63e34a3cc7e6c182e11fc2ff8dea311ba40864736f6c634300081600330000000000000000000000005d3a1ff2b6bab83b63cd9ad0787074081a52ef3400000000000000000000000000000000000000000000000000000000000000eb000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000064c1d4388118fc4fded8943a59a86d03965575bc

Deployed Bytecode

0x6080604052600436106101dc5760003560e01c80639dbfb13f11610102578063cebb512011610095578063eff7f2fd11610064578063eff7f2fd1461069b578063f2f7141f146106b0578063f34ec5e0146106c3578063fa69dc7b146106f757600080fd5b8063cebb51201461063d578063d0a1026014610652578063d3af0cc114610665578063e648f9291461067b57600080fd5b8063b20bffdc116100d1578063b20bffdc14610587578063c37bcb4c146105d3578063cc4aa204146105e9578063ce362c051461061d57600080fd5b80639dbfb13f146104a2578063a4e7f8bd146104d3578063a69610d114610501578063a754403e1461055357600080fd5b806320d2c9511161017a578063643a114e11610149578063643a114e146103fa5780636fad06f51461041a57806371139d6c1461044e5780638d91e5621461048257600080fd5b806320d2c9511461033f578063574ad4a8146103555780635ab870b414610389578063634d45b2146103bd57600080fd5b806319180904116101b6578063191809041461025a5780631cd666901461026d5780631ed0993d146102c05780631f8164d91461030c57600080fd5b806301a29d9a146101e857806303a9437e1461020a57806317a15d4e1461023757600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b506102086102033660046121ec565b61072b565b005b34801561021657600080fd5b5061021f601281565b60405160009190910b81526020015b60405180910390f35b34801561024357600080fd5b5061024c600081565b60405190815260200161022e565b610208610268366004612209565b61088b565b34801561027957600080fd5b5061028d610288366004612237565b610c2a565b60408051825181526020808401516001600160401b0390811691830191909152928201519092169082015260600161022e565b3480156102cc57600080fd5b506102f47f0000000000000000000000005d3a1ff2b6bab83b63cd9ad0787074081a52ef3481565b6040516001600160a01b03909116815260200161022e565b34801561031857600080fd5b506103266280000360e11b81565b6040516001600160e01b0319909116815260200161022e565b34801561034b57600080fd5b50620249f061024c565b34801561036157600080fd5b506102f47f000000000000000000000000222222222222222222222222222222222222222281565b34801561039557600080fd5b506102f47f00000000000000000000000064c1d4388118fc4fded8943a59a86d03965575bc81565b3480156103c957600080fd5b506103dd6103d83660046122d7565b610c69565b604080519283526001600160a01b0390911660208301520161022e565b34801561040657600080fd5b50610208610415366004612209565b610ca7565b34801561042657600080fd5b506102f47f0000000000000000000000003a73033c0b1407574c76bdbac67f126f6b4a9aa981565b34801561045a57600080fd5b5061021f7f000000000000000000000000000000000000000000000000000000000000000a81565b34801561048e57600080fd5b5061020861049d3660046121ec565b610e43565b3480156104ae57600080fd5b506104c26104bd366004612318565b610f97565b60405190511515815260200161022e565b3480156104df57600080fd5b506104f36104ee366004612209565b61109b565b60405161022e9291906123fb565b34801561050d57600080fd5b5061052161051c36600461241d565b6112a6565b6040805182516001600160401b039081168252602080850151821690830152928201519092169082015260600161022e565b34801561055f57600080fd5b5061021f7f000000000000000000000000000000000000000000000000000000000000000a81565b34801561059357600080fd5b506105bb7f000000000000000000000000000000000000000000000000000000000000009681565b6040516001600160401b03909116815260200161022e565b3480156105df57600080fd5b5062030d4061024c565b3480156105f557600080fd5b506102f47f0000000000000000000000005d3a1ff2b6bab83b63cd9ad0787074081a52ef3481565b34801561062957600080fd5b50610208610638366004612209565b6113c9565b34801561064957600080fd5b5061024c604081565b610208610660366004612456565b611520565b34801561067157600080fd5b5061021f60011981565b34801561068757600080fd5b506102086106963660046124f6565b6118c6565b3480156106a757600080fd5b506105bb600081565b6102086106be366004612524565b611979565b3480156106cf57600080fd5b506102f47f00000000000000000000000020000000000000000000000000000000000000eb81565b34801561070357600080fd5b506105bb7f00000000000000000000000000000000000000000000000000000000000000eb81565b336001600160a01b037f00000000000000000000000064c1d4388118fc4fded8943a59a86d03965575bc1614610774576040516320a6214d60e21b815260040160405180910390fd5b60006107a07f0000000000000000000000000000000000000000000000000000000000000096836119b7565b90506107ed7f00000000000000000000000022222222222222222222222222222222222222227f000000000000000000000000000000000000000000000000000000000000009683611a23565b7f00000000000000000000000022222222222222222222222222222222222222226001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000966001600160401b03167f174ca337da6511fd085fea54a16895b8aa4cbb0cddbbeaae3a0f581d8f49f6c88360405161087f91906001600160401b0391909116815260200190565b60405180910390a35050565b6000818152600160208190526040808320815161012081018352815463ffffffff1692810192835292810154606084015260028101546080840152600381015460a0840152600481018054919284929091849160c0850191906108ed90612550565b80601f016020809104026020016040519081016040528092919081815260200182805461091990612550565b80156109665780601f1061093b57610100808354040283529160200191610966565b820191906000526020600020905b81548152906001019060200180831161094957829003601f168201915b5050505050815260200160058201805461097f90612550565b80601f01602080910402602001604051908101604052809291908181526020018280546109ab90612550565b80156109f85780601f106109cd576101008083540402835291602001916109f8565b820191906000526020600020905b8154815290600101906020018083116109db57829003601f168201915b50505050508152602001600682018054610a1190612550565b80601f0160208091040260200160405190810160405280929190818152602001828054610a3d90612550565b8015610a8a5780601f10610a5f57610100808354040283529160200191610a8a565b820191906000526020600020905b815481529060010190602001808311610a6d57829003601f168201915b5050509190925250505081526007919091015460209091015280515190915063ffffffff16600003610ad7576040516302e5218d60e21b8152600481018390526024015b60405180910390fd5b60008281526001602081905260408220805463ffffffff191681559081018290556002810182905560038101829055908181610b166004830182612181565b610b24600583016000612181565b610b32600683016000612181565b5050600782016000905550506000348260200151610b50919061259a565b825160408051808201825283815260006020820152905163c7c7f5b360e01b81529293506001600160a01b037f0000000000000000000000005d3a1ff2b6bab83b63cd9ad0787074081a52ef34169263c7c7f5b3928592610bb59232906004016125ad565b60c06040518083038185885af1158015610bd3573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610bf89190612678565b505060405183907fd41d02272333251e6367f747c63d5cc227dcac6b0c799067569e80a30f9da36990600090a2505050565b6040805160608101825260008082526020820181905291810182905290610c5184876112a6565b519050610c5f838287611afa565b9695505050505050565b60008060408314610c9057604051632b701db160e01b815260048101849052602401610ace565b610c9c838501856126e4565b909590945092505050565b336001600160a01b037f00000000000000000000000064c1d4388118fc4fded8943a59a86d03965575bc1614610cf0576040516320a6214d60e21b815260040160405180910390fd5b60008115610cfe5781610d86565b6040516370a0823160e01b81523060048201527f0000000000000000000000005d3a1ff2b6bab83b63cd9ad0787074081a52ef346001600160a01b0316906370a0823190602401602060405180830381865afa158015610d62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d869190612709565b9050610ddc6001600160a01b037f0000000000000000000000005d3a1ff2b6bab83b63cd9ad0787074081a52ef34167f00000000000000000000000064c1d4388118fc4fded8943a59a86d03965575bc83611b84565b7f00000000000000000000000064c1d4388118fc4fded8943a59a86d03965575bc6001600160a01b03167f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa2882604051610e3791815260200190565b60405180910390a25050565b336001600160a01b037f00000000000000000000000064c1d4388118fc4fded8943a59a86d03965575bc1614610e8c576040516320a6214d60e21b815260040160405180910390fd5b6000610eb87f00000000000000000000000000000000000000000000000000000000000000eb836119b7565b9050610f057f00000000000000000000000020000000000000000000000000000000000000eb7f00000000000000000000000000000000000000000000000000000000000000eb83611a23565b7f00000000000000000000000020000000000000000000000000000000000000eb6001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000eb6001600160401b03167f174ca337da6511fd085fea54a16895b8aa4cbb0cddbbeaae3a0f581d8f49f6c88360405161087f91906001600160401b0391909116815260200190565b604080516020810190915260008152604080516001600160a01b03841660208201526000918291610810910160408051601f1981840301815290829052610fdd91612722565b600060405180830381855afa9150503d8060008114611018576040519150601f19603f3d011682016040523d82523d6000602084013e61101d565b606091505b50915091508161107f5760405162461bcd60e51b815260206004820152602760248201527f436f726520757365722065786973747320707265636f6d70696c652063616c6c6044820152660819985a5b195960ca1b6064820152608401610ace565b80806020019051810190611093919061273e565b949350505050565b600160208181526000928352604092839020835160e081018552815463ffffffff168152928101549183019190915260028101549282019290925260038201546060820152600482018054839160808401916110f690612550565b80601f016020809104026020016040519081016040528092919081815260200182805461112290612550565b801561116f5780601f106111445761010080835404028352916020019161116f565b820191906000526020600020905b81548152906001019060200180831161115257829003601f168201915b5050505050815260200160058201805461118890612550565b80601f01602080910402602001604051908101604052809291908181526020018280546111b490612550565b80156112015780601f106111d657610100808354040283529160200191611201565b820191906000526020600020905b8154815290600101906020018083116111e457829003601f168201915b5050505050815260200160068201805461121a90612550565b80601f016020809104026020016040519081016040528092919081815260200182805461124690612550565b80156112935780601f1061126857610100808354040283529160200191611293565b820191906000526020600020905b81548152906001019060200180831161127657829003601f168201915b5050509190925250505060079091015482565b6040805160608101825260008082526020820181905291810191909152604080516001600160a01b03851660208201526001600160401b0384169181019190915260009081906108019060600160408051601f198184030181529082905261130d91612722565b600060405180830381855afa9150503d8060008114611348576040519150601f19603f3d011682016040523d82523d6000602084013e61134d565b606091505b5091509150816113aa5760405162461bcd60e51b815260206004820152602260248201527f53706f7442616c616e636520707265636f6d70696c652063616c6c206661696c604482015261195960f21b6064820152608401610ace565b808060200190518101906113be919061278e565b925050505b92915050565b336001600160a01b037f00000000000000000000000064c1d4388118fc4fded8943a59a86d03965575bc1614611412576040516320a6214d60e21b815260040160405180910390fd5b600081156114205781611422565b475b905060007f00000000000000000000000064c1d4388118fc4fded8943a59a86d03965575bc6001600160a01b03168260405160006040518083038185875af1925050503d8060008114611491576040519150601f19603f3d011682016040523d82523d6000602084013e611496565b606091505b50509050806114b8576040516312171d8360e31b815260040160405180910390fd5b7f00000000000000000000000064c1d4388118fc4fded8943a59a86d03965575bc6001600160a01b03167f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa288360405161151391815260200190565b60405180910390a2505050565b611528611bdb565b336001600160a01b037f0000000000000000000000003a73033c0b1407574c76bdbac67f126f6b4a9aa9161461157157604051630fd72cd960e31b815260040160405180910390fd5b866001600160a01b03167f0000000000000000000000005d3a1ff2b6bab83b63cd9ad0787074081a52ef346001600160a01b0316146115f657604051636459ab6360e11b81526001600160a01b037f0000000000000000000000005d3a1ff2b6bab83b63cd9ad0787074081a52ef348116600483015288166024820152604401610ace565b60006116028686611c05565b905060006116108787611c1e565b6040516331a6a2d960e11b8152909150309063634d45b2906116369084906004016127e2565b6040805180830381865afa92505050801561166e575060408051601f3d908101601f1916820190925261166b918101906127f5565b60015b6117d4576116bb6040518060e00160405280600063ffffffff1681526020016000801916815260200160008152602001600081526020016060815260200160608152602001606081525090565b6116c58888611c69565b63ffffffff1681526116d78888611c8c565b602082810191909152604080830185905280518082018252838152348184015260008c815260018085529083902082518051825463ffffffff191663ffffffff909116178255948501519181019190915591830151600283015560608301516003830155608083015190929082906004820190611754908261286a565b5060a08201516005820190611769908261286a565b5060c0820151600682019061177e908261286a565b50505060208201518160070155905050887f387fc8f821460fa8221428c9f4dc1f6d5db4f6a0a01f33dbeaa8cebd95e5d144826020015134856040516117c693929190612929565b60405180910390a2506118b1565b813410156117fe57604051631f2dda7760e21b815234600482015260248101839052604401610ace565b600080341161181057620249f0611815565b62030d405b9050805a1015611844575a6040516323e228cb60e01b8152600481019190915260248101829052604401610ace565b60405163f2f7141f60e01b81526001600160a01b038316600482015260248101869052309063f2f7141f9034906044016000604051808303818588803b15801561188d57600080fd5b505af19350505050801561189f575060015b6118ad576118ad8286611c9c565b5050505b50506118bd6001600055565b50505050505050565b336001600160a01b037f00000000000000000000000064c1d4388118fc4fded8943a59a86d03965575bc161461190f576040516320a6214d60e21b815260040160405180910390fd5b600061191c6000846119b7565b905061192a82600083611a23565b6040516001600160401b03821681526001600160a01b038316906000907f174ca337da6511fd085fea54a16895b8aa4cbb0cddbbeaae3a0f581d8f49f6c89060200160405180910390a3505050565b33301461199a5760405162a19dbf60e81b8152336004820152602401610ace565b6119a48282611da6565b34156119b3576119b382611eba565b5050565b6000806119c430856112a6565b5190506001600160401b038082169084161115611a075760405163133c5d1160e31b81526001600160401b03808316600483015284166024820152604401610ace565b6001600160401b03831615611a1c5782611093565b9392505050565b604080516001600160a01b03851660208201526001600160401b038481168284015283166060808301919091528251808303909101815260808201909252600090611a7a906280000360e11b90849060a001612951565b60408051601f19818403018152908290526317938e1360e01b82529150733333333333333333333333333333333333333333906317938e1390611ac19084906004016127e2565b600060405180830381600087803b158015611adb57600080fd5b505af1158015611aef573d6000803e3d6000fd5b505050505050505050565b604080516060810182526000808252602082018190529181019190915260008060008460000b1315611b3b57611b31868686611ff9565b9092509050611b57565b611b518686611b4c87600019612982565b61207c565b90925090505b604080516060810182529283526001600160401b0391821660208401529085169082015290509392505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611bd69084906120e1565b505050565b600260005403611bfe57604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b6000611c15602c600c84866129a9565b611a1c916129d3565b6060611c2d82604c81866129a9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929695505050505050565b6000611c79600c600884866129a9565b611c82916129f1565b60e01c9392505050565b6000611c15604c602c84866129a9565b3415611d6c576000826001600160a01b03163460405160006040518083038185875af1925050503d8060008114611cef576040519150601f19603f3d011682016040523d82523d6000602084013e611cf4565b606091505b5050905080611d6a57604051600090329034908381818185875af1925050503d8060008114611d3f576040519150601f19603f3d011682016040523d82523d6000602084013e611d44565b606091505b5050905080611d6857604051633ba3ce9960e11b8152346004820152602401610ace565b505b505b80156119b3576119b36001600160a01b037f0000000000000000000000005d3a1ff2b6bab83b63cd9ad0787074081a52ef34168383611b84565b6000611e147f00000000000000000000000000000000000000000000000000000000000000eb7f000000000000000000000000000000000000000000000000000000000000000a7f00000000000000000000000020000000000000000000000000000000000000eb85610c2a565b805190915015611bd6576000611e2e848360200151612152565b8251909150611e89906001600160a01b037f0000000000000000000000005d3a1ff2b6bab83b63cd9ad0787074081a52ef3416907f00000000000000000000000020000000000000000000000000000000000000eb90611b84565b611eb4847f00000000000000000000000000000000000000000000000000000000000000eb83611a23565b50505050565b6000611f287f00000000000000000000000000000000000000000000000000000000000000967f000000000000000000000000000000000000000000000000000000000000000a7f000000000000000000000000222222222222222222222222222222222222222234610c2a565b8051909150156119b35780516040516000916001600160a01b037f000000000000000000000000222222222222222222222222222222222222222216918381818185875af1925050503d8060008114611f9d576040519150601f19603f3d011682016040523d82523d6000602084013e611fa2565b606091505b5050905080611fca578151604051633ba3ce9960e11b81526004810191909152602401610ace565b611bd6837f00000000000000000000000000000000000000000000000000000000000000968460200151611a23565b6000808061200884600a612b05565b9050600061201f826001600160401b038816612b14565b905081878161203057612030612b2b565b06870393508084111561206057604051639a0c830f60e01b81526004810185905260248101829052604401610ace565b81848161206f5761206f612b2b565b0492505050935093915050565b6000808061208b84600a612b05565b905060006120a2826001600160401b038816612b41565b9050869350808711156120d257604051639a0c830f60e01b81526004810185905260248101829052604401610ace565b81840292505050935093915050565b600080602060008451602086016000885af180612104576040513d6000823e3d81fd5b50506000513d9150811561211c578060011415612129565b6001600160a01b0384163b155b15611eb457604051635274afe760e01b81526001600160a01b0385166004820152602401610ace565b600061215d83610f97565b5161217b57604051635ee78a7560e11b815260040160405180910390fd5b50919050565b50805461218d90612550565b6000825580601f1061219d575050565b601f0160209004906000526020600020908101906121bb91906121be565b50565b5b808211156121d357600081556001016121bf565b5090565b6001600160401b03811681146121bb57600080fd5b6000602082840312156121fe57600080fd5b8135611a1c816121d7565b60006020828403121561221b57600080fd5b5035919050565b6001600160a01b03811681146121bb57600080fd5b6000806000806080858703121561224d57600080fd5b8435612258816121d7565b93506020850135600081900b811461226f57600080fd5b9250604085013561227f81612222565b9396929550929360600135925050565b60008083601f8401126122a157600080fd5b5081356001600160401b038111156122b857600080fd5b6020830191508360208285010111156122d057600080fd5b9250929050565b600080602083850312156122ea57600080fd5b82356001600160401b0381111561230057600080fd5b61230c8582860161228f565b90969095509350505050565b60006020828403121561232a57600080fd5b8135611a1c81612222565b60005b83811015612350578181015183820152602001612338565b50506000910152565b60008151808452612371816020860160208601612335565b601f01601f19169290920160200192915050565b63ffffffff81511682526020810151602083015260408101516040830152606081015160608301526000608082015160e060808501526123c860e0850182612359565b905060a083015184820360a08601526123e18282612359565b91505060c083015184820360c08601526113be8282612359565b60408152600061240e6040830185612385565b90508260208301529392505050565b6000806040838503121561243057600080fd5b823561243b81612222565b9150602083013561244b816121d7565b809150509250929050565b600080600080600080600060a0888a03121561247157600080fd5b873561247c81612222565b96506020880135955060408801356001600160401b038082111561249f57600080fd5b6124ab8b838c0161228f565b909750955060608a013591506124c082612222565b909350608089013590808211156124d657600080fd5b506124e38a828b0161228f565b989b979a50959850939692959293505050565b6000806040838503121561250957600080fd5b8235612514816121d7565b9150602083013561244b81612222565b6000806040838503121561253757600080fd5b823561254281612222565b946020939093013593505050565b600181811c9082168061256457607f821691505b60208210810361217b57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156113c3576113c3612584565b6080815260006125c06080830186612385565b8451602084810191909152909401516040830152506001600160a01b0391909116606090910152919050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715612624576126246125ec565b60405290565b60006040828403121561263c57600080fd5b604051604081018181106001600160401b038211171561265e5761265e6125ec565b604052825181526020928301519281019290925250919050565b60008082840360c081121561268c57600080fd5b608081121561269a57600080fd5b506126a3612602565b8351815260208401516126b5816121d7565b60208201526126c7856040860161262a565b604082015291506126db846080850161262a565b90509250929050565b600080604083850312156126f757600080fd5b82359150602083013561244b81612222565b60006020828403121561271b57600080fd5b5051919050565b60008251612734818460208701612335565b9190910192915050565b60006020828403121561275057600080fd5b604051602081018181106001600160401b0382111715612772576127726125ec565b6040528251801515811461278557600080fd5b81529392505050565b6000606082840312156127a057600080fd5b6127a8612602565b82516127b3816121d7565b815260208301516127c3816121d7565b602082015260408301516127d6816121d7565b60408201529392505050565b602081526000611a1c6020830184612359565b6000806040838503121561280857600080fd5b82519150602083015161244b81612222565b601f821115611bd6576000816000526020600020601f850160051c810160208610156128435750805b601f850160051c820191505b818110156128625782815560010161284f565b505050505050565b81516001600160401b03811115612883576128836125ec565b612897816128918454612550565b8461281a565b602080601f8311600181146128cc57600084156128b45750858301515b600019600386901b1c1916600185901b178555612862565b600085815260208120601f198616915b828110156128fb578886015182559484019460019091019084016128dc565b50858210156129195787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b8381528260208201526060604082015260006129486060830184612359565b95945050505050565b6001600160e01b0319831681528151600090612974816004850160208701612335565b919091016004019392505050565b60008260000b8260000b028060000b91508082146129a2576129a2612584565b5092915050565b600080858511156129b957600080fd5b838611156129c657600080fd5b5050820193919092039150565b803560208310156113c357600019602084900360031b1b1692915050565b6001600160e01b03198135818116916004851015612a195780818660040360031b1b83161692505b505092915050565b600181815b80851115612a5c578160001904821115612a4257612a42612584565b80851615612a4f57918102915b93841c9390800290612a26565b509250929050565b600082612a73575060016113c3565b81612a80575060006113c3565b8160018114612a965760028114612aa057612abc565b60019150506113c3565b60ff841115612ab157612ab1612584565b50506001821b6113c3565b5060208310610133831016604e8410600b8410161715612adf575081810a6113c3565b612ae98383612a21565b8060001904821115612afd57612afd612584565b029392505050565b6000611a1c60ff841683612a64565b80820281158282048414176113c3576113c3612584565b634e487b7160e01b600052601260045260246000fd5b600082612b5e57634e487b7160e01b600052601260045260246000fd5b50049056fea26469706673582212206e5efe9b8ddf95a0ffeccfe2ef1a63e34a3cc7e6c182e11fc2ff8dea311ba40864736f6c63430008160033

Deployed Bytecode Sourcemap

1126:801:28:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3143:348:2;;;;;;;;;;-1:-1:-1;3143:348:2;;;;;:::i;:::-;;:::i;:::-;;2294:42:0;;;;;;;;;;;;2334:2;2294:42;;;;;484:4:29;556:21;;;;538:40;;526:2;511:18;2294:42:0;;;;;;;;1554:41:2;;;;;;;;;;;;1594:1;1554:41;;;;;735:25:29;;;723:2;708:18;1554:41:2;589:177:29;12921:754:0;;;;;;:::i;:::-;;:::i;11689:362::-;;;;;;;;;;-1:-1:-1;11689:362:0;;;;;:::i;:::-;;:::i;:::-;;;;1954:13:29;;1936:32;;2015:4;2003:17;;;1997:24;-1:-1:-1;;;;;2096:21:29;;;2074:20;;;2067:51;;;;2166:17;;;2160:24;2156:33;;;2134:20;;;2127:63;1924:2;1909:18;11689:362:0;1720:476:29;2382:28:0;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2365:32:29;;;2347:51;;2335:2;2320:18;2382:28:0;2201:203:29;1806:52:1;;;;;;;;;;-1:-1:-1;1806:52:1;-1:-1:-1;;;1806:52:1;;;;;-1:-1:-1;;;;;;2571:33:29;;;2553:52;;2541:2;2526:18;1806:52:1;2409:202:29;14083:83:0;;;;;;;;;;-1:-1:-1;14152:7:0;14083:83;;2417:44;;;;;;;;;;;;;;;1771:41:2;;;;;;;;;;;;;;;7071:316:0;;;;;;;;;;-1:-1:-1;7071:316:0;;;;;:::i;:::-;;:::i;:::-;;;;3556:25:29;;;-1:-1:-1;;;;;3617:32:29;;;3612:2;3597:18;;3590:60;3529:18;7071:316:0;3382:274:29;4568:312:2;;;;;;;;;;-1:-1:-1;4568:312:2;;;;;:::i;:::-;;:::i;2343:33:0:-;;;;;;;;;;;;;;;2467:41;;;;;;;;;;;;;;;2427:344:2;;;;;;;;;;-1:-1:-1;2427:344:2;;;;;:::i;:::-;;:::i;2227:323:1:-;;;;;;;;;;-1:-1:-1;2227:323:1;;;;;:::i;:::-;;:::i;:::-;;;4338:13:29;;4331:21;4324:29;4306:48;;4294:2;4279:18;2227:323:1;4098:262:29;2746:60:0;;;;;;;;;;-1:-1:-1;2746:60:0;;;;;:::i;:::-;;:::i;:::-;;;;;;;;:::i;1895:326:1:-;;;;;;;;;;-1:-1:-1;1895:326:1;;;;;:::i;:::-;;:::i;:::-;;;;6655:13:29;;-1:-1:-1;;;;;6651:22:29;;;6633:41;;6734:4;6722:17;;;6716:24;6712:33;;6690:20;;;6683:63;6794:17;;;6788:24;6784:33;;;6762:20;;;6755:63;6584:2;6569:18;1895:326:1;6394:430:29;2650:40:0;;;;;;;;;;;;;;;2514:44;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;6991:31:29;;;6973:50;;6961:2;6946:18;2514:44:0;6829:200:29;14564:94:0;;;;;;;;;;-1:-1:-1;14644:7:0;14564:94;;2565:30;;;;;;;;;;;;;;;5211:352:2;;;;;;;;;;-1:-1:-1;5211:352:2;;;;;:::i;:::-;;:::i;2051:50:0:-;;;;;;;;;;;;2099:2;2051:50;;4584:2215;;;;;;:::i;:::-;;:::i;2246:42::-;;;;;;;;;;;;-1:-1:-1;;2246:42:0;;3923:314:2;;;;;;;;;;-1:-1:-1;3923:314:2;;;;;:::i;:::-;;:::i;1656:42::-;;;;;;;;;;;;1697:1;1656:42;;7823:379:0;;;;;;:::i;:::-;;:::i;2601:43::-;;;;;;;;;;;;;;;2696;;;;;;;;;;;;;;;3143:348:2;1398:10;-1:-1:-1;;;;;1412:16:2;1398:30;;1394:63;;1437:20;;-1:-1:-1;;;1437:20:2;;;;;;;;;;;1394:63;3226:21:::1;3250:56;3272:20;3294:11;3250:21;:56::i;:::-;3226:80;;3317:84;3343:19;3364:20;3386:14;3317:25;:84::i;:::-;3464:19;-1:-1:-1::0;;;;;3416:68:2::1;3426:20;-1:-1:-1::0;;;;;3416:68:2::1;;3448:14;3416:68;;;;;-1:-1:-1::0;;;;;6991:31:29;;;;6973:50;;6961:2;6946:18;;6829:200;3416:68:2::1;;;;;;;;3216:275;3143:348:::0;:::o;12921:754:0:-;12992:34;13029:21;;;:14;:21;;;;;;;;12992:58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13029:21;;12992:58;;;;13029:21;;12992:58;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;12992:58:0;;;;-1:-1:-1;;;12992:58:0;;;;;;;;;;;;;13064:29;;:36;12992:58;;-1:-1:-1;13064:41:0;;-1:-1:-1;13064:41:0;13060:82;;13114:28;;-1:-1:-1;;;13114:28:0;;;;;735:25:29;;;708:18;;13114:28:0;;;;;;;;13060:82;13160:21;;;;:14;:21;;;;;;;13153:28;;-1:-1:-1;;13153:28:0;;;;;;;;;;;;;;;;;;;;;13160:21;;;13153:28;;;;13160:21;13153:28;:::i;:::-;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;;;13192:21;13241:9;13216:13;:22;;;:34;;;;:::i;:::-;13523:29;;13566:30;;;;;;;;;;;13523:29;13566:30;;;;13471:158;;-1:-1:-1;;;13471:158:0;;13192:58;;-1:-1:-1;;;;;;13476:3:0;13471:14;;;;13192:58;;13471:158;;13610:9;;13471:158;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;13645:23:0;;13662:5;;13645:23;;;;;12982:693;;12921:754;:::o;11689:362::-;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;11920:41:0;11932:14;11948:12;11920:11;:41::i;:::-;:47;;-1:-1:-1;11984:60:0;:9;11920:47;12031:12;11984:31;:60::i;:::-;11977:67;11689:362;-1:-1:-1;;;;;;11689:362:0:o;7071:316::-;7149:19;;2099:2;7196:47;;7192:110;;7252:50;;-1:-1:-1;;;7252:50:0;;;;;735:25:29;;;708:18;;7252:50:0;589:177:29;7192:110:0;7333:47;;;;7344:15;7333:47;:::i;:::-;7313:67;;;;-1:-1:-1;7071:316:0;-1:-1:-1;;;7071:316:0:o;4568:312:2:-;1398:10;-1:-1:-1;;;;;1412:16:2;1398:30;;1394:63;;1437:20;;-1:-1:-1;;;1437:20:2;;;;;;;;;;;1394:63;4650:18:::1;4671:27:::0;;:81:::1;;4742:10;4671:81;;;4701:38;::::0;-1:-1:-1;;;4701:38:2;;4733:4:::1;4701:38;::::0;::::1;2347:51:29::0;4708:5:2::1;-1:-1:-1::0;;;;;4701:23:2::1;::::0;::::1;::::0;2320:18:29;;4701:38:2::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4650:102:::0;-1:-1:-1;4763:56:2::1;-1:-1:-1::0;;;;;4770:5:2::1;4763:26;4790:16;4650:102:::0;4763:26:::1;:56::i;:::-;4844:16;-1:-1:-1::0;;;;;4834:39:2::1;;4862:10;4834:39;;;;735:25:29::0;;723:2;708:18;;589:177;4834:39:2::1;;;;;;;;4640:240;4568:312:::0;:::o;2427:344::-;1398:10;-1:-1:-1;;;;;1412:16:2;1398:30;;1394:63;;1437:20;;-1:-1:-1;;;1437:20:2;;;;;;;;;;;1394:63;2511:21:::1;2535:55;2557:19;2578:11;2535:21;:55::i;:::-;2511:79;;2601:82;2627:18;2647:19;2668:14;2601:25;:82::i;:::-;2745:18;-1:-1:-1::0;;;;;2698:66:2::1;2708:19;-1:-1:-1::0;;;;;2698:66:2::1;;2729:14;2698:66;;;;;-1:-1:-1::0;;;;;6991:31:29;;;;6973:50;;6961:2;6946:18;;6829:200;2227:323:1;-1:-1:-1;;;;;;;;;;;;2404:16:1;;;-1:-1:-1;;;;;2365:32:29;;2404:16:1;;;2347:51:29;2320:12:1;;;;1604:42;;2320:18:29;2404:16:1;;;-1:-1:-1;;2404:16:1;;;;;;;;;;2357:64;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2319:102;;;;2439:7;2431:59;;;;-1:-1:-1;;;2431:59:1;;13016:2:29;2431:59:1;;;12998:21:29;13055:2;13035:18;;;13028:30;13094:34;13074:18;;;13067:62;-1:-1:-1;;;13145:18:29;;;13138:37;13192:19;;2431:59:1;12814:403:29;2431:59:1;2518:6;2507:36;;;;;;;;;;;;:::i;:::-;2500:43;2227:323;-1:-1:-1;;;;2227:323:1:o;2746:60:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;2746:60:0;;;;-1:-1:-1;;;2746:60:0;;;;;;:::o;1895:326:1:-;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;2076:23:1;;;-1:-1:-1;;;;;13961:32:29;;2076:23:1;;;13943:51:29;-1:-1:-1;;;;;14030:31:29;;14010:18;;;14003:59;;;;1996:12:1;;;;1492:42;;13916:18:29;;2076:23:1;;;-1:-1:-1;;2076:23:1;;;;;;;;;;2033:67;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1995:105;;;;2118:7;2110:54;;;;-1:-1:-1;;;2110:54:1;;14275:2:29;2110:54:1;;;14257:21:29;14314:2;14294:18;;;14287:30;14353:34;14333:18;;;14326:62;-1:-1:-1;;;14404:18:29;;;14397:32;14446:19;;2110:54:1;14073:398:29;2110:54:1;2192:6;2181:33;;;;;;;;;;;;:::i;:::-;2174:40;;;;1895:326;;;;;:::o;5211:352:2:-;1398:10;-1:-1:-1;;;;;1412:16:2;1398:30;;1394:63;;1437:20;;-1:-1:-1;;;1437:20:2;;;;;;;;;;;1394:63;5294:18:::1;5315:27:::0;;:64:::1;;5369:10;5315:64;;;5345:21;5315:64;5294:85;;5391:12;5409:16;-1:-1:-1::0;;;;;5409:21:2::1;5439:10;5409:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5390:65;;;5470:7;5465:37;;5486:16;;-1:-1:-1::0;;;5486:16:2::1;;;;;;;;;;;5465:37;5527:16;-1:-1:-1::0;;;;;5517:39:2::1;;5545:10;5517:39;;;;735:25:29::0;;723:2;708:18;;589:177;5517:39:2::1;;;;;;;;5284:279;;5211:352:::0;:::o;4584:2215:0:-;2500:21:26;:19;:21::i;:::-;4818:10:0::1;-1:-1:-1::0;;;;;4832:8:0::1;4818:22;;4814:49;;4849:14;;-1:-1:-1::0;;;4849:14:0::1;;;;;;;;;;;4814:49;4884:4;-1:-1:-1::0;;;;;4877:11:0::1;:3;-1:-1:-1::0;;;;;4877:11:0::1;;4873:64;;4897:40;::::0;-1:-1:-1;;;4897:40:0;;-1:-1:-1;;;;;4926:3:0::1;15533:15:29::0;;4897:40:0::1;::::0;::::1;15515:34:29::0;15585:15;;15565:18;;;15558:43;15450:18;;4897:40:0::1;15303:304:29::0;4873:64:0::1;5060:16;5079:37;5107:8;;5079:27;:37::i;:::-;5060:56;;5126:30;5159:39;5189:8;;5159:29;:39::i;:::-;5334:37;::::0;-1:-1:-1;;;5334:37:0;;5126:72;;-1:-1:-1;5334:4:0::1;::::0;:18:::1;::::0;:37:::1;::::0;5126:72;;5334:37:::1;;;:::i;:::-;;::::0;::::1;;;;;;;;;;;;;;;;-1:-1:-1::0;5334:37:0::1;::::0;;::::1;;::::0;;::::1;-1:-1:-1::0;;5334:37:0::1;::::0;::::1;::::0;;;::::1;::::0;;::::1;::::0;::::1;:::i;:::-;;;5330:1463;;6346:32;-1:-1:-1::0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6346:32:0::1;6417:35;6443:8;;6417:25;:35::i;:::-;6392:60;;::::0;;6487:40:::1;6518:8:::0;;6487:30:::1;:40::i;:::-;6466:18;::::0;;::::1;:61:::0;;;;6541:24:::1;::::0;;::::1;:35:::0;;;6615:72;;;;::::1;::::0;;;;;6675:9:::1;6615:72:::0;;::::1;::::0;-1:-1:-1;6591:21:0;;;:14:::1;:21:::0;;;;;;;:96;;;;;;-1:-1:-1;;6591:96:0::1;;::::0;;::::1;;::::0;;;;::::1;::::0;;;::::1;::::0;;;;;;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;6615:72;;6591:96;:21;;:96:::1;::::0;::::1;::::0;::::1;::::0;;::::1;:::i;:::-;-1:-1:-1::0;6591:96:0::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;;::::1;:::i;:::-;-1:-1:-1::0;6591:96:0::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;;::::1;:::i;:::-;;;;;;;;;;;;;;;6726:5;6706:76;6733:15;:18;;;6753:9;6764:17;6706:76;;;;;;;;:::i;:::-;;;;;;;;6332:461;5330:1463;;;5446:12;5434:9;:24;5430:82;;;5467:45;::::0;-1:-1:-1;;;5467:45:0;;5488:9:::1;5467:45;::::0;::::1;18878:25:29::0;18919:18;;;18912:34;;;18851:18;;5467:45:0::1;18704:248:29::0;5430:82:0::1;5527:14;5556:1:::0;5544:9:::1;:13;:48;;14152:7:::0;5544:48:::1;;;14644:7:::0;5560:20:::1;5527:65;;5875:6;5863:9;:18;5859:65;;;5906:9;5890:34;::::0;-1:-1:-1;;;5890:34:0;;::::1;::::0;::::1;18878:25:29::0;;;;18919:18;;;18912:34;;;18851:18;;5890:34:0::1;18704:248:29::0;5859:65:0::1;6174:66;::::0;-1:-1:-1;;;6174:66:0;;-1:-1:-1;;;;;19149:32:29;;6174:66:0::1;::::0;::::1;19131:51:29::0;19198:18;;;19191:34;;;6174:4:0::1;::::0;:31:::1;::::0;6214:9:::1;::::0;19104:18:29;;6174:66:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;6170:145;;6268:32;6286:3;6291:8;6268:17;:32::i;:::-;5416:909;5372:953;;5330:1463;4804:1995;;2542:20:26::0;1857:1;3068:7;:21;2888:208;2542:20;4584:2215:0;;;;;;;:::o;3923:314:2:-;1398:10;-1:-1:-1;;;;;1412:16:2;1398:30;;1394:63;;1437:20;;-1:-1:-1;;;1437:20:2;;;;;;;;;;;1394:63;4019:21:::1;4043:51;1697:1;4082:11;4043:21;:51::i;:::-;4019:75;;4105:63;4131:3;1697:1;4153:14;4105:25;:63::i;:::-;4183:47;::::0;-1:-1:-1;;;;;6991:31:29;;6973:50;;-1:-1:-1;;;;;4183:47:2;::::1;::::0;1697:1:::1;::::0;4183:47:::1;::::0;6961:2:29;6946:18;4183:47:2::1;;;;;;;4009:228;3923:314:::0;;:::o;7823:379:0:-;7922:10;7944:4;7922:27;7918:60;;7958:20;;-1:-1:-1;;;7958:20:0;;7967:10;7958:20;;;2347:51:29;2320:18;;7958:20:0;2201:203:29;7918:60:0;8041:41;8067:3;8072:9;8041:25;:41::i;:::-;8149:9;:13;8145:50;;8164:31;8191:3;8164:26;:31::i;:::-;7823:379;;:::o;5963:395:2:-;6058:6;6076:21;6100:40;6120:4;6127:12;6100:11;:40::i;:::-;:46;;-1:-1:-1;;;;;;6160:28:2;;;;;;;6156:120;;;6211:54;;-1:-1:-1;;;6211:54:2;;-1:-1:-1;;;;;19463:15:29;;;6211:54:2;;;19445:34:29;19515:15;;19495:18;;;19488:43;19381:18;;6211:54:2;19236:301:29;6156:120:2;-1:-1:-1;;;;;6292:28:2;;;:59;;6340:11;6292:59;;;6323:14;6285:66;-1:-1:-1;;;5963:395:2:o;2825:431:1:-;2961:40;;;-1:-1:-1;;;;;19758:32:29;;2961:40:1;;;19740:51:29;-1:-1:-1;;;;;19864:15:29;;;19844:18;;;19837:43;19916:15;;19896:18;;;;19889:43;;;;2961:40:1;;;;;;;;;;19713:18:29;;;2961:40:1;;;-1:-1:-1;;3034:42:1;;-1:-1:-1;;;3051:16:1;2961:40;;3034:42;;;:::i;:::-;;;;-1:-1:-1;;3034:42:1;;;;;;;;;;-1:-1:-1;;;3198:51:1;;3034:42;-1:-1:-1;1384:42:1;;3198;;:51;;3034:42;;3198:51;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2929:327;;2825:431;;;:::o;2380:989:6:-;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;2563:17:6;2590;2809:1;2794:12;:16;;;2790:456;;;2852:160;2918:7;2943:18;2985:12;2852:48;:160::i;:::-;2826:186;;-1:-1:-1;2826:186:6;-1:-1:-1;2790:456:6;;;3069:166;3136:7;3161:18;3203:17;3208:12;-1:-1:-1;;3203:17:6;:::i;:::-;3069:49;:166::i;:::-;3043:192;;-1:-1:-1;3043:192:6;-1:-1:-1;2790:456:6;3263:99;;;;;;;;;;;-1:-1:-1;;;;;3263:99:6;;;;;;;;;;;;;;;-1:-1:-1;2380:989:6;;;;;:::o;1219:160:24:-;1328:43;;;-1:-1:-1;;;;;19149:32:29;;1328:43:24;;;19131:51:29;19198:18;;;;19191:34;;;1328:43:24;;;;;;;;;;19104:18:29;;;;1328:43:24;;;;;;;;-1:-1:-1;;;;;1328:43:24;-1:-1:-1;;;1328:43:24;;;1301:71;;1321:5;;1301:19;:71::i;:::-;1219:160;;;:::o;2575:307:26:-;1899:1;2702:7;;:18;2698:86;;2743:30;;-1:-1:-1;;;2743:30:26;;;;;;;;;;;2698:86;1899:1;2858:7;:17;2575:307::o;1676:150:18:-;1738:7;1780:37;282:2;232;1780:4;;:37;:::i;:::-;1772:46;;;:::i;2273:128::-;2337:12;2368:26;:4;335:2;2368:4;;:26;:::i;:::-;2361:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2361:33:18;;2273:128;-1:-1:-1;;;;;;2273:128:18:o;1358:141::-;1418:6;1457:33;232:2;185:1;1457:4;;:33;:::i;:::-;1450:41;;;:::i;:::-;1443:49;;;1358:141;-1:-1:-1;;;1358:141:18:o;1989:149::-;2054:7;2088:42;335:2;282;2088:4;;:42;:::i;12294:485:0:-;12395:9;:14;12391:298;;12426:13;12445:14;-1:-1:-1;;;;;12445:19:0;12473:9;12445:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12425:63;;;12507:8;12502:177;;12555:38;;12536:13;;12555:9;;12578;;12536:13;12555:38;12536:13;12555:38;12578:9;12555;:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12535:58;;;12616:8;12611:53;;12633:31;;-1:-1:-1;;;12633:31:0;;12654:9;12633:31;;;735:25:29;708:18;;12633:31:0;589:177:29;12611:53:0;12517:162;12502:177;12411:278;12391:298;12703:14;;12699:73;;12719:53;-1:-1:-1;;;;;12726:5:0;12719:26;12746:14;12762:9;12719:26;:53::i;8582:938::-;8676:32;8711:150;8745:19;8778:18;8810;8842:9;8711:20;:150::i;:::-;9065:11;;8676:185;;-1:-1:-1;9065:16:0;9061:453;;9219:17;9239:38;9259:3;9264:7;:12;;;9239:19;:38::i;:::-;9413:11;;9219:58;;-1:-1:-1;9366:59:0;;-1:-1:-1;;;;;9373:5:0;9366:26;;9393:18;;9366:26;:59::i;:::-;9440:63;9466:3;9471:19;9492:10;9440:25;:63::i;:::-;9083:431;8666:854;8582:938;;:::o;9753:634::-;9829:32;9864:153;9898:20;9932:19;9965;9998:9;9864:20;:153::i;:::-;10032:11;;9829:188;;-1:-1:-1;10032:16:0;10028:353;;10204:11;;10162:59;;10144:12;;-1:-1:-1;;;;;10170:19:0;10162:33;;10144:12;10162:59;10144:12;10162:59;10204:11;10162:33;:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10143:78;;;10240:7;10235:54;;10277:11;;10256:33;;-1:-1:-1;;;10256:33:0;;;;;735:25:29;;;;708:18;;10256:33:0;589:177:29;10235:54:0;10304:66;10330:3;10335:20;10357:7;:12;;;10304:25;:66::i;3871:879:6:-;4054:17;;;4118:18;4124:12;4118:2;:18;:::i;:::-;4102:34;-1:-1:-1;4146:14:6;4163:34;4102;-1:-1:-1;;;;;4163:34:6;;;:::i;:::-;4146:51;;4401:5;4391:7;:15;;;;;:::i;:::-;;4380:7;:27;4368:39;;4493:6;4481:9;:18;4477:86;;;4508:55;;-1:-1:-1;;;4508:55:6;;;;;18878:25:29;;;18919:18;;;18912:34;;;18851:18;;4508:55:6;18704:248:29;4477:86:6;4727:5;4715:9;:17;;;;;:::i;:::-;;4695:38;;4092:658;;3871:879;;;;;;:::o;5236:882::-;5420:17;;;5484:18;5490:12;5484:2;:18;:::i;:::-;5468:34;-1:-1:-1;5512:14:6;5529:34;5468;-1:-1:-1;;;;;5529:34:6;;;:::i;:::-;5512:51;;5610:7;5598:19;;5861:6;5851:7;:16;5847:84;;;5876:55;;-1:-1:-1;;;5876:55:6;;;;;18878:25:29;;;18919:18;;;18912:34;;;18851:18;;5876:55:6;18704:248:29;5847:84:6;6095:5;6083:9;:17;6063:38;;5458:660;;5236:882;;;;;;:::o;8370:720:24:-;8450:18;8478:19;8616:4;8613:1;8606:4;8600:11;8593:4;8587;8583:15;8580:1;8573:5;8566;8561:60;8673:7;8663:176;;8717:4;8711:11;8762:16;8759:1;8754:3;8739:40;8808:16;8803:3;8796:29;8663:176;-1:-1:-1;;8916:1:24;8910:8;8866:16;;-1:-1:-1;8942:15:24;;:68;;8994:11;9009:1;8994:16;;8942:68;;;-1:-1:-1;;;;;8960:26:24;;;:31;8942:68;8938:146;;;9033:40;;-1:-1:-1;;;9033:40:24;;-1:-1:-1;;;;;2365:32:29;;9033:40:24;;;2347:51:29;2320:18;;9033:40:24;2201:203:29;10854:208:0;10947:6;10970:19;10985:3;10970:14;:19::i;:::-;:26;10965:62;;11005:22;;-1:-1:-1;;;11005:22:0;;;;;;;;;;;10965:62;-1:-1:-1;11044:11:0;10854:208;-1:-1:-1;10854:208:0:o;-1:-1:-1:-;;;;;;;:::i;:::-;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::o;:::-;;;;;;;;;;;;;;;;;;:::o;14:129:29:-;-1:-1:-1;;;;;92:5:29;88:30;81:5;78:41;68:69;;133:1;130;123:12;148:245;206:6;259:2;247:9;238:7;234:23;230:32;227:52;;;275:1;272;265:12;227:52;314:9;301:23;333:30;357:5;333:30;:::i;771:180::-;830:6;883:2;871:9;862:7;858:23;854:32;851:52;;;899:1;896;889:12;851:52;-1:-1:-1;922:23:29;;771:180;-1:-1:-1;771:180:29:o;956:131::-;-1:-1:-1;;;;;1031:31:29;;1021:42;;1011:70;;1077:1;1074;1067:12;1092:623;1174:6;1182;1190;1198;1251:3;1239:9;1230:7;1226:23;1222:33;1219:53;;;1268:1;1265;1258:12;1219:53;1307:9;1294:23;1326:30;1350:5;1326:30;:::i;:::-;1375:5;-1:-1:-1;1432:2:29;1417:18;;1404:32;1478:1;1467:22;;;1455:35;;1445:63;;1504:1;1501;1494:12;1445:63;1527:7;-1:-1:-1;1586:2:29;1571:18;;1558:32;1599:33;1558:32;1599:33;:::i;:::-;1092:623;;;;-1:-1:-1;1651:7:29;;1705:2;1690:18;1677:32;;-1:-1:-1;;1092:623:29:o;2616:347::-;2667:8;2677:6;2731:3;2724:4;2716:6;2712:17;2708:27;2698:55;;2749:1;2746;2739:12;2698:55;-1:-1:-1;2772:20:29;;-1:-1:-1;;;;;2804:30:29;;2801:50;;;2847:1;2844;2837:12;2801:50;2884:4;2876:6;2872:17;2860:29;;2936:3;2929:4;2920:6;2912;2908:19;2904:30;2901:39;2898:59;;;2953:1;2950;2943:12;2898:59;2616:347;;;;;:::o;2968:409::-;3038:6;3046;3099:2;3087:9;3078:7;3074:23;3070:32;3067:52;;;3115:1;3112;3105:12;3067:52;3155:9;3142:23;-1:-1:-1;;;;;3180:6:29;3177:30;3174:50;;;3220:1;3217;3210:12;3174:50;3259:58;3309:7;3300:6;3289:9;3285:22;3259:58;:::i;:::-;3336:8;;3233:84;;-1:-1:-1;2968:409:29;-1:-1:-1;;;;2968:409:29:o;3846:247::-;3905:6;3958:2;3946:9;3937:7;3933:23;3929:32;3926:52;;;3974:1;3971;3964:12;3926:52;4013:9;4000:23;4032:31;4057:5;4032:31;:::i;4365:250::-;4450:1;4460:113;4474:6;4471:1;4468:13;4460:113;;;4550:11;;;4544:18;4531:11;;;4524:39;4496:2;4489:10;4460:113;;;-1:-1:-1;;4607:1:29;4589:16;;4582:27;4365:250::o;4620:270::-;4661:3;4699:5;4693:12;4726:6;4721:3;4714:19;4742:76;4811:6;4804:4;4799:3;4795:14;4788:4;4781:5;4777:16;4742:76;:::i;:::-;4872:2;4851:15;-1:-1:-1;;4847:29:29;4838:39;;;;4879:4;4834:50;;4620:270;-1:-1:-1;;4620:270:29:o;4895:763::-;4995:10;4987:5;4981:12;4977:29;4972:3;4965:42;5056:4;5049:5;5045:16;5039:23;5032:4;5027:3;5023:14;5016:47;5112:4;5105:5;5101:16;5095:23;5088:4;5083:3;5079:14;5072:47;5168:4;5161:5;5157:16;5151:23;5144:4;5139:3;5135:14;5128:47;4947:3;5221:4;5214:5;5210:16;5204:23;5259:4;5252;5247:3;5243:14;5236:28;5285:46;5325:4;5320:3;5316:14;5302:12;5285:46;:::i;:::-;5273:58;;5379:4;5372:5;5368:16;5362:23;5427:3;5421:4;5417:14;5410:4;5405:3;5401:14;5394:38;5455;5488:4;5472:14;5455:38;:::i;:::-;5441:52;;;5541:4;5534:5;5530:16;5524:23;5591:3;5583:6;5579:16;5572:4;5567:3;5563:14;5556:40;5612;5645:6;5629:14;5612:40;:::i;5663:335::-;5874:2;5863:9;5856:21;5837:4;5894:55;5945:2;5934:9;5930:18;5922:6;5894:55;:::i;:::-;5886:63;;5985:6;5980:2;5969:9;5965:18;5958:34;5663:335;;;;;:::o;6003:386::-;6070:6;6078;6131:2;6119:9;6110:7;6106:23;6102:32;6099:52;;;6147:1;6144;6137:12;6099:52;6186:9;6173:23;6205:31;6230:5;6205:31;:::i;:::-;6255:5;-1:-1:-1;6312:2:29;6297:18;;6284:32;6325;6284;6325;:::i;:::-;6376:7;6366:17;;;6003:386;;;;;:::o;7034:1063::-;7151:6;7159;7167;7175;7183;7191;7199;7252:3;7240:9;7231:7;7227:23;7223:33;7220:53;;;7269:1;7266;7259:12;7220:53;7308:9;7295:23;7327:31;7352:5;7327:31;:::i;:::-;7377:5;-1:-1:-1;7429:2:29;7414:18;;7401:32;;-1:-1:-1;7484:2:29;7469:18;;7456:32;-1:-1:-1;;;;;7537:14:29;;;7534:34;;;7564:1;7561;7554:12;7534:34;7603:58;7653:7;7644:6;7633:9;7629:22;7603:58;:::i;:::-;7680:8;;-1:-1:-1;7577:84:29;-1:-1:-1;7767:2:29;7752:18;;7739:32;;-1:-1:-1;7780:33:29;7739:32;7780:33;:::i;:::-;7832:7;;-1:-1:-1;7892:3:29;7877:19;;7864:33;;7909:16;;;7906:36;;;7938:1;7935;7928:12;7906:36;;7977:60;8029:7;8018:8;8007:9;8003:24;7977:60;:::i;:::-;7034:1063;;;;-1:-1:-1;7034:1063:29;;-1:-1:-1;7034:1063:29;;;;7951:86;;-1:-1:-1;;;7034:1063:29:o;8102:386::-;8169:6;8177;8230:2;8218:9;8209:7;8205:23;8201:32;8198:52;;;8246:1;8243;8236:12;8198:52;8285:9;8272:23;8304:30;8328:5;8304:30;:::i;:::-;8353:5;-1:-1:-1;8410:2:29;8395:18;;8382:32;8423:33;8382:32;8423:33;:::i;8493:315::-;8561:6;8569;8622:2;8610:9;8601:7;8597:23;8593:32;8590:52;;;8638:1;8635;8628:12;8590:52;8677:9;8664:23;8696:31;8721:5;8696:31;:::i;:::-;8746:5;8798:2;8783:18;;;;8770:32;;-1:-1:-1;;;8493:315:29:o;9019:380::-;9098:1;9094:12;;;;9141;;;9162:61;;9216:4;9208:6;9204:17;9194:27;;9162:61;9269:2;9261:6;9258:14;9238:18;9235:38;9232:161;;9315:10;9310:3;9306:20;9303:1;9296:31;9350:4;9347:1;9340:15;9378:4;9375:1;9368:15;9586:127;9647:10;9642:3;9638:20;9635:1;9628:31;9678:4;9675:1;9668:15;9702:4;9699:1;9692:15;9718:125;9783:9;;;9804:10;;;9801:36;;;9817:18;;:::i;9848:560::-;10147:3;10136:9;10129:22;10110:4;10168:56;10219:3;10208:9;10204:19;10196:6;10168:56;:::i;:::-;10260:13;;10255:2;10240:18;;;10233:41;;;;10316:15;;;10310:22;10305:2;10290:18;;10283:50;-1:-1:-1;;;;;;10369:32:29;;;;10364:2;10349:18;;;10342:60;10160:64;9848:560;-1:-1:-1;9848:560:29:o;10413:127::-;10474:10;10469:3;10465:20;10462:1;10455:31;10505:4;10502:1;10495:15;10529:4;10526:1;10519:15;10545:248;10612:2;10606:9;10654:4;10642:17;;-1:-1:-1;;;;;10674:34:29;;10710:22;;;10671:62;10668:88;;;10736:18;;:::i;:::-;10772:2;10765:22;10545:248;:::o;10798:478::-;10868:5;10916:4;10904:9;10899:3;10895:19;10891:30;10888:50;;;10934:1;10931;10924:12;10888:50;10967:4;10961:11;11011:4;11003:6;10999:17;11082:6;11070:10;11067:22;-1:-1:-1;;;;;11034:10:29;11031:34;11028:62;11025:88;;;11093:18;;:::i;:::-;11129:4;11122:24;11194:16;;11179:32;;11265:2;11250:18;;;11244:25;11227:15;;;11220:50;;;;-1:-1:-1;11164:6:29;10798:478;-1:-1:-1;10798:478:29:o;11281:719::-;11422:6;11430;11474:9;11465:7;11461:23;11504:3;11500:2;11496:12;11493:32;;;11521:1;11518;11511:12;11493:32;11545:4;11541:2;11537:13;11534:33;;;11563:1;11560;11553:12;11534:33;;11589:17;;:::i;:::-;11635:9;11629:16;11622:5;11615:31;11691:2;11680:9;11676:18;11670:25;11704:32;11728:7;11704:32;:::i;:::-;11763:2;11752:14;;11745:31;11808:70;11870:7;11865:2;11850:18;;11808:70;:::i;:::-;11803:2;11792:14;;11785:94;11796:5;-1:-1:-1;11922:72:29;11986:7;11979:4;11964:20;;11922:72;:::i;:::-;11912:82;;11281:719;;;;;:::o;12005:323::-;12081:6;12089;12142:2;12130:9;12121:7;12117:23;12113:32;12110:52;;;12158:1;12155;12148:12;12110:52;12194:9;12181:23;12171:33;;12254:2;12243:9;12239:18;12226:32;12267:31;12292:5;12267:31;:::i;12333:184::-;12403:6;12456:2;12444:9;12435:7;12431:23;12427:32;12424:52;;;12472:1;12469;12462:12;12424:52;-1:-1:-1;12495:16:29;;12333:184;-1:-1:-1;12333:184:29:o;12522:287::-;12651:3;12689:6;12683:13;12705:66;12764:6;12759:3;12752:4;12744:6;12740:17;12705:66;:::i;:::-;12787:16;;;;;12522:287;-1:-1:-1;;12522:287:29:o;13222:544::-;13323:6;13376:2;13364:9;13355:7;13351:23;13347:32;13344:52;;;13392:1;13389;13382:12;13344:52;13425:2;13419:9;13467:2;13459:6;13455:15;13536:6;13524:10;13521:22;-1:-1:-1;;;;;13488:10:29;13485:34;13482:62;13479:88;;;13547:18;;:::i;:::-;13583:2;13576:22;13620:16;;13672:13;;13665:21;13655:32;;13645:60;;13701:1;13698;13691:12;13645:60;13714:21;;13721:6;13222:544;-1:-1:-1;;;13222:544:29:o;14476:612::-;14574:6;14627:2;14615:9;14606:7;14602:23;14598:32;14595:52;;;14643:1;14640;14633:12;14595:52;14669:17;;:::i;:::-;14716:9;14710:16;14735:32;14759:7;14735:32;:::i;:::-;14776:22;;14843:2;14828:18;;14822:25;14856:32;14822:25;14856:32;:::i;:::-;14915:2;14904:14;;14897:31;14973:2;14958:18;;14952:25;14986:32;14952:25;14986:32;:::i;:::-;15045:2;15034:14;;15027:31;15038:5;14476:612;-1:-1:-1;;;14476:612:29:o;15612:217::-;15759:2;15748:9;15741:21;15722:4;15779:44;15819:2;15808:9;15804:18;15796:6;15779:44;:::i;15834:312::-;15913:6;15921;15974:2;15962:9;15953:7;15949:23;15945:32;15942:52;;;15990:1;15987;15980:12;15942:52;16019:9;16013:16;16003:26;;16072:2;16061:9;16057:18;16051:25;16085:31;16110:5;16085:31;:::i;16276:542::-;16377:2;16372:3;16369:11;16366:446;;;16413:1;16437:5;16434:1;16427:16;16481:4;16478:1;16468:18;16551:2;16539:10;16535:19;16532:1;16528:27;16522:4;16518:38;16587:4;16575:10;16572:20;16569:47;;;-1:-1:-1;16610:4:29;16569:47;16665:2;16660:3;16656:12;16653:1;16649:20;16643:4;16639:31;16629:41;;16720:82;16738:2;16731:5;16728:13;16720:82;;;16783:17;;;16764:1;16753:13;16720:82;;;16724:3;;;16276:542;;;:::o;16994:1341::-;17118:3;17112:10;-1:-1:-1;;;;;17137:6:29;17134:30;17131:56;;;17167:18;;:::i;:::-;17196:96;17285:6;17245:38;17277:4;17271:11;17245:38;:::i;:::-;17239:4;17196:96;:::i;:::-;17347:4;;17404:2;17393:14;;17421:1;17416:662;;;;18122:1;18139:6;18136:89;;;-1:-1:-1;18191:19:29;;;18185:26;18136:89;-1:-1:-1;;16951:1:29;16947:11;;;16943:24;16939:29;16929:40;16975:1;16971:11;;;16926:57;18238:81;;17386:943;;17416:662;16223:1;16216:14;;;16260:4;16247:18;;-1:-1:-1;;17452:20:29;;;17569:236;17583:7;17580:1;17577:14;17569:236;;;17672:19;;;17666:26;17651:42;;17764:27;;;;17732:1;17720:14;;;;17599:19;;17569:236;;;17573:3;17833:6;17824:7;17821:19;17818:201;;;17894:19;;;17888:26;-1:-1:-1;;17977:1:29;17973:14;;;17989:3;17969:24;17965:37;17961:42;17946:58;17931:74;;17818:201;-1:-1:-1;;;;;18065:1:29;18049:14;;;18045:22;18032:36;;-1:-1:-1;16994:1341:29:o;18340:359::-;18543:6;18532:9;18525:25;18586:6;18581:2;18570:9;18566:18;18559:34;18629:2;18624;18613:9;18609:18;18602:30;18506:4;18649:44;18689:2;18678:9;18674:18;18666:6;18649:44;:::i;:::-;18641:52;18340:359;-1:-1:-1;;;;;18340:359:29:o;19943:384::-;-1:-1:-1;;;;;;20128:33:29;;20116:46;;20185:13;;20098:3;;20207:74;20185:13;20270:1;20261:11;;20254:4;20242:17;;20207:74;:::i;:::-;20301:16;;;;20319:1;20297:24;;19943:384;-1:-1:-1;;;19943:384:29:o;20332:236::-;20369:7;20446:1;20443;20432:16;20428:1;20425;20414:16;20410:39;20483:11;20480:1;20469:26;20458:37;;20526:11;20517:7;20514:24;20504:58;;20542:18;;:::i;:::-;20504:58;20332:236;;;;:::o;20573:331::-;20678:9;20689;20731:8;20719:10;20716:24;20713:44;;;20753:1;20750;20743:12;20713:44;20782:6;20772:8;20769:20;20766:40;;;20802:1;20799;20792:12;20766:40;-1:-1:-1;;20828:23:29;;;20873:25;;;;;-1:-1:-1;20573:331:29:o;20909:255::-;21029:19;;21068:2;21060:11;;21057:101;;;-1:-1:-1;;21129:2:29;21125:12;;;21122:1;21118:20;21114:33;21103:45;20909:255;;;;:::o;21169:323::-;-1:-1:-1;;;;;;21289:19:29;;21365:11;;;;21396:1;21388:10;;21385:101;;;21473:2;21467;21460:3;21457:1;21453:11;21450:1;21446:19;21442:28;21438:2;21434:37;21430:46;21421:55;;21385:101;;;21169:323;;;;:::o;21497:416::-;21586:1;21623:5;21586:1;21637:270;21658:7;21648:8;21645:21;21637:270;;;21717:4;21713:1;21709:6;21705:17;21699:4;21696:27;21693:53;;;21726:18;;:::i;:::-;21776:7;21766:8;21762:22;21759:55;;;21796:16;;;;21759:55;21875:22;;;;21835:15;;;;21637:270;;;21641:3;21497:416;;;;;:::o;21918:806::-;21967:5;21997:8;21987:80;;-1:-1:-1;22038:1:29;22052:5;;21987:80;22086:4;22076:76;;-1:-1:-1;22123:1:29;22137:5;;22076:76;22168:4;22186:1;22181:59;;;;22254:1;22249:130;;;;22161:218;;22181:59;22211:1;22202:10;;22225:5;;;22249:130;22286:3;22276:8;22273:17;22270:43;;;22293:18;;:::i;:::-;-1:-1:-1;;22349:1:29;22335:16;;22364:5;;22161:218;;22463:2;22453:8;22450:16;22444:3;22438:4;22435:13;22431:36;22425:2;22415:8;22412:16;22407:2;22401:4;22398:12;22394:35;22391:77;22388:159;;;-1:-1:-1;22500:19:29;;;22532:5;;22388:159;22579:34;22604:8;22598:4;22579:34;:::i;:::-;22649:6;22645:1;22641:6;22637:19;22628:7;22625:32;22622:58;;;22660:18;;:::i;:::-;22698:20;;21918:806;-1:-1:-1;;;21918:806:29:o;22729:140::-;22787:5;22816:47;22857:4;22847:8;22843:19;22837:4;22816:47;:::i;22874:168::-;22947:9;;;22978;;22995:15;;;22989:22;;22975:37;22965:71;;23016:18;;:::i;23047:127::-;23108:10;23103:3;23099:20;23096:1;23089:31;23139:4;23136:1;23129:15;23163:4;23160:1;23153:15;23179:217;23219:1;23245;23235:132;;23289:10;23284:3;23280:20;23277:1;23270:31;23324:4;23321:1;23314:15;23352:4;23349:1;23342:15;23235:132;-1:-1:-1;23381:9:29;;23179:217::o

Swarm Source

ipfs://6e5efe9b8ddf95a0ffeccfe2ef1a63e34a3cc7e6c182e11fc2ff8dea311ba408

Block Transaction Gas Used Reward
view all blocks ##produced##

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

Validator Index Block Amount
View All Withdrawals

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

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