Code Monkey home page Code Monkey logo

bodhi-core's Introduction

bodhi-core's People

Contributors

dwalintukan avatar tt1943 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bodhi-core's Issues

Add test cases to verify the EventCreator and Event works as expected

  1. Can a created event information queried correctly?
  2. Can an account bet normally before endingBlock?
  3. Will the betting be disabled when endingBlock has been mined?
  4. Can creator set result correctly?
  5. If out of range index is set, what happens?
  6. Can winner users withdraw reward normally?
  7. Will be loser be prevented to withdraw fund?
  8. If a user bet both on all results, will this user withdraw correct fund?

Enable the user to create prediction event and set the result by the creator

  1. Creator use EventCreator to create a following event
    Name: Which team will win in XYZ competition, A or B?
    Result1: A
    Result2: B

  2. Other users start to sent ETH (aka. QTUM) to bet on either result.

  3. Creator set the result after the competition is finished.

  4. Winner users are able to withdraw their betting + winning tokens.

Trim unnecessary code from contracts

  • TopicEvent.getOracle()
  • ReentrancyGuard
  • getEventName()
  • getEventResultName()
  • string param in getFinalResult()
  • string param in getResult()
  • BytesUtils

event DecentralizedOracleCreated has no topicAddress info

# address: 5f63e04edd043a2fac73fe9920918e75248771dd is OracleFactory
# topics[0]: 834af578c3d42a351e262ebb4c463c830a9777bfe0a2b930de98eaf02455fa0f is DecentralizedOracleCreated event
# topics[1]: 0000000000000000000000007a14d09cbf2a438cb8658e9407ae1467de483332 is address indexed _contractAddress
# topics[2]: 000000000000000000000000979487ee8c643621d2e3950dbe60edc610d7569a is address indexed _eventAddress
# data: bytes32[10] _eventName, bytes32[10] _eventResultNames, uint8 _numOfResults, uint8 _lastResultIndex, uint256 _arbitrationEndBlock, uint256 _consensusThreshold

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.