Viem Migration - wc safe wallet reject approval long error#7478
Viem Migration - wc safe wallet reject approval long error#7478brunota20 wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing the PR for now as the reported issue is reproducible with deprecated wallets. |
Summary
Fixes
https://www.notion.so/cownation/Safe-WC-iOS-app-reject-approval-long-error-34c8da5f04ca8041998de02db4e10dde?v=2fc8da5f04ca81ada4ca000c320d51ef&source=copy_link
When rejecting an approval transaction in Safe iOS wallet via WalletConnect, the user sees a long, verbose error message containing raw request arguments
(addresses, data, gas, function signatures) instead of a clean rejection message.
This PR improves rejection detection and error display for viem-wrapped errors.
To Test
Background
Viem wraps provider errors in ContractFunctionExecutionError which includes all request arguments in error.message. The previous rejection detection had two
issues:
As a safety net, the error display now uses viem's error.shortMessage (which omits request arguments) instead of error.message for non-rejection errors.