Skip to main content

Smart Contracts for Nevermined Data platform

Project description

banner

Nevermined Smart Contracts

💧 Smart Contracts implementation of Nevermined in Solidity nevermined.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
  • yarn

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

Clone the project and install all dependencies:

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

Install dependencies:
```bash
yarn

Compile the solidity contracts:

yarn compile

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

npx ganache-cli@~6.9.1 > ganache-cli.log &

Switch back to your other terminal and deploy the contracts:

yarn test:fast

For redeployment run this instead

yarn clean
yarn compile
yarn test:fast

Upgrade contracts [optional]:

yarn upgrade

Testing

Run tests with yarn test, e.g.:

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

yarn lint

Networks

Testnets

Rinkeby Testnet

The contract addresses deployed on Nevermined Rinkeby Test Network:

Contract Version Address
AccessSecretStoreCondition v0.5.0 0x8154110e87a1fe2c7C1C308980D1f506c36E7afB
AgreementStoreManager v0.5.0 0x4893ef3800636833fA106E6AeB4F70f3df89B159
ComputeExecutionCondition v0.5.0 0xF52767F67dC382412F4b528865DC9C2cCDc3A00A
ConditionStoreManager v0.5.0 0x774271bFA1a48363A5c006DB1BE389a60DD1f743
DIDRegistry v0.5.0 0xD24b1ef9a638A9B65C1EDA2Ffb9802DBCB3A3DD0
DIDRegistryLibrary v0.5.0 0x395C16f56EC85b29CF7Fa23bb1C7Ac2C5fd63B35
EpochLibrary v0.5.0 0xab7c9Fd2e67E52Ad64347a42b64aAFF4ED950a8b
EscrowAccessSecretStoreTemplate v0.5.0 0xdF4A669D40cc3058e10E290A10569c14b6E857CC
EscrowComputeExecutionTemplate v0.5.0 0x8F0B30A82524635D4b35A42aE2dF86684c3360A3
EscrowReward v0.5.0 0x3b3804F5F1C652df1270452f30A4F566Df938B2d
HashLockCondition v0.5.0 0x274d809c5B0b2DA51fF9716AFeEE1b763C737a9C
LockRewardCondition v0.5.0 0x5CAD23D3E6b341ddA48F61E15c39BA88706E9B7F
ProvenanceRegistry v0.5.0 0xec3b7A08206c5f5062503cee1DAE83beea2Bd5AA
ProvenanceRegistryLibrary v0.5.0 0xF38176FfD1ee5Af8DaCA0521323e660C49573178
SignCondition v0.5.0 0xE383A2e66EE61bAD6Bd0bA3C906423df9Ef40b72
TemplateStoreManager v0.5.0 0xAE89fDDbF32e61ED1D5E5822C1E87F9e440564b1
ThresholdCondition v0.5.0 0x116B27A89841253e4b690729f755474670667668
WhitelistingCondition v0.5.0 0xf2CaF3D479C584c83504467238C140E330dEC257
Token v0.5.0 0xc778417e063141139fce010982780140aa0cd5ab

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 nevermined-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 @nevermined-io/contracts

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

const NeverminedToken = require('@nevermined-io/contracts/artifacts/NeverminedToken.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.5.1.tar.gz (36.2 kB view hashes)

Uploaded Source

Built Distribution

nevermined_contracts-0.5.1-py2.py3-none-any.whl (58.0 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