Skip to main content

🐳 Integration of TCRs, CPM and Ocean Tokens in Solidity

Project description

banner

Nevermined Smart Contracts

💧 Nevermined implementation of Ocean Protocol in Solidity keyko.io

Docker Build Status Build NPM Package Pypi Package Maven Package

Table of Contents


Get Started

For local development of nevermined-contracts you can either use Docker, or setup the development environment on your machine.

Docker

The simplest way to get started with is using the Nevermined Tools, a docker compose application to run all the Nevermined stack.

Local development

As a pre-requisite, you need:

  • Node.js
  • npm

Note: For MacOS, make sure to have node@10 installed.

Clone the project and install all dependencies:

git clone git@github.com:keyko-io/nevermined-contracts.git
cd nevermined-contracts/

# install dependencies
npm i

# install RPC client globally
npm install -g ganache-cli

Compile the solidity contracts:

npm run compile

In a new terminal, launch an Ethereum RPC client, e.g. ganache-cli:

ganache-cli

Switch back to your other terminal and deploy the contracts:

npm run deploy:development

# for redeployment run this instead
npm run clean
npm run compile
npm run deploy:development

Upgrade contracts [optional]:

npm run upgrade

Testing

Run tests with npm run test, e.g.:

npm run test -- test/unit/agreements/AgreementStoreManager.Test.js

Code Linting

Linting is setup for JavaScript with ESLint & Solidity with Ethlint.

Code style is enforced through the CI test process, builds will fail if there're any linting errors.

Networks

Testnets

Integration Testnet

The contract addresses deployed on Nevermined Integration Test Network:

Contract Version Address
- - -

Staging Testnet

The contract addresses deployed on Nevermined Staging Test Network:

Contract Version Address
- - -

Mainnets

Production Mainnet

The contract addresses deployed on Production Mainnet:

Contract Version Address
- - -

Packages

To facilitate the integration of the Ocean Protocol's keeper-contracts there are Python, JavaScript and Java packages ready to be integrated. Those libraries include the Smart Contract ABI's. Using these packages helps to avoid compiling the Smart Contracts and copying the ABI's manually to your project. In that way the integration is cleaner and easier. The packages provided currently are:

The packages contains all the content from the doc/ and artifacts/ folders.

In JavaScript they can be used like this:

Install the nevermined-contracts npm package.

npm install @keyko-io/nevermined-contracts

Load the ABI of the OceanToken contract on the staging network:

const OceanToken = require('@keyko-io/nevermined-contracts/artifacts/OceanToken.staging.json')

The structure of the artifacts is:

{
  "abi": "...",
  "bytecode": "0x60806040523...",
  "address": "0x45DE141F8Efc355F1451a102FB6225F1EDd2921d",
  "version": "v0.9.1"
}

Documentation

Prior Art

This project builds on top of the work done in open source projects:

Attribution

This project is based in the Ocean Protocol Keeper Contracts. It keeps the same Apache v2 License and adds some improvements. See NOTICE file.

License

Copyright 2020 Keyko GmbH
This product includes software developed at
BigchainDB GmbH and Ocean Protocol (https://www.oceanprotocol.com/)

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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nevermined-contracts-0.2.0.tar.gz (49.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nevermined_contracts-0.2.0-py2.py3-none-any.whl (153.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file nevermined-contracts-0.2.0.tar.gz.

File metadata

  • Download URL: nevermined-contracts-0.2.0.tar.gz
  • Upload date:
  • Size: 49.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for nevermined-contracts-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bdd8c43021b82f3fe23b27e034017c68feab5687f63a9bff1968001efc687cce
MD5 7f07a9c56f6a726c20b6ed84ea1e1b11
BLAKE2b-256 b8c43b5beb5a411b2557327f00a6fd0b93f4f5729f509b911006f6fc198f80a6

See more details on using hashes here.

File details

Details for the file nevermined_contracts-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: nevermined_contracts-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 153.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for nevermined_contracts-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 243810224420253aebf888d12d9dde35371c1e20e2fadf5c122ed2e4a4137352
MD5 90de7f7bf14af6a31c20c14d4213e407
BLAKE2b-256 f32834179b7ab533674b77a35614cc3f7fa281b8d356697c9b3cb35811f02fa6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page