Skip to content

Commit

Permalink
Merge branch 'main' of github.com:bgd-labs/aave-delivery-infrastructu…
Browse files Browse the repository at this point in the history
…re into fix/create2-adapter-deployments
  • Loading branch information
sendra committed Apr 16, 2024
2 parents 3ea8071 + ae08279 commit 3bf7826
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 131 deletions.
2 changes: 1 addition & 1 deletion scripts/BaseScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ library DeployerHelpers {

library Constants {
address public constant OWNER = 0xf71fc92e2949ccF6A5Fd369a0b402ba80Bc61E02;
bytes32 public constant ADMIN_SALT = keccak256(bytes('Aave Pre Prod Proxy Admin'));
bytes32 public constant ADMIN_SALT = keccak256(bytes('Proxy Admin'));
bytes32 public constant CCC_SALT = keccak256(bytes('a.DI Cross Chain Controller'));
bytes32 public constant CREATE3_FACTORY_SALT = keccak256(bytes('Create3 Factory'));
}
Expand Down
38 changes: 19 additions & 19 deletions scripts/CCC/Set_CCF_Sender_Adapters.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ contract Ethereum is BaseCCFSenderAdapters {
) public view override returns (ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] memory) {
ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[]
memory bridgeAdaptersToEnable = new ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[](
21
23
);

// polygon path
Expand Down Expand Up @@ -118,59 +118,59 @@ contract Ethereum is BaseCCFSenderAdapters {
});

// same chain path
// bridgeAdaptersToEnable[14] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
// currentChainBridgeAdapter: addresses.sameChainAdapter,
// destinationBridgeAdapter: addresses.sameChainAdapter,
// destinationChainId: addresses.chainId
// });
bridgeAdaptersToEnable[14] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
currentChainBridgeAdapter: addresses.sameChainAdapter,
destinationBridgeAdapter: addresses.sameChainAdapter,
destinationChainId: addresses.chainId
});

// gnosis
DeployerHelpers.Addresses memory addressesGnosis = _getAddresses(ChainIds.GNOSIS);
bridgeAdaptersToEnable[14] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
bridgeAdaptersToEnable[15] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
currentChainBridgeAdapter: addresses.gnosisAdapter,
destinationBridgeAdapter: addressesGnosis.gnosisAdapter,
destinationChainId: addressesGnosis.chainId
});
bridgeAdaptersToEnable[15] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
bridgeAdaptersToEnable[16] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
currentChainBridgeAdapter: addresses.lzAdapter,
destinationBridgeAdapter: addressesGnosis.lzAdapter,
destinationChainId: addressesGnosis.chainId
});
bridgeAdaptersToEnable[16] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
bridgeAdaptersToEnable[17] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
currentChainBridgeAdapter: addresses.hlAdapter,
destinationBridgeAdapter: addressesGnosis.hlAdapter,
destinationChainId: addressesGnosis.chainId
});

// ZkEVM
// DeployerHelpers.Addresses memory addressesZkEVM = _getAddresses(ChainIds.POLYGON_ZK_EVM);
// bridgeAdaptersToEnable[17] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
// currentChainBridgeAdapter: addresses.zkevmAdapter,
// destinationBridgeAdapter: addressesZkEVM.zkevmAdapter,
// destinationChainId: addressesZkEVM.chainId
// });
DeployerHelpers.Addresses memory addressesZkEVM = _getAddresses(ChainIds.POLYGON_ZK_EVM);
bridgeAdaptersToEnable[18] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
currentChainBridgeAdapter: addresses.zkevmAdapter,
destinationBridgeAdapter: addressesZkEVM.zkevmAdapter,
destinationChainId: addressesZkEVM.chainId
});

// Scroll
DeployerHelpers.Addresses memory addressesScroll = _getAddresses(ChainIds.SCROLL);
bridgeAdaptersToEnable[17] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
bridgeAdaptersToEnable[19] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
currentChainBridgeAdapter: addresses.scrollAdapter,
destinationBridgeAdapter: addressesScroll.scrollAdapter,
destinationChainId: addressesScroll.chainId
});

// Celo
DeployerHelpers.Addresses memory addressesCelo = _getAddresses(ChainIds.CELO);
bridgeAdaptersToEnable[18] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
bridgeAdaptersToEnable[20] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
currentChainBridgeAdapter: addresses.wormholeAdapter,
destinationBridgeAdapter: addressesCelo.wormholeAdapter,
destinationChainId: addressesCelo.chainId
});
bridgeAdaptersToEnable[19] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
bridgeAdaptersToEnable[21] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
currentChainBridgeAdapter: addresses.lzAdapter,
destinationBridgeAdapter: addressesCelo.lzAdapter,
destinationChainId: addressesCelo.chainId
});
bridgeAdaptersToEnable[20] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
bridgeAdaptersToEnable[22] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({
currentChainBridgeAdapter: addresses.hlAdapter,
destinationBridgeAdapter: addressesCelo.hlAdapter,
destinationChainId: addressesCelo.chainId
Expand Down
2 changes: 1 addition & 1 deletion scripts/CCC/Set_CCR_Receivers_Adapters.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ contract Scroll is BaseSetCCRAdapters {
DeployerHelpers.Addresses memory addresses
) public pure override returns (address[] memory) {
address[] memory receiverBridgeAdaptersToAllow = new address[](1);
receiverBridgeAdaptersToAllow[0] = addresses.scrollAdapter;
receiverBridgeAdaptersToAllow[0] = addresses.zkevmAdapter;

return receiverBridgeAdaptersToAllow;
}
Expand Down
6 changes: 0 additions & 6 deletions scripts/CCC/UpdateCCC.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ abstract contract BaseCCCUpdate is BaseScript {
addresses.clEmergencyOracle = CL_EMERGENCY_ORACLE();
}

// ProxyAdmin(addresses.proxyAdmin).upgradeAndCall(
// TransparentUpgradeableProxy(payable(addresses.crossChainController)),
// crossChainControllerImpl,
// abi.encodeWithSelector(IReinitialize.initializeRevision.selector)
// );

addresses.crossChainControllerImpl = crossChainControllerImpl;
}
}
Expand Down
163 changes: 80 additions & 83 deletions scripts/InitialDeployments.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ abstract contract BaseInitialDeployment is BaseScript {
}

function _execute(DeployerHelpers.Addresses memory addresses) internal override {
// addresses.create3Factory = CREATE3_FACTORY() == address(0)
// ? address(new Create3Factory{salt: Constants.CREATE3_FACTORY_SALT}())
// : CREATE3_FACTORY();
addresses.create3Factory = CREATE3_FACTORY() == address(0)
? address(new Create3Factory{salt: Constants.CREATE3_FACTORY_SALT}())
: CREATE3_FACTORY();
addresses.proxyFactory = TRANSPARENT_PROXY_FACTORY() == address(0)
? address(new TransparentProxyFactory())
: TRANSPARENT_PROXY_FACTORY();
Expand All @@ -52,13 +52,13 @@ contract Ethereum is BaseInitialDeployment {
return MiscEthereum.TRANSPARENT_PROXY_FACTORY;
}

// function PROXY_ADMIN() public pure override returns (address) {
// return AaveMisc.PROXY_ADMIN_ETHEREUM;
// }
//
// function GUARDIAN() public pure override returns (address) {
// return 0xCA76Ebd8617a03126B6FB84F9b1c1A0fB71C2633;
// }
function PROXY_ADMIN() public pure override returns (address) {
return MiscEthereum.PROXY_ADMIN;
}

function GUARDIAN() public pure override returns (address) {
return MiscEthereum.PROTOCOL_GUARDIAN;
}

function TRANSACTION_NETWORK() public pure override returns (uint256) {
return ChainIds.ETHEREUM;
Expand All @@ -70,13 +70,13 @@ contract Polygon is BaseInitialDeployment {
return MiscPolygon.TRANSPARENT_PROXY_FACTORY;
}

// function PROXY_ADMIN() public pure override returns (address) {
// return AaveMisc.PROXY_ADMIN_POLYGON;
// }
//
// function GUARDIAN() public pure override returns (address) {
// return 0x1450F2898D6bA2710C98BE9CAF3041330eD5ae58;
// }
function PROXY_ADMIN() public pure override returns (address) {
return MiscPolygon.PROXY_ADMIN;
}

function GUARDIAN() public pure override returns (address) {
return MiscPolygon.PROTOCOL_GUARDIAN;
}

function TRANSACTION_NETWORK() public pure override returns (uint256) {
return ChainIds.POLYGON;
Expand All @@ -88,13 +88,13 @@ contract Avalanche is BaseInitialDeployment {
return MiscAvalanche.TRANSPARENT_PROXY_FACTORY;
}

// function PROXY_ADMIN() public pure override returns (address) {
// return AaveMisc.PROXY_ADMIN_AVALANCHE;
// }
//
// function GUARDIAN() public pure override returns (address) {
// return 0xa35b76E4935449E33C56aB24b23fcd3246f13470;
// }
function PROXY_ADMIN() public pure override returns (address) {
return MiscAvalanche.PROXY_ADMIN;
}

function GUARDIAN() public pure override returns (address) {
return MiscAvalanche.PROTOCOL_GUARDIAN;
}

function TRANSACTION_NETWORK() public pure override returns (uint256) {
return ChainIds.AVALANCHE;
Expand All @@ -106,13 +106,13 @@ contract Optimism is BaseInitialDeployment {
return MiscOptimism.TRANSPARENT_PROXY_FACTORY;
}

// function PROXY_ADMIN() public pure override returns (address) {
// return AaveMisc.PROXY_ADMIN_OPTIMISM;
// }
//
// function GUARDIAN() public pure override returns (address) {
// return 0xE50c8C619d05ff98b22Adf991F17602C774F785c;
// }
function PROXY_ADMIN() public pure override returns (address) {
return MiscOptimism.PROXY_ADMIN;
}

function GUARDIAN() public pure override returns (address) {
return MiscOptimism.PROTOCOL_GUARDIAN;
}

function TRANSACTION_NETWORK() public pure override returns (uint256) {
return ChainIds.OPTIMISM;
Expand All @@ -124,13 +124,13 @@ contract Arbitrum is BaseInitialDeployment {
return MiscArbitrum.TRANSPARENT_PROXY_FACTORY;
}

// function PROXY_ADMIN() public pure override returns (address) {
// return AaveMisc.PROXY_ADMIN_ARBITRUM;
// }
//
// function GUARDIAN() public pure override returns (address) {
// return 0xbbd9f90699c1FA0D7A65870D241DD1f1217c96Eb;
// }
function PROXY_ADMIN() public pure override returns (address) {
return MiscArbitrum.PROXY_ADMIN;
}

function GUARDIAN() public pure override returns (address) {
return MiscArbitrum.PROTOCOL_GUARDIAN;
}

function TRANSACTION_NETWORK() public pure override returns (uint256) {
return ChainIds.ARBITRUM;
Expand All @@ -142,14 +142,13 @@ contract Metis is BaseInitialDeployment {
return MiscMetis.TRANSPARENT_PROXY_FACTORY;
}

//
// function PROXY_ADMIN() public pure override returns (address) {
// return AaveMisc.PROXY_ADMIN_METIS;
// }
//
// function GUARDIAN() public pure override returns (address) {
// return 0xF6Db48C5968A9eBCB935786435530f28e32Cc501;
// }
function PROXY_ADMIN() public pure override returns (address) {
return MiscMetis.PROXY_ADMIN;
}

function GUARDIAN() public pure override returns (address) {
return MiscMetis.PROTOCOL_GUARDIAN;
}

function TRANSACTION_NETWORK() public pure override returns (uint256) {
return ChainIds.METIS;
Expand All @@ -161,13 +160,13 @@ contract Binance is BaseInitialDeployment {
return MiscBNB.TRANSPARENT_PROXY_FACTORY;
}

// function PROXY_ADMIN() public pure override returns (address) {
// return AaveMisc.PROXY_ADMIN_BINANCE;
// }
//
// function GUARDIAN() public pure override returns (address) {
// return 0xF6Db48C5968A9eBCB935786435530f28e32Cc501;
// }
function PROXY_ADMIN() public pure override returns (address) {
return MiscBNB.PROXY_ADMIN;
}

function GUARDIAN() public pure override returns (address) {
return MiscBNB.PROTOCOL_GUARDIAN;
}

function TRANSACTION_NETWORK() public pure override returns (uint256) {
return ChainIds.BNB;
Expand All @@ -179,13 +178,13 @@ contract Gnosis is BaseInitialDeployment {
return MiscGnosis.TRANSPARENT_PROXY_FACTORY;
}

// function PROXY_ADMIN() public pure override returns (address) {
// return MiscGnosis.PROXY_ADMIN_GNOSIS;
// }
//
// function GUARDIAN() public pure override returns (address) {
// return 0xF163b8698821cefbD33Cf449764d69Ea445cE23D;
// }
function PROXY_ADMIN() public pure override returns (address) {
return MiscGnosis.PROXY_ADMIN;
}

function GUARDIAN() public pure override returns (address) {
return MiscGnosis.PROTOCOL_GUARDIAN;
}

function TRANSACTION_NETWORK() public pure override returns (uint256) {
return ChainIds.GNOSIS;
Expand All @@ -197,13 +196,13 @@ contract Base is BaseInitialDeployment {
return MiscBase.TRANSPARENT_PROXY_FACTORY;
}

// function PROXY_ADMIN() public pure override returns (address) {
// return MiscBase.PROXY_ADMIN_BASE;
// }
//
// function GUARDIAN() public pure override returns (address) {
// return 0x9e10C0A1Eb8FF6a0AaA53a62C7a338f35D7D9a2A;
// }
function PROXY_ADMIN() public pure override returns (address) {
return MiscBase.PROXY_ADMIN;
}

function GUARDIAN() public pure override returns (address) {
return MiscBase.PROTOCOL_GUARDIAN;
}

function TRANSACTION_NETWORK() public pure override returns (uint256) {
return ChainIds.BASE;
Expand All @@ -215,14 +214,13 @@ contract Scroll is BaseInitialDeployment {
return MiscScroll.TRANSPARENT_PROXY_FACTORY;
}

//
// function PROXY_ADMIN() public pure override returns (address) {
// return AaveMisc.PROXY_ADMIN_ZKEVM;
// }
//
// function GUARDIAN() public pure override returns (address) {
// return ;
// }
function PROXY_ADMIN() public pure override returns (address) {
return MiscScroll.PROXY_ADMIN;
}

function GUARDIAN() public pure override returns (address) {
return MiscScroll.PROTOCOL_GUARDIAN;
}

function TRANSACTION_NETWORK() public pure override returns (uint256) {
return ChainIds.SCROLL;
Expand All @@ -234,14 +232,13 @@ contract Zkevm is BaseInitialDeployment {
return MiscPolygonZkEvm.TRANSPARENT_PROXY_FACTORY;
}

//
// function PROXY_ADMIN() public pure override returns (address) {
// return AaveMisc.PROXY_ADMIN_ZKEVM;
// }
//
// function GUARDIAN() public pure override returns (address) {
// return ;
// }
function PROXY_ADMIN() public pure override returns (address) {
return MiscPolygonZkEvm.PROXY_ADMIN;
}

function GUARDIAN() public pure override returns (address) {
return MiscPolygonZkEvm.PROTOCOL_GUARDIAN;
}

function TRANSACTION_NETWORK() public pure override returns (uint256) {
return ChainIds.POLYGON_ZK_EVM;
Expand Down
14 changes: 3 additions & 11 deletions scripts/helpers/RemoveBridgeAdapters.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ abstract contract BaseRemoveBridgeAdapters is BaseScript {
returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory);

function _execute(DeployerHelpers.Addresses memory addresses) internal override {
// ICrossChainForwarder(addresses.crossChainController).disableBridgeAdapters(
// getBridgeAdaptersToDisable()
// );
ICrossChainForwarder(addresses.crossChainController).disableBridgeAdapters(
getBridgeAdaptersToDisable()
);
ICrossChainReceiver(addresses.crossChainController).disallowReceiverBridgeAdapters(
getReceiverBridgeAdaptersToDisallow()
);
Expand Down Expand Up @@ -127,14 +127,6 @@ contract Ethereum is BaseRemoveBridgeAdapters {
bridgeAdapter: 0xFf8C72bE9bE0Fe889e04BBFdA7D83f78dE7A5E64,
chainIds: chainIds
});
// bridgeAdapters[1] = ICrossChainForwarder.BridgeAdapterToDisable({
// bridgeAdapter: 0x4d47404219Ec63dc2e8100D8D09aD918f063E66B,
// chainIds: chainIds
// });
// bridgeAdapters[2] = ICrossChainForwarder.BridgeAdapterToDisable({
// bridgeAdapter: 0x4CC5C07a079A7E67298D498459Fc88Dbb39f2297,
// chainIds: chainIds
// });
return bridgeAdapters;
}

Expand Down
Loading

0 comments on commit 3bf7826

Please sign in to comment.