diff --git a/packages/protocol-kit/src/contracts/BaseContract.ts b/packages/protocol-kit/src/contracts/BaseContract.ts index 35cef03f7..9ea9fb5ed 100644 --- a/packages/protocol-kit/src/contracts/BaseContract.ts +++ b/packages/protocol-kit/src/contracts/BaseContract.ts @@ -68,7 +68,8 @@ class BaseContract { ) { const deployment = getContractDeployment(safeVersion, chainId, contractName) - let contractAddress = customContractAddress || deployment?.networkAddresses[chainId.toString()] + const contractAddress = + customContractAddress || deployment?.networkAddresses[chainId.toString()] if (!contractAddress) { throw new Error(`Invalid ${contractName.replace('Version', '')} contract address`) @@ -78,15 +79,13 @@ class BaseContract { ? deployment?.deployments[safeProvider.deploymentType]?.address : undefined - contractAddress = - Array.isArray(contractAddress) && contractAddress.length - ? contractAddress.find((a) => a === customDeploymentTypeAddress) || contractAddress[0] - : contractAddress.toString() - this.chainId = chainId this.contractName = contractName this.safeVersion = safeVersion - this.contractAddress = contractAddress + this.contractAddress = + Array.isArray(contractAddress) && contractAddress.length + ? contractAddress.find((a) => a === customDeploymentTypeAddress) || contractAddress[0] + : contractAddress.toString() this.contractAbi = customContractAbi ||