Skip to content

fix(deploy): require explicit sender on all production chains#47

Merged
rplusq merged 3 commits into
mainfrom
fix/base-script-prod-sender-guard
Jul 14, 2026
Merged

fix(deploy): require explicit sender on all production chains#47
rplusq merged 3 commits into
mainfrom
fix/base-script-prod-sender-guard

Conversation

@rplusq

@rplusq rplusq commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

BaseScript's production guard only covered mainnet + optimism, so a Base/Arbitrum (or any other non-testnet) broadcast could silently fall back to the public TEST_MNEMONIC key. Invert the guard to an allow-list of local/testnet chains; every other chain must pass ETH_FROM.

🤖 Generated with Claude Code

BaseScript's production guard only covered mainnet + optimism, so a Base/Arbitrum (or any
other non-testnet) broadcast could silently fall back to the public TEST_MNEMONIC key.
Invert to an allow-list of local/testnet chains; every other chain must pass ETH_FROM.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@claude

claude Bot commented Jul 13, 2026

Copy link
Copy Markdown

Claude finished @rplusq's task in 1m 7s —— View job


Review

  • Gather context
  • Read changed file and diff
  • Analyze guard logic correctness
  • Post review findings

✅ No issues found

The allowlist inversion is correct. The original denylist covered only mainnet + optimism, leaving Base, Arbitrum, and any future production chain silently unguarded. The new approach fails safe by default — any chain not explicitly allowlisted requires ETH_FROM.

Chain IDs verified:

  • 31337 Anvil ✓
  • 1337 Hardhat/localhost ✓
  • 11155111 Sepolia ✓
  • 11155420 Optimism Sepolia ✓
  • 84532 Base Sepolia ✓
  • 421614 Arbitrum Sepolia ✓

Logic is sound: the revert fires before deriveBroadcasterFromMnemonic() is reachable on production chains, so TEST_MNEMONIC cannot be used as a fallback key.

Add arbitrum (42161) and base (8453) to the existing production-chain
sender guard rather than inverting to a testnet allow-list. Keeps the
diff minimal and matches the existing style; covers the concrete set of
production chains we deploy to.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rplusq

rplusq commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

Reworked: instead of inverting to a testnet allow-list, this now just adds the missing production chains (arbitrum 42161, base 8453) to the existing explicit guard alongside mainnet/optimism. Same coverage for the chains we actually deploy to, smaller diff, matches existing style. Also supersedes the HIGH finding on #50.

Consistent with the mainnet/optimism entries. Note forge-std's alias is
arbitrum_one (not arbitrum).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rplusq
rplusq merged commit 27f7185 into main Jul 14, 2026
6 of 7 checks passed
@rplusq
rplusq deleted the fix/base-script-prod-sender-guard branch July 14, 2026 19:46
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