Skip to content

Commit

Permalink
chore: check for adapters existance
Browse files Browse the repository at this point in the history
  • Loading branch information
halaprix committed Sep 20, 2023
1 parent 36a64a3 commit ec07606
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions scripts/deployment/deploy-aave-sl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ async function main() {
)) as AaveV3StopLossCommandV2
}

if (
!system.dpmAdapter ||
!system.aaveAdapter ||
system.dpmAdapter.address === hre.ethers.constants.AddressZero ||
system.aaveAdapter.address === hre.ethers.constants.AddressZero
) {
throw new Error('Missing adapters')
}

const aaveStopLossToCollateralV2hash = getCommandHash(TriggerType.SparkStopLossToCollateralV2)
const aaveStopLossToDebtV2hash = getCommandHash(TriggerType.SparkStopLossToDebtV2)
const aaveStopLossAdapterHash = getAdapterNameHash(stopLossCommand.address)
Expand All @@ -71,14 +80,14 @@ async function main() {
...getSafePartialTransactionData(
system,
SafeTxType.addNamedService,
system.dpmAdapter!.address,
system.dpmAdapter.address,
aaveStopLossAdapterHash,
'aaveStopLossAdapter',
),
...getSafePartialTransactionData(
system,
SafeTxType.addNamedService,
system.aaveAdapter!.address,
system.aaveAdapter.address,
aaveStopLossExecuteAdapterHash,
'aaveStopLossExecuteAdapter',
),
Expand Down

0 comments on commit ec07606

Please sign in to comment.