Repository navigation
fix(drain): route undrained mainnet EVM chains (Base 8453, Arbitrum, Avalanche) to Gnosis Safe receiver (zetatool) - #4653
Conversation
…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).
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
Bugbot is paused — on-demand spend limit reachedBugbot 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. |
58bba0a
into
drain-build/mainnet-server-main
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:
ReceiversgetsEVMByChain map[int64]stringandEVMFor(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 inValidate().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.

Confidence 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.
Reviews (5) · Last reviewed commit: "style(drain): name the drained-chain rec..." · Reviewed by Greptile