Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/0xfutures/protocol
0xFutures Protocol Implementation
https://github.com/0xfutures/protocol
blockchain dai derivatives ethereum futures smart-contracts solidity stablecoin
Last synced: 29 days ago
JSON representation
0xFutures Protocol Implementation
- Host: GitHub
- URL: https://github.com/0xfutures/protocol
- Owner: 0xFutures
- License: gpl-3.0
- Created: 2018-11-29T06:50:15.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-19T18:41:44.000Z (over 1 year ago)
- Last Synced: 2024-10-09T12:39:14.039Z (about 1 month ago)
- Topics: blockchain, dai, derivatives, ethereum, futures, smart-contracts, solidity, stablecoin
- Language: JavaScript
- Size: 3.98 MB
- Stars: 9
- Watchers: 1
- Forks: 5
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![npm version](https://badge.fury.io/js/%400xfutures%2Fprotocol.svg)](https://badge.fury.io/js/%400xfutures%2Fprotocol)
[![Build Status](https://travis-ci.org/0xFutures/protocol.svg?branch=master)](https://travis-ci.org/0xFutures/protocol)# 0xFutures protocol
[0xFutures](https://0xfutures.com) protocol implementation
## Setup
```
> npm i -g truffle
> npm i
```## Test
```
npm run publish-abi
npm test
```## Deploy Contracts (local node)
This deployment command will recompile contracts, update ABI, run tests and deploy contracts to the blockchain using a local synchronised Ethereum node.
```
// eg. kovan
> npm run deploy-kovan
```NOTE: the very first time the contracts are deployed to a new network the deployer should run 'npm run deploy-<network>-first-time' instead of 'npm run deploy-<network>' as this will install the permanent Registry contract that all future deployments share. It contains a mapping of all CFDs ever created as well as the address of the most recent CFDFactory contract.
## Deploy Contracts (Infura)
Runs the same steps as the 'local node' deploy above but will deploy using a remote infura node.
See config.kovan.infura.json.template for an example configuration. Put your Infura apikey and HD wallet mnemonic phrase in the config file.
```
// eg. kovan with infura config
> npm run deploy-kovan-infura
```See the note about 'first-time' deployment above. This applies to Infura deployment also.
## Publish NPM
```
// ensure repo has latest abi
> npm run publish-abi
> git add abi && git commit -m "updated ABI" abi// ensure tests are passing
> npm test// publish NPM
> npm version patch # bumps the version number and tags the commit
> npm publish # see package.json scripts prepare - this will run the tests before publishing
> git push --tags
```## npm
The package is published with the contract ABI JSON files (abi/) and js libraries (lib/) to [@0xfutures/protocol](https://www.npmjs.com/package/@0xfutures/protocol).