GithubHelp home page GithubHelp logo

ttceco / oak_random_service Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 8 KB

This is an oracle service for the OAK token generation process. It generates a list of random numbers based on a seed value obtained from smart contracts and provides these numbers back to the smart contracts. This allows the smart contract to select winners in each token generation round.

Python 100.00%

oak_random_service's Introduction

OAK Random Service

OAK Random Service is a crucial component in the process of OAK generation. It ensures that the OAK generation process is both fair and transparent. Specifically, this service is designed to randomly select tickets when the number of tickets for a given day surpasses the one-day limit.

How it Works

  1. Seed Generation: Call the smart contract to generate a seed. This can be done only once per round by any user.
  2. Random Data Generation: With the seed, obtain random data off-chain using any compatible program. For instance, with Python, once the data is generated, check if your tickets are part of the selection.
  3. Admin Input: Admins input the random data to the smart contract in batches. After all entries, you can verify your ticket's status either on the smart contract or via the OAK app.

Running the Checker Script

To check the ticket status with our Python script:

Prerequisites:

Ensure Python3 and pip3 are installed:

sudo apt-get update
sudo apt install python3-pip

Install the required Python packages:

pip3 install web3

In case of any issues installing web3:

python -m pip install --user cython
python -m pip install --user cytoolz
python -m pip install --user eth-brownie

Execution:

Run the script:

python3 oak_random_checking.py

oak_random_service's People

Contributors

ttcoffical avatar briancheong avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

howe1988

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.