Canonical CREATE2 deployment for XGAS + ops env key cleanup - #9
Merged
Conversation
…v naming - replace direct XGAS deployment with deterministic CREATE2 (fixed factory + salt) - compute/log predicted address, enforce deployed==predicted, and skip redeploy if code exists - rename ops env overrides to XGAS_* and remove CHAIN_ID override path - align README/ops docs with current script behavior - apply minor XGAS NatSpec wording cleanup
There was a problem hiding this comment.
Pull request overview
This PR updates XGAS deployment and ops tooling to standardize on deterministic CREATE2 deployment semantics and a cleaned-up ops environment variable interface.
Changes:
- Reworks
DeployXGAS.s.solto compute a predicted CREATE2 address, attempt an idempotent deployment, and validate predicted vs deployed address. - Updates ops scripts to read RPC URL via a shared
readRpcUrl()helper and renames env keys toXGAS_*while removingCHAIN_IDoverride behavior. - Updates docs and examples (
README.md,ops/README.md,.env.example) and adjusts.gitignorefor Foundry-generated outputs.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/token/XGAS.sol | Updates contract-level deployment comment wording. |
| script/deploy/DeployXGAS.s.sol | Introduces CREATE2 predicted-address computation + idempotent deploy logic. |
| ops/token-info.ts | Switches RPC URL handling to shared CLI/env helper. |
| ops/latest-deploy.ts | Removes CHAIN_ID override and derives chainId from RPC. |
| ops/common/env.ts | Adds shared --rpc-url / RPC_URL resolver utility. |
| ops/common/address.ts | Renames env key to XGAS_ADDRESS and removes CHAIN_ID parsing/override. |
| ops/auth-state.ts | Renames env keys to XGAS_AUTHORIZER/XGAS_NONCE and uses shared RPC resolver. |
| ops/README.md | Updates usage/docs to pass --rpc-url and new XGAS_* env keys. |
| README.md | Adds env setup guidance and updates deploy command examples. |
| .gitignore | Adds a new broadcast/ ignore rule (now conflicts with existing broadcast patterns). |
| .env.example | Updates template to include PRIVATE_KEY and XGAS_* env keys, removing CHAIN_ID/TOKEN_ADDRESS/etc. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mialbu
force-pushed
the
feat/xgas-create2
branch
from
April 16, 2026 14:06
0d82d1b to
5712d63
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR switches DeployXGAS.s.sol to the project’s canonical deterministic CREATE2 flow with predicted-address validation and idempotent behavior.
It also updates ops scripts/docs to use XGAS_* env keys, removes CHAIN_ID override logic, and keeps network selection explicit via RPC input.