QA: YieldOmega contract + indexer test checklist #2

Closed
opened 2026-03-26 04:36:26 +00:00 by Brouie · 30 comments
Brouie commented 2026-03-26 04:36:26 +00:00 (Migrated from gitlab.com)

Contracts (Foundry)

TimeCurve

  • Sale start/end flow (test_startSale, test_endSale_and_claim)
  • Timer extends on buy (test_timer_extends_on_buy)
  • Timer cap fuzz (test_timer_cap_fuzz, 256 runs)
  • Min buy grows over time (test_minBuy_grows_over_time)
  • Podiums: highest cumulative, last buyers, most buys, opening window (4 tests)
  • Same-block buy ordering (test_sameBlock_buyOrder)
  • Fee routing on buy (test_fees_routed_on_buy)
  • Double claim reverts (test_double_claim_reverts)
  • Insufficient launched tokens reverts (test_startSale_insufficient_launched_tokens_reverts)
  • Start sale reverts twice (test_startSale_reverts_twice)
  • End sale not started/already ended reverts
  • Distribute prizes reduces vault (test_distributePrizes_reduces_vault_and_sets_flag)
  • TimeCurve invariant tests (runs=256, depth=25)
  • TimeCurve fork test (needs MegaETH RPC)

RabbitTreasury

  • BurrowMath coverage clips (test_coverage_clips_high)
  • Epoch invariants fuzz (test_epoch_invariants_fuzz)
  • Python reference match (test_matches_python_reference_epoch)
  • Multiplier bounds fuzz (test_multiplier_bounds_fuzz)
  • RabbitTreasury invariant tests
  • Bank run / extreme withdrawal sequences
  • Reserve ratio vs supply backing invariants

FeeRouter

  • BPS share basic + fuzz + rounding (3 tests)
  • Validate weights canonical/overflow/wrong sum (3 tests)
  • Distribute fees canonical/zero/insufficient/remainder (4 tests)
  • No dust fuzz
  • Update sinks + unauthorized/invalid reverts (3 tests)
  • Fee router invariant tests

FeeSinks

  • Withdraw happy path + unauthorized + zero-to reverts (3 tests)
  • Prize vault pay prize + unauthorized + zero winner (3 tests)
  • Always revert sink behaviors (2 tests)
  • Blocked sink behavior

LeprechaunNFT

  • Mint basic + unauthorized + max supply (3 tests)
  • Series create/inactive/mint count fuzz (3 tests)
  • Base URI + onchain traits (2 tests)

DevStack Integration

  • Deposit and buy (test_devStack_depositAndBuy)
  • Epoch and sale active (test_devStack_epochAndSaleActive)

TimeMath

  • Known vectors (fee math library)

Indexer (Rust + Postgres)

  • 10/10 lib tests (decoders, reorg rollback, schema)
  • Integration tests (need Postgres)
  • Reorg rollback end-to-end
  • API endpoint coverage

Frontend (Vite + Playwright)

  • Vitest unit tests
  • Playwright E2E (UI-only)
  • Anvil-backed E2E (needs local chain)
  • Missing contract/indexer data surfaced in UI (per dev)

Security (from threat model)

  • MEV/ordering: same-block buy test verified deterministic
  • Timer griefing: extension floor/cap/decay tested
  • Governance mid-sale: param snapshot frozen
  • Rounding: WAD/fixed-point discipline verified
  • Indexer reorg: rollback fixtures pass

Current test counts

  • Contracts: 111/111 (forge test)
  • Indexer lib: 10/10 (cargo test --lib)
  • Integration: not yet tested
  • Frontend: not yet tested
## Contracts (Foundry) ### TimeCurve - [x] Sale start/end flow (test_startSale, test_endSale_and_claim) - [x] Timer extends on buy (test_timer_extends_on_buy) - [x] Timer cap fuzz (test_timer_cap_fuzz, 256 runs) - [x] Min buy grows over time (test_minBuy_grows_over_time) - [x] Podiums: highest cumulative, last buyers, most buys, opening window (4 tests) - [x] Same-block buy ordering (test_sameBlock_buyOrder) - [x] Fee routing on buy (test_fees_routed_on_buy) - [x] Double claim reverts (test_double_claim_reverts) - [x] Insufficient launched tokens reverts (test_startSale_insufficient_launched_tokens_reverts) - [x] Start sale reverts twice (test_startSale_reverts_twice) - [x] End sale not started/already ended reverts - [x] Distribute prizes reduces vault (test_distributePrizes_reduces_vault_and_sets_flag) - [ ] TimeCurve invariant tests (runs=256, depth=25) - [ ] TimeCurve fork test (needs MegaETH RPC) ### RabbitTreasury - [x] BurrowMath coverage clips (test_coverage_clips_high) - [x] Epoch invariants fuzz (test_epoch_invariants_fuzz) - [x] Python reference match (test_matches_python_reference_epoch) - [x] Multiplier bounds fuzz (test_multiplier_bounds_fuzz) - [x] RabbitTreasury invariant tests - [ ] Bank run / extreme withdrawal sequences - [ ] Reserve ratio vs supply backing invariants ### FeeRouter - [x] BPS share basic + fuzz + rounding (3 tests) - [x] Validate weights canonical/overflow/wrong sum (3 tests) - [x] Distribute fees canonical/zero/insufficient/remainder (4 tests) - [x] No dust fuzz - [x] Update sinks + unauthorized/invalid reverts (3 tests) - [x] Fee router invariant tests ### FeeSinks - [x] Withdraw happy path + unauthorized + zero-to reverts (3 tests) - [x] Prize vault pay prize + unauthorized + zero winner (3 tests) - [x] Always revert sink behaviors (2 tests) - [x] Blocked sink behavior ### LeprechaunNFT - [x] Mint basic + unauthorized + max supply (3 tests) - [x] Series create/inactive/mint count fuzz (3 tests) - [x] Base URI + onchain traits (2 tests) ### DevStack Integration - [x] Deposit and buy (test_devStack_depositAndBuy) - [x] Epoch and sale active (test_devStack_epochAndSaleActive) ### TimeMath - [x] Known vectors (fee math library) ## Indexer (Rust + Postgres) - [x] 10/10 lib tests (decoders, reorg rollback, schema) - [ ] Integration tests (need Postgres) - [ ] Reorg rollback end-to-end - [ ] API endpoint coverage ## Frontend (Vite + Playwright) - [ ] Vitest unit tests - [ ] Playwright E2E (UI-only) - [ ] Anvil-backed E2E (needs local chain) - [ ] Missing contract/indexer data surfaced in UI (per dev) ## Security (from threat model) - [ ] MEV/ordering: same-block buy test verified deterministic - [ ] Timer griefing: extension floor/cap/decay tested - [ ] Governance mid-sale: param snapshot frozen - [ ] Rounding: WAD/fixed-point discipline verified - [ ] Indexer reorg: rollback fixtures pass ## Current test counts - Contracts: 111/111 (forge test) - Indexer lib: 10/10 (cargo test --lib) - Integration: not yet tested - Frontend: not yet tested
Brouie commented 2026-03-26 04:37:21 +00:00 (Migrated from gitlab.com)

Invariant tests verified: 6/6 pass (256 runs, depth 25). RabbitTreasury handler: ~6300 calls across deposit/withdraw/epoch/fee with 0 reverts. TimeCurve + FeeRouter invariants also clean. Total: 111/111 forge test.

Invariant tests verified: 6/6 pass (256 runs, depth 25). RabbitTreasury handler: ~6300 calls across deposit/withdraw/epoch/fee with 0 reverts. TimeCurve + FeeRouter invariants also clean. Total: 111/111 forge test.
Brouie commented 2026-03-26 04:42:05 +00:00 (Migrated from gitlab.com)

Pulled latest (7316dce). 117/117 contract tests pass (up from 108 initial, 111 yesterday). 6 invariant tests included. Indexer lib 10/10.

Pulled latest (7316dce). 117/117 contract tests pass (up from 108 initial, 111 yesterday). 6 invariant tests included. Indexer lib 10/10.
Brouie commented 2026-03-27 02:33:01 +00:00 (Migrated from gitlab.com)

Frontend + indexer integration tests verified (2026-03-27):

  • Frontend Vitest: 24/24 pass (6 test files — formatAmount, timeCurveMath, addresses, chain, explorer, indexerApi)
  • Indexer integration: 1/1 pass (postgres_stage2_persist_all_events_and_rollback_after)
  • Previous: 117/117 contracts (6 invariant), 10/10 indexer lib

Total across repo: 152/152 all green.

Remaining from checklist:

  • Playwright E2E (needs Anvil + frontend running)
  • Timer griefing / governance / rounding / reorg items (manual review)
Frontend + indexer integration tests verified (2026-03-27): - Frontend Vitest: 24/24 pass (6 test files — formatAmount, timeCurveMath, addresses, chain, explorer, indexerApi) - Indexer integration: 1/1 pass (postgres_stage2_persist_all_events_and_rollback_after) - Previous: 117/117 contracts (6 invariant), 10/10 indexer lib Total across repo: 152/152 all green. Remaining from checklist: - [ ] Playwright E2E (needs Anvil + frontend running) - [ ] Timer griefing / governance / rounding / reorg items (manual review)
PlasticDigits commented 2026-03-28 09:49:49 +00:00 (Migrated from gitlab.com)

Update after QA implementation (commit b66a62a on main)

@Brouie Could you verify in CI and locally with Postgres (YIELDOMEGA_PG_TEST_URL) that cargo test runs the full postgres_stage2_persist_all_events_and_rollback_after integration test, and that npm test stays green?

Done in this round

  • Indexer Postgres integration: All non-Unknown DecodedEvent variants are exercised, including TimeCurveReferralApplied, ReferralCodeRegistered, and PrizeVaultPrizePaid, with table row assertions.
  • HTTP API smoke: Added requests for /v1/timecurve/prize-distributions, /v1/timecurve/prize-payouts, /v1/referrals/registrations, and /v1/referrals/applied.
  • Rollback: After rollback_after, we now assert block 100 rows are gone for buys, referral/prize tables, and rabbit deposits (proves new tables participate in reorg truncation).
  • Docs: Module comment clarified (Unknown excluded from persist coverage).
  • Frontend Vitest: Extra path-builder tests for prize payouts and referral registrations (default offset + custom offset).

Not done (tracked as new issues; this issue stays open)

  • Playwright UI E2E and Anvil-backed E2E (explicitly out of scope for the agent pass).
  • Optional live MegaETH RPC fork smoke (FORK_URL / foundry.toml endpoints): still manual or optional CI.
  • /v1/referrals/applied: No BAD_REQUEST validation for malformed referrer (unlike buyer-stats); API behavior unchanged.
  • Indexer clippy -D warnings: Pre-existing warnings in persist.rs / reorg.rs not addressed.
  • Deeper security checklist (MEV soak on testnet, governance runbooks, UI surfacing of all missing indexer states): not automated here.

Follow-up issues were opened to split the remaining work. This checklist issue remains open until those are closed or waived.

## Update after QA implementation (commit b66a62a on `main`) @Brouie Could you verify in CI and locally with Postgres (`YIELDOMEGA_PG_TEST_URL`) that `cargo test` runs the full `postgres_stage2_persist_all_events_and_rollback_after` integration test, and that `npm test` stays green? ### Done in this round - **Indexer Postgres integration:** All non-`Unknown` `DecodedEvent` variants are exercised, including `TimeCurveReferralApplied`, `ReferralCodeRegistered`, and `PrizeVaultPrizePaid`, with table row assertions. - **HTTP API smoke:** Added requests for `/v1/timecurve/prize-distributions`, `/v1/timecurve/prize-payouts`, `/v1/referrals/registrations`, and `/v1/referrals/applied`. - **Rollback:** After `rollback_after`, we now assert block 100 rows are gone for buys, referral/prize tables, and rabbit deposits (proves new tables participate in reorg truncation). - **Docs:** Module comment clarified (Unknown excluded from persist coverage). - **Frontend Vitest:** Extra path-builder tests for prize payouts and referral registrations (default offset + custom offset). ### Not done (tracked as new issues; this issue stays open) - Playwright UI E2E and Anvil-backed E2E (explicitly out of scope for the agent pass). - Optional live **MegaETH RPC** fork smoke (`FORK_URL` / `foundry.toml` endpoints): still manual or optional CI. - **`/v1/referrals/applied`:** No `BAD_REQUEST` validation for malformed `referrer` (unlike buyer-stats); API behavior unchanged. - **Indexer `clippy -D warnings`:** Pre-existing warnings in `persist.rs` / `reorg.rs` not addressed. - **Deeper security checklist** (MEV soak on testnet, governance runbooks, UI surfacing of all missing indexer states): not automated here. Follow-up issues were opened to split the remaining work. This checklist issue remains open until those are closed or waived.
PlasticDigits commented 2026-03-28 09:50:12 +00:00 (Migrated from gitlab.com)

mentioned in issue #4

mentioned in issue #4
PlasticDigits commented 2026-03-28 09:50:13 +00:00 (Migrated from gitlab.com)

mentioned in issue #5

mentioned in issue #5
PlasticDigits commented 2026-03-28 09:50:14 +00:00 (Migrated from gitlab.com)

mentioned in issue #6

mentioned in issue #6
PlasticDigits commented 2026-03-28 09:50:15 +00:00 (Migrated from gitlab.com)

mentioned in issue #7

mentioned in issue #7
PlasticDigits commented 2026-03-28 09:50:16 +00:00 (Migrated from gitlab.com)

mentioned in issue #8

mentioned in issue #8
PlasticDigits commented 2026-03-28 09:50:23 +00:00 (Migrated from gitlab.com)

Follow-up issues opened: #4 (Playwright UI E2E), #5 (Anvil-backed E2E), #6 (optional MegaETH/RPC fork smoke), #7 (validate referrer on /v1/referrals/applied), #8 (indexer clippy -D warnings). This parent checklist (#2) stays open until those are done or explicitly waived.

Follow-up issues opened: #4 (Playwright UI E2E), #5 (Anvil-backed E2E), #6 (optional MegaETH/RPC fork smoke), #7 (validate `referrer` on `/v1/referrals/applied`), #8 (indexer clippy `-D warnings`). This parent checklist (#2) stays open until those are done or explicitly waived.
Brouie commented 2026-04-21 03:54:33 +00:00 (Migrated from gitlab.com)

mentioned in issue #37

mentioned in issue #37
Brouie commented 2026-04-21 04:14:10 +00:00 (Migrated from gitlab.com)

mentioned in issue #3

mentioned in issue #3
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-04-21 04:31:17 +00:00
PlasticDigits commented 2026-04-23 07:36:46 +00:00 (Migrated from gitlab.com)

mentioned in issue #55

mentioned in issue #55
PlasticDigits commented 2026-04-24 08:18:43 +00:00 (Migrated from gitlab.com)

mentioned in issue #62

mentioned in issue #62
Brouie commented 2026-04-27 03:56:08 +00:00 (Migrated from gitlab.com)

mentioned in issue #61

mentioned in issue #61
Brouie commented 2026-05-01 03:29:46 +00:00 (Migrated from gitlab.com)

mentioned in issue #102

mentioned in issue #102
Brouie commented 2026-05-01 15:09:39 +00:00 (Migrated from gitlab.com)

mentioned in issue #93

mentioned in issue #93
Brouie commented 2026-05-04 06:14:50 +00:00 (Migrated from gitlab.com)

mentioned in issue #116

mentioned in issue #116
Brouie commented 2026-05-04 06:17:26 +00:00 (Migrated from gitlab.com)

mentioned in issue #119

mentioned in issue #119
Brouie commented 2026-05-04 07:56:02 +00:00 (Migrated from gitlab.com)

mentioned in issue #129

mentioned in issue #129
Brouie commented 2026-05-05 02:49:23 +00:00 (Migrated from gitlab.com)

mentioned in issue #149

mentioned in issue #149
Brouie commented 2026-05-06 01:07:09 +00:00 (Migrated from gitlab.com)

mentioned in issue #155

mentioned in issue #155
Brouie commented 2026-05-08 00:47:04 +00:00 (Migrated from gitlab.com)

mentioned in issue #164

mentioned in issue #164
Brouie commented 2026-05-14 02:53:39 +00:00 (Migrated from gitlab.com)

mentioned in issue #207

mentioned in issue #207
PlasticDigits commented 2026-06-02 12:04:06 +00:00 (Migrated from gitlab.com)

mentioned in merge request !398

mentioned in merge request !398
PlasticDigits commented 2026-06-03 11:42:06 +00:00 (Migrated from gitlab.com)

mentioned in issue #279

mentioned in issue #279
PlasticDigits commented 2026-06-14 22:31:58 +00:00 (Migrated from gitlab.com)

mentioned in issue #326

mentioned in issue #326
PlasticDigits commented 2026-06-14 22:32:09 +00:00 (Migrated from gitlab.com)

mentioned in issue #325

mentioned in issue #325
PlasticDigits commented 2026-06-25 20:07:15 +00:00 (Migrated from gitlab.com)

mentioned in issue #344

mentioned in issue #344
PlasticDigits commented 2026-06-25 20:07:48 +00:00 (Migrated from gitlab.com)

mentioned in issue #342

mentioned in issue #342
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/yieldomega#2
No description provided.