Skip to main content

Module address

Module address 

Source
Expand description

Shared Ethereum address parsing for the deCDN binaries.

Both the daemon (decdn-node) and the CLI (decdn) parse contract and account addresses out of flags and [blockchain] config. This module is the single home for the two parse helpers so the zero-address guard cannot drift between binaries. It lives in decdn-common because that is the one crate on the shared path of everything that needs it — node → common, cli → common, and incentive → common — and it already depends on alloy (the decdn-config-types leaf crate deliberately does not, to keep alloy off the publisher-CLI path, so the guard cannot live there).

Functions§

parse_address
Parse a contract/account address with a labelled error.
parse_nonzero_address
Parse a contract address and reject the zero address. Address::ZERO parses cleanly but is never a real deployment — it would surface only as an opaque on-chain revert at call time, so reject it here with a clear, labelled error.