GithubHelp home page GithubHelp logo

public-contracts's Introduction

LinkedIn


Logo

FLock.io Smart Contracts

Bringing Machine Learning to Web3


Report Bug · Request Feature

Table of Contents
  1. Tokenomics
  2. Getting Started
  3. Usage
  4. Contributing
  5. Contact

1. Tokenomics

tokenomics1 tokenomics2

  • Reward Pool is initialized by Task Creator just after a FlockTask contract is deployed.
  • Every round it is calculated the amount of reward for that round based on the amount left in the pool and the number of rounds left to run the task.
  • Participants can claim their reward for each round base on proportion of staked tokens they hold at the time of the round.
uint256 scale = 10 ** 18; // for precision
uint256 roundsLeft = totalNumberOfRounds - i;
uint256 roundRewardAmount = rewardPool / roundsLeft;
uint256 proportion = mulDiv(
    roundStakedTokens[i][msg.sender] * scale,
    100,
    roundTotalStakedTokens[i]
);
uint256 rewardAmount = mulDiv(
    roundRewardAmount,
    proportion,
    100 * scale
);
  • Slashing is a customizable percentage of participants staked amount where 90% will go back to the Reward Pool and the 10% will go to the

You may download the desktop client of the lastest version here.

For more detailed technical explanation of the FLock client, see here.

(back to top)

2. Getting Started

Prerequisites

  • node
  • npm

Installation

  1. Clone the repo
    git clone https://github.com/FLock-io/v1-core-hardhat.git
  2. Install NPM packages
    npm install

    (back to top)

3. Usage

  1. To compile contracts:
    npx hardhat compile
  2. To run tests locally:
    npx hardhat test
  3. To deploy contracts locally:
    npm run deploy:local
  4. To deploy contracts to mumbai testnet:
    npm run deploy:testnet
  5. To upgrade contracts to mumbai testnet:
    npm run deploy:upgrade
  6. To deploy ClaimRewards contracts to mumbai testnet:
    npm run deploy:claimRewards
  7. To deploy MigrateTokens contracts to mumbai testnet:
    npm run deploy:migrateTokens
  8. To fund MigrateToken contract with FLO token on mumbai testnet:
    npm run fund:migrateContract
  9. To fund ClaimRewards contract with FLO token on mumbai testnet:
    npm run fund:claimRewards

Note that the deployment pipeline defined in ./github/workflows/deploy.yml deploys the same version of the contract contracts twice - one for testing and one for production. Navigate to Git Actions to view addresses of the deployed contracts. It should look something like this:

FlockTaskManager for production is deployed to 0xc002f1802616291B5125BEC6115DA996e70C8D53

FlockTaskManager for testing is deployed to 0x2638e0dC9C5ff33b2DfB73E301C9Ac7BbC441d92

Be aware that you should always use the second address for testing (for instance, in testing frontend interfaces). The first address should only be used for production.

Note also that for deployment, see in-line comments in scripts/deploy.ts for more detailed instructions.

See .env.example for instructions to set up private keys and necessary API keys in order to deploy to testnets.

(back to top)

4. Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

5. Contact

Rodrigo Pavezi - @rodrigopavezi - [email protected]

Project Link: https://github.com/FLock-io/v1-core-hardhat

(back to top)

public-contracts's People

Contributors

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