-
Notifications
You must be signed in to change notification settings - Fork 104
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
fix(usdt-approval): 🐛 fix wallet connect with safe causing same nonce to appear twice #2543
fix(usdt-approval): 🐛 fix wallet connect with safe causing same nonce to appear twice #2543
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Soft approved, i haven't tested if it works. Just checked the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @tukantje , great job!
|
||
// For Wallet Connect based Safe Wallet connections, wait for transaction to be executed. | ||
if (txReceipt && safeApiKit && isSafeWallet && isWalletConnect) { | ||
await waitForSafeTransactionExecution({ safeApiKit, txHash: txReceipt.hash }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, looks nicer!
const isWalletConnect = useIsActiveWallet(walletConnectConnection) | ||
const isSafeWallet = useIsSafeWallet() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I have a hook for that
export function useIsSafeViaWc(): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice - will iterate on it
Summary
Fixes #2532
Safe has an issue with wallet connect where when we send two transactions back to back, they repeat the nonce, causing transaction to fail.
This change introduces a fix by;
To Test
Background
safe-global/safe-wallet-monorepo#2034
https://cowservices.slack.com/archives/C03DVQREAH0/p1684929286045829