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