capstone.mp4
Team Member 1 Avhi : Core Infrastructure & Treasury
-
initialize_organization()
- Create new DAO instance
- Set initial parameters
- Initialize treasury
- Required deposit: 10 SOL
- Features to use SPL Tokens
-
update_organization_settings()
- Update voting thresholds (checks the voter's voting powers based on the NFT holdings or stake deposits)
- Limit for proposals
-
emergency_pause()
- Halt all operations
- Time-locked resumption
-
deposit_funds()
- Accept SOL/SPL tokens
- Update treasury balance
- Emit deposit events
- Anyone can call it and deposit tokens to an Organization ,
nft_mint
will be called + voting power increases
-
withdraw_funds()
- Time-locked withdrawals
- Transaction logging
-
distribute_rewards()
- Calculate reward shares by number of up_votes and down_votes
- Multi-sig authorization
- Process distributions
- Update balances
Team Member 2 Amal: Proposal & Voting System
create_proposal()
- Set proposal parameters
- Define funding requests
- Set voting duration
- Add proposal metadata
-
cast_vote()
- Record vote
- Update vote counts
- Calculate voting powers
- Rewards with a NFT to show on chain proof of voting
-
delegate_vote()
- Transfer voting rights (transfer the NFT )
- Set delegation period
-
revoke_delegation()
- Cancel delegation
- Reclaim voting power
- Update records
-
query_vote_results()
- Calculate current status
- Generate vote analytics
- Project outcomes
Team Member 3 Arjun: Member Management and AI
-
register_member()
- Create member account
- Set initial reputation
- Assign roles
- Call NFT mint
-
stake_tokens()
?- Lock tokens
- Calculate voting power
- Set lock duration
-
unstake_tokens()
?- Process withdrawals
- Apply penalties
- Update status
nft_mint()
- called during
cast_vote
/register_member
- called during
graph TD
A["AI Agent"]
B["Solana Anchor Smart Contract"]
C["initialize_organization()"]
D["create_proposal()"]
E["Solana Blockchain"]
A --> C
A --> D
C --> B
D --> B
B --> E
B --> E
E --> A
- Do some research on cross-chain deposits : deposite ETH tokens on SOL
#[account]
pub struct Organization {
pub name: String,
pub treasury_balance: u64,
pub total_members: u32,
pub created_at: i64,
pub status: OrganizationStatus,
pub proposal_limit: u32,
pub member_registration_fee: u64, // Fee required to join the organization (in lamports)
pub minimum_deposit_amount: u64, // Minimum deposit (stake) required to become a member (in lamports)
pub org_bump: u8,
}
#[account]
pub struct Proposal {
pub title: String,
pub description: String,
pub proposer: Pubkey,
pub up_votes: u32,
pub down_votes: u32,
pub status: ProposalStatus,
pub expiry_time: i64,
pub organization: Pubkey,
pub proposal_bump: u8,
}
#[account]
pub struct Member {
pub address: Pubkey,
pub reputation: Pubkey[],
pub staked_amount: u64,
pub voting_power: u32, // Its 1 if the member registers in DAO, 2 if member deposit the minimum_deposit_amount
pub joined_at: i64,
}
#[derive(AnchorSerialize, AnchorDeserialize, Clone, PartialEq, Debug)]
pub enum ProposalStatus {
Active,
Approved,
Rejected,
Canceled,
}
#[derive(AnchorSerialize, AnchorDeserialize, Clone, PartialEq, Debug)]
pub enum OrganizationStatus {
Active,
InActive
}
-
Treasury → Proposal
- Fund validation
- Balance checks
- Reward distribution
-
Voting → Security
- Permission checks
- Spam prevention
- Vote validation
-
Member → Treasury
- Stake management
- Reward claims
- Balance updates
- Organization setup
- Basic treasury
- Account structures
- Proposal system
- Voting mechanics
- Member management
- Security features
- Analytics
- UI integration
- Unit tests
- Integration tests
- Security audit
- Deployment
-
Unit Tests
- Individual function testing
- Edge case validation
- Error handling
-
Integration Tests
- Cross-module communication
- State management
- Transaction flow
-
Security Tests
- Penetration testing
- Stress testing
- Vulnerability assessment
- Inline code documentation
- API documentation
- User guides
- Technical specifications
-
Phase 2 Features
- Cross-chain integration
- Advanced analytics
- Mobile app support
-
Phase 3 Features
- AI governance
- Automated proposals
- Advanced treasury management