Skip to content

Decentralized escrow for bounties. Post bounties, create submission and earn from completed bounties

Notifications You must be signed in to change notification settings

Complexlity/bountychain

Repository files navigation

BountyChain

BountyChain is a decentralized bounty platform that allows users to create bounties, complete them, and earn rewards in a decentralized way. It is peer-to-peer, and anyone can create a bounty and complete it. The platform is responsible for streamlining the creation and payment process by making it work in just on button click rather than the multi step in traditional processes.

LIVE: https://bountychain.xyz

Getting Started

Prerequisites

Installation

  1. Clone the repository
git clone https://github.com/Complexlity/bountychain
  1. Install dependencies
bun install
  1. Copy env
cp .env.sample .env
  1. Start the server
bun run dev

Navigate to http://localhost:3000.

Architecture

Architecture

Here's all the components comprising the BountyChain platform:

  1. BountyContract: This contract is responsible for creating and managing bounties. It's responsible for creating a bounty, receiving the amount of the bounty, and paying out the bounty to the winner. It's the Source of Truth for the BountyChain platform i.e for every save in the datbase, there must be verification of bounty information from the countract.

Currently, it's hosted on Arbitrum and Arbitrum Sepolia networks.

Contracts Found in the /src/features/bounties/contract

  1. Frontend and Main Server: The site is built with Nextjs which uses React for the frontend and Nodejs for the server routes. The server routes are responsible for saving the bounty details to the database. It's also handle submissions.

  2. Main Database: The database is a SQLite database. Currently, it's hosted on turso but can be run locally. It's responsible for storing the bounty details and submissions.

  3. Backup Server and Database: Since the entire bounty details is not stored on the blockchain, there's always a risk of users losing funds if they create a bounty and then the main server or main database goes down or errors while the bounty is already created on the blockchain, it would be a problem.

The backup server is resonsible for storing bounty details of failed transactions. It runs a cron job every hour to check for failed transactions and store them in the main database.

Backup Server Repository

For Full Explanation on Usage and Architecture, please refer to the Video Demo - 👉 Loom Video

N/B: Since making the video, some improvements have been made to the code:

  • Adding erc20 supported contract to add support for other tokens.
  • Adding USDC support.
  • Improve the create flow: Show prices and user's token balance
  • Show prices in USD, etc.

Architecture Diagram - 👉 eraser.io

Improvements

App

  • Withdraw / Cancel A Bounty
  • Support for ERC20 tokens like USDC
  • Token Prices In USD
  • Show Token Balance when creating a bounty
  • Bounty Deadline and Expiry
  • Adding images
    • For bounty description
    • For bounty submission
  • Rich text support for description

Code

  • Use TRPC for API calls Currently, the api calls are not typesafe and does not have any auto complete and automatic schema parsing. Using TRPC will solve all these issues. See Bounty API Folder
  • Use chainId as source or truth not chainName Using chainId is more reliable than chainName especially if support for other chains might be added.
  • Put backup server in same repo Backup server is currently at here

About

Decentralized escrow for bounties. Post bounties, create submission and earn from completed bounties

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published