Skip to content

Canonical CREATE2 deployment for XGAS + ops env key cleanup - #9

Merged
mialbu merged 4 commits into
mainfrom
feat/xgas-create2
Apr 16, 2026
Merged

Canonical CREATE2 deployment for XGAS + ops env key cleanup#9
mialbu merged 4 commits into
mainfrom
feat/xgas-create2

Conversation

@mialbu

@mialbu mialbu commented Apr 16, 2026

Copy link
Copy Markdown
Member

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.

mialbu added 2 commits April 16, 2026 10:58
…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
@mialbu
mialbu requested a review from Copilot April 16, 2026 09:40
@mialbu mialbu self-assigned this Apr 16, 2026

Copilot AI 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.

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.sol to 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 to XGAS_* while removing CHAIN_ID override behavior.
  • Updates docs and examples (README.md, ops/README.md, .env.example) and adjusts .gitignore for 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.

Comment thread script/deploy/DeployXGAS.s.sol
Comment thread script/deploy/DeployXGAS.s.sol Outdated
@mialbu
mialbu force-pushed the feat/xgas-create2 branch from 0d82d1b to 5712d63 Compare April 16, 2026 14:06
@mialbu
mialbu merged commit 43f6bc8 into main Apr 16, 2026
2 checks passed
@mialbu
mialbu deleted the feat/xgas-create2 branch April 16, 2026 14:24
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.

2 participants