0.4.1 • Published 4 years ago

@keyko-io/nevermined-contracts v0.4.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 years ago

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:keyko-io/nevermined-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:

ContractVersionAddress
AccessSecretStoreConditionv0.4.10x3f558204fA288286C3Ce8cb3C4900Fd675fCeaF7
AgreementStoreManagerv0.4.10x1A3bafbC27F6290C4Fd99F80c0C48D6fFbbE7407
ComputeExecutionConditionv0.4.10x9Ee494Ee11Fded1B7cF915cfF92Db4E3E2F9fDd6
ConditionStoreManagerv0.4.10x31Ea71619B2E8683E13093E93212AACA84238c38
DIDRegistryv0.4.10x3262b3292eda1b5c68a3687EF7D9daF7899075E8
DIDRegistryLibraryv0.4.10x49bE8829eeC5f29262b31e25B6372E4b004a2e30
EpochLibraryv0.4.10x750c547485AeE3774AA1B9919c06ad9833D9d01B
EscrowAccessSecretStoreTemplatev0.4.10x25340D7Db40e31a5ccA3fEB61329A332f3b043dD
EscrowComputeExecutionTemplatev0.4.10x25649De77C125b9cF1EcD0f07A652676d590Ec5a
EscrowRewardv0.4.10x4bc44f922B45008cb4977da9eDEc83D30a40F259
HashLockConditionv0.4.10xAD762e16445aeA6E71b2fc112c5Ef14F40B67d8E
LockRewardConditionv0.4.10xF4193bb555F79b8B3C0e78E1E8caC7b5a1763C4a
SignConditionv0.4.10xe4486F92Bd2BD7e9757E184A5385006324352024
TemplateStoreManagerv0.4.10x3749aF0feCC396310AE03457c51C7bE04850ECdb
ThresholdConditionv0.4.10xfAFa8e939937e7531B896Db9F9B66F935408626C
WhitelistingConditionv0.4.10xa7570Fa3A53337ABfeeE785017C5Eaa5dC84dE36

Integration Testnet

The contract addresses deployed on Nevermined Integration Test Network:

ContractVersionAddress
---

Staging Testnet

The contract addresses deployed on Nevermined Staging Test Network:

ContractVersionAddress
---

Mainnets

Production Mainnet

The contract addresses deployed on Production Mainnet:

ContractVersionAddress
---

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

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

const NeverminedToken = require('@keyko-io/nevermined-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.