fix(wallet): fail loud on unconfigured CENTRALIZED_WALLET_ADDRESS - #1456
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CL-010 fund-safety fix.
config.gobaked a defaultCENTRALIZED_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.)SetDefault. The value is now provided explicitly via Vault (addedCENTRALIZED_WALLET_ADDRESS=0x4ec16127...e465— verified: it's the address the liveCENTRALIZED_WALLET_PRIVATE_KEYsigns for, so prod behavior is unchanged).CENTRALIZED_WALLET_ADDRESS is not configuredbefore 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