GithubHelp home page GithubHelp logo

isabella232 / protocol-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from livepeer/protocol

0.0 0.0 0.0 6.63 MB

Livepeer protocol

License: MIT License

JavaScript 60.90% Shell 0.13% Solidity 33.92% Dockerfile 0.01% TypeScript 5.05%

protocol-1's Introduction

CircleCI Coverage Status

Livepeer Protocol

Ethereum smart contracts used for the Livepeer protocol. These contracts govern the logic for:

  • Livepeer Token (LPT) ownership
  • Bonding and delegating LPT to elect active workers
  • Distributing inflationary rewards and fees to active participants
  • Time progression in the protocol
  • ETH escrow and ticket validation for a probabilistic micropayment protocol used to pay for transcoding work

Documentation

For a general overview of the protocol see:

The contracts are based off of the technical protocol specification.

Development

All contributions and bug fixes are welcome as pull requests back into the repo.

ERC20 Note

The Livepeer token is implemented as an ERC20 token in token/LivepeerToken.sol which inherits from the OpenZeppelin ERC20 token contract and all implemented ERC20 functions will revert if the operation is not successful. However, the ERC20 spec does not require functions to revert and instead requires functions to return true if the operation succeed and false if the operation fails. The contracts bonding/BondingManager.sol and token/Minter.sol do not check the return value of ERC20 functions and instead assume that they will revert if the operation fails. The Livepeer token contract is already deployed on mainnet and its implementation should not change so this is not a problem. However, if for some reason the implementation ever does change, developers should keep in mind that bonding/BondingManager.sol and token/Minter.sol do not check the return value of ERC20 functions.

Install

Make sure Node.js (>=v12.0) is installed.

git clone https://github.com/livepeer/protocol.git
cd protocol
yarn

Build

Compile the contracts and build artifacts used for testing and deployment.

yarn compile

Clean

Remove existing build artifacts.

yarn clean

Lint

The project uses ESLint for Javascript linting and Solium for Solidity linting.

yarn lint

Run Tests

All tests will be executed via hardhat.

Make sure to add relevant API keys inside .env file (by copying provided .env.example) to assist tests and deployments.

To run all tests:

yarn test

To run unit tests only:

yarn test:unit

To run integration tests only:

yarn test:integration

To run gas reporting tests (via hardhat-gas-reporter) only:

yarn test:gas

To run tests with coverage (via solidity-coverage) reporting:

yarn test:coverage

Deployment

Make sure that an ETH node is accessible and that the network being deployed to is supported by the hardhat.config.ts configuration.

export LPT_DEPLOYMENT_EXPORT_PATH=~/Development/lpt_contracts.json
yarn deploy

protocol-1's People

Contributors

yondonfu avatar eladmallel avatar kyriediculous avatar kautukkundan avatar dob avatar ericxtang avatar riccardobiosas avatar leos avatar dependabot[bot] avatar jozanza avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.