Skip to content

Commit 7f67cc4

Browse files
authored
Merge pull request #833 from oceanprotocol/feature/document_templates
document templates
2 parents 795ffa8 + bef3b5f commit 7f67cc4

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,11 @@ from artifacts import address
5757

5858
- Base IP is now represented by an [NFT](https://blog.oceanprotocol.com/what-is-a-data-nft-5804a2d88671), from which a datapublisher can create multiple ERC20s representing different type of access for the same dataset.
5959

60-
- An automated Datatoken [Staking](https://blog.oceanprotocol.com/ocean-v4-one-sided-staking-93988f65e378) helps with the initial DTs distribution and price stability. Goodbye rug pulls!
61-
6260
- Help [Ocean Community Monetize](https://blog.oceanprotocol.com/how-to-make-money-from-ocean-v4-477b3decad51): there's a swap fee for the Ocean Community, if Ocean or allied tokens are the basetoken in a pool, Ocean Community will receive 0.1% swap fee, otherwhise it will be 0.2%.
6361

6462
#### Flexibility
6563

64+
- Based on ERC721 and ERC20 [templates](contracts/templates/README.md) to provide different features
6665
- Introduce an advanced [Fee Structure](https://docs.oceanprotocol.com/core-concepts/fees) both for Market and Provider runners.
6766

6867
- Roles Administration: there are now multiple roles for a more flexible administation both at NFT and ERC20 levels

contracts/templates/README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Ocean-contracts v1.x (Ocean V4 “Onda”) is built on top of templates, in order to accomodate severals scenarios which are mutually exclusive
2+
3+
4+
# ERC721 Templates
5+
Only [ERC721Template](ERC721Template.sol) is defined, and has the following specs:
6+
- adhers to standard ERC721 implementation, but allows only one tokenId (==1). Any operation involving tokenId>1 will revert
7+
- has functions to deal with metadata (DDO)
8+
- has roles
9+
- allows creation of datatokens (caller chooses the datatoken template)
10+
11+
# ERC20 Templates
12+
13+
For now, three templates are defined:
14+
- [ERC20Template](#ERC20Template)
15+
- [ERC20TemplateEnterprise](#ERC20TemplateEnterprise)
16+
- [ERC20Template3](#ERC20Template3)
17+
18+
### ERC20Template
19+
- follows the mental model of "get datatokens" then "pass them around" then "consume".
20+
- requires 2 tx to consume
21+
1. get tokens (buy, dispense, etc)
22+
2. call startOrder
23+
- has the following price schemas:
24+
- pools (deprecated)
25+
- fixed rate exchanges
26+
- dispensers
27+
28+
### ERC20TemplateEnterprise
29+
- follows the mental model of "do not have datatokens in circulation". Means that in a single tx, datatoken is minted, exchanged, used and burned.
30+
- requires 1 tx to consume: (buyFromFreAndOrder / buyFromDispenserAndOrder)
31+
- does not allow self custody of datatokens (means that nobody can get tokens from dispensers or fixed rate exchangers)
32+
- has the following price schemas:
33+
- fixed rate exchanges
34+
- dispensers
35+
36+
### ERC20Template3 (Predictoor)
37+
- designed to work only on Oasis Sapphire, due to privacy features
38+
- requires 1 tx to consume: buyFromFreAndOrder
39+
- does not allow self custody of datatokens (means that nobody can buy a datatoken from fixed rate exchange)
40+
- has the following price schemas:
41+
- fixed rate exchanges
42+
43+
44+
The following table sums it up
45+
Template # | Label | Allows fre/dispense by default? | Allows custody of datatokens? | Combines txs? | Purpose
46+
:----: | :----: | :----: | :----: | :----:| :----:
47+
1 | ERC20Template | Y | Y | N | General
48+
2 | ERC20TemplateEnterprise | N | N | Y | General
49+
3 | ERC20Template3 | N | N | Y | Predictoor
50+

0 commit comments

Comments
 (0)