Skip to content
Verified contractExactMIT

MessageRouter

Address0x7bed5cceac3e87c371acb2ec34f00ebe03652b17
Balance

0 ETH

 

Transactions

0

 

Compiler

solc 0.8.28

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.28+commit.7893614a
Language
solidity
Optimization
Yes, 5 runs
EVM version
prague
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,495,270
Creation transaction
0x43fb099be7…c7ed7830e4
Libraries
node_modules/@shift-defi/core/contracts/libraries/Codec.sol:Codec0x5b0b…1b5f17node_modules/@shift-defi/core/contracts/libraries/Common.sol:Common0x2c3f…d757e1

node_modules/@shift-defi/core/contracts/MessageRouter.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.28;

import {AccessControlUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";

import {IMessageAdapter} from "./interfaces/IMessageAdapter.sol";
import {IMessageReceiver} from "./interfaces/IMessageReceiver.sol";
import {IMessageRouter} from "./interfaces/IMessageRouter.sol";

import {Errors} from "./libraries/Errors.sol";
import {RingCacheLib} from "./libraries/RingCacheLib.sol";

contract MessageRouter is Initializable, AccessControlUpgradeable, ReentrancyGuardUpgradeable, IMessageRouter {
    using RingCacheLib for RingCacheLib.RingCache;

    bytes32 private constant WHITELIST_MANAGER_ROLE = keccak256("WHITELIST_MANAGER_ROLE");
    bytes32 private constant CACHE_MANAGER_ROLE = keccak256("CACHE_MANAGER_ROLE");

    uint256 private _nonce;

    mapping(bytes32 => PathData) private _paths;
    mapping(address => bool) private _whitelistedMessageAdapters;

    RingCacheLib.RingCache private _sendMessagesCache;

    constructor() {
        _disableInitializers();
    }

    function initialize(
        address defaultAdmin,
        address whitelistManager,
        address cacheManager,
        uint256 maxCacheSize
    ) public initializer {
        __AccessControl_init();
        __ReentrancyGuard_init();

        require(defaultAdmin != address(0), Errors.ZeroAddress());
        require(whitelistManager != address(0), Errors.ZeroAddress());
        require(cacheManager != address(0), Errors.ZeroAddress());

        _grantRole(DEFAULT_ADMIN_ROLE, defaultAdmin);
        _grantRole(WHITELIST_MANAGER_ROLE, whitelistManager);
        _grantRole(CACHE_MANAGER_ROLE, cacheManager);

        _sendMessagesCache.initialize(keccak256("SEND_CACHE"), maxCacheSize);
    }

    /// @inheritdoc IMessageRouter
    function calculatePath(address sender, address receiver, uint256 chainId) public pure returns (bytes32) {
        return keccak256(abi.encode(sender, receiver, chainId));
    }

    /// @inheritdoc IMessageRouter
    function encodeMessage(uint256 nonce, bytes32 path, bytes memory message) public pure returns (bytes memory) {
        return abi.encodePacked(nonce, path, message);
    }

    /// @inheritdoc IMessageRouter
    function calculateCacheKey(uint256 chainTo, bytes memory rawMessageWithPathAndNonce) public pure returns (bytes32) {
        return keccak256(abi.encode(chainTo, rawMessageWithPathAndNonce));
    }

    /// @inheritdoc IMessageRouter
    function decodeMessage(bytes memory message) public view returns (uint256, bytes32, bytes memory) {
        require(message.length >= 64, MessageTooShort(message.length));
        // Extract nonce (uint256 = 32 bytes)
        uint256 nonce;
        assembly {
            nonce := mload(add(message, 32))
        }

        // Extract path (bytes32 = 32 bytes)
        bytes32 pathOnRemoteChain;
        assembly {
            pathOnRemoteChain := mload(add(message, 64))
        }

        // Extract remaining message bytes
        uint256 messageLength = message.length - 64; // Total length minus nonce and path
        require(messageLength > 0, MessageTooShort(message.length));
        bytes memory messageData = new bytes(messageLength);
        assembly {
            let src := add(message, 96)
            let dst := add(messageData, 32)
            let success := staticcall(gas(), 0x04, src, messageLength, dst, messageLength)
            if iszero(success) {
                revert(0, 0)
            }
        }
        return (nonce, pathOnRemoteChain, messageData);
    }

    /// @inheritdoc IMessageRouter
    function whitelistPath(
        address sender,
        address receiver,
        uint256 chainId
    ) external onlyRole(WHITELIST_MANAGER_ROLE) {
        require(sender != address(0), Errors.ZeroAddress());
        require(receiver != address(0), Errors.ZeroAddress());
        require(chainId > 0, Errors.IncorrectChainId(chainId));

        bytes32 path = calculatePath(sender, receiver, chainId);
        PathData memory pathData = _paths[path];
        require(!pathData.isWhitelisted, PathAlreadyWhitelisted(path));
        _paths[path] = PathData({
            lastNonce: pathData.lastNonce,
            chainId: chainId,
            sender: sender,
            receiver: receiver,
            isWhitelisted: true
        });
        emit PathWhitelisted(sender, receiver, chainId, path);
    }

    /// @inheritdoc IMessageRouter
    function blacklistPath(
        address sender,
        address receiver,
        uint256 chainId
    ) external onlyRole(WHITELIST_MANAGER_ROLE) {
        bytes32 path = calculatePath(sender, receiver, chainId);
        PathData memory pathData = _paths[path];
        require(pathData.isWhitelisted, PathNotWhitelisted(path));
        _paths[path].isWhitelisted = false;
        emit PathBlacklisted(pathData.sender, pathData.receiver, pathData.chainId, path);
    }

    /// @inheritdoc IMessageRouter
    function whitelistMessageAdapter(address adapter) external onlyRole(WHITELIST_MANAGER_ROLE) {
        require(!_whitelistedMessageAdapters[adapter], AdapterAlreadyWhitelisted(adapter));
        _whitelistedMessageAdapters[adapter] = true;
        emit AdapterWhitelisted(adapter);
    }

    /// @inheritdoc IMessageRouter
    function blacklistMessageAdapter(address adapter) external onlyRole(WHITELIST_MANAGER_ROLE) {
        require(_whitelistedMessageAdapters[adapter], AdapterNotWhitelisted(adapter));
        _whitelistedMessageAdapters[adapter] = false;
        emit AdapterBlacklisted(adapter);
    }

    /// @inheritdoc IMessageRouter
    function isMessageCached(
        uint256 chainTo,
        uint256 nonce,
        bytes32 remotePath,
        bytes memory message
    ) external view returns (bool) {
        bytes memory messageWithNonceAndPath = encodeMessage(nonce, remotePath, message);
        bytes32 cacheKey = calculateCacheKey(chainTo, messageWithNonceAndPath);
        return _sendMessagesCache.exists(cacheKey);
    }

    /// @inheritdoc IMessageRouter
    function send(address receiver, SendParams calldata sendParams) external payable nonReentrant {
        require(_whitelistedMessageAdapters[sendParams.adapter], AdapterNotWhitelisted(sendParams.adapter));

        SendLocalVars memory sendLocalVars;
        sendLocalVars.localPath = calculatePath(msg.sender, receiver, sendParams.chainTo);
        sendLocalVars.remotePath = calculatePath(msg.sender, receiver, block.chainid);
        sendLocalVars.localPathData = _paths[sendLocalVars.localPath];
        sendLocalVars.remotePathData = _paths[sendLocalVars.remotePath];
        sendLocalVars.nonce = ++_nonce;

        require(sendLocalVars.localPathData.isWhitelisted, PathNotWhitelisted(sendLocalVars.localPath));
        require(
            sendLocalVars.localPathData.receiver == receiver,
            ReceiverMismatch(sendLocalVars.localPathData.receiver, receiver)
        );

        sendLocalVars.rawMessageWithPathAndNonce = encodeMessage(
            sendLocalVars.nonce,
            sendLocalVars.remotePath,
            sendParams.message
        );

        _sendMessagesCache.add(calculateCacheKey(sendParams.chainTo, sendLocalVars.rawMessageWithPathAndNonce));

        IMessageAdapter(sendParams.adapter).send{value: msg.value}(
            sendParams.chainTo,
            sendParams.adapterParameters,
            sendLocalVars.rawMessageWithPathAndNonce
        );

        emit MessageSent(
            sendLocalVars.nonce,
            sendParams.chainTo,
            msg.sender,
            receiver,
            sendParams.adapter,
            sendLocalVars.localPath,
            sendLocalVars.remotePath
        );
    }

    /// @inheritdoc IMessageRouter
    function receiveMessage(bytes memory rawMessageWithPathAndNonce) external nonReentrant {
        (uint256 nonce, bytes32 path, bytes memory rawMessage) = decodeMessage(rawMessageWithPathAndNonce);
        PathData memory pathData = _paths[path];

        require(nonce > pathData.lastNonce, ReplayCheckFailed(nonce));
        require(_whitelistedMessageAdapters[msg.sender], AdapterNotWhitelisted(msg.sender));
        require(pathData.isWhitelisted, PathNotWhitelisted(path));

        _paths[path].lastNonce = nonce;
        IMessageReceiver(pathData.receiver).receiveMessage(rawMessage);

        emit MessageReceived(nonce, pathData.chainId, pathData.sender, pathData.receiver, msg.sender, path);
    }

    /// @inheritdoc IMessageRouter
    function retryCachedMessage(
        uint256 nonce,
        bytes32 path,
        SendParams calldata sendParams
    ) external payable nonReentrant onlyRole(CACHE_MANAGER_ROLE) {
        require(_whitelistedMessageAdapters[sendParams.adapter], AdapterNotWhitelisted(sendParams.adapter));

        bytes memory messageWithPathAndNonce = encodeMessage(nonce, path, sendParams.message);
        bytes32 cachedKey = calculateCacheKey(sendParams.chainTo, messageWithPathAndNonce);

        require(_sendMessagesCache.exists(cachedKey), MessageNotCached(_sendMessagesCache.id, cachedKey));

        IMessageAdapter(sendParams.adapter).send{value: msg.value}(
            sendParams.chainTo,
            sendParams.adapterParameters,
            messageWithPathAndNonce
        );

        emit MessageRetried(nonce, sendParams.chainTo, path, sendParams.adapter);
    }

    /// @inheritdoc IMessageRouter
    function removeMessageFromCache(
        uint256 nonce,
        uint256 chainTo,
        bytes32 path,
        bytes memory message
    ) external onlyRole(CACHE_MANAGER_ROLE) {
        bytes memory messageWithPathAndNonce = encodeMessage(nonce, path, message);
        bytes32 cachedKey = calculateCacheKey(chainTo, messageWithPathAndNonce);

        _sendMessagesCache.remove(cachedKey);

        emit MessageRemovedFromCache(_sendMessagesCache.id, nonce, chainTo, path);
    }
}

lib/openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol

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

pragma solidity ^0.8.20;

import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol";
import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {ERC165Upgradeable} from "../utils/introspection/ERC165Upgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";

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

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;


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

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

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

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

    function __AccessControl_init() internal onlyInitializing {
    }

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

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

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

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

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

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

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

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

        _revokeRole(role, callerConfirmation);
    }

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

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

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

lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol

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

pragma solidity ^0.8.20;

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

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

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

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

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

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
     * production.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

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

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

        if (!initialSetup && !construction) {
            revert InvalidInitialization();
        }
        $._initialized = 1;
        if (isTopLevelCall) {
            $._initializing = true;
        }
        _;
        if (isTopLevelCall) {
            $._initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint64 version) {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing || $._initialized >= version) {
            revert InvalidInitialization();
        }
        $._initialized = version;
        $._initializing = true;
        _;
        $._initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        _checkInitializing();
        _;
    }

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

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

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

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

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

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

lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol

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

pragma solidity ^0.8.20;
import {Initializable} from "../proxy/utils/Initializable.sol";

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

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

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

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

lib/openzeppelin-contracts-upgradeable/contracts/utils/ReentrancyGuardUpgradeable.sol

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

pragma solidity ^0.8.20;
import {Initializable} from "../proxy/utils/Initializable.sol";

/**
 * @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 ReentrancyGuardUpgradeable is Initializable {
    // 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;

    /// @custom:storage-location erc7201:openzeppelin.storage.ReentrancyGuard
    struct ReentrancyGuardStorage {
        uint256 _status;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ReentrancyGuard")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant ReentrancyGuardStorageLocation = 0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00;

    function _getReentrancyGuardStorage() private pure returns (ReentrancyGuardStorage storage $) {
        assembly {
            $.slot := ReentrancyGuardStorageLocation
        }
    }

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

    function __ReentrancyGuard_init() internal onlyInitializing {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
        $._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 {
        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
        // 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 {
        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
        // 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) {
        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
        return $._status == ENTERED;
    }
}

lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol

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

pragma solidity ^0.8.20;

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

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

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

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/access/IAccessControl.sol

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

pragma solidity ^0.8.20;

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

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

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call. This account bears the admin role (for the granted role).
     * Expected in cases where the role was granted using the internal {AccessControl-_grantRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

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

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

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

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

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

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

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol

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

node_modules/@shift-defi/core/contracts/interfaces/IMessageAdapter.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.28;

interface IMessageAdapter {
    function router() external view returns (address);
    function send(uint256 chainTo, bytes memory params, bytes memory rawMessage) external payable;
}

node_modules/@shift-defi/core/contracts/interfaces/IMessageReceiver.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.28;

interface IMessageReceiver {
    function receiveMessage(bytes memory rawMessage) external;
}

node_modules/@shift-defi/core/contracts/interfaces/IMessageRouter.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.28;

interface IMessageRouter {
    struct PathData {
        uint256 lastNonce;
        uint256 chainId;
        address sender;
        address receiver;
        bool isWhitelisted;
    }
    struct SendParams {
        address adapter;
        uint256 chainTo;
        bytes adapterParameters;
        bytes message;
    }

    struct SendLocalVars {
        bytes32 localPath;
        bytes32 remotePath;
        uint256 nonce;
        bytes rawMessageWithPathAndNonce;
        PathData localPathData;
        PathData remotePathData;
    }

    event MessageSent(
        uint256 nonce,
        uint256 indexed chainTo,
        address indexed sender,
        address indexed receiver,
        address adapter,
        bytes32 localPath,
        bytes32 remotePath
    );
    event MessageReceived(
        uint256 nonce,
        uint256 indexed chainFrom,
        address indexed sender,
        address indexed receiver,
        address adapter,
        bytes32 path
    );
    event MessageRetried(uint256 nonce, uint256 indexed chainTo, bytes32 remotePath, address indexed adapter);
    event MessageRemovedFromCache(bytes32 cacheId, uint256 nonce, uint256 indexed chainId, bytes32 remotePath);
    event AdapterWhitelisted(address adapter);
    event AdapterBlacklisted(address adapter);
    event PathWhitelisted(address indexed sender, address indexed receiver, uint256 indexed chainId, bytes32 path);
    event PathBlacklisted(address indexed sender, address indexed receiver, uint256 indexed chainId, bytes32 path);

    error ReplayCheckFailed(uint256 nonce);
    error MessageTooShort(uint256 length);
    error PathAlreadyWhitelisted(bytes32 path);
    error PathNotWhitelisted(bytes32 path);
    error AdapterAlreadyWhitelisted(address adapter);
    error AdapterNotWhitelisted(address adapter);
    error ReceiverMismatch(address expected, address received);
    error MessageNotCached(bytes32 cacheId, bytes32 key);

    /**
     * @notice Calculates the path identifier from sender/receiver/chain.
     * @param sender Message sender.
     * @param receiver Message receiver.
     * @param chainId Destination chain id.
     */
    function calculatePath(address sender, address receiver, uint256 chainId) external pure returns (bytes32);

    /**
     * @notice ABI-encodes nonce + path + message.
     * @param nonce Message nonce.
     * @param path Remote path.
     * @param message Message bytes.
     */
    function encodeMessage(uint256 nonce, bytes32 path, bytes memory message) external pure returns (bytes memory);

    /**
     * @notice Calculates cache key for cached message.
     * @param chainTo Destination chain id.
     * @param rawMessageWithPathAndNonce Encoded message with path and nonce.
     */
    function calculateCacheKey(
        uint256 chainTo,
        bytes memory rawMessageWithPathAndNonce
    ) external pure returns (bytes32);

    /**
     * @notice Decodes encoded message into nonce, path and payload.
     * @param message Encoded message bytes.
     */
    function decodeMessage(bytes memory message) external view returns (uint256, bytes32, bytes memory);

    /**
     * @notice Whitelists a message path.
     * @dev Can only be called by accounts with WHITELIST_MANAGER_ROLE.
     * @param sender The address of the message sender
     * @param receiver The address of the message receiver
     * @param chainId The destination chain ID
     */
    function whitelistPath(address sender, address receiver, uint256 chainId) external;

    /**
     * @notice Blacklists a message path.
     * @dev Can only be called by accounts with WHITELIST_MANAGER_ROLE.
     * @param sender The address of the message sender
     * @param receiver The address of the message receiver
     * @param chainId The destination chain ID
     */
    function blacklistPath(address sender, address receiver, uint256 chainId) external;

    /**
     * @notice Whitelists a message adapter.
     * @dev Can only be called by accounts with WHITELIST_MANAGER_ROLE.
     * @param adapter The address of the message adapter
     */
    function whitelistMessageAdapter(address adapter) external;

    /**
     * @notice Blacklists a message adapter.
     * @dev Can only be called by accounts with WHITELIST_MANAGER_ROLE.
     * @param adapter The address of the message adapter
     */
    function blacklistMessageAdapter(address adapter) external;

    /**
     * @notice Sends a cross-chain message.
     * @dev Requires the path to be whitelisted and the adapter to be whitelisted.
     * @param receiver The address of the receiver on the destination chain
     * @param sendParams The parameters for sending the message
     */
    function send(address receiver, SendParams calldata sendParams) external payable;

    /**
     * @notice Receives a cross-chain message.
     * @dev Can only be called by whitelisted message adapters.
     * @param rawMessage The raw message bytes
     */
    function receiveMessage(bytes memory rawMessage) external;

    /**
     * @notice Retries sending a cached message.
     * @dev Can only be called by accounts with CACHE_MANAGER_ROLE.
     * @param nonce_ The nonce of the message to retry
     * @param path The path of the message
     * @param sendParams The parameters for sending the message
     */
    function retryCachedMessage(uint256 nonce_, bytes32 path, SendParams calldata sendParams) external payable;

    /**
     * @notice Removes a message from the cache.
     * @dev Can only be called by accounts with CACHE_MANAGER_ROLE.
     * @param nonce The nonce of the message
     * @param chainTo The destination chain ID
     * @param path The path of the message
     * @param message The message bytes
     */
    function removeMessageFromCache(uint256 nonce, uint256 chainTo, bytes32 path, bytes memory message) external;

    /**
     * @notice Checks if a message is cached.
     * @param chainTo The destination chain ID
     * @param nonce The nonce of the message
     * @param remotePath The remote path
     * @param message The message bytes
     * @return True if the message is cached, false otherwise
     */
    function isMessageCached(
        uint256 chainTo,
        uint256 nonce,
        bytes32 remotePath,
        bytes memory message
    ) external view returns (bool);
}

node_modules/@shift-defi/core/contracts/libraries/Errors.sol

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

library Errors {
    // -- Access Control Errors --

    error Unauthorized();

    // -- State Errors --

    error AlreadyBlacklisted();
    error AlreadyWhitelisted();
    error NotImplemented();
    error TokenAlreadySet(address value);
    error AlreadySet();

    // -- Input Validation Errors --

    error ArrayLengthMismatch();
    error InvalidArrayLength();
    error IncorrectAmount();
    error IncorrectContainerStatus();
    error ZeroAddress();
    error ZeroAmount();
    error ZeroArrayLength();
    error IncorrectContainerType(address container, uint8 expected, uint8 received);
    error DuplicatingAddressInArray(address entry);
    error IncorrectChainId(uint256 chainId);
    error SettingSameBooleanValue();
    error SettingSameValue();

    // -- Business Logic Errors --

    error ReshufflingModeEnabled();
    error ReshufflingModeDisabled();
    error ReshufflingGatewayNotSet();

    error NotEnoughNativeToken(uint256 value, uint256 balance);
    error NotEnoughTokens(address token, uint256 amount, uint256 balance);
    error SwapFailed(address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut);
}

node_modules/@shift-defi/core/contracts/libraries/RingCacheLib.sol

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

/// @title RingCacheLib
/// @notice Minimal ring-buffer cache with O(1) add/remove/exists.
library RingCacheLib {
    uint256 internal constant MAX_CACHE_SIZE = 256;

    struct RingCache {
        mapping(bytes32 => uint256) indices;
        mapping(uint256 => bytes32) ring;
        uint256 head;
        uint256 maxCacheSize;
        bytes32 id;
    }

    event Evicted(bytes32 id, bytes32 value);
    event Stored(bytes32 id, bytes32 value);
    event Removed(bytes32 id, bytes32 value);

    error AlreadyInitialized(bytes32 id);
    error InvalidSize(uint256 proposedSize, uint256 maximumSize);
    error DoesNotExists(bytes32 id, bytes32 data);
    error NullValue(bytes32 id);
    error ValueAlreadyExists(bytes32 id, bytes32 value);
    error ValueMismatch(bytes32 id, bytes32 value, bytes32 storedValue);

    /**
     * @notice Initializes the ring cache with an id and max size.
     * @dev Reverts if called twice or if size is zero/too large.
     * @param _cache Storage cache struct.
     * @param _id Identifier used in errors/events.
     * @param _cacheSize Maximum number of cached items (must be >0 and < MAX_CACHE_SIZE).
     */
    function initialize(RingCache storage _cache, bytes32 _id, uint256 _cacheSize) internal {
        require(_cache.maxCacheSize == 0, AlreadyInitialized(_cache.id));
        require(_cacheSize > 0, InvalidSize(_cacheSize, MAX_CACHE_SIZE));
        require(_cacheSize < MAX_CACHE_SIZE, InvalidSize(_cacheSize, MAX_CACHE_SIZE));
        _cache.maxCacheSize = _cacheSize;
        _cache.id = _id;
    }

    /**
     * @notice Adds a value to the cache; evicts old entry if buffer is full.
     * @dev No-op if value already exists.
     * @param _cache Storage cache struct.
     * @param value Value to cache.
     */
    function add(RingCache storage _cache, bytes32 value) internal {
        require(value != bytes32(0), NullValue(_cache.id));
        require(!exists(_cache, value), ValueAlreadyExists(_cache.id, value));

        uint256 index = (_cache.head++ % _cache.maxCacheSize) + 1;
        bytes32 oldValue = _cache.ring[index];
        if (oldValue != bytes32(0)) {
            delete _cache.indices[oldValue];
            emit Evicted(_cache.id, oldValue);
        }
        _cache.indices[value] = index;
        _cache.ring[index] = value;

        emit Stored(_cache.id, value);
    }

    /**
     * @notice Removes a value from the cache.
     * @dev Reverts if value not present.
     * @param _cache Storage cache struct.
     * @param value Value to remove.
     */
    function remove(RingCache storage _cache, bytes32 value) internal {
        require(exists(_cache, value), DoesNotExists(_cache.id, value));
        uint256 index = _cache.indices[value];
        bytes32 storedValue = _cache.ring[index];
        require(storedValue == value, ValueMismatch(_cache.id, value, storedValue));
        delete _cache.indices[value];
        delete _cache.ring[index];
        emit Removed(_cache.id, value);
    }

    /**
     * @notice Checks whether a value exists in the cache.
     * @param _cache Storage cache struct.
     * @param value Value to check.
     * @return True if present, false otherwise.
     */
    function exists(RingCache storage _cache, bytes32 value) internal view returns (bool) {
        return _cache.indices[value] != 0;
    }

    /**
     * @notice Returns all cached values in physical slot order (ring[1]..ring[maxCacheSize]).
     * @param _cache Storage cache struct.
     * @return out Array of length maxCacheSize; removed/empty slots are bytes32(0).
     */
    function all(RingCache storage _cache) internal view returns (bytes32[] memory out) {
        out = new bytes32[](_cache.maxCacheSize);
        for (uint256 i = 0; i < _cache.maxCacheSize; ++i) {
            out[i] = _cache.ring[i + 1];
        }
    }
}
Compiler settingsShow
{
  "viaIR": false,
  "metadata": {
    "appendCBOR": true,
    "bytecodeHash": "ipfs",
    "useLiteralContent": false
  },
  "libraries": {
    "node_modules/@shift-defi/core/contracts/libraries/Codec.sol": {
      "Codec": "0x5B0b04C23b7FA29Af61C15D4A13B1AeCFc1b5f17"
    },
    "node_modules/@shift-defi/core/contracts/libraries/Common.sol": {
      "Common": "0x2c3F1b9975A41c89AA37ad6D15Fcbba17Ed757e1"
    }
  },
  "optimizer": {
    "runs": 5,
    "enabled": true
  },
  "evmVersion": "prague",
  "remappings": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
    "forge-std/=lib/forge-std/src/",
    "@shift-defi/core/contracts/=node_modules/@shift-defi/core/contracts/",
    "@shift-defi/core/=node_modules/@shift-defi/core/contracts/",
    "@shift-defi/bridge-adapter-usdt0/=node_modules/@shift-defi/bridge-adapter-usdt0/contracts/",
    "@shift-defi/message-adapter-lz-v2/=node_modules/@shift-defi/message-adapter-lz-v2/contracts/",
    "@shift-defi/swap-adapters/=node_modules/@shift-defi/swap-adapters/contracts/",
    "@shift-defi/strategies/=node_modules/@shift-defi/strategies/contracts/",
    "@layerzerolabs/oapp-evm/=lib/devtools/packages/oapp-evm/",
    "@layerzerolabs/oft-evm/=lib/devtools/packages/oft-evm/",
    "@layerzerolabs/lz-evm-protocol-v2/=lib/LayerZero-v2/packages/layerzero-v2/evm/protocol/",
    "@layerzerolabs/lz-evm-messagelib-v2/=lib/LayerZero-v2/packages/layerzero-v2/evm/messagelib/",
    "@layer-zero/devtools/packages/oapp-evm/=lib/devtools/packages/oapp-evm/contracts/",
    "solidity-bytes-utils/=lib/solidity-bytes-utils/"
  ]
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.