@@ -122,11 +122,22 @@ export const configureIonicLiquidator = async ({
122122
123123 for ( const redemptionStrategyConfig of chainIdToConfig [ chainId ] . redemptionStrategies ) {
124124 const { strategy } = redemptionStrategyConfig ;
125- const redemptionStrategyContract = await viem . getContractAt (
126- strategy as string ,
127- ( await deployments . get ( strategy ) ) . address as Address ,
128- { client : { public : publicClient , wallet : walletClient } }
129- ) ;
125+
126+ // Skip if strategy is undefined or deployment doesn't exist
127+ if ( ! strategy ) {
128+ console . log ( `Skipping undefined strategy` ) ;
129+ continue ;
130+ }
131+
132+ const deployment = await deployments . getOrNull ( strategy ) ;
133+ if ( ! deployment ) {
134+ console . log ( `Skipping strategy ${ strategy } - deployment not found` ) ;
135+ continue ;
136+ }
137+
138+ const redemptionStrategyContract = await viem . getContractAt ( strategy as string , deployment . address as Address , {
139+ client : { public : publicClient , wallet : walletClient }
140+ } ) ;
130141
131142 const whitelistedAlready = await ionicLiquidator . read . redemptionStrategiesWhitelist ( [
132143 redemptionStrategyContract . address
@@ -139,11 +150,22 @@ export const configureIonicLiquidator = async ({
139150
140151 for ( const fundingStrategy of chainIdToConfig [ chainId ] . fundingStrategies ) {
141152 const { strategy } = fundingStrategy ;
142- const fundingStrategyContract = await viem . getContractAt (
143- strategy as string ,
144- ( await deployments . get ( strategy ) ) . address as Address ,
145- { client : { public : publicClient , wallet : walletClient } }
146- ) ;
153+
154+ // Skip if strategy is undefined or deployment doesn't exist
155+ if ( ! strategy ) {
156+ console . log ( `Skipping undefined funding strategy` ) ;
157+ continue ;
158+ }
159+
160+ const deployment = await deployments . getOrNull ( strategy ) ;
161+ if ( ! deployment ) {
162+ console . log ( `Skipping funding strategy ${ strategy } - deployment not found` ) ;
163+ continue ;
164+ }
165+
166+ const fundingStrategyContract = await viem . getContractAt ( strategy as string , deployment . address as Address , {
167+ client : { public : publicClient , wallet : walletClient }
168+ } ) ;
147169
148170 const whitelistedAlready = await ionicLiquidator . read . redemptionStrategiesWhitelist ( [
149171 fundingStrategyContract . address
0 commit comments