diff --git a/contracts/deployment_scripts/messenger/layer2/001_deploy_cross_chain_messenger.ts b/contracts/deployment_scripts/messenger/layer2/001_deploy_cross_chain_messenger.ts index 91495307e9..43f6e4d869 100644 --- a/contracts/deployment_scripts/messenger/layer2/001_deploy_cross_chain_messenger.ts +++ b/contracts/deployment_scripts/messenger/layer2/001_deploy_cross_chain_messenger.ts @@ -29,7 +29,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { console.log(`Script: 001_deploy_cross_chain_messenger.ts - address used: ${deployer}`); // TODO: Remove hardcoded L2 message bus address when properly exposed. - const messageBusAddress = hre.ethers.getAddress("0x526c84529b2b8c11f57d93d3f5537aca3aecef9b"); + + const networkConfig : any = await hre.network.provider.request({method: 'net_config'}); + console.log(`L2 MessageBus = ${networkConfig.L2MessageBusAddress}`); + var l2MessageBus = networkConfig.L2MessageBusAddress; + + const messageBusAddress = hre.ethers.getAddress(l2MessageBus); console.log(`Deploying l2 cross chain messenger.`) // Deploy the L2 Cross chain messenger and use the L2 bus for validation const crossChainDeployment = await deployments.deploy('CrossChainMessenger', { diff --git a/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts b/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts index 48950f5cc9..febd838ffd 100644 --- a/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts +++ b/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts @@ -117,6 +117,11 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { }); // Perform message relay. This will forward the whitelist command to the L2 subordinate bridge. + // Get the balance of l2Accounts.deployer using provider + const provider = l2Network.ethers.provider; + const balance = await provider.getBalance(l2Accounts.deployer); + console.log(`Balance of l2Accounts.deployer: ${balance}`); + console.log(`Relaying messages using account ${l2Accounts.deployer}`); const relayMsg = async (msg: any) => { return l2Network.deployments.execute("CrossChainMessenger", { diff --git a/tools/walletextension/rpcapi/net_api.go b/tools/walletextension/rpcapi/net_api.go index 93a4a3d0af..208995747a 100644 --- a/tools/walletextension/rpcapi/net_api.go +++ b/tools/walletextension/rpcapi/net_api.go @@ -19,6 +19,7 @@ func (api *NetAPI) Version(ctx context.Context) (*string, error) { type ConfigResponseJson struct { ManagementContractAddress string MessageBusAddress string + L2MessageBusAddress string } func (api *NetAPI) Config(ctx context.Context) (*ConfigResponseJson, error) {