Solafund is a decentralized crowdfunding platform built on the Solana blockchain. It enables users to create, manage, and contribute to crowdfunding campaigns in a trustless and transparent manner. The program is written in Rust using the Anchor framework, while the frontend is developed with Next.js and TypeScript.
- The
create_campaign
function initializes a new campaign. It requires the title, description, organization name, project link, project image, goal amount, and start and end times. - The campaign details are stored on the blockchain, and the campaign is associated with the creator's public key.
- Users can donate to an active campaign using the
donate
function. - Donations are transferred to the campaign account, and the total amount donated is updated.
- If the total donations reach the goal, the campaign is marked as complete.
- When the campaign goal has been reached, the creator can claim the funds using the
claim_donations
function. - The funds are transferred to the campaign creator's account, and the campaign is marked as claimed.
- A campaign can be canceled by the creator before it starts using the
cancel_campaign
function. - This action will close the campaign account and refund any associated resources.
- Users can cancel their donations if the campaign has ended but did not meet its goal, using the
cancel_donation
function. - The funds are refunded to the donor's account.
- Blockchain: Solana
- Solana Program: Anchor, Rust
- Frontend: Next.js, TypeScript
.
├── / # Next.js frontend application
├── src/ # Next js src
│ └── app/ # App Router Next js
│ └── components/ # components
├── backend/ # Backend - Anchor
│ └── programs/ # Solana programs
│ └── crowdfunding/ # Crowdfunding program
└── README.md # Project documentation
-
Install dependencies:
npm install
-
Run the frontend:
npm run dev
-
Change directory:
cd backend
-
Install dependencies:
npm install
-
Build the program:
anchor build
-
Test the program:
anchor test
If you have questions or any issues, feel free to reach me on Twitter @kds_JS.