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:

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

The contract addresses deployed on Nevermined Alfajores Test Network:

Alfajores (Celo) Testnet

Contract Version Address
AccessCondition v1.0.0 0x81b5764e3A79b195bfe6887B18e232b17e22d356
AccessTemplate v1.0.0 0x1fF6fBf77cc417674462A356905C033cc5a5dc97
AgreementStoreManager v1.0.0 0x5Ab356eCeF4f1041Eefb13A66118b0ddCeD9E544
ComputeExecutionCondition v1.0.0 0x9F0f6AA800199323D8894f03ac4dA8Eea62Fe882
ConditionStoreManager v1.0.0 0x7d30e7462351d3287DF51280f4954585a5BaF952
DIDRegistry v1.0.0 0xb5E59f4BaCDC5cBb5ace97e37DD4b34A718Befbe
DIDRegistryLibrary v1.0.0 0xf3b4547dD0f2475400121C7595c18172b40B50F0
DIDSalesTemplate v1.0.0 0x50D5c496e35b9A8f2aE42a6430e198DdB644Db53
Dispenser v1.0.0 0x611A767a6aD5EFfF3F9824CFa83d5BCdD1b0eE29
EpochLibrary v1.0.0 0xfFfa1141156fEE5ad3E0a1cA7f7D0aD1454FE7e8
EscrowComputeExecutionTemplate v1.0.0 0xe183896ecF5864c25cfEedCF66a6D09259D89408
EscrowPaymentCondition v1.0.0 0xaC79aC52b944B0b3058A12d8E29141E58A15c668
HashLockCondition v1.0.0 0xF2d2885343076e7B5BA5344F4603c15C412Db6eB
LockPaymentCondition v1.0.0 0x8721df21E964d8ff10a69C60eef6Da46B003e67A
NFTAccessCondition v1.0.0 0xed33f04A3a4Afdb263359f9D45fd235709Ce4577
NFTAccessTemplate v1.0.0 0xA6342881e0A93485e8819e5BeDfb062be25c451f
NFTHolderCondition v1.0.0 0x209D112C4D1a0dfD10E2A900049ba46C03d8E139
NFTLockCondition v1.0.0 0x59FD917C0D8eE2D861828bFdc460f6c47A5214B5
NFTSalesTemplate v1.0.0 0xb55fF4Ed2001D006AC687793938ED68eD55BE96F
NeverminedToken v1.0.0 0x697881320067572788FC29e16ae6d635970C3bc5
SignCondition v1.0.0 0xf94D02a89ceB8f0013292782902937D3a2F8C25B
TemplateStoreManager v1.0.0 0x14787AC28C7B6dCC4B856abd4E7Dee555B0170ab
ThresholdCondition v1.0.0 0x47589D3f675037F4Ff174ceb40577743bCFd622d
TransferDIDOwnershipCondition v1.0.0 0x52d2D0529EEDECE81aD381b21d860D54F55Da1dc
TransferNFTCondition v1.0.0 0x6479Bc5ff22C66ac50641460dE90CD52d0118274
WhitelistingCondition v1.0.0 0xAD1DD4D63aA874f677FD8Eafc227bEd81DD93834

Bakalva (Celo) Testnet

The contract addresses deployed on Nevermined Baklava Test Network:

Contract Version Address
AccessCondition v1.0.0 0x7ff61090814B4159105B88d057a3e0cc1058ae44
AccessTemplate v1.0.0 0x39fa249ea6519f2076f304F6906c10C1F59B2F3e
AgreementStoreManager v1.0.0 0x02Dd2D50f077C7060E4c3ac9f6487ae83b18Aa18
ComputeExecutionCondition v1.0.0 0x411e198cf1F1274F69C8d9FF50C2A5eef95423B0
ConditionStoreManager v1.0.0 0x028ff50FA80c0c131596A4925baca939E35A6164
DIDRegistry v1.0.0 0xd1Fa86a203902F763D6f710f5B088e5662961c0f
DIDRegistryLibrary v1.0.0 0x93468169aB043284E53fb005Db176c8f3ea1b3AE
DIDSalesTemplate v1.0.0 0x862f483F35B136313786D67c0794E82deeBc850a
Dispenser v1.0.0 0xED520AeF97ca2afc2f477Aab031D9E68BDe722b9
EpochLibrary v1.0.0 0x42623Afd182D3752e2505DaD90563d85B539DD9B
EscrowComputeExecutionTemplate v1.0.0 0xfB5eA07D3071cC75bb22585ceD009a443ed82c6F
EscrowPaymentCondition v1.0.0 0x0C5cCd10a908909CF744a898Adfc299bB330E818
HashLockCondition v1.0.0 0xe565a776996c69E61636907E1159e407E3c8186d
LockPaymentCondition v1.0.0 0x7CAE82F83D01695FE0A31099a5804bdC160b5b36
NFTAccessCondition v1.0.0 0x49b8BAa9Cd224ea5c4488838b0454154cFb60850
NFTAccessTemplate v1.0.0 0x3B2b32cD386DeEcc3a5c9238320577A2432B03C1
NFTHolderCondition v1.0.0 0xa963AcB9d5775DaA6B0189108b0044f83550641b
NFTLockCondition v1.0.0 0xD39e3Eb7A5427ec4BbAf761193ad79F6fCfA3256
NFTSalesTemplate v1.0.0 0xEe41F61E440FC2c92Bc7b0a902C5BcCd222F0233
NeverminedToken v1.0.0 0xEC1032f3cfc8a05c6eB20F69ACc716fA766AEE17
SignCondition v1.0.0 0xb96818dE64C492f4B66B3500F1Ee2b0929C39f6E
TemplateStoreManager v1.0.0 0x4c161ea5784492650993d0BfeB24ff0Ac2bf8437
ThresholdCondition v1.0.0 0x08D93dFe867f4a20830f1570df05d7af278c5236
TransferDIDOwnershipCondition v1.0.0 0xdb6b856F7BEBba870053ba58F6e3eE48448173d3
TransferNFTCondition v1.0.0 0x2de1C38030A4BB0AB4e60E600B3baa98b73400D9
WhitelistingCondition v1.0.0 0x6D8D5FBD139d81dA245C3c215E0a50444434d11D

Rinkeby (Ethereum) Testnet

The contract addresses deployed on Nevermined Rinkeby Test Network:

Contract Version Address
AccessCondition v1.0.0 0xed4A72056213Ef0820B499CDB684Ed90D8e11fec
AccessTemplate v1.0.0 0x22495Fd5A8f74B73C1b2123913B3F644fb1cef5B
AgreementStoreManager v1.0.0 0x83EE03E3FD91F64DDc303Ab77a22ff85211E68fa
ComputeExecutionCondition v1.0.0 0x3D2967Fe5aE424c36EE5615d535FdD1C2F76755B
ConditionStoreManager v1.0.0 0xdF9bC821360A454d496c82901c4E6944798433b0
DIDRegistry v1.0.0 0x4E4aF77C003Da10Acc5AADed46EEDD84BD87CE61
DIDRegistryLibrary v1.0.0 0x63351d656908788192dB5cAE0F7E069e6A6C9761
DIDSalesTemplate v1.0.0 0x6e0119849F7af64C18AF136767b59A2F309007C5
Dispenser v1.0.0 0x47A98445635f8D2Eb72E4713205c829a3A24Ba1C
EpochLibrary v1.0.0 0x334feA6936F080D391fd2A828d2D7CCf09F3F57E
EscrowComputeExecutionTemplate v1.0.0 0x9073A4aF0110d9A01588684516D7bcd3c8eC5BD7
EscrowPaymentCondition v1.0.0 0x40096525E2f8663eC27Ce1c4188ed1487d6dAea4
HashLockCondition v1.0.0 0xC1E67cb50Fc42492e648F25C15f4981C1948453b
LockPaymentCondition v1.0.0 0xfE38b6FDF853f5B70c507e67b3C51a57cFa07C63
NFTAccessCondition v1.0.0 0xB7B16C164c31Cc0815ECd95a6383Bda7E5558a32
NFTAccessTemplate v1.0.0 0xBe6c2925cEe1d817A2622E2f486dD8F048B63589
NFTHolderCondition v1.0.0 0x410cf168772A759e5c436344b19c7896ff32F2d6
NFTLockCondition v1.0.0 0x8976a209233Cd9009520D3FEcC641b65eb6d5FaE
NFTSalesTemplate v1.0.0 0x74Cd75B84F159BE9AC2305Bf9C1A9C4a6843Ff50
NeverminedToken v1.0.0 0xc771838619FFAA3DB068BfaC64554d85f20D9B98
SignCondition v1.0.0 0x33FDA19494bb5f80cC4Fcb15aB45A680BA264601
TemplateStoreManager v1.0.0 0x4B1cC64b2eAF4fF6dbA24b1e1CC6cdf48598a970
ThresholdCondition v1.0.0 0xAf8E398B4899c9c7aB501Af211C764AD83FDfA2E
TransferDIDOwnershipCondition v1.0.0 0x70B91eE520bF08D64aaD927bCd9e545574624c83
TransferNFTCondition v1.0.0 0x7c55F19042f7ACd451BD982dDCF78d86b3519E93
WhitelistingCondition v1.0.0 0x2D67643102E5dD2A84ac1C8f3F35a061775c481A

Mumbai (Polygon) Testnet

The contract addresses deployed on Mymbai Polygon Test Network:

Contract Version Address
AccessCondition v1.0.0 0x18bdFAf7Cc2B66a4Cfa7e069693CD1a9B639A69b
AccessTemplate v1.0.0 0x4Dd94Fd523a7a099f7E0B4478b295F21dD696b33
AgreementStoreManager v1.0.0 0xC328d7b285A9fa340a0440985F1e7A6F65F0FecE
ComputeExecutionCondition v1.0.0 0x861506c9F9BB71BA7bD6BeB961dD11D40c933496
ConditionStoreManager v1.0.0 0x81568cE9D4C55Ba66067Fc2Cc941324Fc9E5a5af
DIDRegistry v1.0.0 0xE864a1463de48002e1014d152e0fBad8708e8A12
DIDRegistryLibrary v1.0.0 0x7FB9933799E5b88513B62B076bCc60FdF3DB85e3
DIDSalesTemplate v1.0.0 0x562fFCC2E47052319B28F164945827D83cCaaBE3
Dispenser v1.0.0 0x832320316E8Ab9414642320fa9848DB5f296106F
EpochLibrary v1.0.0 0x54Bb351fDC258D2EAf4697393eD4F9B5f47FB09d
EscrowComputeExecutionTemplate v1.0.0 0x815FD27492A944EE0E5Bac9626A353459fd1CFD2
EscrowPaymentCondition v1.0.0 0x8cd0a26CAd8A4B16b164D8DCF20bB8C6b2fd7b15
HashLockCondition v1.0.0 0x4e88A7e4cC5749711B7eeCDDA832Ad7b5124326a
LockPaymentCondition v1.0.0 0x917C55E3711D129Bb7df436B3368a0bCC7cBAB5C
NFTAccessCondition v1.0.0 0x581B2d389BF678aFA8De0695756D811437A3D2CB
NFTAccessTemplate v1.0.0 0x79daFD4FADadd0E5ef24F94874C8fa3635dCC192
NFTHolderCondition v1.0.0 0xdd41e0795660eDea209B1A049Fc52E45C292aE82
NFTLockCondition v1.0.0 0xC130f5581D33Ab2995be4ddC4126e8f69b4DA53d
NFTSalesTemplate v1.0.0 0xbCE97004D96A7C7176116b98Ad22fbA02Bb60365
NeverminedToken v1.0.0 0x1C8A6489F66072828144F556B66bDb92a51EB56A
SignCondition v1.0.0 0x6B0D2cB91dE206d18C30C2Ce83A19022be13C3F5
TemplateStoreManager v1.0.0 0x6bFfcE539E7647B0B78aA4aF37a44bF5014E295E
ThresholdCondition v1.0.0 0x3aAFDeE6a0e85c46cFCBeD133Ad30427ad0af07d
TransferDIDOwnershipCondition v1.0.0 0x8E502BeeD0D20Eb24E3e50B37f7A71871f5F9730
TransferNFTCondition v1.0.0 0xD4A83FbFA2c065aFB8e82946480257a4f8e61195
WhitelistingCondition v1.0.0 0xbB6a2Defde7ecEc9F5f4AF4EcF9Cd40EbD656da0

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

Uploaded Source

Built Distribution

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