Code Monkey home page Code Monkey logo

hackapay's Introduction

Hackapay

HackaPay aims to provide a single platform to manage Hackathons (other contests in the future) facilitating and helping organizers to better manage their Hackathon events, while providing transparency for attendees about prizes, evaluations, final results, improved transparency and credibility, better experience for attendees, and faster payment/distribution of prizes to winners.

Motivation

Hackathon Attendees: Have you ever attended a Blockchain hackathon where you worked really hard to be a winner and after scoring high, you find out prizes will be paid months later in digital currency; or in Cash; or even worse: in gift cards? Wasn't it supposed to be a Blockchain Hackathon?

Hackathon Organizers: Have you ever organized a Hackathon and found yourself struggling to, or trying to figure out how to:

  • Keep track of registration (attendees sign up and team formation)
  • Control of the submission process
  • Provide transparency during the evaluation process
  • Publicly publish the results; and/or
  • Provide transparency about the prizes you'll to distribute as an incentive
  • Distribute the prizes to winner's team members?
  • Improve your organizer's image by using the blockchain to distribute prizes?
UI:

The UI is still under construction, but you can interact with the Factories of the network, which are responsible for deploying and keeping track of the contracts created and deployed by users. There are two Factories in the network:

  • Hackathon Factory: Deploys a Hackathon contract to the blockchain. This contract is used for managing and interacting with the hackathon (registration, proposal submission, evaluation, publishing results, and distributing prizes to winner teams.
  • Contest Team Factory: Deploys a ContestTeam contract to the blockchain. This contract is used for managing team members, depositing prizes (from the Hackathon contract) and distribute received prizes among team members.
UI Limitations:

The current UI, only interacts with the contract Factories, allowing the creation of new hackathons/teams, and retrieving the addresses of the deployed contracts. The UI still needs to implement the functionalities to interact with the Hackathon and ContestTeam contracts, created and deployed dynamically by the users using the factories.

Usefull Information about the project:

Contract Diagram

The basic architecture / contract diagram of the project can be seen in the diagram below.

Alt text

Getting Started

This project was developed with the following environment:

  • Ubuntu Ubuntu 18.04.2 LTS

  • npm 6.9.0

  • Truffle v5.0.28 (core: 5.0.28)

  • Solidity v0.5.0 (solc-js)

  • Node v10.16.0

  • Web3.js v1.0.0-beta.37

    PS: You should have no problems running on ubuntu 16.04 or Node 8.*

1 - Requirements:

WebServer and Smart Contracts Development/Deployment
  • node

  • npm

  • Install truffle: npm install truffle -g

  • Download and install Ganache Gui or ganache-cli. Follow the provided instructions to install the desired version of Ganache. Make sure you configure your ganache application to use Port Number 8545.

    Note related to recent truffle update: A few days ago truffle updated to 5.0.29, and one of the project dependencies for unit tests (openzeppelin-test-helpers) presented some issues. The dependency was updated and this issue is supposed to be fixed now, but if when trying to run it locally you find an error related to the web3 version, make sure you install truffle 5.0.28, using the commands below:

    npm uninstall -g truffle
    npm install -g [email protected]
Front-end
  • A web browser that supports Metamask like Google Chrome, Firefox or Opera
  • Install Metamask Extension

2 - Clone the repo to your desired folder

git clone https://github.com/fodisi/hackapay.git

3 - Move to the project folder, install dependencies and setup config files

cd hackapay
npm install
mv credentials-sample.js credentials.js // Required, otherwise truffle compile will fail

Running the project locally

Smart Contracts

You can use commands below to compile, migrate and test the smart contracts. Make sure you're running GanacheGui or ganache-cli on your localhost (127.0.0.1) at Port Number 8545 before running these commands.

  • compile: truffle compile
  • migrate: truffle migrate
  • run unit tests: truffle test

During development, it was used GanacheGui. You shouldn't have any problem using ganache-cli, but in case some of the steps above fail, please download and install GanacheCli, configure it to listen on port number 8545, and run the commands again.

Running Web dev-server to serve the Front-End

You'll need to run the following command to start you local dev-server. Once the project is compiled, a webbrowser should open automatically on your local machine. The local dev-server runs at http://localhost:8080/

Start web dev-server: npm run start

When you access the application, make sure your selected network on Metamask is either localhost, covan or ropsten.

Additional commands:

Deploying contracts to Testnets (ropsten and kovan)

This project uses Infura infrastructure to deploy the contracts to ETH testnets. You'd need to register with Infura and create a project id. Once you have the credentials, follow these steps:

  • Open file credentials.js
  • Insert your Infura ProjectId and mnemonic in the file for the desired network
  • Once you have the credentials file properly setup, run the following commands to deploy the contracts to ropsten and/or kovan:
    • Deploy to ropsten: npm run deploy:ropsten
    • Deploy to kovan: npm run deploy:kovan
Run test coverage

This project uses solidity-coverage for testing coverage. You can check the test coverage by running the following command: npm run coverage

Run security Analysis

This project uses truffle-security to analyze potential exploits. To run a full analysis, you'll need to create an account with MythX, and use the ETH Address and Password provided. Once you have the ETH Address and password from MythX, open the file mythx-config-sample.sh. Insert the ETH Address and password provided, and run the export commands (with the appropriate ETH address and password) on you command line.

export MYTHX_ETH_ADDRESS=YOUR_MYTHX_ETH_ADDRESS
export MYTHX_PASSWORD='MYTHX_PASSWORD'

After setting up your credentials, you can run the following command: npm run verify-security or truffle run verify

hackapay's People

Contributors

fodisi avatar

Watchers

James Cloos avatar

Forkers

cds-amal

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.