Solidity smart contracts for Obidot — the first DEX aggregator on Polkadot Hub.
Compiled to PolkaVM via resolc. Cross-chain via XCM and Hyperbridge ISMP.
- Aggregate — routes trades across Polkadot parachains (Hydration, Bifrost, Acala, Moonbeam, Interlay) and EVM chains (Ethereum, Arbitrum, Base) from a single entry point
- Vault — ERC-4626 yield-bearing vault on Polkadot Hub; deposit DOT/USDC, earn from automated strategies
- Route — pluggable pool and bridge-type architecture (single-hop, multi-hop, split routing, plus honest preview/stub adapters where live execution is not ready)
- Agent — autonomous AI agent signs EIP-712 intents for cross-chain strategies; validated on-chain with oracle slippage protection
# Prerequisites: Foundry
foundryup --nightly
git clone https://github.com/obidot/obi.router.git
cd obi.router
forge install
cp .env.example .env
forge build # standard EVM
forge test # full suite
FOUNDRY_PROFILE=polkadot forge build # PolkaVM build via resolcNetwork: Polkadot Hub TestNet — chain 420420417
Explorer: blockscout-testnet.polkadot.io
| Contract | Address |
|---|---|
| ObidotVault | 0x03473a95971Ba0496786a615e21b1e87bDFf0025 |
| SwapRouter | 0x60a72d1e20c5dc40Bb5a24394f0583d863201A3c |
| SwapQuoter | 0x81d7aCFEF474DA6c76eC1b5A05a137cB9f3A5Db1 |
| XCMExecutor | 0x011b6FAf32370dCF92a452374FfCfCdbfA20278c |
| HyperExecutor | 0x62919Cb6416Cb919fC4A30c5707a7867Ca874ca6 |
| KeeperOracle | 0xf64d93DC125AC1B366532BBbA165615f6D566C7F |
| HydrationOmnipoolAdapter | 0xF0E1c10f97446C032A86C9643258Bb26d6129933 |
Full address list: docs/addresses.md
Polkadot Hub (PolkaVM)
┌────────────────────────────────────────────────────┐
│ │
│ User ──▶ ObidotVault (ERC-4626 + IIntentSolver) │
│ │ │
│ ┌──────────┼──────────┬──────────────┐ │
│ ▼ ▼ ▼ ▼ │
│ SwapRouter XCMExec HyperExec BifrostAdapter │
│ (9 adapters) │ XCM │ ISMP │ para 2030 │
│ ▼ ▼ │
│ Parachains EVM Chains │
│ (Hydration, (ETH, Arb, │
│ Bifrost…) Base…) │
└────────────────────────────────────────────────────┘
| Slot | Adapter | Destination |
|---|---|---|
| 0 | HydrationOmnipoolAdapter | Hydration (para 2034) via XCM |
| 1 | AssetHubPairAdapter | AssetHub (para 1000) via XCM |
| 2 | BifrostDEXAdapter | Bifrost (para 2030) via XCM |
| 3 | UniswapV2PoolAdapter | On-hub Uniswap V2 pools |
| 4 | MockBridgeAdapter | Lock-and-mint bridge |
| 5 | RelayTeleportAdapter | Relay chain via XCM teleport |
| 6 | KaruraAdapter | Karura (para 2000) via XCM |
| 7 | MoonbeamAdapter | Moonbeam (para 2004) via XCM |
| 8 | InterlayAdapter | Interlay (para 2032) via XCM |
Current status note:
UniswapV2,RelayTeleport, and the currently wired local hub routes are the executable baseline on testnet.HydrationOmnipoolAdapterandAssetHubPairAdaptersupport preview/simulation flows when explicitly enabled.KaruraAdapter,MoonbeamAdapter,InterlayAdapter, andChainflipAdapterare intentionally honest non-live surfaces today and should not be documented as production-ready routing paths.
| Solidity | 0.8.28 |
| Framework | Foundry |
| PVM Compiler | resolc (Revive LLVM) |
| OpenZeppelin | v5.5.0 |
| Cross-Chain | XCM v5 + Hyperbridge ISMP |
| Target Runtime | PolkaVM (pallet-revive) |
- docs/architecture.md — system diagram, intent flow, security model
- docs/addresses.md — all deployed addresses
- docs/deployment.md — deploy guide
- docs/development.md — build, test, code style
- docs/production-cleanup-plan.md — production readiness cleanup roadmap
- docs/release-checklist.md — production release preflight and sign-off template
- audit/SCOPE.md — external audit scope, trust assumptions, and high-risk review areas
- audit/TEST_SURFACE.md — current contract test inventory and audit-relevant coverage gaps
MIT
