Repository: oceanprotocol/ocean.py (language: python)

Issue:
Deprecate datatoken-enterprise.md README
Motivations:
- no one seems to care about it: we haven't linked to it from the main README.md, yet no one ever asks for it
- the README itself has poor UX: super-long, lots of boilerplate, and has the user jumping to 5 other READMEs.
- We could refactor it to be good, but it would take quite a lot of effort. Is it worth the effort? (see bullet 1)
- runtime for the README is 2.5 min. So removing it would speed all our runs

Discussion:
- Trent to Calina: (shared the above, then) thoughts?
- Calina: I would add a one-liner in the normal readme. Ref. Using the template index
- Trent: ok. Great. I'll create an issue.


Discussion / hints:

Fix patch:
diff --git a/READMEs/data-nfts-and-datatokens-flow.md b/READMEs/data-nfts-and-datatokens-flow.md
index d1644c746..418e4ce17 100644
--- a/READMEs/data-nfts-and-datatokens-flow.md
+++ b/READMEs/data-nfts-and-datatokens-flow.md
@@ -57,6 +57,9 @@ Congrats, you've created your first Ocean data NFT!
 
 ### 2.2 🎉 Create a datatoken from the data NFT
 
+By default, the template index is 1 *(regular datatoken), but use the template_index function
+argument to control that (e.g. template_index=2 for an Enterprise Datatoken).
+
 In the same Python console:
 ```python
 # Create datatoken related to the above NFT.
diff --git a/READMEs/datatoken-enterprise.md b/READMEs/datatoken-enterprise.md
deleted file mode 100644
index 1de3e17cd..000000000
--- a/READMEs/datatoken-enterprise.md
+++ /dev/null
@@ -1,246 +0,0 @@
-<!--
-Copyright 2022 Ocean Protocol Foundation
-SPDX-License-Identifier: Apache-2.0
--->
-
-# Quickstart: Using Datatoken Enterprise
-
-This quickstart describes a batteries-included flow including using a new template of ERC20,
-called Datatoken Enterprise.
-
-For dispenser & FRE, it is used as base token, OCEAN token.
-The base token can be changed into something else, such as USDC, DAI etc., but
-it will require an extra fee.
-
-It focuses on Alice's experience as a publisher, and Bob's experience as a buyer & consumer.
-
-Here are the steps:
-
-1. Setup
-2. Alice creates a NFT
-3. Dispenser flow
-4. Fixed Rate Exchange flow
-
-Let's go through each step.
-
-## 1. Setup
-
-### First steps
-
-To get started with this guide, please refer to [installation-flow](install.md) and complete the following steps :
-- [x] Setup : Prerequisites
-- [x] Setup : Download barge and run services
-- [x] Setup : Install the library
-- [x] Setup : Set envvars
-
-
-## 2. Alice creates a NFT
-In your project folder (i.e. my_project from `Install the library` step) and in the work console where you set envvars, run the following:
-
-Please refer to [data-nfts-and-datatokens-flow](data-nfts-and-datatokens-flow.md) and complete the following steps :
-- [x] 2.1 Create a data NFT
-
-## 3. Dispenser Flow
-
-In the Python console:
-```python
-from ocean_lib.web3_internal.constants import ZERO_ADDRESS
-from web3.main import Web3
-
-datatoken_enterprise_token = data_nft.create_datatoken(
-    name="DT1Name",  # name for datatoken
-    symbol="DT1Symbol",  # symbol for datatoken
-    template_index=2,  # this is the value for Datatoken Enterprise token
-    from_wallet=alice_wallet,
-    datatoken_cap=Web3.toWei(50, "ether")
-)
-print(f"Datatoken Enterprise address: {datatoken_enterprise_token.address}")
-
-```
-Then, please refer to [publish-flow](publish-flow.md) to generate your metadata and encrypted files.
-Asset creation will be based on the deployment of Datatoken Enterprise token like this:
-
-```python
-ddo = ocean.assets.create(
-    metadata,
-    alice_wallet,
-    [url_file],
-    deployed_datatokens=[datatoken_enterprise_token]
-)
-access_service = ddo.services[0]
-
-# Create & activate dispenser
-dispenser = ocean.dispenser
-tx = datatoken_enterprise_token.createDispenser(
-    dispenser.address,
-    Web3.toWei(50, "ether"),
-    Web3.toWei(50, "ether"),
-    True,
-    ZERO_ADDRESS,
-    {"from": alice_wallet},
-)
-assert tx, "Dispenser not created!"
-
-OCEAN_token = ocean.OCEAN_token
-consume_fee_amount = Web3.toWei(2, "ether")
-datatoken_enterprise_token.setPublishingMarketFee(
-    bob_wallet.address,
-    OCEAN_token.address,  # can be also USDC, DAI
-    consume_fee_amount,
-    {"from": alice_wallet},
-)
-
-# Approve tokens
-OCEAN_token.approve(
-    datatoken_enterprise_token.address,
-    consume_fee_amount,
-    {"from": alice_wallet},
-)
-
-# Prepare data for order
-# Retrieve provider fee
-(
-    provider_fee_address,
-    provider_fee_token,
-    provider_fee_amount,
-    v,
-    r,
-    s,
-    valid_until,
-    provider_data,
-) = ocean.retrieve_provider_fees(
-    asset=ddo,
-    access_service=access_service,
-    publisher_wallet=alice_wallet
-)
-
-
-initial_bob_balance = OCEAN_token.balanceOf(bob_wallet.address)
-
-# Bob gets 1 DT from dispenser and then startsOrder, while burning that DT
-datatoken_enterprise_token.buy_from_dispenser_and_order(
-    consumer=bob_wallet.address,
-    service_index=1,
-    provider_fee_address=provider_fee_address,
-    provider_fee_token=provider_fee_token,
-    provider_fee_amount=provider_fee_amount,
-    v=v,
-    r=r,
-    s=s,
-    valid_until=valid_until,
-    provider_data=provider_data,
-    consume_market_order_fee_address=bob_wallet.address,
-    consume_market_order_fee_token=datatoken_enterprise_token.address,
-    consume_market_order_fee_amount=0,
-    dispenser_address=dispenser.address,
-    transaction_parameters={"from": alice_wallet},
-)
-increased_balance = OCEAN_token.balanceOf(bob_wallet.address)
-assert initial_bob_balance < increased_balance
-```
-
-## 3. Fixed Rate Exchange Flow
-
-In the Python console:
-```python
-from ocean_lib.web3_internal.constants import ZERO_ADDRESS
-
-datatoken_enterprise_token = data_nft.create_datatoken(
-    name="DT1Name",  # name for datatoken
-    symbol="DT1Symbol",  # symbol for datatoken
-    template_index=2,  # this is the value for Datatoken Enterprise token
-    from_wallet=alice_wallet,
-    datatoken_cap=Web3.toWei(50, "ether")
-)
-print(f"Datatoken Enterprise address: {datatoken_enterprise_token.address}")
-
-```
-Then, please refer to [publish-flow](publish-flow.md) to generate your metadata and encrypted files.
-Asset creation will be based on the deployment of Datatoken Enterprise token like this:
-
-```python
-ddo = ocean.assets.create(
-    metadata,
-    alice_wallet,
-    [url_file],
-    deployed_datatokens=[datatoken_enterprise_token]
-)
-access_service = ddo.services[0]
-
-# Bob buys 1 DT from the FRE and then startsOrder, while burning that DT
-fixed_rate_exchange = ocean.fixed_rate_exchange
-OCEAN_token = ocean.OCEAN_token
-
-exchange_id = ocean.create_fixed_rate(
-    datatoken=datatoken_enterprise_token,
-    base_token=OCEAN_token,
-    amount=Web3.toWei(25, "ether"),
-    fixed_rate=Web3.toWei(1, "ether"),
-    from_wallet=alice_wallet,
-)
-
-# Prepare data for order
-# Retrieve provider fee
-(
-    provider_fee_address,
-    provider_fee_token,
-    provider_fee_amount,
-    v,
-    r,
-    s,
-    valid_until,
-    provider_data,
-) = ocean.retrieve_provider_fees(
-    asset=ddo,
-    access_service=access_service,
-    publisher_wallet=alice_wallet
-)
-
-datatoken_enterprise_token.mint(alice_wallet.address, Web3.toWei(20, "ether"), {"from": alice_wallet})
-
-# Approve tokens
-from web3.main import Web3
-OCEAN_token.approve(
-    datatoken_enterprise_token.address,
-    Web3.toWei(1000, "ether"),
-    {"from": alice_wallet},
-)
-# Approve consume market fee tokens before starting order.
-datatoken_enterprise_token.approve(
-    datatoken_enterprise_token.address,
-    Web3.toWei(1000, "ether"),
-    {"from": alice_wallet}
-)
-
-# Transfer some Datatoken Enterprise tokens to Bob for buying from the FRE
-datatoken_enterprise_token.transfer(bob_wallet.address, Web3.toWei(15, "ether"), {"from": alice_wallet})
-OCEAN_token.approve(
-    datatoken_enterprise_token.address,
-    Web3.toWei(1000, "ether"),
-    {"from": bob_wallet},
-)
-
-tx_receipt = datatoken_enterprise_token.buy_from_fre_and_order(
-    consumer=bob_wallet.address,
-    service_index=1,
-    provider_fee_address=provider_fee_address,
-    provider_fee_token=provider_fee_token,
-    provider_fee_amount=provider_fee_amount,
-    v=v,
-    r=r,
-    s=s,
-    valid_until=valid_until,
-    provider_data=provider_data,
-    consume_market_order_fee_address=bob_wallet.address,
-    consume_market_order_fee_token=datatoken_enterprise_token.address,
-    consume_market_order_fee_amount=0,
-    exchange_contract=fixed_rate_exchange.address,
-    exchange_id=exchange_id,
-    max_base_token_amount=Web3.toWei(10, "ether"),
-    consume_market_swap_fee_amount=Web3.toWei("0.001", "ether"),  # 1e15 => 0.1%
-    consume_market_swap_fee_address=bob_wallet.address,
-    transaction_parameters={"from": alice_wallet},
-)
-
-assert tx_receipt.status == 1, "failed buying data tokens from FRE."
-```


Test patch:
diff --git a/tests/readmes/test_readmes.py b/tests/readmes/test_readmes.py
index 943faef71..c6bf69afd 100644
--- a/tests/readmes/test_readmes.py
+++ b/tests/readmes/test_readmes.py
@@ -7,7 +7,6 @@
 
 import pytest
 
-
 # This file tests READMEs on local chain (ganache).
 # For tests of READMEs on remote chains, see tests/integration/remote/
 
@@ -45,7 +44,6 @@ def test_script_execution(script, monkeypatch):
     runs_with_prerequisites = [
         "c2d-flow",
         "dispenser-flow",
-        "datatoken-enterprise",
         "marketplace-flow",
         "key-value-flow",
         "profile-nfts-flow",
@@ -76,7 +74,6 @@ def test_script_execution(script, monkeypatch):
 
     runs_with_publish = [
         "consume-flow",
-        "datatoken-enterprise",
     ]
     for item in runs_with_publish:
         if item in script.name: