<!-- canonical: https://0xsimao.com/findings/mitosis-index-remote-advance-equality -->

# The domain with 0 index in Cap::_checkRemoteStateAndAdvance() is not checked for equality

Low/Info · Three Sigma · Cross-chain liquidity layer 1 · 25th June, 2024

Finding 3S-Mitosis-N16 of the Mitosis security review.

- Protocol: https://mitosis.org/
- Report: /reports/mitosis
- Source: https://cdn.sanity.io/files/qoqld077/production/b6b3bd7bb47407d99e76abb7c6dc615c1db5018e.pdf

---

### Description

Cap::_checkRemoteStateAndAdvance() returns if not all domains have the same epoch,
but the domain with index 0 is skipped in the [loop](https://github.com/0x73696d616f/evm-eol-3s-audit/blob/eol/src/hooks/Cap.sol#L397). This is never a problem because the only
way for it not to return is if the domains are something such as 2, 1, 1. However, as it only
advances the epoch if the minimum epoch is bigger than the local domain's epoch, as the
current is 1 and the minimum is 1, it will do nothing.

### Recommendation

Consider starting the loop in index 0.

### Status

Addressed in [#40ef30e](https://github.com/mitosis-org/evm/pull/206/commits/40ef30ebc52b4677b1c717ac81d3995a4c075186).

---

Related findings:

- [Equality check should be performed for fees, not >= as it can lead to users sending more fees than supposed](https://0xsimao.com/findings/orange-equality-fees-sending-supposed): Orange Bridge
- [OstiumTrading::canExecute() should also be checked in OstiumTradesUpKeep::checkCallback()](https://0xsimao.com/findings/ostium-trading-checked-trades-callback): Ostium
- [Funding cap in `IDOPoolAbstract::_basicParticipationCheck()` is imprecise and can lead to excessive tokens sold](https://0xsimao.com/findings/blast-ido-pools-participation-imprecise-excessive-sold): Blast IDO Pools
- [_tempTokenToCheck in BaseRouter does not need to be a state variable](https://0xsimao.com/findings/fuji-finance-temp-need-state-variable): Fuji Finance
