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

Rinkeby Testnet

The contract addresses deployed on Nevermined Rinkeby Test Network:

Contract Version Address
AccessSecretStoreCondition v0.3.0 0x82109B64b5e57F7646d3E7E7b68bE7baA2A7b152
AgreementStoreManager v0.3.0 0xEaa29506a228Eb6C7d23297596Ec676192eFA52C
ComputeExecutionCondition v0.3.0 0x68fE91112540F9C0Ba2588A635A5B426f72e9528
ConditionStoreManager v0.3.0 0x667D172EEE7ab400DF16535CA70159fE8662451B
DIDRegistry v0.3.0 0x7830042602f1D4772672e783A636f699b82b7C2B
DIDRegistryLibrary v0.3.0 0x6243456044f8D82692cBb4D2C7234c5baC682680
Dispenser v0.3.0 0x5aDDCAF59Ac69e43BD2850cC549ad3EeA7884393
EpochLibrary v0.3.0 0xaC297F7262116c17a9524E71833eB107Aa649AE7
EscrowAccessSecretStoreTemplate v0.3.0 0x4ec51839ed4eDa844f99Ae3d6D324E487aA8f95d
EscrowComputeExecutionTemplate v0.3.0 0x253bABB1702864680b5c0Dcd6084086F42903659
EscrowReward v0.3.0 0xa56be8E65F6830f6aA856f09213F3ff6d51e3Af6
HashLockCondition v0.3.0 0x4c1dF193b745ECC6159d9bf1d3DB1b13845B4D80
LockRewardCondition v0.3.0 0x0af287B7e8EdA92fFeD6E2bC1cc739bdC5ffd285
OceanToken v0.3.0 0x5f5cbAea5A58176264E14a5403fc5b2A008787c1
SignCondition v0.3.0 0xcD8602A94e17DedF9AF9f4c388B6ec8838bF058d
TemplateStoreManager v0.3.0 0x87c7639cFaA6eb05B928A6d5fe8DE0Ecc3b4935D
ThresholdCondition v0.3.0 0x503dac337B9e3605f3eC27dF72281f82818878cD
WhitelistingCondition v0.3.0 0xfEC4D80C8F0d62F0e64E323684D94e4128c9898a

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.3.1.tar.gz (36.4 kB view hashes)

Uploaded Source

Built Distribution

nevermined_contracts-0.3.1-py2.py3-none-any.whl (58.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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