MilestoneChecker

The MilestoneChecker contract serves as a revenue-based vesting controller for IMO projects. It enforces project accountability by linking escrowed fund releases to specific revenue milestones, ensuring that project teams meet their promised revenue targets before receiving additional funding.

Key Features

  • Customizable revenue milestones.

  • Time-locked phases.

  • Revenue verification system.

  • Automated escrow releases.

  • Project-specific target setting.

Milestone Structure

The contract uses a phase-based system that can be customized per project.

Three phases are initialized by default:

Phase 1 (90 days):  Customizable revenue target
Phase 2 (180 days): Customizable revenue target
Phase 3 (365 days): Customizable revenue target

Customization Options

  • Revenue targets can be set based on:

    • Project size.

    • Market expectations.

    • Revenue model.

    • Token economics.

    • Industry standards.

  • Time periods can be adjusted during deployment.

Contract Details

State Variables

revenueTracker: RevenueTracker    // Revenue monitoring
escrowVesting: EscrowVesting      // Fund release control
imoSaleContract: address          // IMO sale reference
revenueToken: IERC20              // Project revenue token
struct Milestone {
    targetRevenue: uint256        // Required revenue
    releaseTime: uint256          // Unlock timestamp
    achieved: bool                // Completion status
}

Functions

Milestone Management

checkMilestone(uint256 _index)

  • Purpose: Verifies milestone achievement and releases funds.

  • Process Flow:

    1. Validates milestone conditions.

    2. Checks revenue targets to be met.

    3. Triggers an escrow release upon success.

  • Requirements:

    1. Milestone time has been reached.

    2. Revenue target for the milestone is met.

    3. Milestone has not been previously achieved.

  • Events Triggered:

    1. MilestoneChecked.

    2. FundsReleased.


Configuration Functions

setMilestoneTargets(uint256[] calldata _targets)

  • Purpose: Sets the revenue targets for each milestone phase.

  • Access: Owner only.

  • Validation:

    • Non-zero targets.

    • Matches phase count.


setIMOEndTime(uint256 _imoEndTime)

  • Purpose: Initializes milestone timeline.

Phase Setup:

Phase 1: IMO End + 90 days
Phase 2: IMO End + 180 days
Phase 3: IMO End + 365 days

Revenue Verification

getTotalRevenue()

  • Purpose: Fetches the current total revenue collected by the contract.

  • Returns:

    • Total revenue collected.

    • Success status.

  • Usage: Milestone verification.


View Functions

getMilestone(uint256 _index)

  • Purpose: Retrieves the details of a specified milestone.

  • Returns: Milestone information, including target revenue, scheduled time, and status.


getMilestonesCount()

  • Purpose: Returns the total number of milestone phases.


Events

MilestoneChecked(uint256 index, bool achieved)
FundsReleased(uint256 index, uint256 amount)
RevenueTrackerUpdated(address tracker)
EscrowVestingUpdated(address escrow)
IMOEndTimeSet(uint256 endTime)

Integration Points

RevenueTracker

  • Monitors revenue collection.

  • Provides verification data.

  • Must match revenue token.

EscrowVesting

  • Receives release authorizations.

  • Controls fund distribution.

  • Maintains vesting schedule.

Security Features

Access Control

  • Owner-only configuration.

  • IMOSale authorization.

  • Reentrancy protection.

Validation Checks

  • Revenue token matching.

  • Target validation.

  • Timeline verification.

Last updated