Harbor swap registry (Swapper_v1), direct DEX executors (UniV3, Curve, Balancer, composite
routes), and the 1inch v6 aggregator adapter. Deployed via BaoFactory CREATE3; consumed by
Harbor Yield and other Harbor products.
- Architecture and threat model:
src/swap/README.md - Deploy runbook:
script/DEPLOY_SWAP.md
git submodule update --init --recursive
forge build
forge test --match-path "test/swap/**"Test scope: mock-based unit tests only (71 tests under test/swap/). Mainnet fork
integration (full ETH stack + oracle mocks) lives in the Harbor Yield consumer repo.
Aggregator calldata: Harbor Option A — only 1inch v6 swap selector 0x07ed2379 is
accepted (OneInchV6Selectors.SWAP). Build via 1inch Swap API / Pathfinder.
Known design tradeoffs (documented in src/swap/README.md):
FxSaveWstEthSwapper_v1intermediate Curve legs usemin_dy = 0; only final wstETH output is bounded by the consumer'sminAmountOut. Route changes require impl upgrade.OneInchSwapper_v1is open-access; authorization lives on the consumer'sredistributeREDISTRIBUTOR_ROLEgate. Selector allowlist does not validate swap parameters.
MIT — see LICENSE.
Third-party: Uniswap v3 periphery (GPL-2.0-or-later) is used by UniV3Swapper_v1.