async function devDeployOptics(local, remotes, isTestDeploy) {
  const { domain, updater: localUpdaterAddress } = local;

  // Deploy UpgradeBeaconController
  // Note: initial owner will be the signer that's deploying
  const upgradeBeaconController = await optics.deployUpgradeBeaconController();

  const updaterManager = await deployUpdaterManager(localUpdaterAddress);

  // Deploy XAppConnectionManager
  // Note: initial owner will be the signer that's deploying
  const xAppConnectionManager = await deployXAppConnectionManager();

  // Deploy Home and setHome on XAppConnectionManager
  const home = await devDeployHome(
    domain,
    upgradeBeaconController,
    updaterManager.address,
    isTestDeploy,
  );

  await xAppConnectionManager.setHome(home.proxy.address);
  await updaterManager.setHome(home.proxy.address);

  // Deploy GovernanceRouter
  // Note: initial governor will be the signer that's deploying
  const governanceRouter = await devDeployGovernanceRouter(
    domain,
    upgradeBeaconController,
    xAppConnectionManager.address,
    isTestDeploy,
  );

  // Deploy Replica Upgrade Setup
  const replicaSetup = await devDeployReplicaUpgradeSetup(
    domain,
    upgradeBeaconController,
    isTestDeploy,
  );

  // Deploy Replica Proxies and enroll in XAppConnectionManager
  const replicaProxies = {};
  for (let remote of remotes) {
    const { domain: remoteDomain, watchers } = remote;

    const replica = await devDeployReplicaProxy(
      replicaSetup.upgradeBeacon.address,
      remote,
      isTestDeploy,
    );

    replicaProxies[remoteDomain] = replica;

    // Enroll Replica Proxy on XAppConnectionManager
    await xAppConnectionManager.ownerEnrollReplica(
      replica.proxy.address,
      remoteDomain,
    );

    // Add watcher permissions for Replica
    for (let watcher in watchers) {
      await xAppConnectionManager.setWatcherPermission(
        watcher,
        remoteDomain,
        true,
      );
    }
  }

  // Delegate permissions to governance router
  await updaterManager.transferOwnership(governanceRouter.proxy.address);
  await xAppConnectionManager.transferOwnership(governanceRouter.proxy.address);
  await upgradeBeaconController.transferOwnership(
    governanceRouter.proxy.address,
  );
  await home.proxyWithImplementation.transferOwnership(
    governanceRouter.proxy.address,
  );

  const contracts = {
    upgradeBeaconController,
    xAppConnectionManager,
    governanceRouter,
    updaterManager,
    home,
    replicaSetup,
    replicaProxies,
  };

  return contracts;
}
/*
 * Deploy, initialize, and configure the entire
 * suite of Optics contracts for a single chain
 * specified by the config information
 *
 * @param local - a single ChainConfig for the local chain
 * @param remotes - an array of ChainConfigs for each of the remote chains
 * @param isTestDeploy - boolean, true to deploy the test contracts, false otherwise
 *
 * @return contracts - OpticsContracts type for the suite of Optics contract on this chain
 */
Deploy, initialize, and configure the entire
suite of Optics contracts for a single chain
specified by the config information

@param local - a single ChainConfig for the local chain
@param remotes - an array of ChainConfigs for each of the remote chains
@param isTestDeploy - boolean, true to deploy the test contracts, false otherwise

@return contracts - OpticsContracts type for the suite of Optics contract on this chain
Deploy initialize and configure the entire suite of Optics contracts for a single chain specified by the config information @param local - a single ChainConfig for the local chain @param remotes - an array of ChainConfigs for each of the remote chains @param isTestDeploy - boolean true to deploy the test contracts false otherwise @return contracts - OpticsContracts type for the suite of Optics contract on this chain
async function devDeployOptics(local, remotes, isTestDeploy) {
  const { domain, updater: localUpdaterAddress } = local;
  const upgradeBeaconController = await optics.deployUpgradeBeaconController();
  const updaterManager = await deployUpdaterManager(localUpdaterAddress);
  const xAppConnectionManager = await deployXAppConnectionManager();
  const home = await devDeployHome(
    domain,
    upgradeBeaconController,
    updaterManager.address,
    isTestDeploy,
  );
  await xAppConnectionManager.setHome(home.proxy.address);
  await updaterManager.setHome(home.proxy.address);
  const governanceRouter = await devDeployGovernanceRouter(
    domain,
    upgradeBeaconController,
    xAppConnectionManager.address,
    isTestDeploy,
  );
  const replicaSetup = await devDeployReplicaUpgradeSetup(
    domain,
    upgradeBeaconController,
    isTestDeploy,
  );
  const replicaProxies = {};
  for (let remote of remotes) {
    const { domain: remoteDomain, watchers } = remote;
    const replica = await devDeployReplicaProxy(
      replicaSetup.upgradeBeacon.address,
      remote,
      isTestDeploy,
    );
    replicaProxies[remoteDomain] = replica;
    await xAppConnectionManager.ownerEnrollReplica(
      replica.proxy.address,
      remoteDomain,
    );
    for (let watcher in watchers) {
      await xAppConnectionManager.setWatcherPermission(
        watcher,
        remoteDomain,
        true,
      );
    }
  }
  await updaterManager.transferOwnership(governanceRouter.proxy.address);
  await xAppConnectionManager.transferOwnership(governanceRouter.proxy.address);
  await upgradeBeaconController.transferOwnership(
    governanceRouter.proxy.address,
  );
  await home.proxyWithImplementation.transferOwnership(
    governanceRouter.proxy.address,
  );
  const contracts = {
    upgradeBeaconController,
    xAppConnectionManager,
    governanceRouter,
    updaterManager,
    home,
    replicaSetup,
    replicaProxies,
  };
  return contracts;
}
async function devDeployOptics ( local , remotes , isTestDeploy ) { const { domain , updater : localUpdaterAddress } = local ; const upgradeBeaconController = await optics . deployUpgradeBeaconController ( ) ; const updaterManager = await deployUpdaterManager ( localUpdaterAddress ) ; const xAppConnectionManager = await deployXAppConnectionManager ( ) ; const home = await devDeployHome ( domain , upgradeBeaconController , updaterManager . address , isTestDeploy , ) ; await xAppConnectionManager . setHome ( home . proxy . address ) ; await updaterManager . setHome ( home . proxy . address ) ; const governanceRouter = await devDeployGovernanceRouter ( domain , upgradeBeaconController , xAppConnectionManager . address , isTestDeploy , ) ; const replicaSetup = await devDeployReplicaUpgradeSetup ( domain , upgradeBeaconController , isTestDeploy , ) ; const replicaProxies = { } ; for ( let remote of remotes ) { const { domain : remoteDomain , watchers } = remote ; const replica = await devDeployReplicaProxy ( replicaSetup . upgradeBeacon . address , remote , isTestDeploy , ) ; replicaProxies [ remoteDomain ] = replica ; await xAppConnectionManager . ownerEnrollReplica ( replica . proxy . address , remoteDomain , ) ; for ( let watcher in watchers ) { await xAppConnectionManager . setWatcherPermission ( watcher , remoteDomain , true , ) ; } } await updaterManager . transferOwnership ( governanceRouter . proxy . address ) ; await xAppConnectionManager . transferOwnership ( governanceRouter . proxy . address ) ; await upgradeBeaconController . transferOwnership ( governanceRouter . proxy . address , ) ; await home . proxyWithImplementation . transferOwnership ( governanceRouter . proxy . address , ) ; const contracts = { upgradeBeaconController , xAppConnectionManager , governanceRouter , updaterManager , home , replicaSetup , replicaProxies , } ; return contracts ; }
Deploy, initialize, and configure the entire
 suite of Optics contracts for a single chain
 specified by the config information
Deploy initialize and configure the entire suite of Optics contracts for a single chain specified by the config information
// Deploy UpgradeBeaconController // Note: initial owner will be the signer that's deploying // Deploy XAppConnectionManager // Note: initial owner will be the signer that's deploying // Deploy Home and setHome on XAppConnectionManager // Deploy GovernanceRouter // Note: initial governor will be the signer that's deploying // Deploy Replica Upgrade Setup // Deploy Replica Proxies and enroll in XAppConnectionManager // Enroll Replica Proxy on XAppConnectionManager // Add watcher permissions for Replica // Delegate permissions to governance router