Skip to content

chore(oft): deploy the OFT bridge through CreateX for cross-chain deterministic addresses - #19

Merged
sirpy merged 1 commit into
masterfrom
chore/oft-createx-deterministic-deploy
Oct 22, 2026
Merged

sirpy merged 1 commit into
masterfrom
chore/oft-createx-deterministic-deploy

Conversation

@blueogin

@blueogin blueogin commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Description

XCreate is CreateX, the universal deployer at
0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed — the same address on every chain, and already
referenced from GoodProtocol's contracts/utils/ICreateX.sol. Verified live and byte-identical on
Celo, XDC and Ethereum, with a runtime code hash matching the one CreateX publishes.

Problem

The OFT proxies were deployed through GoodProtocol's ProxyFactory1967, which lives at a different
address on each chain (0xD86cd6Bb… on production-celo vs 0x5BE34022… on production-xdc). The
adapter would therefore have had a different address on each chain in production.

Closes #16

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • PR title matches follow: (Feature|Bug|Chore) Task Name
  • My code follows the style guidelines of this project
  • I have followed all the instructions described in the initial task (check Definitions of Done)
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added reference to a related issue in the repository
  • I have added a detailed description of the changes proposed in the pull request. I am as descriptive as possible, assisting reviewers as much as possible.
  • I have added screenshots related to my pull request (for frontend tasks)
  • I have pasted a gif showing the feature.
  • @mentions of the person or team responsible for reviewing proposed changes

Summary by Sourcery

Deploy the OFT bridge through CreateX to provide deterministic cross-chain proxy addresses and consistent implementation upgrades.

New Features:

  • Deploy OFT proxies through CreateX CREATE3 so production and development deployments can use deterministic cross-chain addresses.
  • Add the oft:addresses task to preview proxy addresses before deployment.

Bug Fixes:

  • Ensure OFT proxy addresses no longer vary with the per-chain GoodProtocol ProxyFactory address.

Enhancements:

  • Centralize CreateX salt, address prediction, deployment, initialization, reuse, and runtime-code validation helpers.
  • Use CreateX CREATE2 for deterministic implementation deployments during initial deployment and upgrades.
  • Add invariant checks, local CreateX support, and comprehensive deterministic deployment and integration coverage.

Deployment:

  • Require the same deployer signer across chains and validate CreateX at its canonical address before deploying.

Documentation:

  • Document CreateX-based deployment, cross-chain address requirements, redeployment behavior, and upgrade procedures.

Tests:

  • Add unit and fork coverage for CreateX validation, deterministic CREATE2/CREATE3 addresses, atomic initialization, deployer protection, reuse, and Avatar handover.

- Add utility functions for generating salt labels and proxy salts in oftSalts.ts.
- Introduce a new script to predict CREATE3 addresses for OFT proxies based on the deployer and network.
- Update hardhat.config.ts to include the new address prediction script.
- Enhance the OFT configuring guide with details on CREATE3 deployment and address consistency across chains.
- Create tests to validate the deterministic deployment of OFT proxies using CREATE3.
- Modify existing tests to ensure compatibility with the new deployment strategy.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. A wrong CreateX address, salt, or initialization could leave the bridge proxies deployed at unusable addresses or cause tokens to be bridged incorrectly. Reverting the scripts does not remove those on-chain deployments or undo transfers already made; recovery would require a corrected deployment and configuration.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@blueogin
blueogin requested a review from sirpy October 19, 2026 13:11
@sirpy
sirpy merged commit 21c3c19 into master Oct 22, 2026
3 checks passed
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.

Use XCreate contracts for deterministic address

2 participants