Skip to content

Commit

Permalink
fix: solved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
sendra committed Apr 17, 2024
2 parents 8044f4d + ae08279 commit c1ff698
Show file tree
Hide file tree
Showing 126 changed files with 4,538 additions and 834 deletions.
8 changes: 7 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PRIVATE_KEY=

# Rpcs for running the tests
RPC_MAINNET=https://rpc.flashbots.net
RPC_MAINNET_TESTNET=https://rpc.flashbots.net
RPC_MAINNET_TESTNET=https://ethereum-sepolia.publicnode.com
RPC_AVALANCHE=https://api.avax.network/ext/bc/C/rpc
RPC_AVALANCHE_TESTNET=https://api.avax.network/ext/bc/C/rpc
RPC_OPTIMISM=https://mainnet.optimism.io
Expand All @@ -29,6 +29,10 @@ RPC_GNOSIS=https://rpc.gnosischain.com
RPC_GNOSIS_TESTNET=https://rpc.chiadochain.net
RPC_ZKEVM=https://polygon-zkevm.drpc.org
RPC_ZKEVM_TESTNET=https://rpc.public.zkevm-test.net
RPC_SCROLL=https://rpc.scroll.io
RPC_SCROLL_TESTNET=https://sepolia-rpc.scroll.io
RPC_CELO=https://forno.celo.org
RPC_CELO_ALFAJORES=https://alfajores-forno.celo-testnet.org

# Etherscan verification
ETHERSCAN_API_KEY_MAINNET=
Expand All @@ -41,3 +45,5 @@ ETHERSCAN_API_KEY_BINANCE=
ETHERSCAN_API_KEY_BASE=
ETHERSCAN_API_KEY_GNOSIS=
ETHERSCAN_API_KEY_ZKEVM=
ETHERSCAN_API_KEY_SCROLL=
ETHERSCAN_API_KEY_CELO=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ broadcast/
.DS_Store

input.json
compressedArtifacts.zip
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/hyperlane-monorepo"]
path = lib/hyperlane-monorepo
url = https://github.com/hyperlane-xyz/hyperlane-monorepo
[submodule "lib/solidity-examples"]
path = lib/solidity-examples
url = https://github.com/LayerZero-Labs/solidity-examples
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
Expand Down
81 changes: 64 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ BASE_KEY = --private-key ${PRIVATE_KEY}



custom_ethereum := --with-gas-price 10000000000 # 53 gwei
custom_polygon := --with-gas-price 100000000000 # 560 gwei
custom_ethereum := --with-gas-price 45000000000 # 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/
custom_metis := --verifier-url https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan
custom_scroll-testnet := --legacy --with-gas-price 1000000000 # 1 gwei

# params:
# 1 - path/file_name
Expand All @@ -32,13 +33,23 @@ custom_metis := --verifier-url https://api.routescan.io/v2/network/mainnet/evm/
# default to testnet deployment, to run production, set PROD=true to env
define deploy_single_fn
forge script \
scripts/$(1).s.sol:$(if $(3),$(3),$(shell UP=$(if $(PROD),$(2),$(2)_testnet); echo $${UP} | perl -nE 'say ucfirst')) \
--rpc-url $(if $(PROD),$(2),$(2)-testnet) --broadcast --verify --slow -vvvv \
scripts/$(1).s.sol:$(if $(3),$(if $(PROD),$(3),$(3)_testnet),$(shell UP=$(if $(PROD),$(2),$(2)_testnet); echo $${UP} | perl -nE 'say ucfirst')) \
--rpc-url $(if $(PROD),$(2),$(2)-testnet) --broadcast --verify -vvvv \
$(if $(LEDGER),$(BASE_LEDGER),$(BASE_KEY)) \
$(custom_$(if $(PROD),$(2),$(2)-testnet))

endef

# catapulta
#define deploy_single_fn
#npx [email protected] script \
# scripts/$(1).s.sol:$(if $(3),$(3),$(shell UP=$(if $(PROD),$(2),$(2)_testnet); echo $${UP} | perl -nE 'say ucfirst')) \
# --network $(2) --slow --skip-git \
# $(if $(LEDGER),$(BASE_LEDGER),$(BASE_KEY)) \
# $(custom_$(if $(PROD),$(2),$(2)-testnet))
#
#endef

define deploy_fn
$(foreach network,$(2),$(call deploy_single_fn,$(1),$(network),$(3)))
endef
Expand Down Expand Up @@ -92,9 +103,15 @@ deploy-base-adapters:
deploy-gnosis-adapters:
$(call deploy_fn,Adapters/DeployGnosisChain,ethereum gnosis)

deploy-scroll-adapters:
$(call deploy_fn,Adapters/DeployScrollAdapter,ethereum scroll)

deploy-zkevm-adapters:
$(call deploy_fn,Adapters/DeployZkEVMAdapter,ethereum zkevm)

deploy-wormhole-adapters:
$(call deploy_fn,Adapters/DeployWormholeAdapter,ethereum celo)

## 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)
Expand Down Expand Up @@ -140,43 +157,67 @@ deploy-full:

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

# Deploy Cross Chain Infra on all networks
deploy-cross-chain-infra-test:
$(call deploy_fn,CCC/Deploy_CCC,avalanche base)
$(call deploy_fn,CCC/Deploy_CCC,ethereum)

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

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

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

## Deploy SameChain adapters on ethereum
deploy-same-chain-adapters-test:
$(call deploy_fn,Adapters/DeploySameChainAdapter,ethereum)

deploy-scroll-adapters-test:
$(call deploy_fn,Adapters/DeployScrollAdapter,ethereum)

deploy-wormhole-adapters-test:
$(call deploy_fn,Adapters/DeployWormholeAdapter,ethereum)

deploy-polygon-adapters-test:
$(call deploy_fn,Adapters/DeployPolygon,ethereum)

deploy-gnosis-adapters-test:
$(call deploy_fn,Adapters/DeployGnosisChain,ethereum)

deploy-arbitrum-adapters-test:
$(call deploy_fn,Adapters/DeployArbAdapter,ethereum)

deploy-optimism-adapters-test:
$(call deploy_fn,Adapters/DeployOpAdapter,ethereum)

deploy-metis-adapters-test:
$(call deploy_fn,Adapters/DeployMetisAdapter,ethereum)

deploy-base-adapters-test:
$(call deploy_fn,Adapters/DeployCBaseAdapter,ethereum)

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

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

# Sets the required confirmations
set-ccr-confirmations-test:
$(call deploy_fn,CCC/Set_CCR_Confirmations,base)
$(call deploy_fn,CCC/Set_CCR_Confirmations,ethereum)

# Funds CCC
fund-crosschain-test:
$(call deploy_fn,CCC/FundCCC,ethereum avalanche)
$(call deploy_fn,CCC/FundCCC,ethereum)

## Deploy and configure all contracts
deploy-full-test:
Expand All @@ -197,16 +238,16 @@ deploy-full-test:
# ----------------------------------------------------------------------------------------------------------------------
# ----------------------------------------- HELPER SCRIPTS ---------------------------------------------------------
remove-bridge-adapters:
$(call deploy_fn,helpers/RemoveBridgeAdapters,ethereum avalanche polygon binance)
$(call deploy_fn,helpers/RemoveBridgeAdapters,celo)

send-direct-message:
$(call deploy_fn,helpers/Send_Direct_CCMessage,ethereum)
$(call deploy_fn,helpers/Send_Direct_CCMessage,avalanche)

deploy_mock_destination:
$(call deploy_fn,helpers/Deploy_Mock_destination,zkevm)
$(call deploy_fn,helpers/Deploy_Mock_destination,ethereum)

set-approved-ccf-senders:
$(call deploy_fn,helpers/Set_Approved_Senders,ethereum avalanche polygon)
$(call deploy_fn,helpers/Set_Approved_Senders,ethereum)

send-message:
@$(call deploy_fn,helpers/Testnet_ForwardMessage,ethereum,Testnet_ForwardMessage)
Expand All @@ -219,3 +260,9 @@ send-message-via-adapter:

deploy_ccc_granular_guardian:
$(call deploy_fn,helpers/Send_Message_Via_Adapter,avalanche, polygon, binance, gnosis)

deploy-ccc-revision-and-update:
$(call deploy_fn,CCC/UpdateCCC,ethereum)

deploy-ccc-update-payload:
$(call deploy_fn,helpers/UpdateCCCImpl_Payload,celo)
Loading

0 comments on commit c1ff698

Please sign in to comment.