Code Monkey home page Code Monkey logo

wontology's Introduction

Wontology

Win ONG

Overview

This project aims to develop a decentralized game named Wontology based on ontology smart contract. The idea of Wontology game comes from "lottery". The difference is that all the assets in Wontology will go back to the participants except for the transaction fee. Our team ONT-Avocados will not take anything. You can participate the game by sending ONG to the contract address through the interface we provide and grab the chance to win all ONG of the current round. You can try your luck in both TestNet and MainNet. The source code is public and test results are provided.

The following contents include:

Instruction

Inspired by "lottery", we designed "Wontology". You can participate the game using your ONG.

Wontology game is based on Ontology block chain, providing an open lottery game for every one.

Ontology block chain has 2 tokens : ONT and ONG , ONT cannot be divided , so our game will use ONG for entertainment.

Design

Wontology Description

  • The Wontology game can be classified into four different types according to the size of ticket pool, which is k = 2, 5, 10, or 20.

  • Everytime a player wants to play the game, he will need to choose a specific ticket pool k.

  • Everytime a player plays the game, he will be asked to transfer 1 ONG to the smart contract address. Once the transaction is confirmed, he will be assigned a ticket number i (1 <= i <= k).

  • The round of each kind of ticket pool will grow automatically based on the participation activity. Say, if the n-th round of 5-ticket-pool have 5 players already, then the new player who places 1 ONG wager will be assigned into the (n+1)-th round of 5-ticket-pool. There is no limit of round number.

  • The first player in the n-th round of k-pool will be responsible to start a new round of game.

  • Once the number of participants in the n-th round of k-pool has reached k, the last player will be responsible to end this round game. Or when the number of participants in the n-th round of k-pool has not reached k yet the current round has lasted MaxTime = 3 min * k, the current round can be ended by anyone who invokes "endGame" method.

  • When the n-th round of k-pool ends, Wontology contract will generate a random integer K between 1 and k, the lucky participant with ticket number K will be the winner to receive all the ONG in the current pool.

  • Since the first player in the n-th round of k-pool will activate "startNewRound" and the k-th (last) player in the n-th round of k-pool may activate "endGame", which means he or she will spend extra fee, Wontology contract will transfer this part of extra fee to the first player and the k-th player(if he exists) when the n-th round of k-pool ends.

Wontology Logic Flow

Wontology game has 4 pools: 2, 5 , 10, or 20 tickets for each round in one pool, every wager costs 1 ONG (exclude the network costs).

Any player can try to end a round game if there is not enough players and the duration of this round game has lasted too long.

Wontology Game flow looks like the following:

Source code

The Wontology smart contract can be found publicly in contract folder.

Test resources

Based on python-test-framework for ontology smart contract, test resources are given test resources folder.

How to play

With preparation, you can play Wontology in both TestNet and MainNet.

preparation

  1. Install ontology chrome plugin wallet - Cyano wallet.

  2. Make sure you have some ONG balance in your wallet.

Play

  1. Go to the game in TestNet or MainNet Website.

  2. Select the type of game you'd like to participate.

  3. Click, join, and send the ONG.

  4. Wait for the game to end, then check the winner and your ONG balance.

Contributing

Feel free to contribute to this project.

Contact

License

  • Open-source MIT

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.