Skip to content

Commit 385b977

Browse files
Merge pull request #1943 from Solid-Money/claude/cherrypick-deposit-fixes-to-qa
fix: recreate smart account client after Safe deployment
2 parents 11d3a33 + 3871102 commit 385b977

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

hooks/useWithdrawRainCollateral.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const useWithdrawRainCollateral = (): WithdrawRainCollateralResult => {
9898
});
9999

100100
// Step 3: Create Safe smart account client for transaction execution
101-
const smartAccountClient = await safeAA(chain, user.suborgId, user.signWith);
101+
let smartAccountClient = await safeAA(chain, user.suborgId, user.signWith);
102102

103103
// Step 3a: Ensure Safe is deployed on this chain before signing.
104104
// Safe ERC-1271 signature verification requires the contract to exist on-chain;
@@ -110,6 +110,8 @@ const useWithdrawRainCollateral = (): WithdrawRainCollateralResult => {
110110
calls: [{ to: user.safeAddress as Address, data: '0x', value: 0n }],
111111
});
112112
await smartAccountClient.waitForUserOperationReceipt({ hash: deployHash });
113+
// Recreate client so it no longer includes factory/initCode for the deployed Safe
114+
smartAccountClient = await safeAA(chain, user.suborgId, user.signWith);
113115
}
114116

115117
// Step 4: Generate admin EIP-712 signature via Safe smart account

0 commit comments

Comments
 (0)