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
- Node.js
- Bun (https://bun.sh/docs/installation)
- Clone the repository
git clone https://github.com/Complexlity/bountychain
- Install dependencies
bun install
- Copy env
cp .env.sample .env
- Start the server
bun run dev
Navigate to http://localhost:3000.
Here's all the components comprising the BountyChain platform:
- 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.
-
Arbitrum:
- Native Token: 0xEda8B0898DAc56ead2bC4f573C5252D3ef3d0b3c
- USDC: 0xA7661b719aa7c7af86Dcd7bC0Dc58437945d1BEd
-
Arbitrum Sepolia:
-
Native Token: 0x6E46796857a0E061374a0Bcb4Ce01af851773d2A
Contracts Found in the /src/features/bounties/contract
-
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.
-
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.
-
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.
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
- 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
- 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