generated from bgd-labs/bgd-forge-template
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update Hyperlane and remove old native bridges (#259)
* feat: Update CrossChainController implementation and CCIP adapters * fix: added some internal test methods * Feat/ccip update templating (#255) * CCIP update templating * fix: added missing chain id * fix compilation issues * fix: fixed compilation error * remove redundant DestinationAdaptersInput path * update readme with implementation and tests * fix: test cleanup * fix: more test cleanup * add BaseCCCImplementationUpdatePayloadTest * change BaseTest * fix: added tests to check that only changed necessary receivers * add getTrustedRemoteByChainId * formatting * fix: added test to check that forwarders are set * fix: update scripts (#248) * fix: added test to check only changes on specified forwarders * fix: update readme * fix: add missing ccc impl address for ethereum * fix: updated base contract to add receivers only if receiving chains exist. Added discussion links --------- Co-authored-by: Andrei Kozlov <[email protected]> Co-authored-by: Lukas <[email protected]> * Update src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md Co-authored-by: Harsh Pandey <[email protected]> * Update src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md Co-authored-by: Harsh Pandey <[email protected]> * feat: Update Hyperlane bridge adapter to V3 * fix: fixed compilation errors * fix: added reference to code diffs * fix: linting * fix: ran lint fix * fix: fixed tests * fix: dont remove forwarders if there is no need * Fix/hyperlane use new helpers and remove old native adapters (#294) * fix: Updated with new helpers usage and diffs * fix: added removal of old native bridges * fix: updated readme * fix: updated aave helpers * fix: update helpers * fix: updated title with removal * fix: updated readme with more information * fix: added discussion link --------- Co-authored-by: Andrei Kozlov <[email protected]> Co-authored-by: Lukas <[email protected]> Co-authored-by: Harsh Pandey <[email protected]>
- Loading branch information
1 parent
3b66d9c
commit 61e97df
Showing
33 changed files
with
1,336 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
...20_before_adi_AaveV3Arbitrum_HyperlaneBridgeAdapterUpdateToV3_20240320_after.md
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,14 @@ | ||
## Raw diff | ||
|
||
```json | ||
{ | ||
"receiverAdaptersByChain": { | ||
"1": { | ||
"0x3829943c53F2d00e20B58475aF19716724bF90Ba": { | ||
"from": true, | ||
"to": null | ||
} | ||
} | ||
} | ||
} | ||
``` |
30 changes: 30 additions & 0 deletions
30
...0_before_adi_AaveV3Avalanche_HyperlaneBridgeAdapterUpdateToV3_20240320_after.md
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,30 @@ | ||
## Raw diff | ||
|
||
```json | ||
{ | ||
"forwarderAdaptersByChain": { | ||
"1": { | ||
"0xa198Fac58E02A5C5F8F7e877895d50cFa9ad1E04": { | ||
"from": "0x6Abb61beb5848B476d026C4934E8a6415e2E75a8", | ||
"to": null | ||
}, | ||
"0x617332a777780F546261247F621051d0b98975Eb": { | ||
"from": null, | ||
"to": "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1" | ||
} | ||
} | ||
}, | ||
"receiverAdaptersByChain": { | ||
"1": { | ||
"0xa198Fac58E02A5C5F8F7e877895d50cFa9ad1E04": { | ||
"from": true, | ||
"to": null | ||
}, | ||
"0x617332a777780F546261247F621051d0b98975Eb": { | ||
"from": null, | ||
"to": true | ||
} | ||
} | ||
} | ||
} | ||
``` |
18 changes: 18 additions & 0 deletions
18
...0240320_before_adi_AaveV3BNB_HyperlaneBridgeAdapterUpdateToV3_20240320_after.md
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,18 @@ | ||
## Raw diff | ||
|
||
```json | ||
{ | ||
"receiverAdaptersByChain": { | ||
"1": { | ||
"0x118DFD5418890c0332042ab05173Db4A2C1d283c": { | ||
"from": true, | ||
"to": null | ||
}, | ||
"0x3F006299eC88985c18E6e885EeA29A49eC579882": { | ||
"from": null, | ||
"to": true | ||
} | ||
} | ||
} | ||
} | ||
``` |
14 changes: 14 additions & 0 deletions
14
...240320_before_adi_AaveV3Base_HyperlaneBridgeAdapterUpdateToV3_20240320_after.md
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,14 @@ | ||
## Raw diff | ||
|
||
```json | ||
{ | ||
"receiverAdaptersByChain": { | ||
"1": { | ||
"0x7b62461a3570c6AC8a9f8330421576e417B71EE7": { | ||
"from": true, | ||
"to": null | ||
} | ||
} | ||
} | ||
} | ||
``` |
70 changes: 70 additions & 0 deletions
70
...20_before_adi_AaveV3Ethereum_HyperlaneBridgeAdapterUpdateToV3_20240320_after.md
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,70 @@ | ||
## Raw diff | ||
|
||
```json | ||
{ | ||
"forwarderAdaptersByChain": { | ||
"56": { | ||
"0x6Abb61beb5848B476d026C4934E8a6415e2E75a8": { | ||
"from": "0x118DFD5418890c0332042ab05173Db4A2C1d283c", | ||
"to": null | ||
}, | ||
"0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": { | ||
"from": null, | ||
"to": "0x3F006299eC88985c18E6e885EeA29A49eC579882" | ||
} | ||
}, | ||
"100": { | ||
"0x6Abb61beb5848B476d026C4934E8a6415e2E75a8": { | ||
"from": "0x4A4c73d563395ad827511F70097d4Ef82E653805", | ||
"to": null | ||
}, | ||
"0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": { | ||
"from": null, | ||
"to": "0xA806DA549FcB2B4912a7dFFE4c1aA7A1ed0Bd5C9" | ||
} | ||
}, | ||
"137": { | ||
"0x6Abb61beb5848B476d026C4934E8a6415e2E75a8": { | ||
"from": "0x3c25b96fF62D21E90556869272a277eE2E229747", | ||
"to": null | ||
}, | ||
"0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": { | ||
"from": null, | ||
"to": "0x3e72665008dC237bdd91C04C10782Ed1987a4019" | ||
} | ||
}, | ||
"43114": { | ||
"0x6Abb61beb5848B476d026C4934E8a6415e2E75a8": { | ||
"from": "0xa198Fac58E02A5C5F8F7e877895d50cFa9ad1E04", | ||
"to": null | ||
}, | ||
"0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": { | ||
"from": null, | ||
"to": "0x617332a777780F546261247F621051d0b98975Eb" | ||
} | ||
} | ||
}, | ||
"receiverAdaptersByChain": { | ||
"137": { | ||
"0x6Abb61beb5848B476d026C4934E8a6415e2E75a8": { | ||
"from": true, | ||
"to": null | ||
}, | ||
"0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": { | ||
"from": null, | ||
"to": true | ||
} | ||
}, | ||
"43114": { | ||
"0x6Abb61beb5848B476d026C4934E8a6415e2E75a8": { | ||
"from": true, | ||
"to": null | ||
}, | ||
"0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": { | ||
"from": null, | ||
"to": true | ||
} | ||
} | ||
} | ||
} | ||
``` |
18 changes: 18 additions & 0 deletions
18
...0320_before_adi_AaveV3Gnosis_HyperlaneBridgeAdapterUpdateToV3_20240320_after.md
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,18 @@ | ||
## Raw diff | ||
|
||
```json | ||
{ | ||
"receiverAdaptersByChain": { | ||
"1": { | ||
"0x4A4c73d563395ad827511F70097d4Ef82E653805": { | ||
"from": true, | ||
"to": null | ||
}, | ||
"0xA806DA549FcB2B4912a7dFFE4c1aA7A1ed0Bd5C9": { | ||
"from": null, | ||
"to": true | ||
} | ||
} | ||
} | ||
} | ||
``` |
14 changes: 14 additions & 0 deletions
14
...40320_before_adi_AaveV3Metis_HyperlaneBridgeAdapterUpdateToV3_20240320_after.md
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,14 @@ | ||
## Raw diff | ||
|
||
```json | ||
{ | ||
"receiverAdaptersByChain": { | ||
"1": { | ||
"0x746c675dAB49Bcd5BB9Dc85161f2d7Eb435009bf": { | ||
"from": true, | ||
"to": null | ||
} | ||
} | ||
} | ||
} | ||
``` |
14 changes: 14 additions & 0 deletions
14
...20_before_adi_AaveV3Optimism_HyperlaneBridgeAdapterUpdateToV3_20240320_after.md
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,14 @@ | ||
## Raw diff | ||
|
||
```json | ||
{ | ||
"receiverAdaptersByChain": { | ||
"1": { | ||
"0x81d32B36380e6266e1BDd490eAC56cdB300afBe0": { | ||
"from": true, | ||
"to": null | ||
} | ||
} | ||
} | ||
} | ||
``` |
30 changes: 30 additions & 0 deletions
30
...320_before_adi_AaveV3Polygon_HyperlaneBridgeAdapterUpdateToV3_20240320_after.md
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,30 @@ | ||
## Raw diff | ||
|
||
```json | ||
{ | ||
"forwarderAdaptersByChain": { | ||
"1": { | ||
"0x3c25b96fF62D21E90556869272a277eE2E229747": { | ||
"from": "0x6Abb61beb5848B476d026C4934E8a6415e2E75a8", | ||
"to": null | ||
}, | ||
"0x3e72665008dC237bdd91C04C10782Ed1987a4019": { | ||
"from": null, | ||
"to": "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1" | ||
} | ||
} | ||
}, | ||
"receiverAdaptersByChain": { | ||
"1": { | ||
"0x3c25b96fF62D21E90556869272a277eE2E229747": { | ||
"from": true, | ||
"to": null | ||
}, | ||
"0x3e72665008dC237bdd91C04C10782Ed1987a4019": { | ||
"from": null, | ||
"to": true | ||
} | ||
} | ||
} | ||
} | ||
``` |
14 changes: 14 additions & 0 deletions
14
...0320_before_adi_AaveV3Scroll_HyperlaneBridgeAdapterUpdateToV3_20240320_after.md
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,14 @@ | ||
## Raw diff | ||
|
||
```json | ||
{ | ||
"receiverAdaptersByChain": { | ||
"1": { | ||
"0x118DFD5418890c0332042ab05173Db4A2C1d283c": { | ||
"from": true, | ||
"to": null | ||
} | ||
} | ||
} | ||
} | ||
``` |
27 changes: 27 additions & 0 deletions
27
...rlaneBridgeAdapterUpdateToV3/AaveV3Arbitrum_HyperlaneBridgeAdapterUpdateToV3_20240320.sol
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,27 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import 'aave-helpers/adi/SimpleReceiverAdapterUpdate.sol'; | ||
import {GovernanceV3Arbitrum} from 'aave-address-book/GovernanceV3Arbitrum.sol'; | ||
import {ChainIds} from 'aave-helpers/ChainIds.sol'; | ||
|
||
/** | ||
* @title Hyperlane bridge adapter update to V3 | ||
* @author BGD Labs @bgdlabs | ||
* - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/31 | ||
*/ | ||
contract AaveV3Arbitrum_HyperlaneBridgeAdapterUpdateToV3_20240320 is | ||
SimpleReceiverAdapterUpdate( | ||
SimpleReceiverAdapterUpdate.ConstructorInput({ | ||
ccc: GovernanceV3Arbitrum.CROSS_CHAIN_CONTROLLER, | ||
newAdapter: address(0), // no new adapter | ||
adapterToRemove: 0x3829943c53F2d00e20B58475aF19716724bF90Ba | ||
}) | ||
) | ||
{ | ||
function getChainsToReceive() public pure override returns (uint256[] memory) { | ||
uint256[] memory chains = new uint256[](1); | ||
chains[0] = ChainIds.MAINNET; | ||
return chains; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...aneBridgeAdapterUpdateToV3/AaveV3Arbitrum_HyperlaneBridgeAdapterUpdateToV3_20240320.t.sol
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,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import 'aave-helpers/adi/test/ADITestBase.sol'; | ||
import {GovernanceV3Arbitrum} from 'aave-address-book/GovernanceV3Arbitrum.sol'; | ||
import {AaveV3Arbitrum_HyperlaneBridgeAdapterUpdateToV3_20240320} from './AaveV3Arbitrum_HyperlaneBridgeAdapterUpdateToV3_20240320.sol'; | ||
|
||
/** | ||
* @dev Test for AaveV3Arbitrum_HyperlaneBridgeAdapterUpdateToV3_20240320 | ||
* command: make test-contract filter=AaveV3Arbitrum_HyperlaneBridgeAdapterUpdateToV3_20240320 | ||
*/ | ||
contract AaveV3Arbitrum_HyperlaneBridgeAdapterUpdateToV3_20240320_Test is ADITestBase { | ||
AaveV3Arbitrum_HyperlaneBridgeAdapterUpdateToV3_20240320 internal payload; | ||
|
||
function setUp() public { | ||
vm.createSelectFork(vm.rpcUrl('arbitrum'), 201314733); | ||
payload = new AaveV3Arbitrum_HyperlaneBridgeAdapterUpdateToV3_20240320(); | ||
} | ||
|
||
/** | ||
* @dev executes the generic test suite including e2e and config snapshots | ||
*/ | ||
function test_defaultProposalExecution() public { | ||
defaultTest( | ||
'AaveV3Arbitrum_HyperlaneBridgeAdapterUpdateToV3_20240320', | ||
GovernanceV3Arbitrum.CROSS_CHAIN_CONTROLLER, | ||
address(payload), | ||
true | ||
); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...laneBridgeAdapterUpdateToV3/AaveV3Avalanche_HyperlaneBridgeAdapterUpdateToV3_20240320.sol
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,41 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovernanceV3Avalanche} from 'aave-address-book/GovernanceV3Avalanche.sol'; | ||
import {ChainIds} from 'aave-helpers/ChainIds.sol'; | ||
import 'aave-helpers/adi/SimpleOneToManyAdapterUpdate.sol'; | ||
|
||
/** | ||
* @title Hyperlane bridge adapter update to V3 | ||
* @author BGD Labs @bgdlabs | ||
* - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/31 | ||
*/ | ||
contract AaveV3Avalanche_HyperlaneBridgeAdapterUpdateToV3_20240320 is | ||
SimpleOneToManyAdapterUpdate( | ||
SimpleOneToManyAdapterUpdate.ConstructorInput({ | ||
ccc: GovernanceV3Avalanche.CROSS_CHAIN_CONTROLLER, | ||
newAdapter: 0x617332a777780F546261247F621051d0b98975Eb, | ||
adapterToRemove: 0xa198Fac58E02A5C5F8F7e877895d50cFa9ad1E04 | ||
}) | ||
) | ||
{ | ||
function getChainsToReceive() public pure override returns (uint256[] memory) { | ||
uint256[] memory chains = new uint256[](1); | ||
chains[0] = ChainIds.MAINNET; | ||
return chains; | ||
} | ||
|
||
function getDestinationAdapters() | ||
public | ||
pure | ||
override | ||
returns (DestinationAdaptersInput[] memory) | ||
{ | ||
DestinationAdaptersInput[] memory destinationAdapters = new DestinationAdaptersInput[](1); | ||
|
||
destinationAdapters[0].adapter = 0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1; | ||
destinationAdapters[0].chainId = ChainIds.MAINNET; | ||
|
||
return destinationAdapters; | ||
} | ||
} |
Oops, something went wrong.
61e97df
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Foundry report
Build log
Test success 🌈