Feedana is a decentralized feedback collection platform built on the Solana blockchain using the Anchor framework. It enables creators to collect feedback in a trustless, transparent manner while leveraging IPFS for decentralized data storage.
- π Features
- ποΈ Architecture
- π° Fee Structure
- π Security Features
- π§ͺ Testing
- π Frontend Integration
- π Project Structure
- π Related Links
- π API Reference
- π€ Contributing
- π License
- Decentralized Feedback Boards: Create feedback boards with unique identifiers
- IPFS Integration: Store feedback data on IPFS for decentralized, immutable storage
- Platform Fees: Built-in fee structure to support platform sustainability
- Secure Validation: Comprehensive input validation for board IDs and IPFS CIDs
- Program Derived Addresses (PDAs): Deterministic addressing for feedback boards
- Cross-Platform Compatibility: Works with any Solana-compatible wallet
- Devnet/Localnet:
3TwZoBQB7g8roimCHwUW7JTEHjGeZwvjcdQM5AeddqMY
pub struct FeedbackBoard {
pub creator: Pubkey, // 32 bytes - Board creator's public key
pub ipfs_cid: String, // 4 + up to 60 bytes - IPFS content identifier
pub board_id: String, // 4 + up to 28 bytes - Human-readable board identifier
}
- create_feedback_board: Creates a new feedback board with platform fee payment
- submit_feedback: Updates existing board with new feedback data
Action | Fee | Description |
---|---|---|
Create Board | 10 lamports | One-time fee for creating a feedback board |
Submit Feedback | 1 lamport | Fee per feedback submission |
Platform Wallet: 96fN4Eegj84PaUcyEJrxUztDjo7Q7MySJzV2skLfgchY
- Board ID: 1-32 characters, alphanumeric and hyphens/underscores only
- IPFS CID: 32-64 characters, must start with "Qm" (base58) or "b" (base32)
- Duplicate Prevention: Uses PDAs to prevent duplicate boards per creator
- Creator Restriction: Board creators cannot submit feedback on their own boards
The program includes comprehensive error codes:
pub enum FeedbackBoardError {
InvalidIpfsCid,
BoardIdTooLong,
EmptyBoardId,
EmptyIpfsCid,
DuplicateFeedbackBoard,
InsufficientFunds,
InvalidIpfsCidLength,
InvalidBoardIdChars,
FeedbackBoardNotFound,
UnauthorizedAccess,
CreatorCannotSubmit,
}
The program emits events for important state changes:
#[event]
pub struct FeedbackBoardCreated {
pub creator: Pubkey,
pub board_id: String,
pub ipfs_cid: String,
}
#[event]
pub struct FeedbackSubmitted {
pub board_id: String,
pub new_ipfs_cid: String,
pub feedback_giver: Pubkey,
}
The test suite covers:
- β Successful board creation and feedback submission with event verification
- β Input validation (empty/invalid board IDs and IPFS CIDs)
- β Board ID length and character validation
- β Creator self-feedback prevention (CreatorCannotSubmit)
- β Duplicate board prevention
- β Insufficient funds handling
- β Platform fee verification
- β Multiple feedback submissions
- β Non-existent board handling
- β Event emission verification
Run the complete test suite:
yarn test
# or
npm run test
Frontend Repository: Feedana UI
The frontend provides a user-friendly interface for:
- Creating and managing feedback boards
- Submitting feedback with rich text editing
- Viewing feedback history
- Wallet integration for Solana payments
feedana-program/
βββ programs/
β βββ feedana/
β βββ src/
β β βββ lib.rs # Main program entry point
β β βββ types.rs # Data structures
β β βββ errors.rs # Custom error definitions
β β βββ events.rs # Event definitions
β β βββ instructions/
β β βββ mod.rs
β β βββ create_board.rs # Board creation logic
β β βββ submit_feedback.rs # Feedback submission logic
β βββ Cargo.toml
β βββ Xargo.toml
βββ tests/
β βββ feedana.ts # Comprehensive test suite
βββ migrations/
β βββ deploy.ts # Deployment script
βββ Anchor.toml # Anchor configuration
βββ package.json # Node.js dependencies
βββ tsconfig.json # TypeScript configuration
- Frontend Application: Feedana UI
- Anchor Framework: https://www.anchor-lang.com/
- Solana Documentation: https://docs.solana.com/
- IPFS Documentation: https://docs.ipfs.io/
Creates a new feedback board with the specified board ID and initial IPFS CID.
Parameters:
board_id
: String (1-32 chars, alphanumeric + hyphens/underscores)ipfs_cid
: String (32-64 chars, valid IPFS CID format)
Accounts:
feedback_board
: PDA account to be createdcreator
: Signer and payerplatform_wallet
: Platform fee recipientsystem_program
: System program for account creation
Fee: 10 lamports
Updates an existing feedback board with new IPFS CID containing updated feedback data.
Parameters:
new_ipfs_cid
: String (32-64 chars, valid IPFS CID format)
Accounts:
feedback_board
: Existing feedback board PDAfeedback_giver
: Signer and fee payerplatform_wallet
: Platform fee recipientsystem_program
: System program for fee transfer
Fee: 1 lamport
Feedback boards use the following seed structure:
["feedback_board", creator_pubkey, board_id]
This ensures:
- Deterministic addressing
- Creator can have multiple boards with different IDs
- No collision between different creators
The program emits the following events:
Emitted when a new feedback board is successfully created.
Fields:
creator
: Pubkey - The public key of the board creatorboard_id
: String - The unique identifier of the boardipfs_cid
: String - The initial IPFS content identifier
Emitted when feedback is successfully submitted to a board.
Fields:
board_id
: String - The identifier of the feedback boardnew_ipfs_cid
: String - The updated IPFS content identifierfeedback_giver
: Pubkey - The public key of the feedback submitter
These events can be consumed by frontend applications for real-time updates and analytics tracking.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
This project is licensed under the MIT License.
This is educational/demonstration software. Use at your own risk. Always audit smart contracts before deploying to mainnet with significant funds.