{
  "fixture": "two-stakers",
  "description": "Deterministic acceptance fixture for the Sepolia 'test' (ticker: test) staking contract. One point per second is split pro rata by the active deposited token balances; an empty pool earns nothing; withdrawals preserve already-earned points. Computed independently by exact arithmetic from the listed events.",
  "units": {
    "time": "seconds, relative to second 0 (empty pool)",
    "stake": "whole 'test' tokens (decimal-agnostic: shares are ratios, so results are identical for any token decimals as long as all stakes use the same unit)",
    "points": "point-seconds; exactly 1 point per second is emitted while total_staked > 0, 0 while total_staked == 0",
    "number_format": "all amounts are strings; points are exact fractions 'p/q' in lowest terms or whole-number strings"
  },
  "rules": {
    "accrual": "for each interval [t_i, t_{i+1}) between consecutive events, each staker earns (t_{i+1} - t_i) * stake / total_staked points if total_staked > 0, otherwise 0",
    "ordering": "points for an interval are settled before the event at its end is applied; events at the same timestamp are applied in the listed order with a zero-length interval between them",
    "withdrawals": "reduce stake only; cumulative points are never reduced"
  },
  "checkpoints": [
    {"t": "0",  "action": "init (empty pool)",              "alice_stake": "0",  "bob_stake": "0",  "total_staked": "0",  "alice_points": "0",     "bob_points": "0",    "interval_note": "none"},
    {"t": "10", "action": "alice stakes 30",                "alice_stake": "30", "bob_stake": "0",  "total_staked": "30", "alice_points": "0",     "bob_points": "0",    "interval_note": "[0,10): empty pool, 10 s unoccupied, 0 points"},
    {"t": "20", "action": "bob stakes 10",                  "alice_stake": "30", "bob_stake": "10", "total_staked": "40", "alice_points": "10",    "bob_points": "0",    "interval_note": "[10,20): 10 s, alice 30/30 -> +10"},
    {"t": "32", "action": "alice withdraws 20",             "alice_stake": "10", "bob_stake": "10", "total_staked": "20", "alice_points": "19",    "bob_points": "3",    "interval_note": "[20,32): 12 s, alice 30/40 -> +9, bob 10/40 -> +3"},
    {"t": "42", "action": "bob withdraws 10 (all)",         "alice_stake": "10", "bob_stake": "0",  "total_staked": "10", "alice_points": "24",    "bob_points": "8",    "interval_note": "[32,42): 10 s, alice 10/20 -> +5, bob 10/20 -> +5"},
    {"t": "52", "action": "alice withdraws 10 (all)",       "alice_stake": "0",  "bob_stake": "0",  "total_staked": "0",  "alice_points": "34",    "bob_points": "8",    "interval_note": "[42,52): 10 s, alice 10/10 -> +10"},
    {"t": "60", "action": "bob restakes 5",                 "alice_stake": "0",  "bob_stake": "5",  "total_staked": "5",  "alice_points": "34",    "bob_points": "8",    "interval_note": "[52,60): empty pool, 8 s unoccupied, 0 points"},
    {"t": "60", "action": "alice stakes 10 (same timestamp)","alice_stake": "10", "bob_stake": "5",  "total_staked": "15", "alice_points": "34",    "bob_points": "8",    "interval_note": "[60,60): zero-length interval, 0 points"},
    {"t": "61", "action": "read final state",               "alice_stake": "10", "bob_stake": "5",  "total_staked": "15", "alice_points": "104/3", "bob_points": "25/3", "interval_note": "[60,61): 1 s, alice 10/15 -> +2/3, bob 5/15 -> +1/3"}
  ],
  "final_state_at_61": {
    "alice_stake": "10",
    "bob_stake": "5",
    "total_staked": "15",
    "alice_points": "104/3",
    "bob_points": "25/3",
    "alice_points_decimal_approx": "34.666666666666666667",
    "bob_points_decimal_approx": "8.333333333333333333"
  },
  "conservation_check": {
    "occupied_intervals": ["[10,52)", "[60,61)"],
    "unoccupied_intervals": ["[0,10)", "[52,60)"],
    "total_occupied_seconds": "43",
    "total_unoccupied_seconds": "18",
    "elapsed_seconds": "61",
    "sum_of_final_points_exact": "129/3",
    "sum_of_final_points_reduced": "43",
    "identity": "alice_points + bob_points == total_occupied_seconds (104/3 + 25/3 = 129/3 = 43)",
    "holds": true,
    "fixed_point_comparison": {
      "method": "Multiply each exact fraction p/q by the implementation's scale S (e.g. S = 10^18 for a 1e18 fixed-point accumulator) and compute floor(p*S/q). Compare the contract's reported integer against this value.",
      "expected_at_scale_1e18": {
        "alice_points": "34666666666666666666",
        "bob_points": "8333333333333333333",
        "sum": "42999999999999999999",
        "exact_total_scaled": "43000000000000000000"
      },
      "rounding_rule": "Floor (truncation toward zero) at every division, which is the behaviour of Solidity integer division. The contract must never report more than the exact value: 0 <= exact_scaled - reported.",
      "tolerance": "For a Synthetix-style rewardPerToken accumulator (accumulator += dt*S/total_staked at each event; earned = stake*(accumulator - paid)/S), truncation loses at most 1 unit of the accumulator per accrual step, which is at most stake/S points per step per user, plus at most 1 unit in the final earned division. With 9 accrual steps here, accept |reported - floor(exact*S)| <= 10 for S = 10^18. Whole-number checkpoints (t <= 60) must match exactly: their scaled values are exact multiples of S.",
      "sum_check": "The sum of reported balances must satisfy total_occupied_seconds*S - tolerance*2 <= sum <= total_occupied_seconds*S; the shortfall is dust lost to truncation and must never be a surplus.",
      "worked_check": "floor(104*10^18/3) = 34666666666666666666 and floor(25*10^18/3) = 8333333333333333333 sum to 42999999999999999999, one unit below 43*10^18, consistent with two floor operations."
    }
  },
  "method_note": "Independent arithmetic fixture computed from the listed events only; it does not read or depend on any deployed contract, chain state, or external source."
}
