Giter VIP home page Giter VIP logo

rewarder-smart-contracts's Introduction

Smart contracts for Mysterium Network bounty rewards

This is a set of smart contracts which allow Mysterium team securelly pay exit node bounty and affiliate program rewards. Users who gets rewards will be able to claim them at any time. If they decide not to claim righ after rewards are calculated (e.g. once in a week) then next time they will claim accumulated rewards for both periods at once.

This approach also allows to reduce blockchain transaction fees for both Mysterium team and users while giving bigger flexibility (e.g. possibility to do payouts each weeek instead of once in a month). This

This is also more trustless way for reward distribution (and more similar to how it will work on MainNet). Once rewards are distributed (added new merkle root into blockchain), team can't take them back, even if user is not claiming them for very long time.

There are two main smart contracts:

  • Custody.sol which holds bigger amount of tokens which will be used in future payouts.
  • Rewarder.sol holds main payout and rewards claiming logic. Each time during reward distribution there will be sent new merkle tree root and users will get merkle proofs (via off-chain channels, e.g. in node or affiliate dashboards) which allows to claim rewards.

Setup and test

We're using truffle for smart contract compilation and running tests.

  1. Install dependencies
npm install
  1. Run tests
npm test
  1. Testing deployment (into Görli testnet)

First you should add own mnemonic into hardhat.config.js from which ethereum accounts and private keys will be created. Then simply run:

npx hardhat run --network goerli scripts/deploy.js

Current deployment (ethereum Görli testnet)

Goerli

Matic mainnet

Current

Old

Topperupper (deprecated)

rewarder-smart-contracts's People

Contributors

chompomonim avatar tomasmik 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.