Skip to content

fix(drain): route undrained mainnet EVM chains (Base 8453, Arbitrum, Avalanche) to Gnosis Safe receiver (zetatool) - #4653

Merged
julianrubino merged 3 commits into
drain-build/mainnet-server-mainfrom
drain-build/mainnet-server-main-base-safe
Nov 17, 2026
Merged

julianrubino merged 3 commits into
drain-build/mainnet-server-mainfrom
drain-build/mainnet-server-main-base-safe

Conversation

@julianrubino

@julianrubino julianrubino commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Build branch only (RFC 002 emergency drain), not for merge into a release line.

Why: the mainnet EVM receiver 0x0a538985123729f48D70DBCaE82a7f47f1CbA8f8 is a Coinbase deposit address whose deposit addresses differ per chain, so recovering funds was painful. EVM chains not drained yet should go to the Gnosis Safe instead.

Change: Receivers gets EVMByChain map[int64]string and EVMFor(chainID). zetatool builds each EVM tx to `EVMFor(chain.ChainId)`, the same function the zetaclient poller asserts `tx.to` against. The stale `TestResolveAnchorsMainnetUnset` is dropped. Overrides are validated as checksummed, non-zero addresses in Validate().

Mainnet chain Receiver
Ethereum 1, BSC 56, Polygon 137 (already drained) 0x0a538985123729f48D70DBCaE82a7f47f1CbA8f8 (override)
Base 8453, Arbitrum 42161, Avalanche 43114 0x919F207971b9Dea34150D095169388d25e167F1A (Safe, new default)
BTC bc1qkl02lqffhmpf5hn3khnetc0ay9yyk4eajmlefy (unchanged)

On-chain check (2026-11-16): the Safe is deployed at the same address on Base, Arbitrum and Avalanche: same 123-byte proxy code (eth_getCode), the same 4 owners and threshold 1 on all three. Ethereum, BSC and Polygon have no Safe, which is fine because they keep 0x0a53.

Tests run: go test -tags pebbledb,ledger,drain ./pkg/drain/... ./zetaclient/drain/..., `go test ./cmd/zetatool/cli/`, `go test -tags drain_localnet ./pkg/drain/`. New tests pin all six chain ids. The poller rejects an ETH/BSC/Polygon payload sent to the Safe and a Base/Arbitrum/Avalanche payload sent to 0x0a53.

Operator pubkey unchanged (still the reused testnet drill key 0x03579d09..., see runbook §9).

Build: these HEADs (client 7e589bb, server c3cd027) were built by run https://github.com/zeta-chain/node/actions/runs/43967773384 and published as prerelease drain-mainnet-20261116-base-safe. golangci-lint is clean on the touched packages.

RetriggerView in GreptileConfidence Score: 5/5

The changes since the previous review appear safe to merge into the dedicated build branch.

Summary

The PR adds per-chain EVM receivers for the emergency drain.

  • Mainnet drain transactions use the receiver assigned to each EVM chain.

Reviews (5) · Last reviewed commit: "style(drain): name the drained-chain rec..." · Reviewed by Greptile

…0a53

Mainnet EVM default is now the Gnosis Safe 0x919F207971b9Dea34150D095169388d25e167F1A
(Base 8453, Arbitrum 42161, Avalanche 43114). Ethereum, BSC and Polygon were already
drained and keep 0x0a538985123729f48D70DBCaE82a7f47f1CbA8f8 via EVMByChain. zetatool
builds each EVM tx to Receivers.EVMFor(chainID), the same function the zetaclient
poller asserts against. Drops the stale TestResolveAnchorsMainnetUnset. Build branch
only, not for merge (RFC 002).
@julianrubino
julianrubino requested a review from a team as a code owner November 16, 2026 21:53
@julianrubino
julianrubino requested a review from morde08 November 16, 2026 21:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T21:55:16.864557Z 77efa75 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 77efa75b58

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pkg/drain/receivers.go Resolved
@julianrubino julianrubino changed the title drain: route Base mainnet (8453) to Gnosis Safe receiver (zetatool) fix(drain): route undrained mainnet EVM chains (Base 8453, Arbitrum, Avalanche) to Gnosis Safe receiver (zetatool) Nov 16, 2026
@julianrubino julianrubino added the no-changelog Skip changelog CI check label Nov 16, 2026
@cursor

cursor Bot commented Nov 16, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@julianrubino
julianrubino merged commit 58bba0a into drain-build/mainnet-server-main Nov 17, 2026
58 checks passed
@julianrubino
julianrubino deleted the drain-build/mainnet-server-main-base-safe branch November 17, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking:cli no-changelog Skip changelog CI check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants