Skip to content
Verified contractExactUNLICENSED

HyperlaneAdapterV4

Address0x0dc0deb0c095b871acaf108b454177e5cf65ebf5
Balance

0 ETH

 

Transactions

11

 

Compiler

solc 0.8.30

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.30+commit.73712a01
Language
solidity
Optimization
Yes, 200 runs
EVM version
cancun
Via IR
yes
License
UNLICENSED
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,401,423
Creation transaction
0x6b5708488e…a6b18b4cb7

src/v4/bridge/transports/HyperlaneAdapterV4.sol

// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.30;

import {ITransportAdapterV4, IBridgeForAdaptersV4} from "../ITransportV4.sol";
import {IPendingConfigV4} from "../PangeaDeployerV4.sol";
import {IMailboxV4, IMessageRecipientV4, IInterchainSecurityModuleV4, IAggregationIsmV4, IStaticAggregationIsmFactoryV4, IMultisigIsmV4, IStaticMultisigIsmFactoryV4} from "./IHyperlaneV4.sol";

interface IChainKindV4 {
    function chainKind(uint32 pcid) external view returns (uint8);
}

/// @title HyperlaneAdapterV4 -- the shared bridge's Hyperlane recipient / dispatcher (transport 2), §11.2.14
/// @notice One address on every EVM chain (mailbox, bridge, hook, the pinned StaticAggregationIsm factory from
///         `pending()`). Its ISM is ITSELF, a ROUTING ISM (module type 1: the relayer calls `route(message)`) over its
///         own table ismOf[origin] (no DomainRoutingIsm, hl-r1 HL1-H1): per ORIGIN (main answer #31, every origin)
///         OUR validator's 1-of-1 leaf itself (the solo shape, ismOf == ourIsmOf; no Hyperlane-side set), or, only if
///         the owner later adds one, an immutable StaticAggregationIsm from the pinned factory, mode ALL (threshold ==
///         module count), that contains OUR validator ISM for that origin (fixed at the first set, never changed). A
///         Hyperlane-side set, if ever added, rotates by an INSTANT owner replace
///         (`replaceIsm`, owner rulings 3+4, v4-evma-rulings: no timelock anywhere) under the same pin checks, and
///         every set/replace emits `IsmSet` (the I-12 watcher alerts on it and on the bridge's `ChainAdded`); an origin
///         is never removed; Hyperlane governance (the mailbox default ISM)
///         never changes trust under a coin (HL-2). `verify` records the message id (keccak256 of the Hyperlane
///         message) for the `handle` that follows in the same `process`.
///         HL-5: every dispatch and quote names OUR pinned hook (`hook`: the mailbox's MerkleTreeHook + OUR IGP,
///         an aggregation hook; nonzero, fixed at construction), never the mailbox default hook.
///         HL-3 / HL1-M1 / B3-L2: `handle` passes the PROCESSOR of the message (mailbox.processor(id): the msg.sender
///         of Mailbox.process, recorded by the mailbox before verify; never tx.origin) as the executor; the bridge
///         lands a buy-mode arrival at once only for our delivery keys (our relayer key among them), anyone after
///         the window. A process call made from inside third-party code (e.g. a compose a key retries) is that
///         code's, not the key's. B3-I6: handle refuses msg.value (nothing can be stranded here).
contract HyperlaneAdapterV4 is ITransportAdapterV4, IMessageRecipientV4, IInterchainSecurityModuleV4 {
    uint8 public constant TRANSPORT_ID = 2;
    uint8 public constant ROUTING = 1;
    uint16 internal constant HOOK_METADATA_VARIANT = 1;
    /// @notice The gas limit toward a Solana-kind chain (the IGP adds 100k CU of destination overhead there).
    uint256 public constant DEFAULT_GAS = 300_000;
    /// @notice G-EVMA M-2: the gas toward an EVM chain = the WHOLE receive our relayer pays there (21k + calldata +
    ///         Mailbox.process + our aggregation ISM + handle + the bridge's credit with the real pool read, the held
    ///         store of an arrival (a buy from a third party, a coin not open there: the message is stored in full),
    ///         a stored compose), measured on the Robinhood fork (BridgeV4HlGas.fork.t.sol, block 110318855, tx gas:
    ///         plain 337,537 / held buy 369,136 at 168 B; held buy + 512 B compose 762,131 at 680 B; held + 2048 B
    ///         1,881,572 at 2216 B: ~770 gas per stored byte) + 25%: floor = EVM_BASE_GAS + EVM_GAS_PER_BYTE x the
    ///         bridge message length, >= 1.25 x every measured path. The IGP's EVM destination overhead is 0: this
    ///         floor is the whole figure, and the buy cover (PangeaBridgeV4: the adapter's quote with no options) is
    ///         computed on it.
    uint256 public constant EVM_BASE_GAS = 310_000;
    uint256 public constant EVM_GAS_PER_BYTE = 960;
    /// @notice G-EVMA M-2 / DC-EVMA-I1: the longest bridge message toward an EVM chain, so that its floor stays within
    ///         MAX_GAS (I-3: 1.4M, as LZ's cap) = 1135 B (header 168 + a compose of up to 967 B; the protocol's compose
    ///         limit elsewhere is 512 B, MAX_COMPOSE_MSG_LEN). Any arrival can be held (stored in full), so the limit
    ///         is on every message, not only buys: a longer one is refused at the quote and at the send.
    uint256 public constant EVM_MAX_BODY = (MAX_GAS - EVM_BASE_GAS) / EVM_GAS_PER_BYTE;
    /// @notice G-EVMA I-3: the largest gas limit a send may ask for (as LZ's GasFloorV3 cap, 1.4M): a typo in the
    ///         options can no longer make the sender pay an unbounded quote.
    uint256 public constant MAX_GAS = 1_400_000;
    /// @notice G-EVMA L-2: the most distinct validators an origin's ISM may hold over all its leaves (the scan for a
    ///         validator shared between leaves covers every one of them; today's sets hold at most 9).
    uint256 public constant MAX_VALIDATORS = 64;
    /// @notice SB1-I4: C2's HELD_MAX_BODY (header 168 + MAX_COMPOSE_MSG_LEN 512): a longer body toward a Solana-kind
    ///         chain could never be stored there, so the send refuses it.
    uint256 public constant SVM_MAX_BODY = 680;
    uint8 internal constant KIND_SVM = 2;

    IMailboxV4 public immutable mailbox;
    address public immutable bridge;
    address public immutable hook; // OUR hook (HL-5): MerkleTreeHook + our IGP
    IStaticAggregationIsmFactoryV4 public immutable ismFactory;
    IStaticMultisigIsmFactoryV4 public immutable multisigFactory;

    mapping(uint32 => address) public ismOf; // origin domain -> its ISM (#31: OUR 1-of-1 leaf = ourIsmOf; else a mode-all aggregation)
    mapping(uint32 => address) public ourIsmOf; // origin domain -> OUR validator ISM (fixed at the first set)
    mapping(uint32 => address) public ourValidatorOf; // origin domain -> OUR validator (its 1-of-1 leaf = ourIsmOf)
    bytes32 internal transient _verifiedId;

    event IsmSet(uint32 indexed origin, address ism, address ours);

    error NotOwner();
    error NoHook();
    error BodyTooLong(uint256 len, uint256 max);
    error IsmExists(uint32 origin);
    error NoIsm(uint32 origin);
    error NoRoute(uint32 pcid);
    error NotBridge();
    error NotMailbox();
    error ValueRefused();
    error NotVerified();
    error UnknownOrigin(uint32 origin);
    error GasBelowFloor(uint256 gas, uint256 floor);
    error GasAboveCap(uint256 gas, uint256 cap);
    error TooManyValidators(uint256 max);
    error SoloNotAllowed(uint32 origin);
    error SoloNotOurLeaf(address ism);
    error BadOptions();
    error IsmNotFromFactory(address ism);
    error IsmNotModeAll(address ism);
    error IsmWithoutOurs(address ism);
    error IsmNotTwoSets(address ism);
    error LeafNotSorted(address leaf);
    error SideSetMismatch(address leaf);
    error LeafNotFromFactory(address leaf);
    error SharedValidator(address validator);
    error DuplicateModule(address leaf);

    constructor() {
        (address mb, address br, address hk, address f, address mf) =
            abi.decode(IPendingConfigV4(msg.sender).pending(), (address, address, address, address, address));
        multisigFactory = IStaticMultisigIsmFactoryV4(mf);
        mailbox = IMailboxV4(mb);
        bridge = br;
        if (hk == address(0) || mb == address(0)) revert NoHook();
        hook = hk;
        ismFactory = IStaticAggregationIsmFactoryV4(f);
    }

    function transportId() external pure returns (uint8) {
        return TRANSPORT_ID;
    }

    function _owner() internal view {
        if (msg.sender != IBridgeForAdaptersV4(bridge).owner()) revert NotOwner();
    }

    /// @dev H1's verifyAggregationIsm ON CHAIN (B1-H2, HL2-L1): the aggregation from the pinned aggregation factory,
    ///      mode all (threshold == module count >= 2), distinct modules; EVERY leaf from the pinned multisig factory
    ///      (address derived from its own validators + threshold), validators strictly ascending (one key never counts
    ///      twice), no validator shared between leaves; OUR leaf = the multisig factory's 1-of-1 of our pinned validator,
    ///      present; the Hyperlane-side leaf's validators equal the declared pinned copy `side`.
    function _checkIsm(address ism, address ours, address[] calldata side, uint8 sideThreshold) internal view {
        if (ism.code.length == 0) revert NoIsm(0);
        (address[] memory mods, uint8 t) = IAggregationIsmV4(ism).modulesAndThreshold("");
        if (ismFactory.getAddress(mods, t) != ism) revert IsmNotFromFactory(ism);
        if (t != mods.length || t < 2) revert IsmNotModeAll(ism);
        if (t != 2) revert IsmNotTwoSets(ism); // B4-L1 / H1-R3: exactly {ours, Hyperlane side}, on a new origin as on a replace
        bool found;
        bool sideSeen;
        address[] memory all = new address[](MAX_VALIDATORS);
        uint256 n;
        for (uint256 i = 0; i < mods.length; i++) {
            for (uint256 q = 0; q < i; q++) {
                if (mods[q] == mods[i]) revert DuplicateModule(mods[i]);
            }
            (address[] memory vs, uint8 lt) = IMultisigIsmV4(mods[i]).validatorsAndThreshold("");
            if (vs.length == 0 || multisigFactory.getAddress(vs, lt) != mods[i]) revert LeafNotFromFactory(mods[i]);
            for (uint256 k = 0; k < vs.length; k++) {
                if (k > 0 && vs[k] <= vs[k - 1]) revert LeafNotSorted(mods[i]);
                for (uint256 m = 0; m < n; m++) {
                    if (all[m] == vs[k]) revert SharedValidator(vs[k]);
                }
                if (n == all.length) revert TooManyValidators(MAX_VALIDATORS); // L-2: never a silent stop
                all[n++] = vs[k];
            }
            if (mods[i] == ours) found = true;
            else if (!sideSeen && _sameSet(vs, side) && lt == sideThreshold) sideSeen = true; // GATE-EVM I-4: threshold too
        }
        if (!found || ours == address(0)) revert IsmWithoutOurs(ism);
        if (!sideSeen) revert SideSetMismatch(ism);
    }

    function _ourLeaf(address validator) internal view returns (address) {
        address[] memory v = new address[](1);
        v[0] = validator;
        return multisigFactory.getAddress(v, 1);
    }

    /// @dev Both strictly ascending (checked for `vs`; `side` must be given ascending): set equality = elementwise.
    function _sameSet(address[] memory vs, address[] calldata side) internal pure returns (bool) {
        if (vs.length != side.length || vs.length == 0) return false;
        for (uint256 i = 0; i < vs.length; i++) {
            if (vs[i] != side[i]) return false;
        }
        return true;
    }

    /// @notice The bridge owner pins origin `origin`'s ISM ONCE (`ourValidator` = our validator for that origin, fixed;
    ///         our leaf is derived from it on chain;
    ///         `side` = the Hyperlane-side validators, ascending; `sideThreshold` = that leaf's threshold, GATE-EVM I-4:
    ///         the side leaf must have exactly it, so a 1-of-N side leaf is refused on chain). B4-L1: a NEW origin passes the same rule as a
    ///         replace: exactly two leaves, OUR 1-of-1 leaf of `ourValidator` among them, the side leaf = `side`;
    ///         VerifyBridgeV4 then requires `ourValidator` = chains.json's for every on-chain row (b.pcids()).
    ///         Main answer #31 (owner: "only ours, nothing else"; extends ruling 8 from Elysium to EVERY origin): an
    ///         EMPTY `side` (threshold 0) pins OUR 1-of-1 leaf of `ourValidator` itself as the ISM (the solo shape:
    ///         ismOf == ourIsmOf); no Hyperlane-side set. `ourValidator` stays the owner's argument as for the 2-of-2
    ///         (accepted risk M-5 below); VerifyBridgeV4.checkSoloIsm pins it to chains.json for every origin.
    ///         ACCEPTED RISK (G-EVMA M-5, owner ruling 4): a new origin (row via BridgeRoleV4.addChain, ISM here) is live
    ///         at once and `ourValidator` is the owner's argument; the guards are the pin checks above, the `ChainAdded`
    ///         + `IsmSet` alerts (I-12 watcher) and VerifyBridgeV4 (ourValidatorOf == chains.json for every row).
    function setIsm(uint32 origin, address ism, address ourValidator, address[] calldata side, uint8 sideThreshold) external {
        _owner();
        if (ismOf[origin] != address(0)) revert IsmExists(origin);
        address ours = _ourLeaf(ourValidator);
        if (side.length == 0) {
            if (sideThreshold != 0) revert SoloNotAllowed(origin);
            if (ours == address(0) || ism != ours || ism.code.length == 0) revert SoloNotOurLeaf(ism);
        } else {
            _checkIsm(ism, ours, side, sideThreshold);
        }
        ismOf[origin] = ism;
        ourIsmOf[origin] = ours;
        ourValidatorOf[origin] = ourValidator;
        emit IsmSet(origin, ism, ours);
    }

    /// @notice Rotation of the Hyperlane-side set: the owner replaces origin `origin`'s ISM INSTANTLY (owner ruling 3,
    ///         v4-evma-rulings: the admin can do anything, anytime, instantly; no timelock). The pin check stays: the
    ///         same `_checkIsm` as a new origin (exactly {OUR leaf of the origin's pinned validator, side leaf = `side`
    ///         with `sideThreshold`}; OUR ISM never changes and never leaves), and `IsmSet` is emitted for the alert.
    ///         ACCEPTED RISK (G-EVMA M-1, owner ruling 3): one admin key can swap the side set in one block; the
    ///         guards are the pin check, the IsmSet alert (I-12 watcher) and VerifyBridgeV4.checkIsm against chains.json.
    function replaceIsm(uint32 origin, address ism, address[] calldata side, uint8 sideThreshold) external {
        _owner();
        if (ismOf[origin] == address(0)) revert NoIsm(origin);
        address ours = ourIsmOf[origin];
        _checkIsm(ism, ours, side, sideThreshold);
        ismOf[origin] = ism;
        emit IsmSet(origin, ism, ours);
    }

    // ------------------------------------------------------------------ ISM (routing)

    function interchainSecurityModule() external view returns (address) {
        return address(this);
    }

    function moduleType() external pure returns (uint8) {
        return ROUTING;
    }

    function _origin(bytes calldata message) internal pure returns (uint32) {
        return uint32(bytes4(message[5:9]));
    }

    function route(bytes calldata message) public view returns (address ism) {
        ism = ismOf[_origin(message)];
        if (ism == address(0)) revert NoIsm(_origin(message));
    }

    function verify(bytes calldata metadata, bytes calldata message) external returns (bool) {
        if (msg.sender != address(mailbox)) revert NotMailbox();
        if (!IInterchainSecurityModuleV4(route(message)).verify(metadata, message)) return false;
        _verifiedId = keccak256(message);
        return true;
    }

    // ------------------------------------------------------------------ transport

    function _dst(uint32 pcid) internal view returns (uint32 domain, bytes32 peer) {
        IBridgeForAdaptersV4.Route memory rt = IBridgeForAdaptersV4(bridge).routeOf(pcid, TRANSPORT_ID);
        if (rt.peer == bytes32(0)) revert NoRoute(pcid);
        return (rt.remoteDomain, rt.peer);
    }

    /// @notice M-2: the least gas a message of `len` bytes is sent with toward `dstPcid` (and quoted at). Toward an
    ///         EVM chain a message over EVM_MAX_BODY is refused (its floor would exceed MAX_GAS).
    function gasFloor(uint32 dstPcid, uint256 len) public view returns (uint256) {
        if (IChainKindV4(bridge).chainKind(dstPcid) == KIND_SVM) return DEFAULT_GAS;
        if (len > EVM_MAX_BODY) revert BodyTooLong(len, EVM_MAX_BODY);
        return EVM_BASE_GAS + EVM_GAS_PER_BYTE * len;
    }

    /// @dev Options: empty, or abi.encode(uint256 gasLimit), gasFloor <= gasLimit <= MAX_GAS (I-3; gasFloor <= MAX_GAS
    ///      by EVM_MAX_BODY). StandardHookMetadata variant 1.
    function _metadata(uint32 dstPcid, uint256 len, bytes calldata options, address refundTo) internal view returns (bytes memory) {
        uint256 g = gasFloor(dstPcid, len);
        if (options.length != 0) {
            if (options.length != 32) revert BadOptions();
            uint256 want = abi.decode(options, (uint256));
            if (want < g) revert GasBelowFloor(want, g);
            if (want > MAX_GAS) revert GasAboveCap(want, MAX_GAS);
            g = want;
        }
        return abi.encodePacked(HOOK_METADATA_VARIANT, uint256(0), g, refundTo);
    }

    function quote(uint32 dstPcid, bytes calldata message, bytes calldata extraOptions) external view returns (uint256) {
        (uint32 d, bytes32 peer) = _dst(dstPcid);
        return mailbox.quoteDispatch(d, peer, message, _metadata(dstPcid, message.length, extraOptions, address(this)), hook);
    }

    function send(uint32 dstPcid, bytes calldata message, bytes calldata extraOptions, address refundTo)
        external
        payable
        returns (bytes32)
    {
        if (msg.sender != bridge) revert NotBridge();
        (uint32 d, bytes32 peer) = _dst(dstPcid);
        if (message.length > SVM_MAX_BODY && IChainKindV4(bridge).chainKind(dstPcid) == KIND_SVM) {
            revert BodyTooLong(message.length, SVM_MAX_BODY);
        }
        return mailbox.dispatch{value: msg.value}(d, peer, message, _metadata(dstPcid, message.length, extraOptions, refundTo), hook);
    }

    function handle(uint32 origin, bytes32 sender, bytes calldata body) external payable {
        if (msg.sender != address(mailbox)) revert NotMailbox();
        if (msg.value != 0) revert ValueRefused();
        bytes32 id = _verifiedId;
        if (id == bytes32(0)) revert NotVerified();
        _verifiedId = bytes32(0);
        uint32 pcid = IBridgeForAdaptersV4(bridge).pcidOf(TRANSPORT_ID, origin);
        if (pcid == 0) revert UnknownOrigin(origin);
        // HL-3 / B3-L2: whoever called Mailbox.process for this message (our relayer key = a delivery key, HL1-M1)
        IBridgeForAdaptersV4(bridge).receiveFromTransport(pcid, sender, body, id, mailbox.processor(id));
    }
}

src/v4/bridge/ITransportV4.sol

// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.30;

/// @title ITransportAdapterV4 -- a transport adapter of the shared bridge (V4-INTERFACES §11.2.14)
interface ITransportAdapterV4 {
    function transportId() external view returns (uint8);
    function bridge() external view returns (address);
    function quote(uint32 dstPcid, bytes calldata message, bytes calldata extraOptions) external view returns (uint256);
    /// @notice Bridge only. Returns the transport's own message id (LZ guid / Hyperlane message id).
    function send(uint32 dstPcid, bytes calldata message, bytes calldata extraOptions, address refundTo)
        external
        payable
        returns (bytes32 transportMsgId);
}

/// @notice What the adapters read from / call on the bridge.
interface IBridgeForAdaptersV4 {
    struct Route {
        uint32 remoteDomain;
        bytes32 peer;
    }

    function owner() external view returns (address);
    function routeOf(uint32 pcid, uint8 tid) external view returns (Route memory);
    function pcidOf(uint8 tid, uint32 remoteDomain) external view returns (uint32);
    function receiveFromTransport(uint32 srcPcid, bytes32 srcPeer, bytes calldata message, bytes32 transportMsgId, address executor)
        external;
}

src/v4/bridge/PangeaDeployerV4.sol

// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.30;

/// @notice What a v4 infra contract reads from its deployer in its constructor (the TokenDeployerV4 pattern, §11.2.1):
///         chain-specific values stay out of the init code, so the address is the same on every EVM chain.
interface IPendingConfigV4 {
    function pending() external view returns (bytes memory);
}

/// @title PangeaDeployerV4 -- CREATE2 deployer of the shared-bridge infra (bridge, adapters, coin deployer, core)
/// @notice Itself deployed through the canonical CREATE2 deployer with a fixed salt and `initializer` (the same deploy
///         key / multisig in every config), so it has one address on every EVM chain, and so does everything it deploys
///         with the same salt and init code. Only `initializer` deploys; the per-chain config is handed over through
///         `pending()` for the duration of the constructor only.
contract PangeaDeployerV4 is IPendingConfigV4 {
    address public immutable initializer;
    bytes internal _pending;

    event Deployed(bytes32 indexed salt, address indexed at);

    error NotInitializer();
    error DeployFailed();

    constructor(address initializer_) {
        initializer = initializer_;
    }

    function pending() external view returns (bytes memory) {
        return _pending;
    }

    function predict(bytes32 salt, bytes calldata initcode) external view returns (address) {
        return address(uint160(uint256(keccak256(abi.encodePacked(bytes1(0xff), address(this), salt, keccak256(initcode))))));
    }

    function deploy(bytes32 salt, bytes calldata initcode, bytes calldata config) external returns (address a) {
        if (msg.sender != initializer) revert NotInitializer();
        _pending = config;
        bytes memory code = initcode;
        assembly ("memory-safe") {
            a := create2(0, add(code, 0x20), mload(code), salt)
        }
        delete _pending;
        if (a == address(0)) revert DeployFailed();
        emit Deployed(salt, a);
    }
}

src/v4/bridge/transports/IHyperlaneV4.sol

// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.30;

/// @notice The Hyperlane v3 surfaces the adapter uses (Mailbox, ISM, recipient), as in hyperlane-xyz/core.
interface IMailboxV4 {
    function localDomain() external view returns (uint32);
    /// @notice The msg.sender of Mailbox.process for message `id` (recorded before verify / handle).
    function processor(bytes32 id) external view returns (address);
    function dispatch(uint32 destinationDomain, bytes32 recipientAddress, bytes calldata messageBody, bytes calldata hookMetadata)
        external
        payable
        returns (bytes32 messageId);
    function quoteDispatch(uint32 destinationDomain, bytes32 recipientAddress, bytes calldata messageBody, bytes calldata hookMetadata)
        external
        view
        returns (uint256 fee);
    /// @notice HL-5: with OUR hook (never the mailbox default hook).
    function dispatch(uint32 destinationDomain, bytes32 recipientAddress, bytes calldata messageBody, bytes calldata hookMetadata, address hook)
        external
        payable
        returns (bytes32 messageId);
    function quoteDispatch(uint32 destinationDomain, bytes32 recipientAddress, bytes calldata messageBody, bytes calldata hookMetadata, address hook)
        external
        view
        returns (uint256 fee);
}

interface IInterchainSecurityModuleV4 {
    /// @notice Hyperlane module types: 2 = AGGREGATION, 5 = MESSAGE_ID_MULTISIG.
    function moduleType() external view returns (uint8);
    function verify(bytes calldata metadata, bytes calldata message) external returns (bool);
}

interface IMessageRecipientV4 {
    function handle(uint32 origin, bytes32 sender, bytes calldata message) external payable;
}

/// @notice Hyperlane's StaticAggregationIsm (mode all when threshold == module count) and its pinned factory.
interface IAggregationIsmV4 {
    function modulesAndThreshold(bytes calldata message) external view returns (address[] memory, uint8);
}

interface IStaticAggregationIsmFactoryV4 {
    function getAddress(address[] calldata modules, uint8 threshold) external view returns (address);
    function deploy(address[] calldata modules, uint8 threshold) external returns (address);
}

/// @notice Hyperlane's (Static)MessageIdMultisigIsm leaf view.
interface IMultisigIsmV4 {
    function validatorsAndThreshold(bytes calldata message) external view returns (address[] memory, uint8);
}

/// @notice Hyperlane's StaticMessageIdMultisigIsmFactory (deterministic leaf address per (validators, threshold)).
interface IStaticMultisigIsmFactoryV4 {
    function getAddress(address[] calldata validators, uint8 threshold) external view returns (address);
    function deploy(address[] calldata validators, uint8 threshold) external returns (address);
}
Compiler settingsShow
{
  "viaIR": true,
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "cancun",
  "remappings": [
    "@layerzerolabs/lz-evm-protocol-v2/=lib/layerzero/protocol-v2/",
    "@layerzerolabs/oapp-evm/=lib/layerzero/oapp-evm/",
    "@layerzerolabs/oft-evm/=lib/layerzero/oft-evm/",
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@uniswap/v4-core/=lib/uniswap-v4-core/",
    "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "layerzero/=lib/layerzero/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "solmate/=lib/solmate/",
    "uniswap-v4-core/=lib/uniswap-v4-core/src/"
  ]
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.