Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ deploy-emergency-registry:

# Deploy Proxy Factories on all networks
deploy-initial:
$(call deploy_fn,InitialDeployments,ethereum avalanche polygon optimism arbitrum metis base binance gnosis zkevm)
$(call deploy_fn,InitialDeployments,xlayer)

# Deploy Cross Chain Infra on all networks
deploy-cross-chain-infra:
$(call deploy_fn,ccc/Deploy_CCC,ethereum avalanche polygon optimism arbitrum metis base binance gnosis zkevm)
$(call deploy_fn,ccc/Deploy_CCC,xlayer)

## Deploy CCIP bridge adapters on all networks
deploy-ccip-bridge-adapters:
Expand Down Expand Up @@ -135,24 +135,27 @@ deploy-soneium-adapters:
deploy-bob-adapters:
$(call deploy_fn,adapters/DeployBobAdapter,ethereum bob)

deploy-xlayer-adapters:
$(call deploy_fn,adapters/DeployXLayerAdapter,ethereum xlayer)

## Set sender bridge dapters. Only eth pol avax are needed as other networks will only receive
set-ccf-sender-adapters:
$(call deploy_fn,ccc/Set_CCF_Sender_Adapters,ethereum)

# Set the bridge adapters allowed to receive messages
set-ccr-receiver-adapters:
$(call deploy_fn,ccc/Set_CCR_Receivers_Adapters,ethereum polygon avalanche binance arbitrum optimism base metis gnosis zkevm)
$(call deploy_fn,ccc/Set_CCR_Receivers_Adapters,xlayer)

# Sets the required confirmations
set-ccr-confirmations:
$(call deploy_fn,CCC/Set_CCR_Confirmations,ethereum polygon avalanche optimism arbitrum metis base binance gnosis zkevm)
$(call deploy_fn,CCC/Set_CCR_Confirmations,xlayer)


# ------------------------------------------------------------------------------------------------------------------
# ----------------------------------------- ACCESS CONTROL SCRIPTS ---------------------------------------------------------

deploy_ccc_granular_guardian:
$(call deploy_fn,access_control/network_scripts/GranularGuardianNetworkDeploys,plasma)
$(call deploy_fn,access_control/network_scripts/GranularGuardianNetworkDeploys,xlayer)

# ------------------------------------------------------------------------------------------------------------------
# ----------------------------------------- HELPER SCRIPTS ---------------------------------------------------------
Expand All @@ -163,7 +166,7 @@ send-direct-message:
$(call deploy_fn,helpers/Send_Direct_CCMessage,ethereum)

deploy_mock_destination:
$(call deploy_fn,helpers/Deploy_Mock_destination,plasma)
$(call deploy_fn,helpers/Deploy_Mock_destination,xlayer)

set-approved-ccf-senders:
$(call deploy_fn,helpers/Set_Approved_Senders,ethereum)
Expand All @@ -181,4 +184,4 @@ update-owners-and-guardians:
$(call deploy_fn,helpers/Update_Ownership,zksync)

update-ccc-permissions:
$(call deploy_fn,helpers/UpdateCCCPermissions,plasma)
$(call deploy_fn,helpers/UpdateCCCPermissions,xlayer)
3 changes: 2 additions & 1 deletion deployments/arbitrum.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
}
1 change: 1 addition & 0 deletions deployments/avalanche.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
1 change: 1 addition & 0 deletions deployments/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
1 change: 1 addition & 0 deletions deployments/binance.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
1 change: 1 addition & 0 deletions deployments/bob.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
1 change: 1 addition & 0 deletions deployments/celo.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x3F006299eC88985c18E6e885EeA29A49eC579882",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
1 change: 1 addition & 0 deletions deployments/ethereum.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0xA4dC3F123e1c601A19B3DC8382BB9311F678cafA",
"soneiumAdapter": "0xe66973c4571F733CafEb1BDE1fa58Ff35416d901",
"wormholeAdapter": "0x42206271373675661500F8a4d6A6CE2FDc6b5De5",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x6aD9d4147467f08b165e1b6364584C5d28898b84"
}
1 change: 1 addition & 0 deletions deployments/gnosis.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
1 change: 1 addition & 0 deletions deployments/ink.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
1 change: 1 addition & 0 deletions deployments/linea.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
1 change: 1 addition & 0 deletions deployments/mantle.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
1 change: 1 addition & 0 deletions deployments/metis.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
1 change: 1 addition & 0 deletions deployments/optimism.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
1 change: 1 addition & 0 deletions deployments/plasma.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
1 change: 1 addition & 0 deletions deployments/polygon.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
1 change: 1 addition & 0 deletions deployments/pre_prod_ethereum.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x525EC320AbD05FF316683BA3e38023CEe72f9868",
"soneiumAdapter": "0x4e00fD05aBb32F3eAF8C4D0773284ae10675C225",
"wormholeAdapter": "0x7458fd003C60D6B581D20249386188eA976e0556",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x22b56CC7c45ed007eA7E4Ea10D28967d36E314D6"
}
1 change: 1 addition & 0 deletions deployments/scroll.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x3C06dce358add17aAf230f2234bCCC4afd50d090",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
1 change: 1 addition & 0 deletions deployments/soneium.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x5698e43Ef1be85C68Dec568B5925dD5DB7903e39",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
1 change: 1 addition & 0 deletions deployments/sonic.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
1 change: 1 addition & 0 deletions deployments/zksync.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x1BC5C10CAe378fDbd7D52ec4F9f34590a619c68E"
}
8 changes: 8 additions & 0 deletions foundry.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"lib/aave-delivery-infrastructure": {
"rev": "3d430b0441eab83f5825501077e8a02227d31634"
},
"lib/aave-helpers": {
"rev": "bf2206bc6ae5a32fccfc4a10f51b76894ab73c36"
}
}
2 changes: 1 addition & 1 deletion lib/aave-helpers
Submodule aave-helpers updated 37 files
+1 −1 .gitmodules
+ audits/Aave Gho CCIP Update Review Final Report.pdf
+5 −2 foundry.lock
+1 −1 lib/aave-address-book
+1 −1 lib/forge-std
+490 −431 package-lock.json
+2 −1 package.json
+1 −0 remappings.txt
+1 −1 src/CommonTestBase.sol
+2 −2 src/DiffUtils.sol
+51 −0 src/GovV3Helpers.sol
+10 −7 src/ProtocolV2TestBase.sol
+11 −1 src/ProtocolV3TestBase.sol
+1 −1 src/SeatbeltUtils.sol
+332 −0 src/bridges/ccip/AaveGhoCcipBridge.sol
+44 −0 src/bridges/ccip/README.md
+233 −0 src/bridges/ccip/interfaces/IAaveGhoCcipBridge.sol
+58 −0 src/dependencies/chainlink/CCIPReceiver.sol
+13 −0 src/dependencies/chainlink/interfaces/IAny2EVMMessageReceiver.sol
+10 −0 src/dependencies/chainlink/interfaces/IOnRampClient.sol
+38 −0 src/dependencies/chainlink/interfaces/IRouter.sol
+37 −0 src/dependencies/chainlink/interfaces/IRouterClient.sol
+35 −0 src/dependencies/chainlink/interfaces/ITokenPool.sol
+57 −0 src/dependencies/chainlink/libraries/Client.sol
+1 −1 tests/ProtocolV2TestBase.t.sol
+1 −1 tests/ProtocolV3TestBase.t.sol
+955 −0 tests/bridges/ccip/AaveGhoCcipBridgeForkTest.t.sol
+256 −0 tests/bridges/ccip/AaveGhoCcipBridgeUnitTest.t.sol
+57 −0 tests/bridges/ccip/Constants.sol
+24 −0 tests/bridges/ccip/IGhoToken.sol
+173 −0 tests/bridges/ccip/mocks/CCIPLocalSimulatorFork.sol
+159 −0 tests/bridges/ccip/mocks/CallWithExactGas.sol
+57 −0 tests/bridges/ccip/mocks/Internal.sol
+214 −0 tests/bridges/ccip/mocks/MockRouter.sol
+242 −0 tests/bridges/ccip/mocks/Register.sol
+607 −10 zksync/src/ProtocolV3TestBase.sol
+1 −1 zksync/tests/ProtocolV3TestBase.t.sol
7 changes: 5 additions & 2 deletions scripts/BaseDeployerScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ struct Addresses {
address scrollAdapter;
address soneiumAdapter;
address wormholeAdapter;
address xlayerAdapter;
address zksyncAdapter;
}

Expand Down Expand Up @@ -87,7 +88,8 @@ library DeployerHelpers {
zksyncAdapter: abi.decode(persistedJson.parseRaw('.zksyncAdapter'), (address)),
mantleAdapter: abi.decode(persistedJson.parseRaw('.mantleAdapter'), (address)),
bobAdapter: abi.decode(persistedJson.parseRaw('.bobAdapter'), (address)),
granularCCCGuardian: abi.decode(persistedJson.parseRaw('.granularCCCGuardian'), (address))
granularCCCGuardian: abi.decode(persistedJson.parseRaw('.granularCCCGuardian'), (address)),
xlayerAdapter: abi.decode(persistedJson.parseRaw('.xlayerAdapter'), (address))
});

return addresses;
Expand Down Expand Up @@ -125,7 +127,8 @@ library DeployerHelpers {
json.serialize('scrollAdapter', addresses.scrollAdapter);
json.serialize('soneiumAdapter', addresses.soneiumAdapter);
json.serialize('wormholeAdapter', addresses.wormholeAdapter);
json = json.serialize('zksyncAdapter', addresses.zksyncAdapter);
json.serialize('xlayerAdapter', addresses.xlayerAdapter);
json.serialize('zksyncAdapter', addresses.zksyncAdapter);
vm.writeJson(json, path);
}
}
Expand Down
20 changes: 18 additions & 2 deletions scripts/InitialDeployments.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {MiscLinea} from 'aave-address-book/MiscLinea.sol';
import {MiscInk} from 'aave-address-book/MiscInk.sol';
import {MiscSoneium} from 'aave-address-book/MiscSoneium.sol';
import {MiscPlasma} from 'aave-address-book/MiscPlasma.sol';
import {MiscBob} from 'aave-address-book/MiscBob.sol';
import {GovernanceV3Arbitrum} from 'aave-address-book/GovernanceV3Arbitrum.sol';
import {GovernanceV3Avalanche} from 'aave-address-book/GovernanceV3Avalanche.sol';
import {GovernanceV3Base} from 'aave-address-book/GovernanceV3Base.sol';
Expand All @@ -39,6 +40,7 @@ import {GovernanceV3Linea} from 'aave-address-book/GovernanceV3Linea.sol';
import {GovernanceV3Ink} from 'aave-address-book/GovernanceV3Ink.sol';
import {GovernanceV3Soneium} from 'aave-address-book/GovernanceV3Soneium.sol';
import {GovernanceV3Plasma} from 'aave-address-book/GovernanceV3Plasma.sol';
import {GovernanceV3Bob} from 'aave-address-book/GovernanceV3Bob.sol';

abstract contract BaseInitialDeployment is BaseDeployerScript {
function OWNER() internal virtual returns (address) {
Expand Down Expand Up @@ -323,11 +325,11 @@ contract Bob is BaseInitialDeployment {
}

function TRANSPARENT_PROXY_FACTORY() internal pure override returns (address) {
return 0xEB0682d148e874553008730f0686ea89db7DA412;
return MiscBob.TRANSPARENT_PROXY_FACTORY;
}

function EXECUTOR() internal pure override returns (address) {
return 0x90800d1F54384523723eD3962c7Cd59d7866c83d;
return GovernanceV3Bob.EXECUTOR_LVL_1;
}
}

Expand All @@ -344,3 +346,17 @@ contract Plasma is BaseInitialDeployment {
return GovernanceV3Plasma.EXECUTOR_LVL_1;
}
}

contract Xlayer is BaseInitialDeployment {
function TRANSACTION_NETWORK() internal pure override returns (uint256) {
return ChainIds.XLAYER;
}

function TRANSPARENT_PROXY_FACTORY() internal pure override returns (address) {
return 0xEB0682d148e874553008730f0686ea89db7DA412; //MiscXlayer.TRANSPARENT_PROXY_FACTORY;
}

function EXECUTOR() internal pure override returns (address) {
return address(0); // GovernanceV3Xlayer.EXECUTOR_LVL_1; // TODO: add address when deployed
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,21 @@ contract Plasma is DeployGranularGuardian {
return ChainIds.PLASMA;
}
}

contract Xlayer is DeployGranularGuardian {
function DEFAULT_ADMIN() internal pure override returns (address) {
return address(0); //GovernanceV3XLayer.EXECUTOR_LVL_1;
}

function RETRY_GUARDIAN() internal pure override returns (address) {
return 0x734c3fF8DE95c3745770df69053A31FDC92F2526; // bgd guardian
}

function SOLVE_EMERGENCY_GUARDIAN() internal pure override returns (address) {
return 0xeB55A63bf9993d80c86D47f819B5eC958c7C127B; // dao governance guardian
}

function TRANSACTION_NETWORK() internal pure override returns (uint256) {
return ChainIds.XLAYER;
}
}
45 changes: 45 additions & 0 deletions scripts/adapters/DeployXLayerAdapter.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

import 'adi-scripts/Adapters/DeployXLayer.sol';
import '../BaseDeployerScript.sol';

abstract contract DeployXLayerAdapter is BaseDeployerScript, BaseXLayerAdapter {
function _execute(Addresses memory addresses) internal override {
addresses.xlayerAdapter = _deployAdapter(addresses.crossChainController);
}
}

// @dev addresses taken from TODO: add link to docs
contract Ethereum is DeployXLayerAdapter {
function OVM() internal pure override returns (address) {
return address(0); // TODO: add address when deployed
}

function TRANSACTION_NETWORK() internal pure override returns (uint256) {
return ChainIds.ETHEREUM;
}

function REMOTE_CCC_BY_NETWORK() internal pure override returns (RemoteCCC[] memory) {
return new RemoteCCC[](0);
}
}

contract Xlayer is DeployXLayerAdapter {
function OVM() internal pure override returns (address) {
return 0x4200000000000000000000000000000000000007;
}

function TRANSACTION_NETWORK() internal pure override returns (uint256) {
return ChainIds.XLAYER;
}

function REMOTE_CCC_BY_NETWORK() internal view override returns (RemoteCCC[] memory) {
RemoteCCC[] memory remoteCCCByNetwork = new RemoteCCC[](1);
remoteCCCByNetwork[0].chainId = ChainIds.ETHEREUM;
remoteCCCByNetwork[0].crossChainController = _getAddresses(ChainIds.ETHEREUM)
.crossChainController;

return remoteCCCByNetwork;
}
}
10 changes: 10 additions & 0 deletions scripts/ccc/DeployCCC.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,13 @@ contract Plasma is BaseCCCNetworkDeployment {
return ChainIds.PLASMA;
}
}

contract Xlayer is BaseCCCNetworkDeployment {
function CL_EMERGENCY_ORACLE() internal pure override returns (address) {
return address(0); // TODO: add address when deployed
}

function TRANSACTION_NETWORK() internal pure override returns (uint256) {
return ChainIds.XLAYER;
}
}
Loading
Loading