Skip to content

Commit

Permalink
fix(core): throw error if no address for chain
Browse files Browse the repository at this point in the history
  • Loading branch information
extg3 committed Jun 10, 2024
1 parent 43e8c90 commit e6e0741
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/core/src/lib/vaults/smart-wallet-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ export class SmartWalletFactory implements Factory {
}

public getContractAddress(chainId: number): Address {
return config.vaultFactoryAddresses[chainId as Chain];
const address = config.vaultFactoryAddresses[chainId as Chain];

if (!address) {
throw new Error(`Vault factory address for chain ${chainId} not found`);
}

return address;
}

public async deploy(id: number, chainId: Chain, version: SmartWalletVersion = 3) {
Expand Down

0 comments on commit e6e0741

Please sign in to comment.