Skip to main content

cow_chains/
lib.rs

1//! `cow-chains` — Layer 0 chain configuration for the `CoW` Protocol SDK.
2//!
3//! Centralises all deployment-specific knowledge: which chains are supported,
4//! where the protocol contracts live, what the native/wrapped tokens are, and
5//! how to reach the orderbook API.
6//!
7//! This crate sits at Layer 0 of the workspace DAG and has no dependencies on
8//! any other internal crate.
9//!
10//! # Submodules
11//!
12//! | Module | Purpose |
13//! |---|---|
14//! | [`chain`] | [`SupportedChainId`], [`Env`], API base URLs, explorer links |
15//! | [`chains`] | Extended chain enums ([`EvmChains`], [`NonEvmChains`]), rich [`ChainInfo`] metadata, classification helpers |
16//! | [`contracts`] | Protocol contract addresses (`SETTLEMENT_CONTRACT`, `VAULT_RELAYER`, …), `CREATE2` helpers, EIP-1967 proxy slots |
17//! | [`tokens`] | Native/wrapped currency constants and per-chain [`TokenInfo`] |
18//! | [`params`] | [`CowSwapConfig`] executor configuration and [`TokenRegistry`] |
19
20#![deny(unsafe_code)]
21#![warn(missing_docs)]
22
23pub mod chain;
24pub mod chains;
25pub mod contracts;
26pub mod params;
27pub mod tokens;
28
29pub use chain::{Env, SupportedChainId, api_base_url, api_url, order_explorer_link};
30pub use chains::{
31    AdditionalTargetChainId, AddressPerChain, ApiBaseUrls, ApiContext, ChainContract,
32    ChainContracts, ChainInfo, ChainRpcUrls, ChainTokenInfo, EvmCall, EvmChainInfo, EvmChains,
33    IpfsConfig, NonEvmChainInfo, NonEvmChains, ProtocolOptions, RAW_CHAINS_FILES_PATH,
34    RAW_FILES_PATH, TOKEN_LIST_IMAGES_PATH, TargetChainId, ThemedImage, WebUrl,
35    additional_target_chain_info, all_additional_target_chain_ids, all_additional_target_chains,
36    all_chain_ids, all_chains, all_supported_chain_ids, all_supported_chains, get_chain_info,
37    is_additional_target_chain, is_btc_chain, is_chain_deprecated, is_chain_under_development,
38    is_evm_chain, is_evm_chain_info, is_non_evm_chain, is_non_evm_chain_info, is_supported_chain,
39    is_target_chain_id, is_zk_sync_chain, map_address_to_supported_networks, map_all_networks,
40    map_supported_networks, supported_chain_info, tradable_supported_chain_ids,
41    tradable_supported_chains,
42};
43pub use contracts::{
44    BARN_ETH_FLOW, BUY_ETH_ADDRESS, COMPOSABLE_COW, DEPLOYER_CONTRACT, ETH_FLOW_PROD,
45    ETH_FLOW_STAGING, EXTENSIBLE_FALLBACK_HANDLER, IMPLEMENTATION_STORAGE_SLOT, MAX_VALID_TO_EPOCH,
46    OWNER_STORAGE_SLOT, SALT, SETTLEMENT_CONTRACT, SETTLEMENT_CONTRACT_STAGING, VAULT_RELAYER,
47    VAULT_RELAYER_STAGING, composable_cow, composable_cow_contract_address,
48    cow_protocol_settlement_contract_address, cow_protocol_vault_relayer_address,
49    cow_protocol_vault_relayer_address_staging, deterministic_deployment_address, eth_flow_for_env,
50    extensible_fallback_handler, extensible_fallback_handler_contract_address,
51    implementation_address_slot, owner_address_slot, settlement_contract,
52    settlement_contract_for_env, vault_relayer, vault_relayer_for_env,
53};
54pub use params::{CowSwapConfig, TokenRegistry};
55pub use tokens::{
56    BTC_CURRENCY_ADDRESS, EVM_NATIVE_CURRENCY_ADDRESS, NATIVE_CURRENCY_ADDRESS,
57    SOL_NATIVE_CURRENCY_ADDRESS, TokenInfo, get_wrapped_token_for_chain, wrapped_native_currency,
58};