Skip to content

fix(wallet): fail loud on unconfigured CENTRALIZED_WALLET_ADDRESS - #1456

Merged
tieubao merged 1 commit into
developfrom
fix/centralized-wallet-address-guard
Jul 9, 2026
Merged

fix(wallet): fail loud on unconfigured CENTRALIZED_WALLET_ADDRESS#1456
tieubao merged 1 commit into
developfrom
fix/centralized-wallet-address-guard

Conversation

@tieubao

@tieubao tieubao commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

CL-010 fund-safety fix. config.go baked a default CENTRALIZED_WALLET_ADDRESS (0x4ec1...e465), so a missing env silently routed vault-withdraws + swaps to that address instead of failing loudly. (Prod's env in fact lacked it, so the default was live.)

  • Removed the SetDefault. The value is now provided explicitly via Vault (added CENTRALIZED_WALLET_ADDRESS=0x4ec16127...e465 — verified: it's the address the live CENTRALIZED_WALLET_PRIVATE_KEY signs for, so prod behavior is unchanged).
  • Fail-loud guards at every EVM fund-routing site (vault.go TransferVaultToken + AutoTransferVaultToken, swap.go EVM branch): an empty CentralizedWalletAddress returns CENTRALIZED_WALLET_ADDRESS is not configured before any transfer/swap, never routes to "". Solana paths untouched.

Verify: build/vet green; guard trace shows no fund path can consume an empty address; 4 baseline test fails unrelated.

CI baseline-broken (see #1438).

🤖 Generated with Claude Code

CENTRALIZED_WALLET_ADDRESS is a fund-routing destination for vault
withdrawals and swaps. A baked-in SetDefault meant that if the
variable was ever absent, funds would silently route to that
hardcoded address instead of failing. Remove the default so the
value must be supplied at runtime, and add empty-destination guards
right before each fund-routing call site (vault transfer, auto-
transfer, EVM swap) so a missing config now returns a clear error
instead of transferring to an empty or unintended address.

Solana paths are untouched; they already resolve their own
centralized wallet address via a separate source.
@tieubao
tieubao merged commit fc892ac into develop Jul 9, 2026
4 of 5 checks passed
@tieubao
tieubao deleted the fix/centralized-wallet-address-guard branch July 9, 2026 02:25
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