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

fix: bridge e2e test #16

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion bridge/standard/bridge-v1/deploy_contracts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ $CAST_BIN_PATH send \
"$L1_DEPLOYER_ADDR" \
--value 0.5ether

EXPECTED_WHITELIST_ADDR="0x57508f0B0f3426758F1f3D63ad4935a7c9383620"
EXPECTED_WHITELIST_ADDR="0xcf59aDa3C5FBa545Cc50FB9AEAe83D37b46F6E1B"
check_balance "$STANDARD_BRIDGE_RELAYER_SETTLEMENT_RPC_URL" "$EXPECTED_WHITELIST_ADDR"

echo "changing directory to $CONTRACTS_PATH and running deploy scripts for standard bridge"
Expand Down
4 changes: 2 additions & 2 deletions bridge/standard/bridge-v1/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ services:
SETTLEMENT_RPC_URL: "http://sl-bootnode:8545"
L1_CHAIN_ID: "39999"
SETTLEMENT_CHAIN_ID: "17864"
L1_CONTRACT_ADDR: "0x1a18dfEc4f2B66207b1Ad30aB5c7A0d62Ef4A40b"
SETTLEMENT_CONTRACT_ADDR: "0xc1f93bE11D7472c9B9a4d87B41dD0a491F1fbc75"
L1_CONTRACT_ADDR: "0xe7B3D66A143Bfb85Cd980d1577Ba52f68F8f5809"
SETTLEMENT_CONTRACT_ADDR: "0xC157631f4aaaaabAB864544d743c5726a68C85a4"
networks:
primev_net:
ipv4_address: '172.29.0.103'
Expand Down
4 changes: 2 additions & 2 deletions bridge/standard/bridge-v1/emulator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
const (
settlementRPCUrl = "http://sl-bootnode:8545"
l1RPCUrl = "http://l1-bootnode:8545"
l1ContractAddrString = "0x1a18dfEc4f2B66207b1Ad30aB5c7A0d62Ef4A40b"
settlementContractAddrString = "0xc1f93bE11D7472c9B9a4d87B41dD0a491F1fbc75"
l1ContractAddrString = "0xe7B3D66A143Bfb85Cd980d1577Ba52f68F8f5809"
settlementContractAddrString = "0xC157631f4aaaaabAB864544d743c5726a68C85a4"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions bridge/standard/bridge-v1/example_config/relayer_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ priv-key-file: "example_config/relayer_key"
log-level: "debug"
l1-rpc-url: "http://l1-bootnode:8545"
settlement-rpc-url: "http://sl-bootnode:8545"
l1-contract-addr: "0x1a18dfEc4f2B66207b1Ad30aB5c7A0d62Ef4A40b"
settlement-contract-addr: "0xc1f93bE11D7472c9B9a4d87B41dD0a491F1fbc75"
l1-contract-addr: "0xe7B3D66A143Bfb85Cd980d1577Ba52f68F8f5809"
settlement-contract-addr: "0xC157631f4aaaaabAB864544d743c5726a68C85a4"
2 changes: 1 addition & 1 deletion contracts/contracts/standard-bridge/SettlementGateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {IWhitelist} from "../interfaces/IWhitelist.sol";
contract SettlementGateway is Gateway{

// Assuming deployer is 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266,
// whitelist's create2 addr should be 0x57508f0B0f3426758F1f3D63ad4935a7c9383620.
// whitelist's create2 addr should be 0xcf59aDa3C5FBa545Cc50FB9AEAe83D37b46F6E1B.
// This variable is not hardcoded for testing purposes.
address public immutable whitelistAddr;

Expand Down
6 changes: 3 additions & 3 deletions contracts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ elif [ "$DEPLOY_TYPE" = "whitelist" ]; then
exit 1
fi
echo "Deploying whitelist contract"
HYP_ERC20_ADDR="$HYP_ERC20_ADDR" $FORGE_BIN_PATH script ${SCRIPT_PATH_PREFIX}DeployScripts.s.sol:DeployWhitelist --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --chain-id $CHAIN_ID -vvvv --use 0.8.23 $ROOT_OPTION
HYP_ERC20_ADDR="$HYP_ERC20_ADDR" $FORGE_BIN_PATH script ${SCRIPT_PATH_PREFIX}DeployScripts.s.sol:DeployWhitelist --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --chain-id $CHAIN_ID -vvvv --use 0.8.23 $ROOT_OPTION --via-ir

elif [ "$DEPLOY_TYPE" = "settlement-gateway" ]; then
if [ -z "$RELAYER_ADDR" ]; then
echo "RELAYER_ADDR not specified"
exit 1
fi
echo "Deploying gateway contract on settlement chain"
RELAYER_ADDR="$RELAYER_ADDR" $FORGE_BIN_PATH script ${SCRIPT_PATH_PREFIX}DeployStandardBridge.s.sol:DeploySettlementGateway --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --chain-id $CHAIN_ID -vvvv --use 0.8.23 $ROOT_OPTION
RELAYER_ADDR="$RELAYER_ADDR" $FORGE_BIN_PATH script ${SCRIPT_PATH_PREFIX}DeployStandardBridge.s.sol:DeploySettlementGateway --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --chain-id $CHAIN_ID -vvvv --use 0.8.23 $ROOT_OPTION --via-ir

elif [ "$DEPLOY_TYPE" = "l1-gateway" ]; then
if [ -z "$RELAYER_ADDR" ]; then
echo "RELAYER_ADDR not specified"
exit 1
fi
echo "Deploying gateway contract on L1"
RELAYER_ADDR="$RELAYER_ADDR" $FORGE_BIN_PATH script ${SCRIPT_PATH_PREFIX}DeployStandardBridge.s.sol:DeployL1Gateway --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --chain-id $CHAIN_ID -vvvv --use 0.8.23 $ROOT_OPTION
RELAYER_ADDR="$RELAYER_ADDR" $FORGE_BIN_PATH script ${SCRIPT_PATH_PREFIX}DeployStandardBridge.s.sol:DeployL1Gateway --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --chain-id $CHAIN_ID -vvvv --use 0.8.23 $ROOT_OPTION --via-ir
fi
2 changes: 1 addition & 1 deletion contracts/scripts/DeployScripts.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ contract DeployWhitelist is Script, Create2Deployer {

console.log("Warning: DeployWhitelist is deprecated and only for backwards compatibility with hyperlane");

address expectedWhiteListAddr = 0x57508f0B0f3426758F1f3D63ad4935a7c9383620;
address expectedWhiteListAddr = 0xcf59aDa3C5FBa545Cc50FB9AEAe83D37b46F6E1B;
if (isContractDeployed(expectedWhiteListAddr)) {
console.log("Whitelist already deployed to:", expectedWhiteListAddr);
return;
Expand Down
2 changes: 1 addition & 1 deletion contracts/scripts/DeployStandardBridge.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract DeploySettlementGateway is Script, Create2Deployer {
// Forge deploy with salt uses create2 proxy from https://github.com/primevprotocol/deterministic-deployment-proxy
bytes32 salt = 0x8989000000000000000000000000000000000000000000000000000000000000;

address expectedWhitelistAddr = 0x57508f0B0f3426758F1f3D63ad4935a7c9383620;
address expectedWhitelistAddr = 0xcf59aDa3C5FBa545Cc50FB9AEAe83D37b46F6E1B;
if (isContractDeployed(expectedWhitelistAddr)) {
console.log("Whitelist must not be deployed to execute DeploySettlementGateway script. Exiting...");
return;
Expand Down
9 changes: 0 additions & 9 deletions mev-commit-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,6 @@ deploy_standard_bridge_contracts() {
-e RELAYER_ADDR="0x0DCaa27B9E4Db92F820189345792f8eC5Ef148F6" \
contract-deployer

local settlement_gateway_addr="0xc1f93bE11D7472c9B9a4d87B41dD0a491F1fbc75"
docker run --rm --network "$DOCKER_NETWORK_NAME" \
-e RPC_URL="$rpc_url" \
-e CHAIN_ID="$chain_id" \
-e PRIVATE_KEY="$private_key" \
-e DEPLOY_TYPE="whitelist" \
-e HYP_ERC20_ADDR="$settlement_gateway_addr" \
contract-deployer

docker run --rm --network "geth-poa_l1_net" \
-e RPC_URL="http://l1-bootnode:8545" \
-e CHAIN_ID="39999" \
Expand Down
Loading