1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

GITBOOK-339: Updated the contracts section

This commit is contained in:
Ana Loznianu 2023-05-29 14:53:54 +00:00 committed by gitbook-bot
parent d4fd85d7b6
commit 5f516de8f5
No known key found for this signature in database
GPG Key ID: 07D2180C7B12D0FF
11 changed files with 88 additions and 84 deletions

View File

@ -37,9 +37,10 @@
* [Access Control Tools](developers/datanft-and-datatoken/access-control-tools.md)
* [Revenue](developers/datanft-and-datatoken/revenue.md)
* [Fractional Ownership](developers/datanft-and-datatoken/fractional-ownership.md)
* [Roles](developers/roles.md)
* [Fees](developers/fees.md)
* [Asset Pricing](developers/asset-pricing.md)
* [Contracts](developers/contracts/README.md)
* [Roles](developers/contracts/roles.md)
* [Fees](developers/contracts/fees.md)
* [Asset Pricing](developers/contracts/asset-pricing.md)
* [Identifiers & Metadata](developers/Identifiers-Metadata.md)
* [DDO Specification](developers/ddo-specification.md)
* [Storage Specifications](developers/storage-specifications.md)
@ -49,8 +50,6 @@
* [Forking Ocean Market](developers/build-a-marketplace/forking-ocean-market.md)
* [Customising a Market](developers/build-a-marketplace/customising-your-market.md)
* [Deploying a Market](developers/build-a-marketplace/deploying-market.md)
* [Contracts](developers/contracts/README.md)
* [Page 1](developers/contracts/page-1.md)
* [Subgraph](developers/subgraph/README.md)
* [Get data NFTs](developers/using-ocean-subgraph/list-data-nfts.md)
* [Get data NFT information](developers/using-ocean-subgraph/get-data-nft-information.md)

View File

@ -18,7 +18,7 @@ Ocean Protocol was built for a world running on data and AI in mind. At the base
* Access control is one of the most important parts of data sharing. Ocean Protocol is a standard for managing access control across various storage providers. Publishers can add the credentials for accessing their data assets directly into the assets they list on Ocean. Publishers can also utilize a fine-grained allow list for whitelisting only specific wallets are able to purchase their assets. The fine-grained access control of Ocean Protocol makes it easier for data publishers to interact with each others assets across different storage providers while ensuring only those they want to share the data with can access it. They can also ensure only whitelisted algorithms from trusted parties are allowed to run any computation on their data. To learn more, check out our [fine-grained access control section.](../developers/Fine-Grained-Permissions.md)\
* Crypto-native Payments
* Utilizing Ocean Protocol contracts for payment processing brings numerous benefits compared to the traditional financial system. One major advantage is the significantly lower transaction fees, ranging from 0.1% to 0.2% per transaction, which can be a major reduction compared to the 2-6% typically associated with traditional financial systems. Another key benefit is the instant settlement feature nature of crypto. Payments are processed immediately, ensuring that funds are readily available for immediate use. This eliminates the usual wait of several days associated with traditional systems and avoids any additional charges that may arise from delayed settlements. This instant settlement also provides a zero counterparty risk environment. With the absence of chargebacks, businesses can enjoy greater stability in their revenue streams. This feature provides assurance and peace of mind, eliminating the concerns associated with potential payment reversals. Moreover, users can transact with each other with far greater ease across borders. Users can use any ERC20 token to transact, such as OCEAN or USDC. This provides a standard for selling products around the world. To learn more, check out our our [asset pricing](../developers/asset-pricing.md) and [contracts ](../developers/contracts/)sections.\
* Utilizing Ocean Protocol contracts for payment processing brings numerous benefits compared to the traditional financial system. One major advantage is the significantly lower transaction fees, ranging from 0.1% to 0.2% per transaction, which can be a major reduction compared to the 2-6% typically associated with traditional financial systems. Another key benefit is the instant settlement feature nature of crypto. Payments are processed immediately, ensuring that funds are readily available for immediate use. This eliminates the usual wait of several days associated with traditional systems and avoids any additional charges that may arise from delayed settlements. This instant settlement also provides a zero counterparty risk environment. With the absence of chargebacks, businesses can enjoy greater stability in their revenue streams. This feature provides assurance and peace of mind, eliminating the concerns associated with potential payment reversals. Moreover, users can transact with each other with far greater ease across borders. Users can use any ERC20 token to transact, such as OCEAN or USDC. This provides a standard for selling products around the world. To learn more, check out our our [asset pricing](../developers/contracts/asset-pricing.md) and [contracts ](../developers/contracts/)sections.\
* Provenance of data

View File

@ -7,7 +7,7 @@ description: Choose the revenue model during asset publishing
Ocean Protocol offers two types of pricing options for asset monetization. The publisher can choose a pricing model which best suits their needs while publishing an asset. The pricing model selected cannot be changed once the asset is published.
The price of an asset is determined by the number of Ocean tokens a buyer must pay to access the asset. When users pay the right amount of Ocean tokens, they get a _datatoken_ in their wallets, a tokenized representation of the access right stored on the blockchain. To read more about datatoken and data NFT click [here](datanft-and-datatoken/).
The price of an asset is determined by the number of Ocean tokens a buyer must pay to access the asset. When users pay the right amount of Ocean tokens, they get a _datatoken_ in their wallets, a tokenized representation of the access right stored on the blockchain. To read more about datatoken and data NFT click [here](../datanft-and-datatoken/).
### Fixed pricing
@ -17,7 +17,7 @@ A [FixedRateExchange](https://github.com/oceanprotocol/contracts/blob/v4main/con
The image below shows how to set the fixed pricing of an asset in the Ocean's Marketplace. Here, the price of the asset is set to 10 Ocean tokens.
![Fixed asset pricing](../.gitbook/assets/market/fixed-asset-pricing.png)
![Fixed asset pricing](../../.gitbook/assets/market/fixed-asset-pricing.png)
### Free pricing
@ -29,4 +29,4 @@ Free pricing is suitable for individuals and organizations working in the public
The image below shows how to set free access to an asset in the Ocean's Marketplace.
![Free asset pricing](../.gitbook/assets/market/free-asset-pricing.png)
![Free asset pricing](../../.gitbook/assets/market/free-asset-pricing.png)

View File

@ -1,2 +0,0 @@
# Page 1

View File

@ -0,0 +1,75 @@
---
title: Data NFTs and datatoken roles
description: >-
The permissions stored on chain in the contracts control the access to the
data NFT (ERC721) and datatoken (ERC20) smart contract functions.
---
# Roles
The permissions are stored in the data NFT (ERC721) smart contract. The data NFT (ERC721) and datatoken (ERC20) smart contracts both use this information to restrict access to the smart contract functions. The tables below list restricted actions that are accessible only to the allowed users.
### What Roles Can The Data NFT Owner Assign?
The data NFT is the base IP for the asset and all the datatokens are therefore linked to the data NFT smart contract — this has enabled us to do a bunch of cool new things around role administration. Weve introduced a host of useful roles which give you flexibility in how you manage your project. This can be a big help for enterprises and startups who are ready to scale up and introduce a level of administration.
```mermaid
```
#### NFT Owner
The NFT owner is the owner of the base-IP and is therefore at the highest level. The NFT owner can perform any action or assign any role but crucially, the NFT owner is the only one who can assign the manager role. Upon deployment or transfer of the data NFT, the NFT owner is automatically added as a manager. The NFT owner is also the only role that cant be assigned to multiple users — the only way to share this role is via multi-sig or a DAO.
#### Manager
The manager can assign or revoke three main roles (deployer, metadata updater, store updater). The manager is also able to interact with the ERC725 data.
#### ERC20 Deployer
The Deployer has a bunch of privileges at the ERC20 datatoken level. They can deploy new datatokens with fixed price exchange, or free pricing. They can also update the ERC725Y key-value store and assign roles the ERC20 level.
#### Metadata Updater
There is also a specific role for updating the metadata. The Metadata updater has the ability to update the information about the data asset (title, description, sample data etc) that is displayed to the user on the asset detail page within the market.
#### Store Updater
The store updater can store, remove or update any arbitrary key value using the ERC725Y implementation (at the ERC721 level). The use case for this role depends a lot on what data is being stored in the ERC725Y key-value pair — as mentioned above, this is highly flexible.
#### Minter
The Minter has the ability to mint new datatokens, provided the limit has not been exceeded. In most cases, this role will not be used as the alternative is for the datatokens to be minted by the side-staking bot which has many advantages. We highly recommend taking a read of this article if youre interested in learning more about safer staking and one-sided staking.
#### Fee Manager
Finally, we also have a fee manager which has the ability to set a new fee collector — this is the account that will receive the datatokens when a data asset is consumed. If no fee collector account has been set, the datatokens will be sent by default to the NFT Owner. The applicable fees (market and community fees) are automatically deducted from the datatokens that are received.
### Roles in data NFT (ERC721) smart contract
| Action ↓ / Role → | NFT Owner | Manager | ERC20 Deployer | Store Updater | Metadata Updater |
| --------------------------------- | --------- | ------- | -------------- | ------------- | ---------------- |
| Set token URI | | | | | |
| Add manager | **✓** | | | | |
| Remove manager | **✓** | | | | |
| Clean permissions | **✓** | | | | |
| Set base URI | **✓** | | | | |
| Set Metadata state | | | | | **✓** |
| Set Metadata | | | | | **✓** |
| Create new datatoken | | | **✓** | | |
| Executes any other smart contract | | **✓** | | | |
| Set new key-value in store | | | | **✓** | |
### Roles in datatoken (ERC20) smart contract
| Action ↓ / Role → | ERC20 Deployer | Minter | NFT owner | Fee manager |
| -------------------------- | -------------- | ------ | --------- | ----------- |
| Create Fixed Rate exchange | **✓** | | | |
| Create Dispenser | **✓** | | | |
| Add minter | **✓** | | | |
| Remove minter | **✓** | | | |
| Add fee manager | **✓** | | | |
| Remove fee manager | **✓** | | | |
| Set data | **✓** | | | |
| Clean permissions | | | **✓** | |
| Mint | | **✓** | | |
| Set fee collector | | | | **✓** |

View File

@ -33,7 +33,7 @@ Once someone has generated datatokens, they can be used in any ERC20 exchange, c
The marketplaces are decentralized (no single owner or controller), and non-custodial (only the data owner holds the keys for the datatokens).
Ocean Market supports fixed pricing or free pricing. For more detials on pricing schema refer [this guide](../asset-pricing.md).
Ocean Market supports fixed pricing or free pricing. For more detials on pricing schema refer [this guide](../contracts/asset-pricing.md).
Complementary to Ocean Market, Ocean has reference code to ease building **third-party data marketplaces**, such as for logistics ([dexFreight data marketplace](https://blog.oceanprotocol.com/dexfreight-ocean-protocol-partner-to-enable-transportation-logistics-companies-to-monetize-data-7aa839195ac)) or mobility ([Daimler](https://blog.oceanprotocol.com/ocean-protocol-delivers-proof-of-concept-for-daimler-ag-in-collaboration-with-daimler-south-east-564aa7d959ca)).

View File

@ -1,6 +1,6 @@
# Publish
This tutorial guides you through the process of creating your own data NFT and a datatoken using Ocean libraries. To know more about data NFTs and datatokens please refer [this page](../datanft-and-datatoken/). Ocean Protocol supports different pricing schemes which can be set while publishing an asset. Please refer [this page](../asset-pricing.md) for more details on pricing schemes.
This tutorial guides you through the process of creating your own data NFT and a datatoken using Ocean libraries. To know more about data NFTs and datatokens please refer [this page](../datanft-and-datatoken/). Ocean Protocol supports different pricing schemes which can be set while publishing an asset. Please refer [this page](../contracts/asset-pricing.md) for more details on pricing schemes.
#### Prerequisites

View File

@ -1,68 +0,0 @@
---
title: Data NFTs and datatoken roles
description: The permissions stored on chain in the contracts control the access to the data NFT (ERC721) and datatoken (ERC20) smart contract functions.
---
The permissions are stored in the data NFT (ERC721) smart contract. The data NFT (ERC721) and datatoken (ERC20) smart contracts both use this information to restrict access to the smart contract functions. The tables below list restricted actions that are accessible only to the allowed users.
## What Roles Can The Data NFT Owner Assign?
The data NFT is the base IP for the asset and all the datatokens are therefore linked to the data NFT smart contract — this has enabled us to do a bunch of cool new things around role administration. Weve introduced a host of useful roles which give you flexibility in how you manage your project. This can be a big help for enterprises and startups who are ready to scale up and introduce a level of administration.
### NFT Owner
The NFT owner is the owner of the base-IP and is therefore at the highest level. The NFT owner can perform any action or assign any role but crucially, the NFT owner is the only one who can assign the manager role. Upon deployment or transfer of the data NFT, the NFT owner is automatically added as a manager. The NFT owner is also the only role that cant be assigned to multiple users — the only way to share this role is via multi-sig or a DAO.
### Manager
The manager can assign or revoke three main roles (deployer, metadata updater, store updater). The manager is also able to interact with the ERC725 data.
### ERC20 Deployer
The Deployer has a bunch of privileges at the ERC20 datatoken level. They can deploy new datatokens with fixed price exchange, or free pricing. They can also update the ERC725Y key-value store and assign roles the ERC20 level.
### Metadata Updater
There is also a specific role for updating the metadata. The Metadata updater has the ability to update the information about the data asset (title, description, sample data etc) that is displayed to the user on the asset detail page within the market.
### Store Updater
The store updater can store, remove or update any arbitrary key value using the ERC725Y implementation (at the ERC721 level). The use case for this role depends a lot on what data is being stored in the ERC725Y key-value pair — as mentioned above, this is highly flexible.
### Minter
The Minter has the ability to mint new datatokens, provided the limit has not been exceeded. In most cases, this role will not be used as the alternative is for the datatokens to be minted by the side-staking bot which has many advantages. We highly recommend taking a read of this article if youre interested in learning more about safer staking and one-sided staking.
### Fee Manager
Finally, we also have a fee manager which has the ability to set a new fee collector — this is the account that will receive the datatokens when a data asset is consumed. If no fee collector account has been set, the datatokens will be sent by default to the NFT Owner. The applicable fees (market and community fees) are automatically deducted from the datatokens that are received.
## Roles in data NFT (ERC721) smart contract
| Action ↓ / Role → | NFT Owner | Manager | ERC20 Deployer | Store Updater | Metadata Updater |
| --------------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
| Set token URI | | | | | |
| Add manager | <center>**✓**</center> | | | | |
| Remove manager | <center>**✓**</center> | | | | |
| Clean permissions | <center>**✓**</center> | | | | |
| Set base URI | <center>**✓**</center> | | | | |
| Set Metadata state | | | | | <center>**✓**</center> |
| Set Metadata | | | | | <center>**✓**</center> |
| Create new datatoken | | | <center>**✓**</center> | | |
| Executes any other smart contract | | <center>**✓**</center> | | | |
| Set new key-value in store | | | | <center>**✓**</center> | |
## Roles in datatoken (ERC20) smart contract
| Action &darr; / Role &rarr; | ERC20 Deployer | Minter | NFT owner | Fee manager |
| --------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
| Create Fixed Rate exchange | <center>**✓**</center> | | | |
| Create Dispenser | <center>**✓**</center> | | | |
| Add minter | <center>**✓**</center> | | | |
| Remove minter | <center>**✓**</center> | | | |
| Add fee manager | <center>**✓**</center> | | | |
| Remove fee manager | <center>**✓**</center> | | | |
| Set data | <center>**✓**</center> | | | |
| Clean permissions | | | <center>**✓**</center> | |
| Mint | | <center>**✓**</center> | | |
| Set fee collector | | | | <center>**✓**</center> |

View File

@ -4,7 +4,7 @@ description: 'Discover the World of NFTs: Retrieving a List of Fixed-rate exchan
# Get fixed-rate exchanges
Having gained knowledge about fetching lists of data NFTs and datatokens and extracting specific information about each, let's now explore the process of retrieving the information of fixed-rate exchanges. A fixed-rate exchange refers to a mechanism where data assets can be traded at a predetermined rate or price. These exchanges offer stability and predictability in data transactions, enabling users to securely and reliably exchange data assets based on fixed rates. If you need a refresher on fixed-rate exchanges, visit the [asset pricing](../asset-pricing.md#fixed-pricing) page.
Having gained knowledge about fetching lists of data NFTs and datatokens and extracting specific information about each, let's now explore the process of retrieving the information of fixed-rate exchanges. A fixed-rate exchange refers to a mechanism where data assets can be traded at a predetermined rate or price. These exchanges offer stability and predictability in data transactions, enabling users to securely and reliably exchange data assets based on fixed rates. If you need a refresher on fixed-rate exchanges, visit the [asset pricing](../contracts/asset-pricing.md#fixed-pricing) page.

View File

@ -95,9 +95,9 @@ With the _fixed pricing_ schema, the publisher sets the price that buyers will p
With the _free pricing_ schema, the publisher provides an asset that is free to be downloaded by anyone.
For more information on the pricing models, please refer this [document](../developers/asset-pricing.md).
For more information on the pricing models, please refer this [document](../developers/contracts/asset-pricing.md).
For a deep dive into the fee structure, please refer to this [document](../developers/fees.md).
For a deep dive into the fee structure, please refer to this [document](../developers/contracts/fees.md).
![Asset pricing](../.gitbook/assets/market/publish-3.png)