Coder Social home page Coder Social logo

cryptomeda_staking's Introduction

Cryptomeda Token Ethereum Contracts

ERC20 Token

We use a basic burnable ERC20 contract for Cryptomeda Network tokens. The contract implementations is directly based on the (https://github.com/OpenZeppelin/openzeppelin-contracts)implementation of ERC-20.

Cestaking

Cestaking is a flexible staking contract for ERC20 tokens.

It supports the following configuration:

  • Constant guaranteed time based return. For example 10% return per month. Payout rewards are calculated based on mining time.
  • Reward distribution after maturity. Staking contract can have a maturity date and a fixed reward amount which will be distributed between amounts that were not withdrawn until maturity time.
  • Mix of above.
  • Cap staking amount and time-boxed staking period.
  • Prevent withdraw before a given withdraw start date.
  • No compounded return. Returns are linearly distributed.

Cestaking Parameters

        address tokenAddress_,
        uint stakingStarts_,
        uint stakingEnds_,
        uint withdrawStarts_,
        uint withdrawEnds_,
        uint256 stakingCap_

Note, reward distribution period starts after stakingEnds.

Examples

To generate a hypothetical staking with 10% ARR return with a $ token:

stakingCap = $1000
stakingReward=$100;
earlyWithdrawReward=$100;
stakingStats = ...
stakingEnds = ...
withdrawStarts = stakingEnds
withdrawEnds = withdrawStarts + 1 year

To generate staking with minimum 5% ARR and minimum of 95%+ after maturity:

stakingCap = $1000
stakingReward=$1000;
earlyWithdrawReward=$50;
stakingStats = ...
stakingEnds = ...
withdrawStarts = stakingEnds
withdrawEnds = withdrawStarts + 1 year

To generate staking with 3 month maturity and 20% reward:

stakingCap = $1000
stakingReward=$300;
earlyWithdrawReward=$0;
stakingStats = ...
stakingEnds = ...
withdrawStarts = stakingEnds + 3 months
withdrawEnds = withdrawStarts + 3 months + 1 second

How to add contract to Etherscan.io

  1. Paste the flatenned contract ABI JSON (from dist folder) to REMIX
  2. Compile and deploy the contract (using REMIX or the dashboard). Take an exact note of the constructor arguments.
  3. Go to https://abi.hashex.org/#, paste the ABI JSON, and fill up constructor arguments to get the ABI encoded data
  4. In Etherscan, on the contract tab, select add source and verify. Then paste the flattened contract code, and ABI encoded constructor data obtaied at step 3.

cryptomeda_staking's People

Contributors

starneit avatar

Watchers

James Cloos avatar

Forkers

maxheltzel

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.