On-Chain slotbased Development

Job ID: 40207127

Budget: ₹12,500 – ₹37,500 INR

ON-CHAIN MATRIX SYSTEM — UPDATED REQUIREMENTS
1) GENERAL
- The system is 100% on-chain, immutable, and permissionless.
- Users register once and activate slots sequentially (Slot 1 → Slot 15).
- Each slot has a fixed activation price (as defined).
- All accounting and payouts are done in the platform token.

2) SLOT STRUCTURE (GLOBAL TREE)
- Each slot has ONE global binary tree.
- The tree grows indefinitely (no fixed depth, no fixed level count).
- Every activation or rebirth for that slot adds a new node to that slot’s global tree.
- Placement order is deterministic BFS: top-to-bottom, left-to-right.
- Each node has at most 2 children.
- Each user can appear multiple times in the same slot tree due to repeat cycles (rebirths).

3) MATRIX CYCLE (30 POSITIONS PER CYCLE)
- For each user, a “cycle” is defined as 30 downstream positions in that slot.
- When a user completes 30 positions in their matrix cycle:
- The cycle is marked complete.
- The slot automatically reopens for that user (rebirth).
- The user is placed again into the SAME global tree of that slot.
- Cycles can repeat unlimited times.

4) MATRIX INCOME (BOUNDED WORK)
- Matrix income is distributed based on relative positions in the tree (lines/levels as per rules).
- Payout computation per placement must be bounded (constant or small fixed number of lookups).
- The contract must NOT loop over unbounded sets of users for matrix payouts.

5) DIRECT REFERRAL INCOME
- A fixed percentage (e.g., 40%) of slot activation goes to the direct referrer.
- Paid instantly at the time of activation or rebirth placement.
- Unlimited directs are allowed.

6) SLOT 6 & SLOT 12 PASSIVE PROTOCOLS (UNBOUNDED USERS)
- Slot 6: Eligible users earn extra passive income from downstream volume.
- Slot 12: Eligible users earn extra passive income (independent of Slot 6).
- Each has a maximum earning cap (e.g., 2× slot cost).
- A small portion (e.g., 0.1%) goes to a donation/new pool.
- These rewards must support UNLIMITED eligible users.
- Implementation MUST use:
- Global reward accumulators (indexes)
- Per-user checkpoints (reward debt)
- The contract must NOT loop over all eligible users in any transaction.

7) BUILDER’S ROYALTY (LIFETIME MULTIPLIER)
- Based on number of direct referrals:
- 5 directs → +0.1%
- 10 directs → +0.15%
- 20 directs → +0.25%
- 30 directs → +0.5%
- 50 directs → +1%
- Once unlocked, the multiplier is permanent.
- Applies to downstream volume across all repeat cycles.
- Implemented as a per-user multiplier applied during reward calculation.
- Must NOT loop over all builders.

8) GAS SAFETY (CRITICAL)
- No function may iterate over an unbounded list of users.
- All unbounded reward systems (Slot 6, Slot 12, Royalty) must use lazy accounting:
- Global accumulators
- Per-user checkpoints
- Rebirth processing must be gas-safe (no unbounded loops in one transaction).
- Tree insertion must be O(1) using index-based BFS (array-like indexing).

9) USER BALANCES & CLAIMING
- Rewards are considered earned immediately in the same block via accounting updates.
- Actual token transfer can be:
- On claim(), or
- On next interaction, or
- On explicit withdraw().
- Accounting must remain correct even if users do not interact for long periods.

10) SCALABILITY GUARANTEE
- The system must support:
- Millions of users
- Unlimited tree depth
- Unlimited repeat cycles
- Gas per user action must remain O(1) or bounded by small constants.
- The contract must never require “loop over all users” to function correctly.
Related categories: Blockchain Ethereum Solidity Smart Contracts DApps