Skip to content

feat(factory): the genesis admin is a parameter, one factory per environment - #80

Merged
xgreenx merged 2 commits into
mainfrom
feat/factory-genesis-per-deployer
Oct 4, 2026
Merged

xgreenx merged 2 commits into
mainfrom
feat/factory-genesis-per-deployer

Conversation

@xgreenx

@xgreenx xgreenx commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Green (2026-10-04): the testnet deployer key moves to libid-testnet and mainnet gets its own; different contract addresses per environment are accepted. The factory baked one admin constant, which tied every network to one key.

Changes

  • Solidity: FactoryGenesis.sol removed; FactoryDeployer.proxyInitCode(admin), predictFactoryAddress(admin), proxyDeployCalldata(admin). LibidFactory and the factory README describe one factory per environment.
  • Rust: FACTORY_GENESIS_ADMIN, factory_proxy_init_code, predict_factory_address and ensure_factory become FactoryGenesis { admin } with proxy_init_code, address, ensure.
  • Tests: the Solidity suite uses a test admin and asserts another admin lands elsewhere; the anvil bootstrap test deploys with the signer as admin, so the impersonation of a placeholder admin is gone.

Verified

  • forge build + factory suite: 28 passed. cargo +nightly fmt, cargo clippy --all-targets -D warnings clean, cargo test -p libid-contracts: 14 + 7 anvil tests pass (bootstrap from a bare chain included).
  • Vendored artifacts unchanged: the factory and proxy bytecode does not depend on the admin.
  • rust-code-quality greps on the changed files: no hits (no unwrap on production paths, no prints, visibility, paths, free _of functions).

Not verified / known issues

  • Breaking API for the Rust crate (0.17.0). chain-configurations follows with [accounts].deployer per network and a fresh stack per environment.

Assisted-by: Claude Fable 5.1

…ronment

The factory's proxy init code baked one admin constant, so every network
shared one factory address and one deployer key. Each environment now has
its own deployer key (testnet in libid-testnet, mainnet in libid-mainnet),
so the admin becomes the one varying input: `FactoryDeployer.proxyInitCode(admin)`
in Solidity, `FactoryGenesis { admin }` in Rust with `address` and `ensure`.
Addresses stay a pure function of (admin, name), the same on every network
one deployer deploys to; testnet and mainnet get different tables.

Assisted-by: Claude Fable 5.1
Signed-off-by: Green Baneling <XgreenX9999@gmail.com>
Assisted-by: Claude Fable 5.1
Signed-off-by: Green Baneling <XgreenX9999@gmail.com>
@xgreenx
xgreenx merged commit 710c622 into main Oct 4, 2026
12 checks passed
@xgreenx
xgreenx deleted the feat/factory-genesis-per-deployer branch October 4, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant