Remington532reid / contracts

πŸ™ Smart contracts for Ocean Protocol v3

Home Page:https://oceanprotocol.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

banner

Ocean Protocol Contracts

πŸ™ Smart contracts for Ocean Protocol v3

Build Status codecov


This is in alpha state and you can expect running into problems. If you run into them, please open up a new issue.


A high level overview of OceanProtocol contracts:

image

Table of Contents

Get Started

For quick installation of the contract ABIs:

npm i @oceanprotocol/contracts

Usage

For more details about how to use ocean contracts, please refer to the quick start section in ocean-lib-js and ocean-lib-py.

Local development

For local development of the contracts setup the development environment on your machine as follows:

As a pre-requisite, you need:

  • Node.js v12+
  • npm

Clone the project and install all dependencies:

git clone git@github.com:oceanprotocol/ocean-contracts.git
cd ocean-contracts/

# install packages
npm i

# to compile contracts
npm run compile

Testing

Run tests with

# for unit tests
npm run test:unit

# for test coverage
npm run test:cover

Code Linting

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

# to check lint issues
npm run lint

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

Networks

Testnets

For local development, start a local testnet using ganache-cli, then run:

npm run deploy

Or depoly ocean-contracts on rinkeby network as follows:

export MNEMONIC='YOUR MNEMONIC SHOULD BE HERE'
# If you are using remote test or main net using Infura
export INFURA_TOKEN='GET INFURA_TOKEN FROM INFURA PLATFORM' 
npm run deploy:rinkeby

After the deployment, check out the address.json file containing the deployed contracts addresses.

Checkout the supported deployment(s) on these networks.

Documentation

To use generate documentation via solidity-docgen please run:

npm run doc:generate

Contributing

See the page titled "Ways to Contribute" in the Ocean Protocol documentation.

Prior Art

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

License

Copyright 2020 Ocean Protocol Foundation

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.

About

πŸ™ Smart contracts for Ocean Protocol v3

https://oceanprotocol.com

License:Apache License 2.0


Languages

Language:Solidity 57.4%Language:JavaScript 40.2%Language:Shell 1.2%Language:Python 1.0%Language:Dockerfile 0.3%