Skip to content

Commit

Permalink
move --constructor-args to last argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Lam committed Oct 27, 2023
1 parent 011796a commit 000a894
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
12 changes: 6 additions & 6 deletions docker/run_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,18 @@ if [ ! -e $dir_prefix/NETWORK_RUNNING ]; then

# Deploy TeleporterRegistry to each chain.
cd contracts
registry_deploy_result_a=$(forge create --private-key $user_private_key --constructor-args "[(1,$teleporter_contract_address)]" \
--rpc-url $subnet_a_url src/Teleporter/upgrades/TeleporterRegistry.sol:TeleporterRegistry)
registry_deploy_result_a=$(forge create --private-key $user_private_key \
--rpc-url $subnet_a_url src/Teleporter/upgrades/TeleporterRegistry.sol:TeleporterRegistry --constructor-args "[(1,$teleporter_contract_address)]")
registry_address_a=$(parseContractAddress "$registry_deploy_result_a")
echo "TeleporterRegistry contract deployed to subnet A at $registry_address_a."

registry_deploy_result_b=$(forge create --private-key $user_private_key --constructor-args "[(1,$teleporter_contract_address)]" \
--rpc-url $subnet_b_url src/Teleporter/upgrades/TeleporterRegistry.sol:TeleporterRegistry)
registry_deploy_result_b=$(forge create --private-key $user_private_key \
--rpc-url $subnet_b_url src/Teleporter/upgrades/TeleporterRegistry.sol:TeleporterRegistry --constructor-args "[(1,$teleporter_contract_address)]")
registry_address_b=$(parseContractAddress "$registry_deploy_result_b")
echo "TeleporterRegistry contract deployed to subnet B at $registry_address_b."

registry_deploy_result_c=$(forge create --private-key $user_private_key --constructor-args "[(1,$teleporter_contract_address)]" \
--rpc-url $subnet_c_url src/Teleporter/upgrades/TeleporterRegistry.sol:TeleporterRegistry)
registry_deploy_result_c=$(forge create --private-key $user_private_key \
--rpc-url $subnet_c_url src/Teleporter/upgrades/TeleporterRegistry.sol:TeleporterRegistry --constructor-args "[(1,$teleporter_contract_address)]")
registry_address_c=$(parseContractAddress "$registry_deploy_result_c")
echo "TeleporterRegistry contract deployed to subnet C at $registry_address_c."
cd ..
Expand Down
8 changes: 4 additions & 4 deletions scripts/local/integration-tests/block_hash_publish_receive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ set -e # Stop on first error

# Deploy the block hash publisher to subnet A
cd contracts
block_hash_publisher_deploy_result=$(forge create --private-key $user_private_key --constructor-args $registry_address_a \
--rpc-url $subnet_a_url src/CrossChainApplications/VerifiedBlockHash/BlockHashPublisher.sol:BlockHashPublisher)
block_hash_publisher_deploy_result=$(forge create --private-key $user_private_key \
--rpc-url $subnet_a_url src/CrossChainApplications/VerifiedBlockHash/BlockHashPublisher.sol:BlockHashPublisher --constructor-args $registry_address_a )
block_hash_publisher_contract_address=$(parseContractAddress "$block_hash_publisher_deploy_result")
echo "Block hash publisher contract deployed to subnet A at $block_hash_publisher_contract_address"

# Deploy the example messenger application on subnet B
block_hash_receiver_deploy_result=$(forge create --private-key $user_private_key \
--constructor-args $registry_address_a $subnet_a_chain_id_hex $block_hash_publisher_contract_address \
--rpc-url $subnet_b_url src/CrossChainApplications/VerifiedBlockHash/BlockHashReceiver.sol:BlockHashReceiver)
--rpc-url $subnet_b_url src/CrossChainApplications/VerifiedBlockHash/BlockHashReceiver.sol:BlockHashReceiver \
--constructor-args $registry_address_a $subnet_a_chain_id_hex $block_hash_publisher_contract_address)
block_hash_receiver_contract_address=$(parseContractAddress "$block_hash_receiver_deploy_result")
echo "Block hash receiver contract deployed to subnet B at $block_hash_receiver_contract_address"

Expand Down
15 changes: 9 additions & 6 deletions scripts/local/integration-tests/erc20_bridge_multihop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,21 @@ native_erc20_contract_address=$(parseContractAddress "$native_erc20_deploy_resul
echo "Test ERC20 contract deployed to $native_erc20_contract_address on Subnet A"

# Deploy the ERC20 bridge contract to all chains.
bridge_a_deploy_result=$(forge create --private-key $user_private_key --constructor-args $registry_address_a \
--rpc-url $subnet_a_url src/CrossChainApplications/ERC20Bridge/ERC20Bridge.sol:ERC20Bridge)
bridge_a_deploy_result=$(forge create --private-key $user_private_key \
--rpc-url $subnet_a_url src/CrossChainApplications/ERC20Bridge/ERC20Bridge.sol:ERC20Bridge \
--constructor-args $registry_address_a)
bridge_a_address=$(parseContractAddress "$bridge_a_deploy_result")
echo "ERC20 bridge contract deployed to subnet A at $bridge_a_address."

bridge_b_deploy_result=$(forge create --private-key $user_private_key --constructor-args $registry_address_b \
--rpc-url $subnet_b_url src/CrossChainApplications/ERC20Bridge/ERC20Bridge.sol:ERC20Bridge)
bridge_b_deploy_result=$(forge create --private-key $user_private_key \
--rpc-url $subnet_b_url src/CrossChainApplications/ERC20Bridge/ERC20Bridge.sol:ERC20Bridge \
--constructor-args $registry_address_b)
bridge_b_address=$(parseContractAddress "$bridge_b_deploy_result")
echo "ERC20 bridge contract deployed to subnet B at $bridge_b_address."

bridge_c_deploy_result=$(forge create --private-key $user_private_key --constructor-args $registry_address_c \
--rpc-url $subnet_c_url src/CrossChainApplications/ERC20Bridge/ERC20Bridge.sol:ERC20Bridge)
bridge_c_deploy_result=$(forge create --private-key $user_private_key \
--rpc-url $subnet_c_url src/CrossChainApplications/ERC20Bridge/ERC20Bridge.sol:ERC20Bridge \
--constructor-args $registry_address_c)
bridge_c_address=$(parseContractAddress "$bridge_c_deploy_result")
echo "ERC20 bridge contract deployed to subnet C at $bridge_c_address."

Expand Down
8 changes: 4 additions & 4 deletions scripts/local/integration-tests/example_messenger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ erc20_contract_address=$(parseContractAddress "$erc20_deploy_result")
echo "Test ERC20 contract deployed to $erc20_contract_address on Subnet A"

# Deploy the example messenger application on subnet A
example_messenger_a_deploy_result=$(forge create --private-key $user_private_key --constructor-args $registry_address_a \
--rpc-url $subnet_a_url src/CrossChainApplications/ExampleMessenger/ExampleCrossChainMessenger.sol:ExampleCrossChainMessenger)
example_messenger_a_deploy_result=$(forge create --private-key $user_private_key \
--rpc-url $subnet_a_url src/CrossChainApplications/ExampleMessenger/ExampleCrossChainMessenger.sol:ExampleCrossChainMessenger --constructor-args $registry_address_a)
example_messenger_a_contract_address=$(parseContractAddress "$example_messenger_a_deploy_result")
echo "Example Messenger contract deployed to subnet A at $example_messenger_a_contract_address"

# Deploy the example messenger application on subnet B
example_messenger_b_deploy_result=$(forge create --private-key $user_private_key --constructor-args $registry_address_b \
--rpc-url $subnet_b_url src/CrossChainApplications/ExampleMessenger/ExampleCrossChainMessenger.sol:ExampleCrossChainMessenger)
example_messenger_b_deploy_result=$(forge create --private-key $user_private_key \
--rpc-url $subnet_b_url src/CrossChainApplications/ExampleMessenger/ExampleCrossChainMessenger.sol:ExampleCrossChainMessenger --constructor-args $registry_address_b)
example_messenger_b_contract_address=$(parseContractAddress "$example_messenger_b_deploy_result")
echo "Example Messenger contract deployed to subnet B at $example_messenger_b_contract_address"

Expand Down

0 comments on commit 000a894

Please sign in to comment.