Skip to main content

Module known_chains

Module known_chains 

Source
Expand description

Registry of deployment targets decdn config init --chain <name> can bake in.

Each KnownChain pairs a small hand-written descriptor (name, label, chain id, public RPC endpoint) with the on-disk deployment manifest embedded at compile time. Contract addresses are never written here — they are read from the manifest the Foundry DeployProtocol script writes, so a redeploy flows into config init automatically with no addresses to hand-sync.

The manifest is embedded from crates/cli/deployments/, not from contracts/deployments/ where the deploy script writes it, because include_str! may not escape the package: a path outside the crate is unreachable from the published .crate and cargo install decdn-cli would fail to build. contracts/deployments/ stays canonical and this is a byte-identical mirror — the deployment-manifest-mirror pre-commit hook and its CI counterpart cmp the two and fail on any drift, so re-copy the file as part of a redeploy.

Structs§

ChainAddresses
Contract addresses read from a chain’s manifest, mapped to [blockchain] config keys. Every field is an EIP-55 checksummed 0x string exactly as the deploy script recorded it.
KnownChain
A deployment target config init knows how to bake into a fresh config.

Constants§

KNOWN_CHAINS
Every chain config init can target. Adding an entry here — plus its manifest under contracts/deployments/ and a copy of that file in crates/cli/deployments/ — is all it takes to offer a new network; today there is exactly one, so --chain may be omitted entirely.

Functions§

resolve
Resolve a --chain selector to the chain whose values to bake in.