# Incorrect `destEid` Value in `_handleLiquidationSuccess` Prevents Liquidation Completion

CrossChainRouter._handleLiquidationSuccess hardcodes destEid=0 in findCrossChainCollateral, so the lookup always fails and cross-chain liquidations never complete.

- Payout: Audit contest
- Severity: high
- Program: Lend Audit Contest
- Found by: 0xc0ffEE
- Disclosed: 2025-05-22
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2025-05-lend-audit-contest-judging/issues/979
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-05-lend-audit-contest%3AH-25
- Tags: area:web3 domain:web3 impact:dos impact:funds-loss kind:contest platform:sherlock sev:high tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** CrossChainRouter.sol / LendStorage.sol cross-chain collateral lookup
**Root cause:** _handleLiquidationSuccess passes a hardcoded destEid of 0 to findCrossChainCollateral instead of the actual destination endpoint id, so the stored Borrow struct never matches and the lookup returns (false, 0).
**Steps:**
1. User performs a cross-chain borrow, storing a Borrow struct in crossChainCollaterals with real srcEid/destEid.
2. Liquidation executes on the source chain and the success handler runs on Chain A.
3. _handleLiquidationSuccess calls `lendStorage.findCrossChainCollateral(payload.sender, underlying, srcEid, 0, payload.destlToken, payload.srcToken)`.
4. destEid=0 never equals the stored destEid, so found=false and index=0.
5. Liquidation cannot be finalized; debt remains and collateral is not seized.
**How found:** Code review of the liquidation success handler: noticed the destEid argument was a literal 0 while the stored Borrow struct records the real destination endpoint id, making the match impossible.
**Insight:** When a lookup helper matches a struct on multiple fields, audit every call site for hardcoded or defaulted arguments (0, address(0), empty string) that can never equal stored values; a single wrong field silently breaks the whole flow.

## Proof of concept (copied exactly from the original report)

**findCrossChainCollateral call with hardcoded destEid 0**

```
(bool found, uint256 index) = lendStorage.findCrossChainCollateral(
    payload.sender,
    underlying,
    srcEid,
    0, // Incorrect destEid
    payload.destlToken,
    payload.srcToken
);
```

