-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add close-and-remain operation definitions
- Loading branch information
Showing
5 changed files
with
123 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
packages/deploy-configurations/operation-definitions/aave/v3/close-and-remain.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { loadContractNames, OPERATION_NAMES } from '@deploy-configurations/constants' | ||
import { Network } from '@deploy-configurations/types/network' | ||
import { getActionHash } from '@deploy-configurations/utils/action-hash' | ||
|
||
export function getAaveV3CloseAndRemainOperationDefinition(network: Network) { | ||
const SERVICE_REGISTRY_NAMES = loadContractNames(network) | ||
|
||
return { | ||
name: OPERATION_NAMES.aave.v3.CLOSE_AND_REMAIN, | ||
actions: [ | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.common.TAKE_A_FLASHLOAN_BALANCER), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.common.SET_APPROVAL), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.aave.v3.DEPOSIT), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.aave.v3.WITHDRAW), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.common.SWAP_ACTION), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.common.SET_APPROVAL), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.aave.v3.PAYBACK), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.aave.v3.WITHDRAW_AUTO), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.aave.v3.WITHDRAW), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.common.RETURN_FUNDS), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.common.RETURN_FUNDS), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.aave.v3.SET_EMODE), | ||
optional: false, | ||
}, | ||
], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
packages/deploy-configurations/operation-definitions/spark/multiply/close-and-remain.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { loadContractNames, OPERATION_NAMES } from '@deploy-configurations/constants' | ||
import { Network } from '@deploy-configurations/types/network' | ||
import { getActionHash } from '@deploy-configurations/utils/action-hash' | ||
|
||
export function getSparkCloseAndRemainOperationDefinition(network: Network) { | ||
const SERVICE_REGISTRY_NAMES = loadContractNames(network) | ||
|
||
return { | ||
name: OPERATION_NAMES.spark.CLOSE_AND_REMAIN, | ||
actions: [ | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.common.TAKE_A_FLASHLOAN), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.common.SET_APPROVAL), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.spark.PAYBACK), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.spark.SET_EMODE), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.spark.WITHDRAW), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.common.SWAP_ACTION), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.common.SEND_TOKEN), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.common.UNWRAP_ETH), | ||
optional: true, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.common.RETURN_FUNDS), | ||
optional: false, | ||
}, | ||
{ | ||
hash: getActionHash(SERVICE_REGISTRY_NAMES.common.RETURN_FUNDS), | ||
optional: false, | ||
}, | ||
], | ||
log: false, | ||
} | ||
} |