Architecture
Two layers: protocol (on-chain) and stack (off-chain). Apps talk to the stack; the stack talks to Gnosis.
On-chain
Discovery starts at ContractRegistry. It maps identifiers to index proxies.
| Identifier | Contract | What it lists |
|---|---|---|
AccountIndex | AccountsIndex | Registered users (clc-core writes here) |
TokenIndex | TokenUniqueSymbolIndex | Vouchers |
PoolIndex | TokenUniqueSymbolIndex | Pools |
eth-tracker walks TokenIndex and PoolIndex, then each pool's tokenRegistry(), and watches those addresses. clc-core only needs AccountIndex from the registry.
A pool is not one contract. SwapPool is the vault; it is injected with a registry, quoter, fee policy, limiter, and optional protocol fee controller. Seal bits lock those slots.
Implementations are shared. Each voucher/pool/index is an ERC-1967 proxy from ERC1967Factory. DecimalQuoter, SwapRouter, RescueVault, ERC1967Factory, and Calibur are plain contracts.
Off-chain
| Process | Role |
|---|---|
| eth-tracker | Follows the chain, filters CLC events, publishes to NATS |
| eth-indexer | Consumes NATS, writes chain_data |
| clc-core | HTTP API, SIWE auth, catalog, deploy jobs, EIP-7702 relayer |
| storage-server | Signed uploads to R2; browsers post here, not through clc-core |
| clc-app | Web PWA + admin console |
Tracker publishes to NATS; indexer consumes. Indexer does not tail logs.