fix(card-spend): skip the module read on a Safe not yet deployed on Fuse - #2590
Merged
Merged
Conversation
65138da made card set-up read the Safe's module list on every v2 set-up, to disable any retired v2 core. A new cardholder's Safe is often still counterfactual on Fuse — the set-up batch is what deploys it — so `getModulesPaginated` returns `0x`, viem throws, and activation fails with "Card not activated" before anything is signed. A Safe with no code has no modules, so there is nothing to disable: return an empty cleanup and let the batch deploy and register the Safe as before. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
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.
Problem
Since #2589, new Wirex cardholders can't activate their card. Pressing Activate card fails with:
#2589 made first-time set-up read the Safe's module list so it can disable any retired v2 core. Before that, the list was only read when v1 had to come off. A new cardholder's Safe is often not deployed on Fuse yet, because the set-up batch is what deploys it. On an address with no code,
getModulesPaginatedreturns0xand viem throws.Confirmed on the reported Safe:
eth_getCode(0x07e96000b9F96057a0EEA88b84508eCc6E69F29b)on Fuse returns0x.The failure happens before anything is signed, so no consents are filed and no card is created. The user just can't get past the screen.
Fix
encodeModuleDisablesnow callsgetCodefirst. A Safe with no code has no modules, so it returns an empty cleanup, and the batch deploys and registers the Safe as it did before #2589. Deployed Safes follow the same path as before.The mode-switch path needs an already-registered (so already deployed) Safe, so it was never affected.
Testing
tsc --noEmit: no errors in the changed file.lib/utils/__tests__/safeModules.test.tspasses (11/11). It coversbuildModuleDisables, which this PR doesn't change. The new guard is in a private helper in the hook and has no direct test.Rollout
Every build with #2589 is affected, so this should ship as an OTA update.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.