code: def setup_contracts_or_exit(
          config: Dict[str, Any],
          network_id: int,
  ) -> Dict[str, Any]:
      
      environment_type = config['environment_type']
  
      not_allowed = (  # for now we only disallow mainnet with test configuration
          network_id == 1 and
          environment_type == Environment.DEVELOPMENT
      )
      if not_allowed:
          click.secho(
              f'The chosen network ({ID_TO_NETWORKNAME[network_id]}) is not a testnet, '
              f'but the "development" environment was selected.\n'
              f'This is not allowed. Please start again with a safe environment setting '
              f'(--environment production).',
              fg='red',
          )
          sys.exit(1)
  
      contracts = dict()
      contracts_version = environment_type_to_contracts_version(environment_type)
  
      config['contracts_path'] = contracts_precompiled_path(contracts_version)
  
      if network_id in ID_TO_NETWORKNAME and ID_TO_NETWORKNAME[network_id] != 'smoketest':
          try:
              deployment_data = get_contracts_deployment_info(
                  chain_id=network_id,
                  version=contracts_version,
              )
          except ValueError:
              return contracts, False
  
          contracts = deployment_data['contracts']
  
      return contracts
docs: Sets the contract deployment data depending on the network id and environment type
  
      If an invalid combination of network id and environment type is provided, exits
      the program with an error