@credit-cooperative/address-book
v0.1.0
Published
Canonical registry of Credit Cooperative deployed contract addresses for Solidity and TypeScript
Readme
Credit Cooperative Address Book
The canonical registry of Credit Cooperative deployed contract addresses, for use in both Solidity and
TypeScript/JavaScript projects. It aggregates the per-chain deployment registries that each protocol repo
commits under deployments/<chainId>.json (produced by @credit-cooperative/devkit)
and republishes them as typed, per-chain libraries.
What's inside
data/<project>/<chainId>.json— the source registries, mirrored from each protocol repo. This is the input. Everything else is generated from it.src/<Project><Chain>.sol— generated Solidity libraries ofaddressconstants (e.g.V3ProtocolPaymentRailsSepolia,V3ProtocolPaymentRailsBase).ts/index.ts— generated TypeScript twin (chain-keyed address maps + agetAddresshelper, no runtime deps).
src/andts/are generated and committed. Do not hand-edit them — runbun run generate. CI fails if they drift fromdata/.
Usage
Solidity (forge install)
forge install credit-cooperative/address-bookimport { V3ProtocolPaymentRailsSepolia } from "address-book/src/V3ProtocolPaymentRailsSepolia.sol";
contract MyContract {
address node = V3ProtocolPaymentRailsSepolia.NODE;
}TypeScript (npm)
bun add @credit-cooperative/address-bookimport {
v3ProtocolPaymentRails,
getAddress,
} from "@credit-cooperative/address-book";
const node = v3ProtocolPaymentRails[11155111].Node;
const cowSwap = getAddress("v3ProtocolPaymentRails", 8453, "CowSwapModule");How it updates
- A protocol repo runs
just deploy …, which writes/updates itsdeployments/<chainId>.json, and the change is merged tomain. - The repo's
deployments.ymlworkflow dispatches adeployments-updatedevent here. dispatch-receive.ymlmirrors the changed files intodata/<project>/, regeneratessrc/+ts/, and opens a PR.- Merging + tagging publishes the npm package and updates the
forge installsource.
To regenerate locally after editing data/:
bun run generate # rewrite src/ and ts/
bun run generate:check # CI guard: fail if committed output is stale
forge test # sanity + (with --fork-url) on-chain code checks
bun test ts/ # TypeScript consumption testsMulti-chain note
Addresses are not assumed identical across chains — every entry is keyed by chainId. Always confirm you are
reading the library/map for the chain you are deploying against.
