Skip to content

Commit

Permalink
Merge pull request #54 from Instadapp/dsa-migrate-connector
Browse files Browse the repository at this point in the history
Added dsa migration and import connectors
  • Loading branch information
thrilok209 authored Apr 28, 2021
2 parents fcddab7 + acee2db commit 7db3b80
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/abi/connectors/v1/dsa_migrate_v1_to_v2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { AbiItem } from 'web3-utils'

export const dsa_migrate_v1_to_v2: AbiItem[] = [{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"currentDsa","type":"address"},{"indexed":true,"internalType":"address","name":"newData","type":"address"},{"indexed":false,"internalType":"string[]","name":"targets","type":"string[]"},{"indexed":false,"internalType":"bytes[]","name":"calldatas","type":"bytes[]"}],"name":"LogCreateAndMigrate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"currentDsa","type":"address"},{"indexed":true,"internalType":"address","name":"newData","type":"address"},{"indexed":false,"internalType":"string[]","name":"targets","type":"string[]"},{"indexed":false,"internalType":"bytes[]","name":"calldatas","type":"bytes[]"}],"name":"LogMigrate","type":"event"},{"inputs":[],"name":"connectorID","outputs":[{"internalType":"uint256","name":"model","type":"uint256"},{"internalType":"uint256","name":"id","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"address[]","name":"migrateTokens","type":"address[]"},{"internalType":"address[]","name":"allowanceTokens","type":"address[]"},{"internalType":"uint256[]","name":"allowances","type":"uint256[]"},{"internalType":"uint256[]","name":"makerVaults","type":"uint256[]"},{"internalType":"string[]","name":"targets","type":"string[]"},{"internalType":"bytes[]","name":"calldatas","type":"bytes[]"}],"internalType":"struct MigrateResolver.MigrationData","name":"data","type":"tuple"}],"name":"createAndMigrate","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newDsa","type":"address"},{"internalType":"string[]","name":"targets","type":"string[]"},{"internalType":"bytes[]","name":"calldatas","type":"bytes[]"}],"name":"migrate","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]
1 change: 1 addition & 0 deletions src/abi/connectors/v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ export * from './staking'
export * from './swerve'
export * from './polygon_bridge'
export * from './uniswap'
export * from './dsa_migrate_v1_to_v2'
3 changes: 3 additions & 0 deletions src/abi/connectors/v2/AAVE-V1-IMPORT-A.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { AbiItem } from 'web3-utils'

export const AAVE_V1_IMPORT_A: AbiItem[] = [{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address[]","name":"supplyTokens","type":"address[]"},{"indexed":false,"internalType":"address[]","name":"borrowTokens","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"supplyAmts","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"borrowAmts","type":"uint256[]"}],"name":"LogAaveV1Import","type":"event"},{"inputs":[{"internalType":"address","name":"userAccount","type":"address"},{"internalType":"address[]","name":"supplyTokens","type":"address[]"},{"internalType":"address[]","name":"borrowTokens","type":"address[]"}],"name":"importAave","outputs":[{"internalType":"string","name":"_eventName","type":"string"},{"internalType":"bytes","name":"_eventParam","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]
3 changes: 3 additions & 0 deletions src/abi/connectors/v2/AAVE-V2-IMPORT-A.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { AbiItem } from 'web3-utils'

export const AAVE_V2_IMPORT_A: AbiItem[] = [{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bool","name":"convertStable","type":"bool"},{"indexed":false,"internalType":"address[]","name":"supplyTokens","type":"address[]"},{"indexed":false,"internalType":"address[]","name":"borrowTokens","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"supplyAmts","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"stableBorrowAmts","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"variableBorrowAmts","type":"uint256[]"}],"name":"LogAaveV2Import","type":"event"},{"inputs":[{"internalType":"address","name":"userAccount","type":"address"},{"internalType":"address[]","name":"supplyTokens","type":"address[]"},{"internalType":"address[]","name":"borrowTokens","type":"address[]"},{"internalType":"bool","name":"convertStable","type":"bool"}],"name":"importAave","outputs":[{"internalType":"string","name":"_eventName","type":"string"},{"internalType":"bytes","name":"_eventParam","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]
3 changes: 3 additions & 0 deletions src/abi/connectors/v2/COMPOUND-IMPORT-A.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { AbiItem } from 'web3-utils'

export const COMPOUND_IMPORT_A: AbiItem[] = [{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address[]","name":"ctokens","type":"address[]"},{"indexed":false,"internalType":"string[]","name":"supplyIds","type":"string[]"},{"indexed":false,"internalType":"string[]","name":"borrowIds","type":"string[]"},{"indexed":false,"internalType":"uint256[]","name":"supplyAmts","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"borrowAmts","type":"uint256[]"}],"name":"LogCompoundImport","type":"event"},{"inputs":[{"internalType":"address","name":"userAccount","type":"address"},{"internalType":"string[]","name":"supplyIds","type":"string[]"},{"internalType":"string[]","name":"borrowIds","type":"string[]"}],"name":"importCompound","outputs":[{"internalType":"string","name":"_eventName","type":"string"},{"internalType":"bytes","name":"_eventParam","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]
6 changes: 6 additions & 0 deletions src/abi/connectors/v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ import {COMPOUND_A} from './COMPOUND-A'
import {MAKERDAO_A} from './MAKERDAO-A'
import {POLYGON_BRIDGE_A} from './POLYGON-BRIDGE-A'
import {UNISWAP_A} from './UNISWAP-A'
import {AAVE_V1_IMPORT_A} from './AAVE-V1-IMPORT-A'
import {AAVE_V2_IMPORT_A} from './AAVE-V2-IMPORT-A'
import {COMPOUND_IMPORT_A} from './COMPOUND-IMPORT-A'


export const connectorsV2_M1 = {
"COMPOUND-IMPORT-A": COMPOUND_IMPORT_A,
"AAVE-V2-IMPORT-A": AAVE_V2_IMPORT_A,
"AAVE-V1-IMPORT-A": AAVE_V1_IMPORT_A,
"1INCH-A": ONEINCH_A,
"AAVE-CLAIM-A": AAVE_CLAIM_A,
"AAVE-V1-A": AAVE_V1,
Expand Down
3 changes: 2 additions & 1 deletion src/addresses/mainnet/connectorsV1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ export const connectorsV1 = {
polygon_bridge: "0x5d1C4e6c91Ee834c6E1949DB2D0A6309061c358A",
aave_polygon_migrate: "0x9686CE6Ad5C3f7b212CAF401b928c4bB3422E7Ba",
aave_claim: "0x8f1e38c53af7bD2b2bE01b9580911b7Cca504F1b",
aave_stake: "0xa96b2F679fB935Ba279eA9395402ca4696D64D78"
aave_stake: "0xa96b2F679fB935Ba279eA9395402ca4696D64D78",
dsa_migrate_v1_to_v2: "0x2A00684bFAb9717C21271E0751BCcb7d2D763c88"
}
3 changes: 3 additions & 0 deletions src/addresses/mainnet/connectorsV2_M1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ export const connectorsV2_M1 = {
"POLYGON-BRIDGE-A": "0x697860CeE594c577F18f71cAf3d8B68D913c7366",
"AAVE-CLAIM-A": "0x611C1FA59Aa1d6352c4C8bD44882063c6aEE85E0",
"AAVE-STAKE-A": "0xf73C94402BC24148b744083eD02654EEc2C37D5B",
"AAVE-V1-IMPORT-A": "0x8358A92707824476f0d788075D53b627E85490a7",
"AAVE-V2-IMPORT-A": "0x89305678Cc853A929428fA6a97ab35bD864e3F14",
"COMPOUND-IMPORT-A": "0xf2113d0c99f36d7d6f6c6faf05e0863892255999"
}
3 changes: 3 additions & 0 deletions src/data/connectorsV2_M1_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ export default {
"polygon_bridge" :"POLYGON-BRIDGE-A",
"aave_claim": "AAVE-CLAIM-A",
"aave_stake": "AAVE-STAKE-A",
"aave_v1_import": "AAVE-V1-IMPORT-A",
"aave_v2_import": "AAVE-V1-IMPORT-A",
"compoundImport_v2": "COMPOUND-IMPORT-A",
}

0 comments on commit 7db3b80

Please sign in to comment.