- Introduction
- Technology Stack
- Architecture
- Run Locally
- Usage Guide
- Smart Contract Documentation
- Deployment
- Future Improvements
- Contributing
- Community
FairFund is a blockchain based platform for community-driven funding. Users can deploy funding vaults, deposit funds, and submit proposals for funding. The platform uses a voting mechanism to decide which proposals receive how much funding.
- Frontend: Next.js, TailwindCSS, ShadCN UI
- Backend: Next.js API Routes, Prisma ORM, NextAuth, SIWE, Web3Modal
- Blockchain: Foundry, Solidity
- Database: PostgreSQL
- Other tools and libraries: Wagmi, Viem, React Hook Form
-
Foundry Setup: Ensure you have Foundry installed and setup. You can follow the instructions given here: Foundry Docs.
-
Node.js: Ensure you have Node.js Installed. You can follow the instructions here: Nodejs Docs
-
Navigate to the Blockchain Directory:
cd app/blockchain
-
Install Dependencies:
forge install
-
Run Tests:
forge test
-
Run Local Anvil Chain:
anvil
-
Deploy Mock Smart Contracts:
make mock-all
Note: This will automatically update relevant contract addresses and ABIs for smart contract in web-app folder.
-
Deploy to the Testnet:
- Ensure you have a
.env
file set up. You can use.env.example
as a template. - Load the environment variables:
source .env
- Deploy the contract:
make deploy-sepolia
- Ensure you have a
-
Navigate to the Web App Directory:
cd app/web-app
-
Install Dependencies:
npm install
-
Update the environment variables: Create a
.env
file in theweb-app
directory and add all the values. You can use.env.example
as a template. -
To use local instance of postgreSQL database:
- Start docker desktop
- Run
docker compose up
-
Run the Development Server:
npm run dev
-
Access the Web App:
- Open your browser and navigate to
http://localhost:3000
.
- Open your browser and navigate to
Our platform supports three types of users: Vault Creators, Proposal Creators, and Voters/Community Members. Here's how each user type can navigate and use the application:
Vault.Creator.mp4
-
Getting Started
- On the landing page, click "Get Started" to access the dashboard
- Connect your wallet and sign in with Ethereum
-
Creating a Vault
- Click the "Create" button and select "Vault" from the dropdown
- Choose a space for your vault (multiple vaults can exist in one space)
- Enter the vault description, token configurations, and funding parameters
- Review and submit the proposal (requires a wallet transaction)
-
Optional: Add Funds
- After creation, you can immediately add funds to your vault
-
Vault Management
- You'll be redirected to the vault page to view all details
Proposal.Creator.mp4
-
Getting Started
- On the landing page, click "Get Started" to access the dashboard
- Connect your wallet and sign in with Ethereum
-
Creating a Proposal
- Click the "Create" button and select "Proposal" from the dropdown
- Search and select the vault you want to create a proposal for
- Enter the proposal description, minimum and maximum request amounts, and recipient address
- Review the information and submit
-
Tracking Proposals
- View your created proposals in the "My Activity" page or on the vault details page
Community.Member.small.mp4
-
Accessing Vaults
- On the landing page, click "Get Started" to access the dashboard
- Click "Spaces" in the navbar to view available spaces
- Select a space and then choose a vault within that space
-
Participating in a Vault
- On the vault page, register to vote
- Deposit tokens for distribution
- Create new proposals (if desired)
- After the tally date, withdraw remaining funds (if applicable)
-
Viewing Results
- After the tally date, results page will be accessible to view the distribution statistics and other vault-related information
Smart contract documentation can be found here.
- Smart Contract: Sepolia Testnet
- Frontend: https://fair-fund.vercel.app/
- Add support for multiple blockchains
- Audit smart contracts
- Refactor smart contracts for better readability and extensibility. detailed issue
- Implement functionality to sponser gas for voting and proposal creation
- Optimize smart contracts further
- Add comments functionality on proposals page
- Enable editing of space, proposal, and vault descriptions
- Implement moderation functionality for spaces (control who can create vaults and proposals)
- Add ability to delegate moderation functionality to users other than creator of the space
- Implement various fund distribution mechanisms
We welcome additional suggestions! Join our Discord: Discord Link
- Create an issue on GitHub
- Discuss your ideas on our project's Discord channel
(#fairfund)
in Stability Nexus Server (if required). - Wait for the issue to be assigned to you
- Fork the repository
- Set up the project locally using this Run Locally Guide
- Create a new branch following this format:
type/brief-description
- Types:
fix
,feat
,chore
,perf
, orrefactor
- Example:
feat/add-space-moderation-functionality
- Types:
- Switch to the new branch
- Make your changes
- Commit and push your changes
- Open a pull request to the
v2
branch - Provide a detailed description of your changes in the PR, including videos and images if applicable