Git Product home page Git Product logo

rg-staking's Introduction

RG Staking

Purchase assets by depositing tokens and earn rewards based on your holdings. Visit rg-staking.on.fleek.co to get started.

Smart Contract

The smart contract offers the following:

Token Creation and Asset Ownership

  • Users can deposit multiples of 10 tokens to purchase assets. To simplify this process, users can directly buy assets, where 1 asset equals 10 tokens. This ensures that users always deposit a multiple of 10 tokens.

Asset Creation and Reward Distribution

  • For every 10 tokens (1 asset) purchased, an "Asset" is created and associated with the user's wallet address. For instance, if a user deposits 40 tokens, they become the owner of 4 assets.

  • Every 24 hours, asset owners are entitled to a reward of 0.1 tokens per asset they hold. This reward is calculated based on the number of assets owned by the user.

Reward Pool

  • A reward pool with 10,000 native tokens has been initialized to facilitate rewards distribution. The pool will be used to pay out rewards to asset owners.

Claiming Rewards

  • Asset owners can claim their earned rewards at any time during a given time frame. However, the claimable reward amount is capped at the maximum available balance in the reward pool. This ensures that the reward distribution does not exceed the available rewards.

Reasoning around the Implementation

The implementation introduces the concept of asset ownership, where users directly purchase assets instead of depositing multiples of 10 tokens. This approach simplifies the user experience while achieving the same result.

The reward distribution follows a fair model where users are entitled to 0.1 tokens per asset they hold, and the reward pool ensures sufficient rewards for everyone.

To calculate rewards, we consider the number of assets owned by each user and the last time they interacted with the contract (bought assets, redeemed assets, or claimed rewards). This allows us to provide accurate and up-to-date reward amounts when users perform actions on the contract.

To get started, the reward pool must be initialized by sending exactly 10,000 tokens to the contract. Once initialized, users can begin purchasing assets, redeeming assets, and claiming rewards.

Contract Links

RGT Token

RG Staking

rg-staking's People

Contributors

snnbotchway avatar

Stargazers

 avatar

Watchers

 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.