From 1f00aa714cfd06432e6088570f54a7953eb100c8 Mon Sep 17 00:00:00 2001 From: leekt Date: Tue, 16 Jan 2024 14:13:41 +0900 Subject: [PATCH] fix: check for deployment address when error --- src/action/deployContracts.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/action/deployContracts.ts b/src/action/deployContracts.ts index 0e04f4c..04c62ce 100644 --- a/src/action/deployContracts.ts +++ b/src/action/deployContracts.ts @@ -56,6 +56,14 @@ export const deployToChain = async ( ) { throw new AlreadyDeployedError(address) } + if ( + expectedAddress && + expectedAddress.toLowerCase() !== address.toLowerCase() + ) { + throw new Error( + `Contract will be deployed at ${address.toLowerCase()} does not match expected address ${expectedAddress.toLowerCase()}` + ) + } throw new Error( `Error calling contract ${DEPLOYER_CONTRACT_ADDRESS} : ${error}` )