diff --git a/packages/account/src/account.ts b/packages/account/src/account.ts index 56e92d09f..7a9e8da89 100644 --- a/packages/account/src/account.ts +++ b/packages/account/src/account.ts @@ -413,7 +413,8 @@ export class Account { } // On immutable chains, we add the WalletProxyHook - if (chainId === ChainId.IMMUTABLE_ZKEVM || chainId === ChainId.IMMUTABLE_ZKEVM_TESTNET) { + const { proxyImplementationHook } = this.contexts[status.config.version] + if (proxyImplementationHook && (chainId === ChainId.IMMUTABLE_ZKEVM || chainId === ChainId.IMMUTABLE_ZKEVM_TESTNET)) { const provider = this.providerFor(chainId) if (provider) { const hook = new ethers.Contract(this.address, walletContracts.walletProxyHook.abi, provider) @@ -431,7 +432,7 @@ export class Account { to: this.address, data: hooksInterface.encodeFunctionData(hooksInterface.getFunction('addHook')!, [ '0x90611127', - '0x1f56dbAD5e8319F0DE9a323E24A31b5077dEB1a4' + proxyImplementationHook, ]), gasLimit: 50000, // Expected ~28k gas. Buffer added delegateCall: false, diff --git a/packages/core/src/commons/context.ts b/packages/core/src/commons/context.ts index 7794efae9..6bad5cb1b 100644 --- a/packages/core/src/commons/context.ts +++ b/packages/core/src/commons/context.ts @@ -12,6 +12,8 @@ export type WalletContext = { guestModule: string walletCreationCode: string + + proxyImplementationHook?: string; } export function addressOf(context: WalletContext, imageHash: ethers.BytesLike) { diff --git a/packages/core/src/v2/index.ts b/packages/core/src/v2/index.ts index f921265a4..98b12e1f0 100644 --- a/packages/core/src/v2/index.ts +++ b/packages/core/src/v2/index.ts @@ -21,5 +21,6 @@ export const DeployedWalletContext: WalletContext = { guestModule: '0xfea230Ee243f88BC698dD8f1aE93F8301B6cdfaE', mainModule: '0xfBf8f1A5E00034762D928f46d438B947f5d4065d', mainModuleUpgradable: '0x4222dcA3974E39A8b41c411FeDDE9b09Ae14b911', - walletCreationCode: '0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3' + walletCreationCode: '0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3', + proxyImplementationHook: '0x1f56dbAD5e8319F0DE9a323E24A31b5077dEB1a4', } diff --git a/packages/tests/src/context/v2.ts b/packages/tests/src/context/v2.ts index d30c9e6de..2e06deb4f 100644 --- a/packages/tests/src/context/v2.ts +++ b/packages/tests/src/context/v2.ts @@ -43,6 +43,7 @@ export async function deployV2Context(signer: ethers.Signer): Promise