Coder Social home page Coder Social logo

afrogg / beethovenx-token Goto Github PK

View Code? Open in Web Editor NEW

This project forked from beethovenxfi/beethovenx-token

1.0 0.0 0.0 1.64 MB

Repository around beethoven X token & governance

License: MIT License

JavaScript 1.04% TypeScript 27.03% CSS 0.95% HTML 48.01% Solidity 20.11% Vyper 2.86%

beethovenx-token's Introduction

BeethovenX token

Contracts

BeethovenxToken

The token uses OpenZeppelins ERC20 base contract and only adds a maximum supply of 250mio BEETS to it.

BeethovenxMasterChef

The contract is based on SUSHI's version with some adjustments:

  • Upgrade to pragma 0.8.7
  • therefore remove usage of SafeMath (built in overflow check for solidity > 8)
  • Merge sushi's master chef V1 & V2 (no usage of dummy pool)
  • remove withdraw function (without harvest) => requires the rewardDebt to be an signed int instead of uint which requires a lot of casting and has no real usecase for us
  • no dev emissions, but treasury emissions instead
  • treasury percentage is subtracted from emissions instead of added on top
  • update of emission rate with upper limit of 6 BEETS/block
  • more require checks in general

FBeetsLocker

Based on CVX Staking contract for https://www.convexfinance.com - https://github.com/convex-eth/platform/blob/main/contracts/contracts/CvxLocker.sol

Changes:

  • upgrade to solidity 0.8.7
  • remove boosted concept
  • remove staking of locked tokens

Locking mechanism

  • locking mechanism is based on epochs
  • an epoch is defined by the timestamp of the start of an epoch
  • an epoch length is defined by the epochDuration where the default is 1 week
  • there is an epoch for each week, there exist no holes (missing epochs)
  • the release time for a lock period is set to the current epoch + lockDuration which defaults to 17 weeks
  • all tokens locked within the same epoch share the same lock and therefore the same unlock time
  • withdrawal / re-locking is incentivized by paying a reward for kicking out expired locks (plus grace period)

Voting

  • locked tokens of the current epoch are not eligible for voting
  • locked tokens which are expired (lockDuration has passed) are not eligible for voting
  • the voting power is represented by the balanceOf function
  • the total voting power is represented by the totalSupply function

Rewards

  • rewards are shared between users based on the total amount of locked tokens in the contract
  • tokens which have been locked in the current epoch and also tokens of expired locks are counted towards the total
  • rewards can be claimed at any time

Tests

Tests are located under the test/ directory.

Scripts:

  • yarn test - Runs all tests
  • yarn test:coverage - Runs all tests with coverage report

beethovenx-token's People

Contributors

0xskly avatar franzns avatar arb000r avatar

Stargazers

Sunny 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.