Skip to content

Commit

Permalink
feat: add bridges (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra authored Nov 27, 2024
1 parent c63b6ab commit 937b958
Show file tree
Hide file tree
Showing 13 changed files with 223 additions and 1 deletion.
15 changes: 15 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pre-commit:
parallel: false
commands:
generate:
priority: 1
run: npm run generate:addresses
stage_fixed: true
test:
priority: 2
run: npm run test
stage_fixed: true
format:
priority: 3
run: npm run prettier
stage_fixed: true
153 changes: 153 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"generate:addresses": "tsx scripts/generateAddresses.ts && npm run generate:safe && npm run prettier",
"start": "tsx scripts/generateABIs.ts && tsx scripts/generateAddresses.ts && npm run prettier",
"build": "tsup",
"test": "vitest tests",
"test": "vitest run tests",
"prepublishOnly": "npm run build"
},
"repository": {
Expand All @@ -86,6 +86,7 @@
"ajv-formats": "^3.0.1",
"dotenv": "^16.4.1",
"esbuild-plugin-file-path-extensions": "^2.0.0",
"lefthook": "^1.8.4",
"prettier": "^3.0.3",
"prettier-plugin-solidity": "^1.1.3",
"tsup": "^8.0.2",
Expand Down
2 changes: 2 additions & 0 deletions safe.csv
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,7 @@ address,name,chainId
0xE3B770Dc4ae3f8bECaB3Ed12dE692c741603e16A,GovernanceV3Optimism PC_DATA_HELPER,10
0x55Cf9583D7D30DC4936bAee1f747591dBECe5df7,MiscOptimism AAVE_CL_ROBOT_OPERATOR,10
0x1685D81212580DD4cDA287616C2f6F4794927e18,MiscOptimism AAVE_MERKLE_DISTRIBUTOR,10
0xc3250A20F8a7BbDd23adE87737EE46A45Fe5543E,MiscOptimism AAVE_OPT_ETH_BRIDGE,10
0x3b56998Ec06477704622ca8e2eA1b4db134cec32,MiscOptimism CREATE_3_FACTORY,10
0x7d9103572bE58FfE99dc390E8246f02dcAe6f611,MiscOptimism LEGACY_BRIDGE_EXECUTOR,10
0x9abf798f5314BFd793A9E57A654BEd35af4A1D60,MiscOptimism PARASWAP_FEE_CLAIMER,10
Expand Down Expand Up @@ -1789,6 +1790,7 @@ address,name,chainId
0x4922093c476CfbCF903C7C4082d2D64bAE8A37cE,GovernanceV3Arbitrum GRANULAR_GUARDIAN,42161
0x89644CA1bB8064760312AE4F03ea41b05dA3637C,GovernanceV3Arbitrum PAYLOADS_CONTROLLER,42161
0xE3B770Dc4ae3f8bECaB3Ed12dE692c741603e16A,GovernanceV3Arbitrum PC_DATA_HELPER,42161
0x0335ffa9af5CE05590d6C9A75B645470e07744a9,MiscArbitrum AAVE_ARB_ETH_BRIDGE,42161
0xaa944aD95e51CB83C1f35FAEEDfC7d2c31B0BB4d,MiscArbitrum AAVE_CL_ROBOT_OPERATOR,42161
0x3b56998Ec06477704622ca8e2eA1b4db134cec32,MiscArbitrum CREATE_3_FACTORY,42161
0x7d9103572bE58FfE99dc390E8246f02dcAe6f611,MiscArbitrum LEGACY_BRIDGE_EXECUTOR,42161
Expand Down
2 changes: 2 additions & 0 deletions scripts/configs/networks/arbitrum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const arbitrumAddresses: NetworkAddresses<{
wstETH_stETH_AGGREGATOR: Hex;
rETH_ETH_AGGREGATOR: Hex;
LEGACY_BRIDGE_EXECUTOR: Hex;
AAVE_ARB_ETH_BRIDGE: Hex;
}> = {
name: 'Arbitrum',
chainId: ChainId.arbitrum,
Expand All @@ -19,6 +20,7 @@ export const arbitrumAddresses: NetworkAddresses<{
wstETH_stETH_AGGREGATOR: '0xB1552C5e96B312d0Bf8b554186F846C40614a540',
rETH_ETH_AGGREGATOR: '0xF3272CAfe65b190e76caAF483db13424a3e23dD2',
LEGACY_BRIDGE_EXECUTOR: '0x7d9103572bE58FfE99dc390E8246f02dcAe6f611',
AAVE_ARB_ETH_BRIDGE: '0x0335ffa9af5CE05590d6C9A75B645470e07744a9',
},
};

Expand Down
2 changes: 2 additions & 0 deletions scripts/configs/networks/optimism.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const optimismAddresses: NetworkAddresses<{
wstETH_stETH_AGGREGATOR: Hex;
rETH_ETH_AGGREGATOR: Hex;
LEGACY_BRIDGE_EXECUTOR: Hex;
AAVE_OPT_ETH_BRIDGE: Hex;
}> = {
name: 'Optimism',
chainId: ChainId.optimism,
Expand All @@ -20,6 +21,7 @@ export const optimismAddresses: NetworkAddresses<{
wstETH_stETH_AGGREGATOR: '0xe59EBa0D492cA53C6f46015EEa00517F2707dc77',
rETH_ETH_AGGREGATOR: '0x22F3727be377781d1579B7C9222382b21c9d1a8f',
LEGACY_BRIDGE_EXECUTOR: '0x7d9103572bE58FfE99dc390E8246f02dcAe6f611',
AAVE_OPT_ETH_BRIDGE: '0xc3250A20F8a7BbDd23adE87737EE46A45Fe5543E',
},
};

Expand Down
3 changes: 3 additions & 0 deletions src/MiscArbitrum.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ library MiscArbitrum {

// https://arbiscan.io/address/0x7d9103572bE58FfE99dc390E8246f02dcAe6f611
address internal constant LEGACY_BRIDGE_EXECUTOR = 0x7d9103572bE58FfE99dc390E8246f02dcAe6f611;

// https://arbiscan.io/address/0x0335ffa9af5CE05590d6C9A75B645470e07744a9
address internal constant AAVE_ARB_ETH_BRIDGE = 0x0335ffa9af5CE05590d6C9A75B645470e07744a9;
}
3 changes: 3 additions & 0 deletions src/MiscOptimism.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ library MiscOptimism {

// https://optimistic.etherscan.io/address/0x7d9103572bE58FfE99dc390E8246f02dcAe6f611
address internal constant LEGACY_BRIDGE_EXECUTOR = 0x7d9103572bE58FfE99dc390E8246f02dcAe6f611;

// https://optimistic.etherscan.io/address/0xc3250A20F8a7BbDd23adE87737EE46A45Fe5543E
address internal constant AAVE_OPT_ETH_BRIDGE = 0xc3250A20F8a7BbDd23adE87737EE46A45Fe5543E;
}
3 changes: 3 additions & 0 deletions src/ts/MiscArbitrum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ export const rETH_ETH_AGGREGATOR = '0xF3272CAfe65b190e76caAF483db13424a3e23dD2';
// https://arbiscan.io/address/0x7d9103572bE58FfE99dc390E8246f02dcAe6f611
export const LEGACY_BRIDGE_EXECUTOR = '0x7d9103572bE58FfE99dc390E8246f02dcAe6f611';

// https://arbiscan.io/address/0x0335ffa9af5CE05590d6C9A75B645470e07744a9
export const AAVE_ARB_ETH_BRIDGE = '0x0335ffa9af5CE05590d6C9A75B645470e07744a9';

export const CHAIN_ID = 42161;
3 changes: 3 additions & 0 deletions src/ts/MiscOptimism.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ export const rETH_ETH_AGGREGATOR = '0x22F3727be377781d1579B7C9222382b21c9d1a8f';
// https://optimistic.etherscan.io/address/0x7d9103572bE58FfE99dc390E8246f02dcAe6f611
export const LEGACY_BRIDGE_EXECUTOR = '0x7d9103572bE58FfE99dc390E8246f02dcAe6f611';

// https://optimistic.etherscan.io/address/0xc3250A20F8a7BbDd23adE87737EE46A45Fe5543E
export const AAVE_OPT_ETH_BRIDGE = '0xc3250A20F8a7BbDd23adE87737EE46A45Fe5543E';

export const CHAIN_ID = 10;
27 changes: 27 additions & 0 deletions tests/cache/verified.json
Original file line number Diff line number Diff line change
Expand Up @@ -2279,6 +2279,27 @@
},
"0x9FB3B12248bf010AEA7cE08343C8499FFAB4770f": {
"name": "TransparentProxyFactory"
},
"0xA1290d69c65A6Fe4DF752f95823fae25cB99e5A7": {
"name": "TransparentUpgradeableProxy"
},
"0x2D62109243b87C4bA3EE7bA1D91B0dD0A074d7b1": {
"name": "InitializableImmutableAdminUpgradeabilityProxy"
},
"0x6De3E52A1B7294A34e271a508082b1Ff4a37E30e": {
"name": "InitializableImmutableAdminUpgradeabilityProxy"
},
"0x47F52B2e43D0386cF161e001835b03Ad49889e3b": {
"name": "RsETHPriceCapAdapter"
},
"0xd1B2dec98A95B773C4909B5CD8FB455F467A527f": {
"name": "ParaSwapDebtSwapAdapterV3"
},
"0x40ede12b44d98Fc4E53A2fB027D1BD1846e1690C": {
"name": "ParaSwapDebtSwapAdapterV3"
},
"0xA1c93D2687f7014Aaf588c764E3Ce80aF016229b": {
"name": "GnosisSafeProxy"
}
},
"10": {
Expand Down Expand Up @@ -2734,6 +2755,9 @@
},
"0x984B710D22730f799312513A10C1382e9D1Fa689": {
"name": "TransparentProxyFactory"
},
"0xc3250A20F8a7BbDd23adE87737EE46A45Fe5543E": {
"name": "AaveOpEthERC20Bridge"
}
},
"56": {
Expand Down Expand Up @@ -5618,6 +5642,9 @@
},
"0x9B643d4aC937BEE8Bfb1Ec76401C22E18C318429": {
"name": "TransparentProxyFactory"
},
"0x0335ffa9af5CE05590d6C9A75B645470e07744a9": {
"name": "AaveArbEthERC20Bridge"
}
},
"43113": {
Expand Down
1 change: 1 addition & 0 deletions tests/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import 'dotenv/config';
7 changes: 7 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {defineConfig} from 'vitest/config';

export default defineConfig({
test: {
setupFiles: ['./tests/setup.ts'], //this line,
},
});

0 comments on commit 937b958

Please sign in to comment.