Skip to content

TomasDmArg/venture-pilot-contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

18 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

VenturePilot Smart Contracts ๐ŸŽฏ

A milestone-based funding platform with jury voting system for early-stage projects. Built with Factory Pattern for scalability and advanced governance features.

๐Ÿ—๏ธ VenturePilot Ecosystem

Repository Description Status
Frontend Next.js web application with React & Material-UI โœ… Active
Backend AI Multiagent system for deck and document analysis โœ… Active
Smart Contracts Solidity contracts with Hardhat & TypeScript โœ… Active

๐ŸŒŸ Overview

VenturePilot revolutionizes early-stage project funding by implementing a milestone-based approach where investors commit funds that are only released when specific project milestones are approved by an authorized jury. This system ensures accountability, reduces risk, and enables partial funding with community governance.

๐Ÿ—๏ธ Architecture

graph TB
    subgraph "Factory Layer"
        Factory[VenturePilotFactory]
        Factory --> AuthorizeJurors[Authorize Jurors]
        Factory --> CreateRounds[Create Rounds]
        Factory --> TrackRounds[Track Rounds]
    end
    
    subgraph "Round Layer"
        Round1[VenturePilotRound #1]
        Round2[VenturePilotRound #2]
        RoundN[VenturePilotRound #N]
    end
    
    subgraph "Governance"
        Jury[Jury Members]
        Community[Community Triggers]
        Founders[Project Founders]
        Investors[Investors]
    end
    
    Factory --> Round1
    Factory --> Round2
    Factory --> RoundN
    
    Jury --> Round1
    Jury --> Round2
    Jury --> RoundN
    
    Community --> Round1
    Community --> Round2
    Community --> RoundN
    
    Founders --> Round1
    Founders --> Round2
    Founders --> RoundN
    
    Investors --> Round1
    Investors --> Round2
    Investors --> RoundN
    
    classDef factory fill:#e1f5fe,stroke:#0277bd,stroke-width:2px
    classDef round fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
    classDef governance fill:#e8f5e8,stroke:#388e3c,stroke-width:2px
    
    class Factory factory
    class Round1,Round2,RoundN round
    class Jury,Community,Founders,Investors governance
Loading

๐ŸŽฏ System Flow

sequenceDiagram
    participant F as Factory Owner
    participant Founder as Project Founder
    participant Investor as Investor
    participant Jury as Jury Member
    participant Community as Community
    participant Round as Round Contract
    
    F->>+Factory: authorizeJuror(juror)
    Factory-->>-F: โœ… Juror authorized
    
    Founder->>+Factory: createFundingRound(token, amount, deadline, milestones)
    Factory->>+Round: Deploy new round
    Round-->>-Factory: Round created
    Factory-->>-Founder: Round ID & Address
    
    Founder->>+Round: whitelistInvestor(investor)
    Round-->>-Founder: โœ… Investor whitelisted
    
    Investor->>+Round: invest(amount)
    Round-->>-Investor: โœ… Investment recorded
    
    Note over Round: Funding deadline reached
    Round->>Round: Move to Execution Phase
    
    Community->>+Round: triggerMilestoneDeadline(milestoneId)
    Round-->>-Community: โœ… Voting started
    
    Jury->>+Round: castJuryVote(milestoneId, approve)
    Round-->>-Jury: โœ… Vote recorded
    
    Note over Round: Jury approves milestone
    
    Founder->>+Round: completeMilestone(milestoneId)
    Round-->>-Founder: โœ… Milestone completed
    
    Note over Round: 24h verification delay
    
    Founder->>+Round: releaseFunds(milestoneId)
    Round-->>-Founder: ๐Ÿ’ฐ Funds released
Loading

โœจ Key Features

๐ŸŽฏ Funding & Governance

  • ๐Ÿ“Š Partial Funding: Rounds can proceed with partial funding
  • ๐Ÿ—ณ๏ธ Jury Voting: 3 authorized wallets decide milestone approval
  • โฐ Deadline System: Specific deadlines per milestone
  • ๐Ÿšซ Restricted Voting: Only jury can vote (not founders/investors)
  • ๐Ÿ”„ Community Triggers: Anyone can activate deadline voting

๐Ÿ” Security & Controls

  • ๐Ÿญ Factory Pattern: Scalable and gas-optimized deployment
  • ๐Ÿ›ก๏ธ Security First: ReentrancyGuard, SafeERC20, comprehensive validations
  • ๐Ÿšจ Emergency Features: Pause, cancel, withdrawal protections
  • ๐Ÿ’ฐ Proportional Release: Funds released proportionally to funding achieved

๐Ÿ’ก User Experience

  • ๐Ÿ‘ฅ Whitelist System: Founder-controlled investor access
  • ๐Ÿ”„ Multiple Rounds: Independent rounds per project
  • ๐Ÿ“ˆ Transparent Tracking: Full visibility of funding and milestones
  • โšก Automatic Transitions: Smart phase management

๐Ÿš€ Quick Start

# Clone and setup
git clone https://github.com/TomasDmArg/money-mule-contracts.git
cd money-mule-contracts
npm install

# Compile contracts
npm run compile

# Run tests
npm run test

# Deploy demo system
npm run deploy:factory

๐Ÿ“ฆ Deployed Contracts

๐Ÿญ Factory System

Contract Address Network
VenturePilotFactory 0xa1820208Dff37B39a8a324e82E3449283e21703b Saga Chainlet
USDC Token 0xA2bE65F0Bfb810eF7B17807F3cd10D428f989A4a Saga Chainlet

๐ŸŒ Network Details

Parameter Value
Chain ID 2751721147387000
RPC URL https://moneymule-2751721147387000-1.jsonrpc.sagarpc.io
Explorer https://moneymule-2751721147387000-1.sagaexplorer.io

๐Ÿ“š Documentation

๐Ÿ“– Detailed Guides

๐ŸŽฏ Core Workflow

1. Setup Phase

// Factory owner authorizes jurors
await factory.authorizeJuror(juror1.address);
await factory.authorizeJuror(juror2.address);
await factory.authorizeJuror(juror3.address);

2. Round Creation

// Founder creates funding round
const milestones = [{
  description: "MVP Development",
  fundingAmount: ethers.parseEther("40"),
  deadline: fundingDeadline + 86400,
  juryWallets: [juror1, juror2, juror3]
}];

const [roundId, roundContract] = await factory.createFundingRound(
  tokenAddress,
  ethers.parseEther("100"),
  fundingDeadline,
  milestones
);

3. Investment Phase

// Founder whitelists investors
await round.whitelistInvestor(investor.address);

// Investors contribute funds
await round.invest(ethers.parseEther("50"));

4. Milestone Execution

// Community triggers milestone deadline
await round.triggerMilestoneDeadline(1);

// Jury votes on milestone completion
await round.castJuryVote(1, true);  // Approve

// Founder completes milestone
await round.completeMilestone(1);

// Funds released after verification delay
await round.releaseFunds(1);

๐Ÿงช Testing

Test Suite

# Run all tests
npm run test

# Run with coverage
npm run test:coverage

# Clean and rebuild
npm run clean && npm run compile

Test Coverage

  • โœ… Factory management & juror authorization
  • โœ… Round creation & validation
  • โœ… Funding phase & investor whitelisting
  • โœ… Jury voting system & deadline triggers
  • โœ… Milestone completion & fund release
  • โœ… Investment withdrawal & edge cases
  • โœ… Complete lifecycle integration tests

๐Ÿš€ Deployment Scripts

Available Scripts

# ๐Ÿญ Factory Deployment
npm run deploy:factory          # Full demo deployment
npm run deploy:production       # Production deployment
npm run manage:factory          # Post-deployment management

# ๐ŸŽฌ Demo & Testing
npm run demo:factory           # Complete lifecycle demo
npm run demo:factory:local     # Local demo

# ๐Ÿช™ USDC Token
npm run deploy:usdc            # Deploy USDC token
npm run mint:usdc              # Mint USDC tokens

Environment Setup

# Required
PRIVATE_KEY=your-private-key-here
FACTORY_ADDRESS=0xa1820208Dff37B39a8a324e82E3449283e21703b

# For demo accounts
PRIVATE_KEY_2=second-account-private-key
PRIVATE_KEY_3=third-account-private-key

# Network configuration
SAGA_RPC_URL=https://moneymule-2751721147387000-1.jsonrpc.sagarpc.io

๐Ÿ“‹ Smart Contract API

VenturePilotFactory

// Core Functions
function createFundingRound(
    address token,
    uint256 targetAmount,
    uint256 fundingDeadline,
    MilestoneData[] calldata milestones
) external returns (uint256 roundId, address roundContract);

function authorizeJuror(address juror) external;
function revokeJuror(address juror) external;

// View Functions
function getRoundContract(uint256 roundId) external view returns (address);
function getFounderRounds(address founder) external view returns (uint256[] memory);
function isAuthorizedJuror(address juror) external view returns (bool);

VenturePilotRound

// Investment Functions
function whitelistInvestor(address investor) external;
function invest(uint256 amount) external;
function withdrawInvestment(uint256 amount) external;

// Milestone Functions
function triggerMilestoneDeadline(uint256 milestoneId) external;
function castJuryVote(uint256 milestoneId, bool approve) external;
function completeMilestone(uint256 milestoneId) external;
function releaseFunds(uint256 milestoneId) external;

๐Ÿ”’ Security Features

Built-in Protections

  • ๐Ÿ›ก๏ธ Reentrancy Guard: All critical functions protected
  • ๐Ÿ” Access Control: Role-based permissions with validation
  • โœ… Input Validation: Comprehensive parameter checking
  • ๐Ÿšจ Emergency Controls: Pause, cancel, emergency recovery
  • ๐Ÿ’Ž Safe Transfers: OpenZeppelin SafeERC20 implementation

Governance Security

  • ๐ŸŽฏ Voting Isolation: Only authorized jury members can vote
  • โฐ Time Controls: Deadlines and verification delays
  • ๐Ÿ”„ Transparent Process: All actions emit comprehensive events
  • ๐Ÿ’ฐ Fund Protection: Multiple withdrawal conditions and safeguards

๐ŸŽฎ Demo Scenarios

Successful Funding

graph LR
    A[Create Round] --> B[Whitelist Investors]
    B --> C[Receive Funding]
    C --> D[Trigger Milestone]
    D --> E[Jury Votes]
    E --> F[Complete Milestone]
    F --> G[Release Funds]
    
    classDef success fill:#e8f5e8,stroke:#388e3c,stroke-width:2px
    class A,B,C,D,E,F,G success
Loading

Partial Funding

graph LR
    A[Create Round] --> B[Partial Funding]
    B --> C[Proportional Milestones]
    C --> D[Scaled Fund Release]
    
    classDef partial fill:#fff3e0,stroke:#f57c00,stroke-width:2px
    class A,B,C,D partial
Loading

Milestone Rejection

graph LR
    A[Trigger Milestone] --> B[Jury Votes]
    B --> C[Milestone Rejected]
    C --> D[Investor Withdrawal]
    
    classDef rejected fill:#ffebee,stroke:#d32f2f,stroke-width:2px
    class A,B,C,D rejected
Loading

๐Ÿ† Built For ETH Global Cannes 2025

Tech Stack

  • ๐Ÿ”จ Hardhat 3: Development framework
  • ๐Ÿ›ก๏ธ OpenZeppelin: Security standards
  • โšก Ethers.js v6: Ethereum library
  • ๐ŸŒ Saga Chainlet: Deployment network
  • ๐Ÿ“ TypeScript: Type safety

Innovation Highlights

  • ๐Ÿญ Factory Pattern: Scalable round deployment
  • โš–๏ธ Jury Governance: Decentralized milestone approval
  • ๐Ÿ“Š Partial Funding: Flexible funding thresholds
  • ๐Ÿ”„ Community Triggers: Permissionless deadline activation

๐Ÿค Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ“‹ Key Principles

  1. ๐Ÿ’ฐ Funding Restriction: Only invest during funding phase
  2. ๐Ÿ—ณ๏ธ Voting Restriction: Only authorized jury votes
  3. โฐ Community Trigger: Anyone can activate deadline voting
  4. ๐Ÿ’Ž Proportional Release: Funds released proportionally to funding achieved
  5. ๐Ÿšจ Emergency Safety: Owner controls for critical situations

๐ŸŽ‰ Complete milestone-based funding with jury governance!

About

VenturePilot.xyz - Tool for early stage investors. ETH Global Cannes. Smart Contracts Repo

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors