diff --git a/deployment/protocol-factory.md b/deployment/protocol-factory.md index 15870e4..2276d11 100644 --- a/deployment/protocol-factory.md +++ b/deployment/protocol-factory.md @@ -30,7 +30,7 @@ The factory is also a permanent, tamper-proof **record of exactly what was deplo - `getParameters()` — the exact configuration the deployment used. - `getDeployment()` — every address it produced (the registries, the `DAOFactory`/`PluginRepoFactory`, the PSP, the ENS contracts, the Management DAO and its multisig, and each core plugin repo). -Nobody can change the record afterwards. The factory is the canonical source of truth for that chain's OSx deployment: anyone with its address can read both the settings used and the addresses produced, permanently and without trusting an off-chain manifest. Those records cannot be redirected later. +Nobody can change the record afterwards. The factory is the canonical source of truth for that chain's OSx deployment: anyone with its address can read both the settings used and the addresses produced, permanently and without trusting an off-chain manifest. Those records cannot be redirected later. The [artifacts-hub](../tooling/artifacts-hub.md) address book is built from this record: for every chain deployed with the factory, it reads `getDeployment()` and publishes the result as plain JSON. ## Split to fit chain limits diff --git a/guides/setup.md b/guides/setup.md index f7a1b67..5276b51 100644 --- a/guides/setup.md +++ b/guides/setup.md @@ -44,7 +44,7 @@ Guides that touch only OSx core (the [DAO](../core/dao.md), [permissions](../cor ## 3. Point at a deployed protocol -The guides run as **fork tests** against a chain where OSx is already deployed, so they read the protocol's addresses from the environment. The template uses [just-foundry](../tooling/just-foundry.md), which supplies these addresses for every supported network. Select a network to export them: +The guides run as **fork tests** against a chain where OSx is already deployed, so they read the protocol's addresses from the environment. The template uses [just-foundry](../tooling/just-foundry.md), which supplies these addresses for every supported network (synced from the [artifacts-hub](../tooling/artifacts-hub.md) address book, where you can also look up any address the env vars don't carry). Select a network to export them: ```sh just switch sepolia # or mainnet, base, arbitrum, … (see lib/just-foundry/networks/) diff --git a/index.md b/index.md index cf229e4..10064e3 100644 --- a/index.md +++ b/index.md @@ -38,12 +38,14 @@ Browse by area: - **[Plugins](./plugins/index.md)** — the governance plugins (token voting, multisig, admin, staged proposals, lock-to-vote). - **[Helpers](./helpers/index.md)** — protocol helpers: the condition library. - **[Deployment](./deployment/index.md)** — deploying the protocol and DAOs: the protocol factory and the DAO launchpad. -- **[Tooling](./tooling/index.md)** — the tooling for building on OSx: the Foundry plugin template and the `just`/Foundry task runner. +- **[Tooling](./tooling/index.md)** — the tooling for building on OSx: the Foundry plugin template, the `just`/Foundry task runner, and the deployed addresses and ABIs. **Coming from another system?** [OSx compared](./osx-compared.md) puts the permission model side by side with OpenZeppelin, Safe + Zodiac and Hats: where each keeps its authorization state, what that buys, what it costs, and how to express each one's patterns in OSx. **Looking up an exact signature?** The [ABI reference](./abi/index.md) is the generated lookup layer: every public function, event, error, enum and constant of every contract, with its NatSpec, straight from the source. Read the area pages to understand a component; use the ABI reference to check its exact interface. +**Need a deployed address or a JSON ABI?** [artifacts-hub](./tooling/artifacts-hub.md) is the canonical address book for every chain Aragon is deployed on, with a versioned, machine-readable ABI for every contract. + **The code:** every component's GitHub repository is listed in [Source repositories](./repositories.md). --- diff --git a/log.md b/log.md index 24d8578..3a1e192 100644 --- a/log.md +++ b/log.md @@ -1,5 +1,9 @@ # Change log +## 2026-10-26 + +- Added the artifacts-hub reference (snapshot `ffcc2118`): where to source deployed addresses per chain and versioned ABIs, with Foundry and viem examples. Linked it from the front door, tooling, just-foundry (whose network configs sync from the hub), the setup guide, the Protocol Factory, and the source repositories. + ## 2026-10-16 - Extended the approved voice pilot across the repository's authored prose; preserved source-derived ABI content, technical examples, and operating rules. Independent fidelity and voice reviews are complete; human review of the draft PR is pending. diff --git a/repositories.md b/repositories.md index ece7bc7..a8ed565 100644 --- a/repositories.md +++ b/repositories.md @@ -20,6 +20,7 @@ The **Snapshot** column pins the exact commit each component's docs were generat | [Condition library](./helpers/condition-library.md) | [`aragon/conditions`](https://github.com/aragon/conditions) | [`7a9bb0df`](https://github.com/aragon/conditions/commit/7a9bb0dfb1) | | [Protocol Factory](./deployment/protocol-factory.md) | [`aragon/protocol-factory`](https://github.com/aragon/protocol-factory) | [`444bc98a`](https://github.com/aragon/protocol-factory/commit/444bc98a4b) | | [DAO Launchpad](./deployment/dao-launchpad.md) | [`aragon/dao-launchpad`](https://github.com/aragon/dao-launchpad) | [`b9fb5947`](https://github.com/aragon/dao-launchpad/commit/b9fb59475a) | +| [artifacts-hub](./tooling/artifacts-hub.md) | [`aragon/artifacts-hub`](https://github.com/aragon/artifacts-hub) | [`ffcc2118`](https://github.com/aragon/artifacts-hub/commit/ffcc211894) | | [Plugin template](./tooling/plugin-template.md) | [`aragon/osx-plugin-template`](https://github.com/aragon/osx-plugin-template) | [`e43cf300`](https://github.com/aragon/osx-plugin-template/commit/e43cf30032) | | [just-foundry](./tooling/just-foundry.md) | [`aragon/just-foundry`](https://github.com/aragon/just-foundry) | [`885dea0d`](https://github.com/aragon/just-foundry/commit/885dea0d8e) | | [EVM Mirror](./tooling/evm-mirror.md) | [`aragon/evm-mirror`](https://github.com/aragon/evm-mirror) | [`0072576d`](https://github.com/aragon/evm-mirror/commit/0072576dbd) | diff --git a/tooling/artifacts-hub.md b/tooling/artifacts-hub.md new file mode 100644 index 0000000..c21d1c5 --- /dev/null +++ b/tooling/artifacts-hub.md @@ -0,0 +1,112 @@ +--- +type: reference +title: Deployed addresses and ABIs (artifacts-hub) +source: artifacts-hub/README.md, artifacts-hub/addresses/README.md, artifacts-hub/abi/README.md, artifacts-hub/scripts/schema.ts +--- + +# Deployed addresses and ABIs (artifacts-hub) + +[`aragon/artifacts-hub`](https://github.com/aragon/artifacts-hub) is the **canonical source for where Aragon's contracts live onchain and what their interfaces are**: one JSON address book per chain and one JSON ABI per contract, for every deployed version. It has no NPM package and no build step: add it as a git submodule and read the files. + +Use it whenever you need a real address or an ABI outside of Solidity source: a frontend, an indexer, a script, a fork test that targets a specific plugin build. Pair an address from `addresses/` with the matching ABI from `abi/` and you can call any deployed Aragon contract. + +```sh +git submodule add https://github.com/aragon/artifacts-hub lib/artifacts-hub +``` + +## Addresses: `addresses/.json` + +One file per chain, all with the same shape (a Zod schema, `scripts/schema.ts`, is the source of truth). Each `.json` has a `.json` symlink beside it (`sepolia.json`, `mainnet.json`, `base.json`, …), so either name works. + +| You want | Path in the file | +|---|---| +| The current OSx version on the chain | `osx.versions.find(v => v.current)` | +| The framework contracts (`daoFactory`, `pluginSetupProcessor`, `pluginRepoFactory`, the registries, `daoBase`) | `osx.versions.find(v => v.current).core.*` | +| The latest build of a plugin (its `setup` + `implementation`) | `plugins[""].versions.find(v => v.current)` | +| Every historical build of a plugin | `plugins[""].versions` | +| A plugin's [PluginRepo](../framework/plugin-repo.md) and ENS name | `plugins[""].repo`, `plugins[""].ens` | +| The Management DAO and its multisig | `management.*` | +| Aragon's ENS contracts on the chain | `ens.*` | +| The current [condition](../helpers/condition-library.md) factory | `conditions.factories.find(f => f.current).address` | +| The [Protocol Factory](../deployment/protocol-factory.md) (chains deployed with it) | `deployers.protocolFactory` | + +Plugin slugs are `admin`, `multisig`, `token-voting`, `spp`, `lock-to-vote` and `crosschain`. Plugin versions are `(release, build)` pairs, the same [versioning](../framework/plugin-repo.md) the PluginRepo uses onchain, and arrays are sorted ascending with the newest real build marked `current: true`. + +## ABIs: `abi//.json` + +One folder per component (the same slugs as above, plus `osx`, `conditions` and `protocol-factory`), one JSON ABI per contract. Every version the address book references has its own folder, and the component root always mirrors the latest one: + +``` +abi//.json # latest version +abi//v/.json # a specific version +``` + +Plugins use `v.` (`abi/multisig/v1.2`), matching their entry in the address book. OSx uses its protocol version (`abi/osx/v1.4.0`). An ABI inside a version folder never changes: a changed interface means a new version. So when a DAO still runs an older build, you can read that build's exact interface. + +Each folder also carries a generated `index.ts` exporting every ABI as `ABI` with `as const`, the literal typing viem needs for typed `readContract` / `writeContract`. Bytecode is not included: the deployed code is onchain, and the source repos (see [Source repositories](../repositories.md)) build it when you need it. + +These ABIs are the machine-readable counterpart of the [ABI reference](../abi/index.md): read the reference to understand a function, load the JSON to call it. + +## Reading it from Solidity (Foundry) + +A Foundry test or script can read the address book with cheatcodes. Allow read access in `foundry.toml`: + +```toml +fs_permissions = [{ access = "read", path = "./lib/artifacts-hub/addresses" }] +``` + +Then select the `current` entry with a JSONPath filter: + +```solidity +string memory book = vm.readFile("lib/artifacts-hub/addresses/sepolia.json"); + +address daoFactory = vm.parseJsonAddress( + book, "$.osx.versions[?(@.current == true)].core.daoFactory" +); +address multisigSetup = vm.parseJsonAddress( + book, "$.plugins.multisig.versions[?(@.current == true)].setup" +); +``` + +For the everyday case you don't need this: [just-foundry](./just-foundry.md)'s network configs carry the main OSx addresses as environment variables (`DAO_FACTORY_ADDRESS`, `PLUGIN_SETUP_PROCESSOR_ADDRESS`, …), and those values are synced from this address book. Read the hub directly when you need what the env vars don't carry, such as a specific plugin build or a historical version. + +## Reading it from TypeScript (viem) + +```ts +import sepolia from "./lib/artifacts-hub/addresses/sepolia.json"; +import { MultisigSetupABI } from "./lib/artifacts-hub/abi/multisig"; +import { createPublicClient, http } from "viem"; +import { sepolia as sepoliaChain } from "viem/chains"; + +const build = sepolia.plugins.multisig.versions.find(v => v.current)!; + +const client = createPublicClient({ chain: sepoliaChain, transport: http() }); +const implementation = await client.readContract({ + address: build.setup as `0x${string}`, + abi: MultisigSetupABI, + functionName: "implementation", +}); +``` + +Import a specific version with `.../abi/multisig/v1.2`, or every component at once with `import { multisig, tokenVoting } from "./lib/artifacts-hub/abi"`. + +## How it stays accurate + +- **Chains deployed with the [Protocol Factory](../deployment/protocol-factory.md)** are reconstructed from that one address: the hub reads the factory's frozen `getDeployment()` record, then walks each plugin's PluginRepo onchain to list every published build. Older chains that predate the factory are maintained by hand. +- **New plugin builds** arrive as deployment artifacts the plugin repos emit after each deploy, merged in with strict rules: an existing `(release, build)` can never be pointed at a different address. +- **ABIs are pinned** to an exact git commit (or, for builds from before the Foundry repos, an npm package) and checked against the deployed bytecode: every function selector in a version's ABI must exist in the code of every setup and implementation of that version. +- **Addresses are EIP-55 checksummed**, and every file is validated against the schema in CI. + +## Keep in mind + +- **Placeholder builds are not the plugin.** On chains where a plugin starts at a later build, the earlier build numbers point to the OSx `PlaceholderSetup` (so a `(release, build)` means the same thing on every chain, see the [Protocol Factory](../deployment/protocol-factory.md)). Those entries carry `placeholder: true` and can't be installed. Pick `current`, or filter placeholders out, when you list installable builds. +- **Deprecated chains stay in the book.** A file with `deprecated: true` is a retired chain. Its addresses still resolve existing DAOs, but don't build anything new on it. +- **Compare addresses case-insensitively.** The files are checksummed, but addresses from other sources may not be. +- **Match the ABI to the build the DAO runs.** The root ABI is the latest version. A DAO that hasn't [updated its plugin](../guides/update-a-plugin.md) still runs an older build: load `abi//v.` for that one. + +## See also + +- [just-foundry](./just-foundry.md): the per-network env vars synced from this address book. +- [Protocol Factory](../deployment/protocol-factory.md): the onchain record the hub reconstructs each chain from. +- [ABI reference](../abi/index.md): the readable, per-function documentation of the same contracts. +- [Source repositories](../repositories.md): the code every address and ABI comes from. diff --git a/tooling/index.md b/tooling/index.md index 4c3c87b..71ad973 100644 --- a/tooling/index.md +++ b/tooling/index.md @@ -1,9 +1,10 @@ # Tooling -The **tooling** for building on OSx: the scaffolding you start a plugin from, and the shared task runner the repos deploy with. For step-by-step walkthroughs, see the [guides](../guides/index.md). +The **tooling** for building on OSx: the scaffolding you start a plugin from, the shared task runner the repos deploy with, and the place to source deployed addresses and ABIs. For step-by-step walkthroughs, see the [guides](../guides/index.md). - [Plugin Template (Foundry)](./plugin-template.md) — a starting-point repo for writing, testing, publishing, and deploying your own OSx plugin (source: `osx-plugin-template-foundry`). - [Foundry Task Runner (just-foundry)](./just-foundry.md) — the shared `just`/Foundry task runner and environment manager the Aragon repos use for building, testing, deploying, and verifying across chains (source: `just-foundry`). +- [Deployed addresses and ABIs (artifacts-hub)](./artifacts-hub.md): the canonical address book for every chain Aragon is deployed on, plus a versioned JSON ABI for every contract (source: `artifacts-hub`). - [EVM Mirror](./evm-mirror.md) — Aragon's source-verification CLI: checks that a contract's verified onchain code matches the exact commit that was deployed (source: `evm-mirror`). ## Where to start diff --git a/tooling/just-foundry.md b/tooling/just-foundry.md index 9660a15..f5ec143 100644 --- a/tooling/just-foundry.md +++ b/tooling/just-foundry.md @@ -1,7 +1,7 @@ --- type: concept title: Foundry Task Runner (just-foundry) -source: just-foundry/README.md +source: just-foundry/README.md, just-foundry/scripts/sync-addresses.sh --- # Foundry Task Runner (just-foundry) @@ -19,7 +19,7 @@ Even a single project benefits from the shared configuration and commands: A deployment project's configuration has three parts. just-foundry supplies the public network parameters; you provide the project-specific values and secrets. -- **Public network parameters** (RPC, chain id, verifier, and the **deployed OSx addresses**: values that change per chain and are *not* secret) — **supplied by just-foundry** for every supported network, so you don't need to assemble or hardcode them. Their public nature lets projects share the configuration. +- **Public network parameters** (RPC, chain id, verifier, and the **deployed OSx addresses**: values that change per chain and are *not* secret) — **supplied by just-foundry** for every supported network, so you don't need to assemble or hardcode them. Their public nature lets projects share the configuration. The addresses are synced from the canonical [artifacts-hub](./artifacts-hub.md) address book. - **Project-specific parameters** (how many multisig signers, the min-approvals, metadata URIs, and other values your deployment needs) — yours to set for each deployment. - **Secrets** (deployer key, API keys) — yours to provide. just-foundry resolves them through the `vars` encrypted store or a plain `.env`. @@ -35,10 +35,12 @@ With the project parameters and secrets set, use `just switch ` and `ju ## Keep in mind - **just-foundry runs other projects' deployments.** It doesn't deploy a protocol of its own. -- **The network config is the single source of Aragon addresses.** Because each chain's addresses live in the shared config, projects switch networks instead of hardcoding, which is what keeps a project portable across chains. +- **The network config is your project's single source of Aragon addresses.** Because each chain's addresses live in the shared config, projects switch networks instead of hardcoding, which is what keeps a project portable across chains. +- **The network config follows [artifacts-hub](./artifacts-hub.md).** Maintainers run `just sync-addresses` against a local artifacts-hub checkout. It adds new plugin-repo addresses on its own, but never overwrites an existing address that disagrees with the hub (unless `--force` is passed): it reports the conflict and exits non-zero, so the same command doubles as a drift check in CI. ## See also +- [Deployed addresses and ABIs (artifacts-hub)](./artifacts-hub.md): the address book the network configs are synced from, and the ABIs to pair with those addresses. - [DAO Launchpad](../deployment/dao-launchpad.md) — the workbench whose projects inherit this runner. - [Plugin Template (Foundry)](./plugin-template.md) — the plugin-authoring scaffold, which inits and runs with this (`just init`). - [Protocol Factory](../deployment/protocol-factory.md) — uses this runner to drive protocol deployments.