Giter Site home page Giter Site logo

chrisckwong821 / blockchain-developer-bootcamp-final-project Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 1.97 MB

blockchain-developer-bootcamp-final-project

License: MIT License

Solidity 2.89% Shell 0.66% JavaScript 14.01% CSS 82.03% HTML 0.12% Less 0.06% Dockerfile 0.16% TypeScript 0.07%

blockchain-developer-bootcamp-final-project's Introduction

๐Ÿ— Online Betting Protocol

Consensys Final Project: Bet with optimal fee, no chance of rugpull.

An interactive front-end at https://chrisckwong821.github.io/obp-frontend/, deployed using gh-pages at HERE

Contracts deployed on Kovan Testnet


OBPMain

OBPToken

CourtProxy

CourtLib(V1)

BettingOperatorDeployer

RefereeDeployer

BettingRouter

High-Level Overview

A Screencast - Introduction over Kovan Testnet

Screenshot 2021-11-06 at 10 03 37 PM

Installing dependencies


This project runs on ScaffoldETH. To set it up:

  1. Install ScaffoldETH following the instruction from ScaffoldETH
  2. Git clone this repo; replace the directory "package" which is the main project directory

Accessing


Go into /package/;

yarn chain to start the local network;

yarn deploy to deploy the contracts with additional workflow defined in /package/hardhat/deploy/*;

yarn start to bring up a local frontend at port 3000

Unit Tests:


Run yarn test that runs the test scripts form /package/hardhat/test/myTest.js

Introduction:


OBP = Online Betting Protocol for everyone! There are billions of dollar being gambled on sport&Esport events every year. Yet people can hardly find a fair, decentralised and customized betting place for events they would like to bet. Result of sport events are exposed to everyone; rather than creating an oracle network when only whitelisted operator can run, OBP allows everyone to be a bettor, refereee, event operator, as well as a court member for keeping OBP as a fair place!

OBPToken:


OBPToken is an ERC20 token that serves 3 functions:

  1. Stake at court for getting 1% of all total fee generated in all events deployed in the protocol.
  2. Stakers are eligible to vote on cases where an refereee is sued for cheating/injecting wrong result for an event.
  3. OBPToken is accepted as a betting token.

OBPMain:


OBPMain is the hub of OBP protocols. It allows anyone to deploy a bettingOperator and a referee respectively. This contracts:

  1. Records all official referee(s) and betting operator(s) that are deployed through the official deployers.
  2. Deploy Referee or Operator
  3. Add/remove supported tokens for betting
  4. Record the official court contract.

BettingOperatorDeployer:


BettingOperatorDeployer deploys a bettingOperator. It should be only called indirectly through the OBPMain contracts so the deployed operator is registered in the OBPMain contract.

BettingOperator


A bettingOperator contains a roothash when deployed, that is a hash of all its event logic and Pool Ids. A BettingOpeartor start to take bet once it has received a bounding of OBP from a registered Referee. Then anyone can place bet on a Pool based on its Ids. Payout is claimable once the Referee closes the Pool and inject payout results. A betting operator takes 1% of total bet fee.

RefereeDeployer:


RefereeDeployer deploys a referee. It should be only called indirectly through the OBPMain contracts so the deployed referee is registered in the OBPMain contract.

Referee


A Referee takes the responsibility to bounds its staked OBP for betting Operator(s) to ensure it is injecting the precise payout result, in return for 3% of the total betting fee received in the bettingOperator.

CourtProxy:


CourtProxy is an upgradable proxy that performs the court duty. It allows

  1. staking for getting 1% of total bet fee.
  2. voting
  3. upgradeability
  4. consifacte staked OBP from a referee if its result is deemed corrupt.

CourtLib(V1)


CourtLib is the logic library that handles the delegatd call from CourtProxy.

blockchain-developer-bootcamp-final-project's People

Contributors

chrisckwong821 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

blockchain-developer-bootcamp-final-project's Issues

Final Project Feedback

Hi @chrisckwong821 , I'm a mentor of the consensy bootcamp responsible for grading your project.
Congratulations, your Final Project passed! We'll be approving it on the course itself in a week or two, but here's your feedback in the meanwhile:

Frontend Comments
It's really nice to see you using eth-scaffold. I see the project is complex, with lots of contracts and actors. This is super nice and interesting. The FE also meets the requirements of interacting w/ the contract and updating/displaying status updates. Well done.From a UX perspective however, the front-end displays a lot of info, and it's not clear what the user is expected to do.Seems like there's a lot of UI features that are part of the eth-scaffold, and not really relevant to the project. Cleaning up the FE would be better, but not a blocker.I was able to mint some tokens and check the balance after that, but not much else.NOTE: The project is missing the video walkthrough, which would make things easier for testing the FE and understanding the user flow.

Testing Comments
unit tests meet the requirements of the bootcamp. For a real life project, specially with the complexity of your contracts, keep up on the good work and adding more unit tests. The closer to 100% test coverage the better.the contracts look awesome - really complex structure/design compared to what is generally expected from bootcamp project. Huge congrats on that.You also used some advanced concepts like delegatecalls and upgradeability. Extra kudos to that!!!

Design and Security Comments
the contracts look awesome - really complex structure/design compared to what is generally expected from bootcamp project. Huge congrats on that.You also used some advanced concepts like delegatecalls and upgradeability. Extra kudos to that!!!

Overall Feedback
Well done with the project. Congratulations

Follow UP
I couldn't find an wallet address for you to receive the NFT certificate. In case you want to update the readme with that info, please do so and tag me in the comments. Thanks

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.