From 26e5fff1c1de73adb07f0fd1eb60379ef736b973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yago=20P=C3=A9rez=20V=C3=A1zquez?= Date: Mon, 29 Apr 2024 17:29:07 +0200 Subject: [PATCH] Fix BaseContract not selecting specific chain deployments --- packages/protocol-kit/src/contracts/BaseContract.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/protocol-kit/src/contracts/BaseContract.ts b/packages/protocol-kit/src/contracts/BaseContract.ts index 2da1efa92..3e553421e 100644 --- a/packages/protocol-kit/src/contracts/BaseContract.ts +++ b/packages/protocol-kit/src/contracts/BaseContract.ts @@ -58,7 +58,10 @@ class BaseContract { ) { const deployment = getContractDeployment(safeVersion, chainId, contractName) - const contractAddress = customContractAddress || deployment?.defaultAddress + const contractAddress = + customContractAddress || + deployment?.networkAddresses[chainId.toString()] || + deployment?.defaultAddress if (!contractAddress) { throw new Error(`Invalid ${contractName.replace('Version', '')} contract address`)