🐳 Ocean Protocol L1 - v3
Project description
Ocean Contracts
🐙 Smart contracts for Ocean Protocol v3. https://oceanprotocol.com
If you run into problems, please open up a new issue.
Overview:
Table of Contents
- Get Started
- Usage via Ocean Libraries
- Network Deployments
- Local Development
- Testing
- Code Linting
- Documentation
- Contributing
- License
Get Started
For quick installation of the contract ABIs
:
npm i @oceanprotocol/contracts
Usage via Ocean Libraries
The ocean.js and ocean.py libraries wrap contracts
in JavaScript and Python respectively. They each have quickstart guides.
Network Deployments
You can use an existing deployment of Ocean contracts, or do your own deployment for testing. Let's review each.
Use existing deployments
Ocean contracts are deployed to Rinkeby, Ethereum mainnet, and maybe more. Here are details.
Do your own deployment
To deploy to a local testnet:
- In a separate terminal, start the testnet:
ganache-cli
- In your main terminal, run:
npm run deploy
Alternatively, to deploy to rinkeby testnet:
- In your main terminal:
export MNEMONIC='YOUR MNEMONIC SHOULD BE HERE'
# If you are using remote test or Etherejm mainnet using Infura
export INFURA_TOKEN='GET INFURA_TOKEN FROM INFURA PLATFORM'
npm run deploy:rinkeby
After deployment, check out the ./artifacts/address.json
file. It contains the addresses of the deployed contracts. It will have been updated for the network you deployed to (e.g. development
).
Local Development
For local development of contracts
, set up the development environment on your machine as follows.
As a prerequisite, 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.
Documentation
You can generate documentation using solidity-docgen
. Here's how:
npm run doc:generate
Contributing
More info here.
License
Copyright 2021 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.
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
Built Distribution
Hashes for ocean_contracts-0.5.10-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad922d0fdedc61fddf5c2275edb1023e9bde4e1a5389cdb20974364b0b98352b |
|
MD5 | da6ec740605edf00a0b6c8c7968a9070 |
|
BLAKE2b-256 | aaa258a9ec380209e4dddc98a2acde0e59868b63f15a514de0e43b4fc2826fa6 |