Skip to content

Commit

Permalink
Update wagmi to use the latest factory
Browse files Browse the repository at this point in the history
  • Loading branch information
niran committed Dec 3, 2024
1 parent 6299659 commit efc528f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ export const accountAbi = [
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/**
* [__View Contract on Base Sepolia Blockscout__](https://base-sepolia.blockscout.com/address/0x5716673E64B74E7D16FAd20c53B1687983b2E350)
* [__View Contract on Base Sepolia Blockscout__](https://base-sepolia.blockscout.com/address/0x775062650652749c86686f68971F23Bb3FFf2b92)
*/
export const accountFactoryAbi = [
{
Expand Down Expand Up @@ -535,14 +535,14 @@ export const accountFactoryAbi = [
] as const

/**
* [__View Contract on Base Sepolia Blockscout__](https://base-sepolia.blockscout.com/address/0x5716673E64B74E7D16FAd20c53B1687983b2E350)
* [__View Contract on Base Sepolia Blockscout__](https://base-sepolia.blockscout.com/address/0x775062650652749c86686f68971F23Bb3FFf2b92)
*/
export const accountFactoryAddress = {
84532: '0x5716673E64B74E7D16FAd20c53B1687983b2E350',
84532: '0x775062650652749c86686f68971F23Bb3FFf2b92',
} as const

/**
* [__View Contract on Base Sepolia Blockscout__](https://base-sepolia.blockscout.com/address/0x5716673E64B74E7D16FAd20c53B1687983b2E350)
* [__View Contract on Base Sepolia Blockscout__](https://base-sepolia.blockscout.com/address/0x775062650652749c86686f68971F23Bb3FFf2b92)
*/
export const accountFactoryConfig = {
address: accountFactoryAddress,
Expand Down
10 changes: 5 additions & 5 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ type BuildNextConfigArgs = {

export async function buildNextConfig(client: PublicClient, { account, currentConfigData, newConfigData }: BuildNextConfigArgs): Promise<KeystoreConfig> {
const { configHash, configNonce } = await getMasterKeystoreStorage(client, account);
console.log("configHash", configHash);
console.log("configNonce", configNonce);
const expectedConfigHash = hashConfig({ account, nonce: configNonce, data: currentConfigData });
if (configHash !== expectedConfigHash) {
throw new Error(`Config hash mismatch: actual ${configHash} !== expected ${expectedConfigHash}`);
if (fromHex(configHash, "bigint") !== 0n) {
const expectedConfigHash = hashConfig({ account, nonce: configNonce, data: currentConfigData });
if (configHash !== expectedConfigHash) {
throw new Error(`Config hash mismatch: actual ${configHash} !== expected ${expectedConfigHash}`);
}
}

return {
Expand Down
2 changes: 1 addition & 1 deletion wagmi.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default defineConfig({
{
abi: smartWalletFactoryABI,
address: {
[baseSepolia.id]: "0x5716673E64B74E7D16FAd20c53B1687983b2E350",
[baseSepolia.id]: "0x775062650652749c86686f68971F23Bb3FFf2b92",
// [optimismSepolia.id]: "0x4Ca895d26b7eb26a9D980565732049d4199f32C8",
},
name: "AccountFactory",
Expand Down

0 comments on commit efc528f

Please sign in to comment.