Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: redeploy celo contracts #32

Merged
merged 6 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[submodule "lib/aave-delivery-infrastructure"]
path = lib/aave-delivery-infrastructure
url = https://github.com/bgd-labs/aave-delivery-infrastructure
branch = feat/deploy-celo
[submodule "lib/aave-helpers"]
path = lib/aave-helpers
url = https://github.com/bgd-labs/aave-helpers
23 changes: 13 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ BASE_KEY = --private-key ${PRIVATE_KEY}



custom_ethereum := --with-gas-price 20000000000 # 53 gwei
custom_ethereum := --with-gas-price 12000000000 # 53 gwei
#custom_polygon := --with-gas-price 190000000000 # 560 gwei
#custom_avalanche := --with-gas-price 27000000000 # 27 gwei
#custom_metis-testnet := --legacy --verifier-url https://goerli.explorer.metisdevops.link/api/
Expand Down Expand Up @@ -164,23 +164,23 @@ deploy-full:

# Deploy Proxy Factories on all networks
deploy-proxy-factory-test:
$(call deploy_fn,InitialDeployments,linea)
$(call deploy_fn,InitialDeployments,celo)

# Deploy Cross Chain Infra on all networks
deploy-cross-chain-infra-test:
$(call deploy_fn,ccc/DeployCCC,linea)
$(call deploy_fn,ccc/DeployCCC,celo)

## Deploy CCIP bridge adapters on all networks
deploy-ccip-bridge-adapters-test:
$(call deploy_fn,adapters/DeployCCIP,ethereum)
$(call deploy_fn,adapters/DeployCCIPAdapter,ethereum)

## Deploy LayerZero bridge adapters on all networks
deploy-lz-bridge-adapters-test:
$(call deploy_fn,adapters/DeployLZ,ethereum)
$(call deploy_fn,adapters/DeployLZ,celo)

## Deploy HyperLane bridge adapters on all networks
deploy-hl-bridge-adapters-test:
$(call deploy_fn,adapters/DeployHL,ethereum)
$(call deploy_fn,adapters/DeployHL,celo)

## Deploy SameChain adapters on ethereum
deploy-same-chain-adapters-test:
Expand Down Expand Up @@ -219,11 +219,11 @@ set-ccf-sender-adapters-test:

# Set the bridge adapters allowed to receive messages
set-ccr-receiver-adapters-test:
$(call deploy_fn,ccc/Set_CCR_Receivers_Adapters,linea)
$(call deploy_fn,ccc/Set_CCR_Receivers_Adapters,celo)

# Sets the required confirmations
set-ccr-confirmations-test:
$(call deploy_fn,ccc/Set_CCR_Confirmations,linea)
$(call deploy_fn,ccc/Set_CCR_Confirmations,celo)


## Deploy and configure all contracts
Expand All @@ -245,7 +245,7 @@ deploy-full-test:
# ----------------------------------------------------------------------------------------------------------------------
# ----------------------------------------- HELPER SCRIPTS ---------------------------------------------------------
remove-bridge-adapters:
$(call deploy_fn,helpers/RemoveBridgeAdapters,ethereum)
$(call deploy_fn,helpers/RemoveBridgeAdapters,celo)

send-direct-message:
$(call deploy_fn,helpers/Send_Direct_CCMessage,ethereum)
Expand All @@ -266,7 +266,7 @@ send-message-via-adapter:
$(call deploy_fn,helpers/Send_Message_Via_Adapter,ethereum)

deploy_ccc_granular_guardian:
$(call deploy_fn,access_control/network_scripts/GranularGuardianNetworkDeploys,linea)
$(call deploy_fn,access_control/network_scripts/GranularGuardianNetworkDeploys,celo)

deploy-ccc-revision-and-update:
$(call deploy_fn,CCC/UpdateCCC,ethereum)
Expand All @@ -283,5 +283,8 @@ deploy-zksync-path-payload:
deploy-linea-path-payload:
$(call deploy_fn,payloads/adapters/ethereum/Network_Deployments,ethereum)

deploy-celo-path-payload:
$(call deploy_fn,payloads/adapters/ethereum/Network_Deployments,ethereum)

update-owners-and-guardians:
$(call deploy_fn,helpers/Update_Ownership,zksync)
18 changes: 9 additions & 9 deletions deployments/celo.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"arbAdapter": "0x0000000000000000000000000000000000000000",
"baseAdapter": "0x0000000000000000000000000000000000000000",
"ccipAdapter": "0x0000000000000000000000000000000000000000",
"ccipAdapter": "0x3d534E8964e7aAcfc702751cc9A2BB6A9fe7d928",
"chainId": 42220,
"clEmergencyOracle": "0x91b21900E91CD302EBeD05E45D8f270ddAED944d",
"create3Factory": "0x0000000000000000000000000000000000000000",
"crossChainController": "0x4A5f4b29C0407E5Feb323305e121f563c7bC4d79",
"crossChainControllerImpl": "0xf41193E25408F652AF878c47E4401A01B5E4B682",
"crossChainController": "0x50F4dAA86F3c747ce15C3C38bD0383200B61d6Dd",
"crossChainControllerImpl": "0xB0f963f93bb14C9c7c9061939107989c726E144d",
"emergencyRegistry": "0x0000000000000000000000000000000000000000",
"gnosisAdapter": "0x0000000000000000000000000000000000000000",
"granularCCCGuardian": "0xbE815420A63A413BB8D508d8022C0FF150Ea7C39",
"guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6",
"granularCCCGuardian": "0x0000000000000000000000000000000000000000",
"hlAdapter": "0xa5cc218513305221201f196760E9e64e9D49d98A",
"hlAdapter": "0x7b065E68E70f346B18636Ab86779980287ec73e0",
"lineaAdapter": "0x0000000000000000000000000000000000000000",
"lzAdapter": "0xAE93BEa44dcbE52B625169588574d31e36fb3A67",
"lzAdapter": "0x83BC62fbeA15B7Bfe11e8eEE57997afA5451f38C",
"metisAdapter": "0x0000000000000000000000000000000000000000",
"mockDestination": "0x0000000000000000000000000000000000000000",
"opAdapter": "0x0000000000000000000000000000000000000000",
"owner": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6",
"polAdapter": "0x0000000000000000000000000000000000000000",
"proxyAdmin": "0x01d678F1bbE148C96e7501F1Ac41661904F84F61",
"proxyFactory": "0xb172a90A7C238969CE9B27cc19D13b60A91e7F00",
"proxyAdmin": "0x54BDcc37c4143f944A3EE51C892a6cBDF305E7a0",
"proxyFactory": "0xAe13e4DA0952f0B8fE04E21df53716fCF799a923",
"sameChainAdapter": "0x0000000000000000000000000000000000000000",
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x3F006299eC88985c18E6e885EeA29A49eC579882",
"zkevmAdapter": "0x0000000000000000000000000000000000000000",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
}
2 changes: 1 addition & 1 deletion deployments/ethereum.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"arbAdapter": "0x88d6D01e08d3e64513b15fD46528dBbA7d755883",
"baseAdapter": "0xa5948b0ac79f72966dFFC5C13E44f6dfDD3D58A0",
"ccipAdapter": "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29",
"ccipAdapter": "0x58489B249BfBCF5ef4B30bdE2792086e83122B6f",
"chainId": 1,
"clEmergencyOracle": "0x0000000000000000000000000000000000000000",
"create3Factory": "0xcc3C54B95f3f1867A43009B80ed4DD930E3cE2F7",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Raw diff

```json
{
"forwarderAdaptersByChain": {
"42220": {
"from": "",
"to": {
"0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": "0x7b065E68E70f346B18636Ab86779980287ec73e0",
"0x58489B249BfBCF5ef4B30bdE2792086e83122B6f": "0x3d534E8964e7aAcfc702751cc9A2BB6A9fe7d928",
"0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": "0x83BC62fbeA15B7Bfe11e8eEE57997afA5451f38C"
}
}
}
}
```
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fs_permissions = [{ access = "read-write", path = "./"}]
metadata="none"
solc = "0.8.20"
ffi = true

evm_version = 'paris'

[profile.zksync.zksync]
fallback_oz = true
Expand Down
2 changes: 1 addition & 1 deletion lib/aave-helpers
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,21 @@ contract Linea is DeployGranularGuardian {
return ChainIds.LINEA;
}
}

contract Celo is DeployGranularGuardian {
function DEFAULT_ADMIN() internal pure override returns (address) {
return 0x1dF462e2712496373A347f8ad10802a5E95f053D; //GovernanceV3Linea.EXECUTOR_LVL_1;
sendra marked this conversation as resolved.
Show resolved Hide resolved
}

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

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

function TRANSACTION_NETWORK() internal pure override returns (uint256) {
return ChainIds.CELO;
}
}
23 changes: 23 additions & 0 deletions scripts/adapters/DeployCCIPAdapter.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,26 @@ contract Binance_testnet is DeployCCIPAdapter {
return remoteCCCByNetwork;
}
}

contract Celo is DeployCCIPAdapter {
function CCIP_ROUTER() internal pure override returns (address) {
return 0xfB48f15480926A4ADf9116Dca468bDd2EE6C5F62;
}

function LINK_TOKEN() internal pure override returns (address) {
return 0xd07294e6E917e07dfDcee882dd1e2565085C2ae0;
}

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

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;
}
}
5 changes: 2 additions & 3 deletions scripts/ccc/Set_CCR_Receivers_Adapters.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,10 @@ contract Celo is BaseSetCCRAdapters {
function getReceiverBridgeAdaptersToAllow(
Addresses memory addresses
) public pure override returns (address[] memory) {
address[] memory receiverBridgeAdaptersToAllow = new address[](4);
address[] memory receiverBridgeAdaptersToAllow = new address[](3);
receiverBridgeAdaptersToAllow[0] = addresses.lzAdapter;
receiverBridgeAdaptersToAllow[1] = addresses.hlAdapter;
receiverBridgeAdaptersToAllow[2] = addresses.wormholeAdapter;
receiverBridgeAdaptersToAllow[3] = addresses.ccipAdapter;
receiverBridgeAdaptersToAllow[2] = addresses.ccipAdapter;

return receiverBridgeAdaptersToAllow;
}
Expand Down
10 changes: 3 additions & 7 deletions scripts/helpers/RemoveBridgeAdapters.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,13 @@ contract Celo is BaseRemoveBridgeAdapters {
chainIds[0] = ChainIds.ETHEREUM;

ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[]
memory bridgeAdapters = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[](3);
memory bridgeAdapters = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[](2);
bridgeAdapters[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({
bridgeAdapter: 0xcB1F67533DAD738E1930404bE9D4F844752773DA,
bridgeAdapter: 0xa5cc218513305221201f196760E9e64e9D49d98A,
chainIds: chainIds
});
bridgeAdapters[1] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({
bridgeAdapter: 0x2e649f6b54B07E210b31c9cC2eB8a0d5997c3D4A,
chainIds: chainIds
});
bridgeAdapters[2] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({
bridgeAdapter: 0x9fE056F44510F970d724adA16903ba5D75CC4742,
bridgeAdapter: 0xAE93BEa44dcbE52B625169588574d31e36fb3A67,
chainIds: chainIds
});
return bridgeAdapters;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import '../../../BaseDeployerScript.sol';
import '../../../../src/adapter_payloads/Ethereum_Celo_Path_Payload.sol';

abstract contract Ethereum_Activate_Celo_Bridge_Adapter_Payload is BaseDeployerScript {
function _getPayloadByteCode() internal virtual returns (bytes memory);

function PAYLOAD_SALT() internal pure virtual returns (string memory) {
return 'Add Celo path to a.DI';
}

function DESTINATION_CHAIN_ID() internal pure virtual returns (uint256);

function _deployPayload(AddForwarderAdapterArgs memory args) internal returns (address) {
bytes memory payloadCode = abi.encodePacked(_getPayloadByteCode(), abi.encode(args));

return _deployByteCode(payloadCode, PAYLOAD_SALT());
}

function _execute(Addresses memory addresses) internal virtual override {
Addresses memory destinationAddresses = _getAddresses(DESTINATION_CHAIN_ID());

_deployPayload(
AddForwarderAdapterArgs({
crossChainController: addresses.crossChainController,
currentChainHLBridgeAdapter: addresses.hlAdapter,
destinationChainHLBridgeAdapter: destinationAddresses.hlAdapter,
currentChainCCIPBridgeAdapter: addresses.ccipAdapter,
destinationChainCCIPBridgeAdapter: destinationAddresses.ccipAdapter,
currentChainLZBridgeAdapter: addresses.lzAdapter,
destinationChainLZBridgeAdapter: destinationAddresses.lzAdapter,
destinationChainId: DESTINATION_CHAIN_ID()
})
);
}
}
24 changes: 21 additions & 3 deletions scripts/payloads/adapters/ethereum/Network_Deployments.s.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import './Ethereum_Activate_Lina_Bridge_Adapter_Payload.s.sol';
import '../../../BaseDeployerScript.sol';
import {Ethereum_Activate_Celo_Bridge_Adapter_Payload} from './Ethereum_Activate_Celo_Bridge_Adapter_Payload.s.sol';
import {Ethereum_Activate_Lina_Bridge_Adapter_Payload} from './Ethereum_Activate_Lina_Bridge_Adapter_Payload.s.sol';
import {Ethereum_Celo_Path_Payload} from '../../../../src/adapter_payloads/Ethereum_Celo_Path_Payload.sol';
import {SimpleAddForwarderAdapter} from '../../../../src/templates/SimpleAddForwarderAdapter.sol';

contract Ethereum is Ethereum_Activate_Lina_Bridge_Adapter_Payload {
contract Ethereum is Ethereum_Activate_Celo_Bridge_Adapter_Payload {
function TRANSACTION_NETWORK() internal pure override returns (uint256) {
return ChainIds.ETHEREUM;
}

function _getPayloadByteCode() internal pure override returns (bytes memory) {
return type(Ethereum_Celo_Path_Payload).creationCode;
}

function DESTINATION_CHAIN_ID() internal pure override returns (uint256) {
return ChainIds.CELO;
}
}

contract Ethereum_Linea is Ethereum_Activate_Lina_Bridge_Adapter_Payload {
function TRANSACTION_NETWORK() internal pure override returns (uint256) {
return ChainIds.ETHEREUM;
}
Expand All @@ -15,4 +33,4 @@ contract Ethereum is Ethereum_Activate_Lina_Bridge_Adapter_Payload {
function DESTINATION_CHAIN_ID() internal pure override returns (uint256) {
return ChainIds.LINEA;
}
}
}
Loading
Loading