Skip to content

Commit

Permalink
document templates
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcos20 committed Oct 25, 2023
1 parent 795ffa8 commit 046ce00
Showing 2 changed files with 51 additions and 2 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -57,12 +57,11 @@ from artifacts import address

- 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.

- 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!

- 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%.

#### Flexibility

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

- Roles Administration: there are now multiple roles for a more flexible administation both at NFT and ERC20 levels
50 changes: 50 additions & 0 deletions contracts/templates/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Ocean v1.x is build on top of templates, in order to accomodate severals scenarios which are mutually exclusive


# ERC721 Templates
Only [ERC721Template](ERC721Template.sol) is defined, and has the following specs:
- adhers to standard ERC721 implementation, but allows only one tokenId (==1). Any operation involving tokenId>1 will revert
- has functions to deal with metadata (DDO)
- has roles
- allows creation of datatokens (caller chooses the datatoken template)

# ERC20 Templates

For now, three templates are defined:
- [ERC20Template](#ERC20Template)
- [ERC20TemplateEnterprise](#ERC20TemplateEnterprise)
- [ERC20Template3](#ERC20Template3)

### ERC20Template
- follows the mental model of "get datatokens" then "pass them around" then "consume".
- requires 2 tx to consume
1. get tokens (buy, dispense, etc)
2. call startOrder
- has the following price schemas:
- pools (deprecated)
- fixed rate exchanges
- dispensers

### ERC20TemplateEnterprise
- follows the mental model of "do not have datatokens in circulation". Means that in a single tx, datatoken is minted, exchanged, used and burned.
- requires 1 tx to consume: (buyFromFreAndOrder / buyFromDispenserAndOrder)
- does not allow self custody of datatokens (means that nobody can get tokens from dispensers or fixed rate exchangers)
- has the following price schemas:
- fixed rate exchanges
- dispensers

### ERC20Template3 (Predictoor)
- designed to work only on Oasis Sapphire, due to privacy features
- requires 1 tx to consume: buyFromFreAndOrder
- does not allow self custody of datatokens (means that nobody can buy a datatoken from fixed rate exchange)
- has the following price schemas:
- fixed rate exchanges

The following table sums it up
Template # | Label | Allows fre/dispense by default? | Allows custody of datatokens? | Combines txs? | Purpose
:----: | :----: | :----: | :----: | :----:| :----:
1 | ERC20Template | Y | Y | N | General
2 | ERC20TemplateEnterprise | N | N | Y | General
3 | ERC20Template3 | N | N | Y | Predictoor

0 comments on commit 046ce00

Please sign in to comment.