{
 "item": "bridge-lzpaths-config",
 "commit": "ff1c192b3798542997f600091f2dc73ff05e4c40",
 "forge": "forge Version: 1.9.0 (/root/.foundry/versions/.../v1.9.0; the PATH default is 1.8.3), --use solar (Solar 0.8.38)",
 "verdict": "findings",
 "findings": [
  {
   "id": "F1",
   "severity": "low",
   "title": "A second path builder ships off-spec 4663 path config (20 confirmations from 4663, 1-day window, 5,000/50,000 delay) and the contract accepts it",
   "property": "P1 (4663 -> Ethereum 18,000 confirmations; one source of path numbers)",
   "claim": "README:1107-1108 'the real figures (9,000 / 18,000) are only in `script/LzPaths.sol`' -- false at this commit: script/house/DeployConfig.sol RobinhoodConfig carries a full launch BATCH for the 4663 path with CONF_FROM_4663 = 20, and script/house/DeployMainnetBridge.s.sol:11 tells the operator to open the path with it",
   "files": [
    "script/house/DeployConfig.sol:1066",
    "script/house/DeployConfig.sol:865",
    "script/house/DeployConfig.sol:1131",
    "script/house/DeployConfig.sol:1137",
    "script/house/DeployConfig.sol:1153",
    "script/house/DeployConfig.sol:1232",
    "script/house/DeployMainnetBridge.s.sol:11",
    "src/bridge/ImdBridge.sol:324",
    "src/bridge/ImdBridge.sol:1058",
    "script/LzPaths.sol:152"
   ],
   "sequence": "Safe proposes ImdBridge(Ethereum).propose(RobinhoodConfig.launchBatchMainnet(robinhoodPathOnMainnet(peer))) as script/house/DeployMainnetBridge.s.sol:11 documents; _validate passes (20 >= MIN_CONFIRMATIONS_FROM_OTHER); anyone applies after 48 h. Ethereum's receive ULN for eid 30416 is then 20 confirmations (~2-4 s of 4663 soft confirmations), inbound window 1 day (50,000/day: L x (1 + 4d/W) = 250,000 > the 50,000 breaker this builder sets, so in-limit traffic trips the path), instant cap 5,000, breaker 50,000.",
   "expected": "Every writer of the 4663 path yields LzChains.ROBINHOOD_CONFIRMATIONS = 18,000 from 4663 and LzPaths' 4-day window / 10,000 / 100,000 (or the stale builder is removed); README:1107 true",
   "actual": "receive ULN confirmations 20 (test: '20 != 18000'); window 86,400 s; applied without revert",
   "reachableAtDeploy": "yes, as a script route only: no on-chain actor without the Safe can use it; the Safe following house/DeployMainnetBridge.s.sol:11 opens the 4663 path off-spec. The launch file route (BridgeBatch -> LzPaths) is correct.",
   "fix": "Delete RobinhoodConfig's path builders (lzConfig*/lzLibraries*/delaySettings/launchBatch*/mainnetPath/robinhoodPathOnMainnet/CONF_*) from script/house/DeployConfig.sol and point house/DeployMainnetBridge.s.sol:11 to LzPaths.launchBatch / BridgeBatch; or raise the contract floor per source eid (ImdBridge keyed floors 9,000 Base / 18,000 4663) so no builder can go below.",
   "test": {
    "source": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.38;\n\nimport {Test} from \"forge-std/Test.sol\";\nimport {SetConfigParam} from \"layerzero-v2/protocol/interfaces/IMessageLibManager.sol\";\nimport {MessagingParams, MessagingReceipt, MessagingFee} from \"layerzero-v2/protocol/interfaces/ILayerZeroEndpointV2.sol\";\nimport {SendParam} from \"layerzero-v2/oft/interfaces/IOFT.sol\";\nimport {ImdBridge, IMintableBurnable} from \"../../src/bridge/ImdBridge.sol\";\nimport {ILayerZeroEndpointV2} from \"layerzero-v2/protocol/interfaces/ILayerZeroEndpointV2.sol\";\nimport {LzChains, LzPaths} from \"../../script/LzPaths.sol\";\nimport {RobinhoodConfig as HouseRH} from \"../../script/house/DeployConfig.sol\";\n\ncontract Lib {\n    function messageLibType() external pure returns (uint8) { return 2; }\n}\n\ncontract Tok {\n    function mint(address, uint256) external pure returns (bool) { return true; }\n    function burn(address, uint256) external pure returns (bool) { return true; }\n}\n\n/// Records every config the bridge writes and checks it against ULN302 semantics + the floors (a violation is sticky).\ncontract RecEp {\n    uint32 public eid;\n    mapping(address => bool) public isSendLib;\n    mapping(address => bool) public isLib;\n    mapping(address => mapping(address => mapping(uint32 => mapping(uint32 => bytes)))) public cfg;\n    mapping(address => mapping(uint32 => address)) public sendLib;\n    mapping(address => mapping(uint32 => address)) public recvLib;\n    bool public violated;\n    bytes public lastOptions;\n\n    constructor(uint32 e) { eid = e; }\n    function addLib(address l, bool s) external { isLib[l] = true; isSendLib[l] = s; }\n\n    function setConfig(address oapp, address lib, SetConfigParam[] calldata p) external {\n        require(msg.sender == oapp && isLib[lib], \"auth/lib\");\n        for (uint256 i; i < p.length; ++i) {\n            if (p[i].configType == 2) {\n                LzPaths.UlnConfig memory u = abi.decode(p[i].config, (LzPaths.UlnConfig));\n                uint64 floor_ = (isSendLib[lib] ? eid : p[i].eid) == 30101 ? 15 : 20;\n                if (u.requiredDVNCount < 3 || u.requiredDVNCount == 255 || u.requiredDVNs.length != u.requiredDVNCount\n                    || u.confirmations < floor_ || u.optionalDVNCount == 0) violated = true;\n            } else {\n                require(isSendLib[lib] && p[i].configType == 1, \"type\"); // ReceiveUln302 has no executor config\n            }\n            cfg[oapp][lib][p[i].eid][p[i].configType] = p[i].config;\n        }\n    }\n    function setSendLibrary(address oapp, uint32 e, address lib) external {\n        require(msg.sender == oapp && isSendLib[lib] && sendLib[oapp][e] != lib, \"send lib\");\n        sendLib[oapp][e] = lib;\n    }\n    function setReceiveLibrary(address oapp, uint32 e, address lib, uint256) external {\n        require(msg.sender == oapp && isLib[lib] && !isSendLib[lib] && recvLib[oapp][e] != lib, \"recv lib\");\n        recvLib[oapp][e] = lib;\n    }\n    function send(MessagingParams calldata p, address) external payable returns (MessagingReceipt memory r) {\n        lastOptions = p.options;\n        r.nonce = 1;\n    }\n}\n\ncontract LzCfgTest is Test {\n    uint32 constant ETH = 30101;\n    uint32 constant RH = 30416;\n    bytes32 constant PEER = bytes32(uint256(0xbeef));\n\n    function _bridge(uint32 local) internal returns (RecEp ep, ImdBridge b) {\n        ep = new RecEp(local);\n        b = new ImdBridge(ILayerZeroEndpointV2(address(ep)), IMintableBurnable(address(new Tok())), address(this), address(1));\n    }\n\n    function _etchLib(RecEp ep, address a, bool s) internal {\n        vm.etch(a, address(new Lib()).code);\n        ep.addLib(a, s);\n    }\n\n    function _apply(ImdBridge b, bytes memory payload) internal {\n        b.propose(payload);\n        vm.warp(b.pendingEta());\n        vm.prank(address(0xdead));\n        b.applyPending();\n    }\n\n    // ---- F1: the second writer (script/house/DeployConfig.sol RobinhoodConfig.launchBatchMainnet, named by\n    // script/house/DeployMainnetBridge.s.sol:11) opens Ethereum's 4663 path at 20 confirmations and a 1-day window.\n    function test_houseBuilderOpens4663PathOffSpec() public {\n        (RecEp ep, ImdBridge b) = _bridge(ETH);\n        LzChains.Chain memory e = LzChains.ethereum();\n        _etchLib(ep, e.sendUln, true);\n        _etchLib(ep, e.receiveUln, false);\n        _apply(b, HouseRH.launchBatchMainnet(HouseRH.robinhoodPathOnMainnet(PEER)));\n        assertEq(b.peers(RH), PEER, \"path set\");\n        assertTrue(b.configured(b.receiveLibrary(RH), RH), \"configured: send/lzReceive accept the path\");\n        LzPaths.UlnConfig memory u = abi.decode(ep.cfg(address(b), e.receiveUln, RH, 2), (LzPaths.UlnConfig));\n        (, uint32 window,,) = b.inbound(RH);\n        emit log_named_uint(\"confirmations from 4663 accepted by Ethereum\", u.confirmations);\n        emit log_named_uint(\"inbound window (s)\", window);\n        assertEq(u.confirmations, LzChains.ROBINHOOD_CONFIRMATIONS, \"P1: 4663 -> Ethereum must be 18,000 confirmations\");\n        assertEq(uint256(window), LzPaths.LIMIT_WINDOW, \"P1/LzPaths: 4-day window\");\n    }\n\n}\n",
    "ran": "forge 1.9.0: forge test --use solar --match-path test/scratch/LzCfg.t.sol -vv",
    "result": "[FAIL: P1: 4663 -> Ethereum must be 18,000 confirmations: 20 != 18000] test_houseBuilderOpens4663PathOffSpec() (gas: 8577634)"
   }
  },
  {
   "id": "F2",
   "severity": "info",
   "title": "BridgeBatch._checkPath does not check what the batch writes: limit values, library addresses, DVN set, confirmations, executor",
   "property": "P2 (BridgeBatch writes exactly the path it checks)",
   "claim": "C1",
   "files": [
    "script/launch/BridgeBatch.s.sol:443",
    "script/launch/BridgeBatch.s.sol:445",
    "script/launch/BridgeBatch.s.sol:446",
    "script/launch/BridgeBatch.s.sol:448",
    "script/launch/BridgeBatch.s.sol:413"
   ],
   "sequence": "Apply an Ethereum<-4663 BATCH with limits 5 x LIMIT (250,000) and a receive ULN of 20 confirmations, path paused; evaluate _checkPath + _delayIs (copied verbatim).",
   "expected": "the simulation check refuses a path whose limits, libraries, DVNs or confirmations differ from LzPaths",
   "actual": "accepted: only peer, non-zero pins, configured flags, enforced options, limits != 0, paused, and the delay triple are compared",
   "reachableAtDeploy": "no: path() builds the items from LzPaths.batchItems itself (BridgeBatch.s.sol:413-414), so the written file equals LzPaths; the gap only matters if the builder or the bridge changes. Defense in depth.",
   "fix": "In _checkPath compare availableOut/availableIn and outbound/inbound (limit, window) to LzPaths.link, sendLibrary/receiveLibrary to LzChains.byId(local).sendUln/receiveUln, and endpoint.getConfig(bridge, lib, eid, 1|2) to LzPaths.config(local, remote).",
   "test": {
    "source": "// harness (imports, Lib, Tok, RecEp, _bridge, _etchLib, _apply) as in F1\n    /// C1 / P2: BridgeBatch._checkPath's predicates (script/launch/BridgeBatch.s.sol:443-451, _delayIs :471-476), copied\n    /// verbatim, accept a path whose limits are 5x the launch values and whose receive ULN from 4663 has 20 confirmations.\n    function _checkPathAccepts(ImdBridge b, uint32 eid, uint256 chainId, bytes32 peer32) internal view returns (bool) {\n        if (b.peers(eid) != peer32) return false;\n        if (b.sendLibrary(eid) == address(0) || b.receiveLibrary(eid) == address(0)) return false;\n        if (!b.configured(b.sendLibrary(eid), eid) || !b.configured(b.receiveLibrary(eid), eid)) return false;\n        if (keccak256(b.enforcedOptions(eid)) != keccak256(LzPaths.enforcedOptions(chainId))) return false;\n        if (b.availableOut(eid) == 0 || b.availableIn(eid) == 0) return false;\n        if (!b.paused(eid)) return false;\n        LzPaths.Link memory l = LzPaths.link(LzChains.ETHEREUM, chainId);\n        (,, uint64 capSD) = b.instantIn(eid);\n        (,,, uint64 breakerSD, uint32 delay,,) = b.breakers(eid);\n        return uint256(capSD) * 1e12 == l.instantCap && delay == l.claimDelay && uint256(breakerSD) * 1e12 == l.queueBreaker;\n    }\n\n    function test_checkPathPassesOffSpecPath() public {\n        (RecEp ep, ImdBridge b) = _bridge(ETH);\n        LzChains.Chain memory e = LzChains.ethereum();\n        _etchLib(ep, e.sendUln, true);\n        _etchLib(ep, e.receiveUln, false);\n        bytes[] memory items = LzPaths.batchItems(LzChains.ETHEREUM, LzChains.ROBINHOOD, LzPaths.setPath(LzChains.ETHEREUM, LzChains.ROBINHOOD, PEER));\n        items[0] = abi.encode(uint8(1), RH, PEER, 5 * LzPaths.LIMIT, 4 days, 5 * LzPaths.LIMIT, 4 days, LzPaths.enforcedOptions(LzChains.ROBINHOOD));\n        address[] memory d = LzPaths.sortedDvns(e);\n        SetConfigParam[] memory rp = new SetConfigParam[](1);\n        rp[0] = SetConfigParam(RH, 2, abi.encode(LzPaths.UlnConfig(20, 3, 255, 0, d, new address[](0))));\n        items[5] = abi.encode(uint8(2), e.receiveUln, rp);\n        b.pause(RH);\n        _apply(b, abi.encode(uint8(6), items));\n        assertFalse(_checkPathAccepts(b, RH, LzChains.ROBINHOOD, PEER), \"_checkPath accepts limit 250,000 and 20 confirmations from 4663\");\n    }\n\n",
    "ran": "forge 1.9.0: forge test --use solar --match-path test/scratch/LzCfg.t.sol -vv",
    "result": "[FAIL: _checkPath accepts limit 250,000 and 20 confirmations from 4663] test_checkPathPassesOffSpecPath() (gas: 8659471)"
   }
  }
 ],
 "claims": [
  {
   "id": "C1",
   "result": "holds",
   "evidence": "True as stated for limits: BridgeBatch.s.sol:448 checks availableOut/availableIn != 0 only (F2 test: 5 x launch limits pass the check). Delays are checked exactly (_delayIs :471-476: capSD*1e12, delay, breakerSD*1e12 equal to LzPaths). No batch written by path() carries other values: items = LzPaths.batchItems(local, remote, LzPaths.setPath(...)) at :413-414, path() returns if a proposal is pending (:403) or the path is already set (:409). So 'a batch that opens a path with a limit or delay above the launch values' cannot be produced through BridgeBatch; reported as info F2."
  },
  {
   "id": "C2",
   "result": "holds",
   "evidence": "RAN at head: Ethereum block 26553746 (https://ethereum-rpc.publicnode.com), Base block 65801024 (https://mainnet.base.org), 4663 block 129468858 (https://rpc.mainnet.chain.robinhood.com). EndpointV2 0x1a44...728c eid() = 30101 on Ethereum and 30184 on Base; 0x6F47...DD5B eid() = 30416 on 4663. All 21 pinned addresses (20 unique) have code: endpoints 24,005 B; SendUln302 22,995 B; ReceiveUln302 11,010 B (isRegisteredLibrary true on each endpoint); executors 2,304 B; all 9 DVNs answer vid() = 101 / 184 / 416 on their chain. Operator identity of each DVN (LZ Labs / Twinstake / P2P) not verified on chain."
  },
  {
   "id": "C3",
   "result": "holds",
   "evidence": "test/unit/LzPaths.t.sol testFuzz_goldenEthereum4663 PASS (256 runs): every 32-byte word of both sides' batch equals test/golden/GoldenRobinhoodPath.sol except the listed deliberate diffs (windows 1d->4d, cap 5,000->10,000, breaker 50,000->100,000, 4663 confirmations 20->18,000 in 4663's send ULN and Ethereum's receive ULN). Note: the golden copy is the same stale builder still shipped in script/house/DeployConfig.sol (F1)."
  },
  {
   "id": "C4",
   "result": "holds",
   "evidence": "Code read, no dedicated test: SET_DELAY refuses cap/breaker not multiples of 1e12 (ImdBridge.sol:1037), so pre-floor DelaySet values only arise from tighten's clamp (:654-670 -> _setDelay :1242-1253 emits cap/breaker before /1e12). Readers in src/ use capSD/breakerSD; the only script reader, BridgeBatch._delayIs (:473-475), multiplies the stored SD values by 1e12. No reader of the event in src/ or script/. Matches README:781 as written."
  },
  {
   "id": "C5",
   "result": "holds",
   "evidence": "Writers of library pins / ULN / executor config at the endpoint: only ImdBridge._apply (SET_CONFIG :1152-1157, SET_SEND_LIBRARY :1158-1161, SET_RECEIVE_LIBRARY :1162-1166), reached only through Governed.applyPending after _validate; no endpoint delegate is ever set (no setDelegate in src/bridge; ImdBridge.sol:41), so EndpointV2 accepts config only from the bridge. INVARIANT: for every eid, endpoint pins == bridge pins; every set path (peer != 0) has both pins non-zero and configured with a ULN config held at the endpoint; and no ULN config with < 3 required DVNs, NIL required, count != list length, optional count 0, or confirmations under the source floor (15 from Ethereum, 20 otherwise) ever reaches the endpoint. Campaign CfgInvariant (random single items and BATCHes of SET_PATH / pins with grace / SET_CONFIG with random DVN counts, repeated DVNs, confirmations 0/14/15/19/20/18,000, optional 0/NIL/1, random libraries incl. receive libs as send; launch-shaped batches shuffled and with one item dropped; applied by a stranger at eta..eta+1d with block rolls; cancels): PASS 1000 runs x 100 depth; paths do get set. Mutants: floor check removed -> FAIL 'a weak ULN config reached the endpoint'; SET_PATH P6 check removed -> FAIL 'path on a default library'. The invariant does not cover the off-chain numbers (18,000 / 9,000): those exist only in scripts (F1); the smallest replacement design is per-source-eid confirmation floors in ImdBridge. Source: /// ---- C5: ONE invariant over every route that writes a library pin or a ULN config (only `_apply` reaches the endpoint;\n/// no delegate is ever set). Random BATCHes / single items of SET_PATH, pins, SET_CONFIG (random DVN counts,\n/// confirmations, optional sets, libraries), applied by anyone, any order, cancels, warps, block rolls.\ncontract CfgHandler is Test {\n    ImdBridge public b;\n    RecEp public ep;\n    address[4] public libs; // 0,1 send; 2,3 receive\n    uint32[3] public eids = [uint32(30101), 30416, 40000];\n    uint256 public applied;\n\n    constructor(ImdBridge b_, RecEp ep_, address[4] memory l) { b = b_; ep = ep_; libs = l; }\n\n    function _item(uint256 s) internal view returns (bytes memory) {\n        uint32 eid = eids[s % 3];\n        uint256 k = (s >> 8) % 4;\n        if (k == 0) {\n            return abi.encode(uint8(1), eid, bytes32(uint256(1 + (s >> 16) % 3)), 50_000e18, 4 days, 50_000e18, 4 days, bytes(\"\"));\n        }\n        if (k == 1) return abi.encode(uint8(3), eid, libs[(s >> 16) % 4]);\n        if (k == 2) return abi.encode(uint8(4), eid, libs[(s >> 16) % 4], (s >> 24) % 3 == 0 ? (s >> 32) % 100 : 0);\n        // SET_CONFIG\n        address lib = libs[(s >> 16) % 4];\n        uint8 n = uint8((s >> 24) % 5);\n        address[] memory d = new address[](n);\n        for (uint256 i; i < n; ++i) d[i] = address(uint160(100 + i * ((s >> 40) % 3)));\n        uint64[4] memory conf = [uint64(0), 14, 19, 20];\n        uint64 c = (s >> 48) % 5 == 4 ? uint64(18_000) : conf[(s >> 48) % 4];\n        uint8[3] memory oc = [uint8(0), 255, 1];\n        uint8 o = oc[(s >> 56) % 3];\n        address[] memory od = new address[](o == 1 ? 1 : 0);\n        if (o == 1) od[0] = address(500);\n        SetConfigParam[] memory p = new SetConfigParam[](1 + (s >> 64) % 2);\n        p[0] = SetConfigParam(eid, 2, abi.encode(LzPaths.UlnConfig(c, n, o, o == 1 ? 1 : 0, d, od)));\n        if (p.length == 2) p[1] = SetConfigParam(eid, 1, abi.encode(LzPaths.ExecutorConfig(10_000, address(77))));\n        return abi.encode(uint8(2), lib, p);\n    }\n\n    function propose(uint256 seed, uint8 n) external {\n        n = uint8(1 + n % 5);\n        bytes memory payload;\n        if (n == 1) {\n            payload = _item(seed);\n        } else {\n            bytes[] memory items = new bytes[](n);\n            for (uint256 i; i < n; ++i) items[i] = _item(uint256(keccak256(abi.encode(seed, i))));\n            payload = abi.encode(uint8(6), items);\n        }\n        vm.prank(b.governor());\n        try b.propose(payload) {} catch {}\n    }\n\n    uint256 public pathsApplied;\n\n    function _cfg(address lib, uint32 eid, uint256 s) internal pure returns (bytes memory) {\n        address[] memory d = new address[](3);\n        (d[0], d[1], d[2]) = (address(100), address(101), address(uint160(102 - (s % 7 == 0 ? 1 : 0))));\n        uint64 c = s % 5 == 0 ? 19 : (s % 5 == 1 ? 15 : 18_000);\n        SetConfigParam[] memory p = new SetConfigParam[](1);\n        p[0] = SetConfigParam(eid, 2, abi.encode(LzPaths.UlnConfig(c, 3, 255, 0, d, new address[](0))));\n        return abi.encode(uint8(2), lib, p);\n    }\n\n    /// A launch-shaped BATCH (path, two pins, two configs) with random libraries / confirmations / a repeated DVN,\n    /// in random order, sometimes missing an item.\n    function proposeLaunch(uint256 s) external {\n        uint32 eid = eids[s % 3];\n        address sl = libs[(s >> 8) % 4];\n        address rl = libs[2 + ((s >> 10) % 2)];\n        if ((s >> 12) % 6 == 0) rl = libs[(s >> 14) % 2];\n        bytes[] memory five = new bytes[](5);\n        five[0] = abi.encode(uint8(1), eid, bytes32(uint256(1 + (s >> 16) % 3)), 50_000e18, 4 days, 50_000e18, 4 days, bytes(\"\"));\n        five[1] = abi.encode(uint8(3), eid, sl);\n        five[2] = abi.encode(uint8(4), eid, rl, uint256(0));\n        five[3] = _cfg(sl, eid, s >> 20);\n        five[4] = _cfg(rl, eid, s >> 30);\n        // shuffle\n        for (uint256 i = 4; i > 0; --i) {\n            uint256 j = uint256(keccak256(abi.encode(s, i))) % (i + 1);\n            (five[i], five[j]) = (five[j], five[i]);\n        }\n        uint256 n = (s >> 40) % 4 == 0 ? 4 : 5;\n        bytes[] memory items = new bytes[](n);\n        for (uint256 i; i < n; ++i) items[i] = five[i];\n        vm.prank(b.governor());\n        try b.propose(abi.encode(uint8(6), items)) {} catch {}\n    }\n\n    function applyNow(uint256 dt) external {\n        if (b.pendingEta() == 0) return;\n        vm.warp(b.pendingEta() + dt % 1 days);\n        vm.roll(block.number + 1 + dt % 200);\n        bool wasPath = abi.decode(b.pending(), (uint8)) == 6;\n        try b.applyPending() { applied++; if (wasPath) pathsApplied++; } catch {}\n    }\n\n    function cancel() external {\n        if (b.pendingEta() == 0) return;\n        vm.prank(b.governor());\n        b.cancel();\n    }\n}\n\ncontract CfgInvariant is Test {\n    CfgHandler h;\n    ImdBridge b;\n    RecEp ep;\n\n    function setUp() public {\n        ep = new RecEp(30184); // a spoke: send floor 20, receive from Ethereum 15\n        b = new ImdBridge(ILayerZeroEndpointV2(address(ep)), IMintableBurnable(address(new Tok())), address(this), address(1));\n        address[4] memory l;\n        for (uint256 i; i < 4; ++i) {\n            l[i] = address(new Lib());\n            ep.addLib(l[i], i < 2);\n        }\n        h = new CfgHandler(b, ep, l);\n        targetContract(address(h));\n    }\n\n    /// INV: (a) no ULN config below the floors ever reaches the endpoint; (b) every set path has both libraries pinned,\n    /// equal to the endpoint's pins, and configured; (c) the endpoint pins equal the bridge's (no unpinned/default library).\n    function invariant_pinsAndConfigs() public view {\n        assertFalse(ep.violated(), \"a weak ULN config reached the endpoint\");\n        for (uint256 i; i < 3; ++i) {\n            uint32 e = h.eids(i);\n            assertEq(ep.sendLib(address(b), e), b.sendLibrary(e));\n            assertEq(ep.recvLib(address(b), e), b.receiveLibrary(e));\n            if (b.peers(e) != bytes32(0)) {\n                assertTrue(b.sendLibrary(e) != address(0) && b.receiveLibrary(e) != address(0), \"path on a default library\");\n                assertTrue(b.configured(b.sendLibrary(e), e) && b.configured(b.receiveLibrary(e), e), \"path unconfigured\");\n                assertTrue(ep.cfg(address(b), b.receiveLibrary(e), e, 2).length != 0, \"endpoint holds no ULN config\");\n            }\n        }\n    }\n\n    function afterInvariant() public {\n        emit log_named_uint(\"applied\", h.applied());\n        emit log_named_uint(\"batches applied\", h.pathsApplied());\n        uint256 set_;\n        for (uint256 i; i < 3; ++i) if (b.peers(h.eids(i)) != 0) set_++;\n        emit log_named_uint(\"paths set\", set_);\n    }\n}\n"
  }
 ],
 "holds": [
  {
   "property": "P1 topology and pins via the launch route",
   "tried": "test_lzPathsBatchAppliesAsSpecified: LzPaths.launchBatch(ETH, 4663) applied on an ImdBridge over a recording endpoint: pins = LzChains sendUln/receiveUln, Ethereum send 15, receive from 4663 18,000, 3 required DVNs, enforced options 250,000 (PASS). test/unit/LzPaths.t.sol test_starOnly, test_everyDeclaredPathHoldsTheProperties (Base 9,000), test_chainsAreDistinctAndComplete PASS. The contract itself accepts SET_PATH to any eid (ImdBridge.sol:929): the star is a Safe/script rule (2-of-3 Safe accepted). Fails for the house route: F1."
  },
  {
   "property": "P2 no path open on default (unpinned) libraries",
   "tried": "Dropping any one of the pin/config items from the launch batch is refused at propose (test_lzPathsBatchAppliesAsSpecified); CfgInvariant (C5) 1000x100 with mutant checks; send/lzReceive refuse unconfigured pins (ImdBridge.sol:512, :557); a pin to address(0)/no-code is refused (:967), so a pin can never return to the default. Info gap in the script's check: F2."
  },
  {
   "property": "P3 enforced lzReceive options",
   "tried": "testFuzz_enforcedOptionsAlwaysLead (5,000 runs, arbitrary extraOptions): every successful send hands the endpoint options starting with the enforced type-3 lzReceive 250,000 option (or the send reverts), so a sender can only add gas. enforcedOptions(remote) uses the destination's receiveGas (LzPaths.sol:267,310). The 250,000 vs measured need (192,299 / 198,721 worst today, test/fork/AuditW4BridgeEndpoint.t.sol) was NOT re-measured (fork); Glamsterdam shortfall is README 5-C10 known. Source:     // ---- P3: whatever extra options a sender passes, the enforced lzReceive option leads what goes to the endpoint\n    // (the executor sums every lzReceive option), or the send reverts.\n    function testFuzz_enforcedOptionsAlwaysLead(bytes calldata extra) public {\n        (RecEp ep, ImdBridge b) = _bridge(ETH);\n        LzChains.Chain memory e = LzChains.ethereum();\n        _etchLib(ep, e.sendUln, true);\n        _etchLib(ep, e.receiveUln, false);\n        _apply(b, LzPaths.launchBatch(LzChains.ETHEREUM, LzChains.ROBINHOOD, PEER));\n        bytes memory enf = b.enforcedOptions(RH);\n        SendParam memory p = SendParam(RH, bytes32(uint256(1)), 100e18, 0, extra, \"\", \"\");\n        try b.send(p, MessagingFee(0, 0), address(this)) {\n            bytes memory o = ep.lastOptions();\n            assertGe(o.length, enf.length);\n            for (uint256 i; i < enf.length; ++i) assertEq(o[i], enf[i], \"enforced prefix\");\n        } catch {}\n    }\n"
  }
 ],
 "notRun": [
  "test/fork/AuditW4BridgeEndpoint.t.sol test_fork_lzReceiveGasRealImdUsd and test/fork/BasePaths.fork.t.sol (P3 gas need on the real EndpointV2 with the real ImdUSD): not run, no archive/mainnet fork RPC configured; C2 was checked instead with read-only eth_call / eth_getCode at head",
  "C4: no dedicated test (code reading only)"
 ]
}