ocean-contracts


Nameocean-contracts JSON
Version 2.0.4 PyPI version JSON
download
home_pagehttps://github.com/oceanprotocol/contracts
Summary🐳 Ocean Protocol L1 - v4
upload_time2024-03-15 20:50:22
maintainer
docs_urlNone
authorleucothia
requires_python>=3.6
license
keywords ocean-contracts
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![banner](https://raw.githubusercontent.com/oceanprotocol/art/master/github/repo-banner%402x.png)](https://oceanprotocol.com)

<h1 align="center">contracts-v4</h1>

> 🦑 Smart contracts for Ocean Protocol v4. https://oceanprotocol.com
> Ocean v4 is part of the [Ocean Protocol](https://oceanprotocol.com) toolset.

This is in beta state and you can expect running into problems. If you run into them, please open up a [new issue](https://github.com/oceanprotocol/contracts/issues/new?assignees=&labels=bug&template=bug_report.md&title=).

- [📚 Installation](#-installation)
- [🏄 Quickstart](#-quickstart)
  - [Features](#features)
  - [Publisher Flow](#publisher-flow)
  - [Roles Diagram](#roles-diagram)
  - [Functions you will need](#functions-you-will-need)
  - [Bundle functions](#bundle-functions)
- [🦑 Development and testing](#-development-and-testing)
- [🏛 License](#-license)

## 📚 Installation

For quick installation of the contract `ABIs`:

### Javascript/Typescript

```bash
npm install @oceanprotocol/contracts
```

### Python

```bash
pip3 install ocean-contracts
```

#### ⚙️ Usage

By default, Python does not support importing `json` files directly, so it is recommended to use `json-sempai` package in order to automatically importing `ABIs/json` artifacts.

```
pip3 install json-sempai
# install the ocean-contracts package.
```

```python
from jsonsempai import magic
from artifacts import address
```

## Overview

![image](docs/images/smart-contracts.png)

## 🏄 Quickstart

### Features

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

- 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

- Key-value store in the NFT contract : NFT contract can be used to store custom key-value pairs (ERC725Y standard)

- Multiple NFT template support: the Factory can deploy different types of NFT templates

- Multiple datatoken template support: the Factory can deploy different types of Datatoken templates

### Publisher Flow

Interaction flow from DataPublisher point of view.

[Go to publisher flow](docs/quickstart_pubFlow.md)

### Roles Diagram

How roles are handled in the v4.

[Go to roles diagram](docs/quickstart_roles.md)

### Functions you will need

Selection of most common functions.

[Go to functions](docs/quickstart_functions.md)

### Bundle functions

Helper functions which can perform multiple steps in 1 call.

[Go to helpers](docs/quickstart_bundle.md)

If you have any difficulties with the quickstarts, or if you have further questions about how to use the contracts please reach out to us on [Discord](https://discord.gg/TnXjkR5).

If you notice any bugs or issues with this repo please [open an issue on github](https://github.com/oceanprotocol/contracts/issues/new?assignees=&labels=bug&template=bug_report.md&title=). -->

The [ocean.js](https://github.com/oceanprotocol/ocean.js) and [ocean.py](https://github.com/oceanprotocol/ocean.py) libraries wrap `contracts` in JavaScript and Python respectively. They each have quickstart guides.

## 🦑 Development and Testing

Run hardhat in a new terminal:

```bash
export ALCHEMY_URL="https://eth-mainnet.alchemyapi.io/v2/XXXXXXXX"
npm install
npx hardhat node
```

Open a new terminal to run the tests:

```bash
export ALCHEMY_URL="https://eth-mainnet.alchemyapi.io/v2/XXXXXXXX"

npm run test:full
# same thing, but with coverage reporting
npm run test:full:cover
```

### Unit Tests

You can execute just unit tests with:

```bash
npm run test:unit

```

### Flow Tests

You can execute just flow tests with:

```bash
npm run test:flow

```

## 🏛 License

```
Copyright ((C)) 2023 Ocean Protocol Foundation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/oceanprotocol/contracts",
    "name": "ocean-contracts",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "ocean-contracts",
    "author": "leucothia",
    "author_email": "devops@oceanprotocol.com",
    "download_url": "https://files.pythonhosted.org/packages/35/04/348a4aab56c1b4cad6ee4c26f5a5a8bd14858aea1d6887f8fa878cfff058/ocean-contracts-2.0.4.tar.gz",
    "platform": null,
    "description": "[![banner](https://raw.githubusercontent.com/oceanprotocol/art/master/github/repo-banner%402x.png)](https://oceanprotocol.com)\n\n<h1 align=\"center\">contracts-v4</h1>\n\n> \ud83e\udd91 Smart contracts for Ocean Protocol v4. https://oceanprotocol.com\n> Ocean v4 is part of the [Ocean Protocol](https://oceanprotocol.com) toolset.\n\nThis is in beta state and you can expect running into problems. If you run into them, please open up a [new issue](https://github.com/oceanprotocol/contracts/issues/new?assignees=&labels=bug&template=bug_report.md&title=).\n\n- [\ud83d\udcda Installation](#-installation)\n- [\ud83c\udfc4 Quickstart](#-quickstart)\n  - [Features](#features)\n  - [Publisher Flow](#publisher-flow)\n  - [Roles Diagram](#roles-diagram)\n  - [Functions you will need](#functions-you-will-need)\n  - [Bundle functions](#bundle-functions)\n- [\ud83e\udd91 Development and testing](#-development-and-testing)\n- [\ud83c\udfdb License](#-license)\n\n## \ud83d\udcda Installation\n\nFor quick installation of the contract `ABIs`:\n\n### Javascript/Typescript\n\n```bash\nnpm install @oceanprotocol/contracts\n```\n\n### Python\n\n```bash\npip3 install ocean-contracts\n```\n\n#### \u2699\ufe0f Usage\n\nBy default, Python does not support importing `json` files directly, so it is recommended to use `json-sempai` package in order to automatically importing `ABIs/json` artifacts.\n\n```\npip3 install json-sempai\n# install the ocean-contracts package.\n```\n\n```python\nfrom jsonsempai import magic\nfrom artifacts import address\n```\n\n## Overview\n\n![image](docs/images/smart-contracts.png)\n\n## \ud83c\udfc4 Quickstart\n\n### Features\n\n- 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.\n\n- 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%.\n\n#### Flexibility\n\n- Based on ERC721 and ERC20 [templates](contracts/templates/README.md) to provide different features\n- Introduce an advanced [Fee Structure](https://docs.oceanprotocol.com/core-concepts/fees) both for Market and Provider runners.\n\n- Roles Administration: there are now multiple roles for a more flexible administation both at NFT and ERC20 levels\n\n- Key-value store in the NFT contract : NFT contract can be used to store custom key-value pairs (ERC725Y standard)\n\n- Multiple NFT template support: the Factory can deploy different types of NFT templates\n\n- Multiple datatoken template support: the Factory can deploy different types of Datatoken templates\n\n### Publisher Flow\n\nInteraction flow from DataPublisher point of view.\n\n[Go to publisher flow](docs/quickstart_pubFlow.md)\n\n### Roles Diagram\n\nHow roles are handled in the v4.\n\n[Go to roles diagram](docs/quickstart_roles.md)\n\n### Functions you will need\n\nSelection of most common functions.\n\n[Go to functions](docs/quickstart_functions.md)\n\n### Bundle functions\n\nHelper functions which can perform multiple steps in 1 call.\n\n[Go to helpers](docs/quickstart_bundle.md)\n\nIf you have any difficulties with the quickstarts, or if you have further questions about how to use the contracts please reach out to us on [Discord](https://discord.gg/TnXjkR5).\n\nIf you notice any bugs or issues with this repo please [open an issue on github](https://github.com/oceanprotocol/contracts/issues/new?assignees=&labels=bug&template=bug_report.md&title=). -->\n\nThe [ocean.js](https://github.com/oceanprotocol/ocean.js) and [ocean.py](https://github.com/oceanprotocol/ocean.py) libraries wrap `contracts` in JavaScript and Python respectively. They each have quickstart guides.\n\n## \ud83e\udd91 Development and Testing\n\nRun hardhat in a new terminal:\n\n```bash\nexport ALCHEMY_URL=\"https://eth-mainnet.alchemyapi.io/v2/XXXXXXXX\"\nnpm install\nnpx hardhat node\n```\n\nOpen a new terminal to run the tests:\n\n```bash\nexport ALCHEMY_URL=\"https://eth-mainnet.alchemyapi.io/v2/XXXXXXXX\"\n\nnpm run test:full\n# same thing, but with coverage reporting\nnpm run test:full:cover\n```\n\n### Unit Tests\n\nYou can execute just unit tests with:\n\n```bash\nnpm run test:unit\n\n```\n\n### Flow Tests\n\nYou can execute just flow tests with:\n\n```bash\nnpm run test:flow\n\n```\n\n## \ud83c\udfdb License\n\n```\nCopyright ((C)) 2023 Ocean Protocol Foundation\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "\ud83d\udc33 Ocean Protocol L1 - v4",
    "version": "2.0.4",
    "project_urls": {
        "Bug Tracker": "https://github.com/oceanprotocol/contracts/issues",
        "Homepage": "https://github.com/oceanprotocol/contracts"
    },
    "split_keywords": [
        "ocean-contracts"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d8d7bee809c8a6bad42b9583e5f5c2f9ee04cc33fb8b6bc353ac0963812693ff",
                "md5": "11aed0809191d1ef68dc8dd347ca6e96",
                "sha256": "1c1d7ceeda5ebd9f2d3c56cb30db0d8403a8fc5201b56714c8c2c7fa8d72a3f7"
            },
            "downloads": -1,
            "filename": "ocean_contracts-2.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "11aed0809191d1ef68dc8dd347ca6e96",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 320167,
            "upload_time": "2024-03-15T20:50:19",
            "upload_time_iso_8601": "2024-03-15T20:50:19.628567Z",
            "url": "https://files.pythonhosted.org/packages/d8/d7/bee809c8a6bad42b9583e5f5c2f9ee04cc33fb8b6bc353ac0963812693ff/ocean_contracts-2.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3504348a4aab56c1b4cad6ee4c26f5a5a8bd14858aea1d6887f8fa878cfff058",
                "md5": "52f53298bc013be4b051a56d7c005f99",
                "sha256": "193018681cb06e9bb10107374c9f2fc9c118150f4bdb32bb8cc1bfed618ba8a3"
            },
            "downloads": -1,
            "filename": "ocean-contracts-2.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "52f53298bc013be4b051a56d7c005f99",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 281141,
            "upload_time": "2024-03-15T20:50:22",
            "upload_time_iso_8601": "2024-03-15T20:50:22.445948Z",
            "url": "https://files.pythonhosted.org/packages/35/04/348a4aab56c1b4cad6ee4c26f5a5a8bd14858aea1d6887f8fa878cfff058/ocean-contracts-2.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-15 20:50:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "oceanprotocol",
    "github_project": "contracts",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ocean-contracts"
}
        
Elapsed time: 0.20985s