Skip to content

Commit 9e3fc9a

Browse files
cache predict address
1 parent a37e16b commit 9e3fc9a

File tree

1 file changed

+11
-11
lines changed
  • packages/thirdweb/src/wallets/smart/lib

1 file changed

+11
-11
lines changed

packages/thirdweb/src/wallets/smart/lib/calls.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,18 @@ export async function predictAddress(args: {
7373
accountSalt?: string;
7474
accountAddress?: string;
7575
}): Promise<string> {
76+
const {
77+
factoryContract,
78+
predictAddressOverride: predictAddress,
79+
adminAddress,
80+
accountSalt,
81+
accountAddress,
82+
} = args;
83+
if (predictAddress) {
84+
return predictAddress(factoryContract, adminAddress);
85+
}
7686
return withCache(
7787
async () => {
78-
const {
79-
factoryContract,
80-
predictAddressOverride: predictAddress,
81-
adminAddress,
82-
accountSalt,
83-
accountAddress,
84-
} = args;
85-
if (predictAddress) {
86-
return predictAddress(factoryContract, adminAddress);
87-
}
8888
if (accountAddress) {
8989
return accountAddress;
9090
}
@@ -104,7 +104,7 @@ export async function predictAddress(args: {
104104
});
105105
},
106106
{
107-
cacheKey: `${args.factoryContract.address}-${args.adminAddress}-${args.accountSalt}`,
107+
cacheKey: `${args.factoryContract.chain.id}-${args.factoryContract.address}-${args.adminAddress}-${args.accountSalt}`,
108108
cacheTime: 1000 * 60 * 60 * 24, // 1 day
109109
},
110110
);

0 commit comments

Comments
 (0)