Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAFE Wallet Account Abstraction ERC 4337 fix #480

Merged
merged 17 commits into from
Feb 19, 2025

Conversation

Sharqiewicz
Copy link
Contributor

The SAFE Wallet AA Issue

When using Safe Wallet, the initial transaction hash returned is a safeTxHash which differs from the final on-chain transaction hash. This is because Safe uses a multi-signature approach where:

  1. The initial safeTxHash is generated when a transaction is proposed
  2. This transaction needs to be confirmed by the required number of owners (based on the threshold)
  3. Only after sufficient confirmations and execution will there be an actual on-chain transaction with a different hash
    This creates challenges when tracking transaction status using standard wagmi/viem hooks, as they look for the initial safeTxHash on-chain which doesn't exist.

Instead of wagmi waitForTransactionReceipt use

import { waitForTransactionConfirmationReceipt } from '...';

await waitForTransactionConfirmationReceipt(hash, wagmiConfig);

Copy link

netlify bot commented Feb 17, 2025

Deploy Preview for pendulum-pay ready!

Name Link
🔨 Latest commit 5f7898a
🔍 Latest deploy log https://app.netlify.com/sites/pendulum-pay/deploys/67b5d66b5eaaf900087ed8bd
😎 Deploy Preview https://deploy-preview-480--pendulum-pay.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

github-actions bot commented Feb 17, 2025

yarn.lock changes

Click to toggle table visibility
Name Status Previous Current
@peculiar/asn1-schema ADDED - 2.3.15
@safe-global/api-kit ADDED - 2.5.9
@safe-global/protocol-kit ADDED - 5.2.2
@safe-global/safe-deployments ADDED - 1.37.29
@safe-global/safe-modules-deployments ADDED - 2.2.7
@safe-global/types-kit ADDED - 1.0.2
asn1js ADDED - 3.0.5
es-shim-unscopables UPDATED 1.0.2 1.1.0
pathe UPDATED 2.0.2 2.0.3
pvtsutils ADDED - 1.3.6
pvutils ADDED - 1.1.3
viem UPDATED 2.23.1 2.23.2

@Sharqiewicz
Copy link
Contributor Author

@pendulum-chain/devs Ready for review ✅

@Sharqiewicz Sharqiewicz self-assigned this Feb 17, 2025
@ebma ebma requested a review from a team February 17, 2025 18:08
@Sharqiewicz
Copy link
Contributor Author

One thing worth mentioning is that for setting the maximum and current number of signers, we use Zustand outside of a React component and custom hook, directly within a plain function.

https://github.com/pmndrs/zustand#readingwriting-state-and-reacting-to-changes-outside-of-components

Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great changes, looks good to me in general 🙏 I only left some questions regarding the structure.

@Sharqiewicz
Copy link
Contributor Author

@pendulum-chain/devs Ready ✅

Copy link
Contributor

@gianfra-t gianfra-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I think we should test one offramp, if you haven't already. Do you have a safe wallet to test?

@Sharqiewicz
Copy link
Contributor Author

@gianfra-t I tested 2 days ago, should I test again?

@gianfra-t
Copy link
Contributor

We can test on staging then, to save some funds.

@ebma
Copy link
Member

ebma commented Feb 19, 2025

Yes, let's do that 👍

@Sharqiewicz Sharqiewicz merged commit e718180 into staging Feb 19, 2025
5 checks passed
@ebma ebma deleted the 426-safe-wallet-not-able-to-sign-transactions branch February 20, 2025 08:52
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.

3 participants