Skip to content

fix(contracts): admin-only mint auth matrix/docs; treasury signer-spe… - #1697

Open
charityagbenu12-cmd wants to merge 1 commit into
MyFanss:mainfrom
charityagbenu12-cmd:somzilla_1625-1626
Open

fix(contracts): admin-only mint auth matrix/docs; treasury signer-spe…#1697
charityagbenu12-cmd wants to merge 1 commit into
MyFanss:mainfrom
charityagbenu12-cmd:somzilla_1625-1626

Conversation

@charityagbenu12-cmd

Copy link
Copy Markdown
Contributor

This PR

Closes #1627
Closes #1628
Closes #1629
Closes #1630

Closes #1628

Verified test_unauthorized_withdraw_reverts already covers non-creator withdraw with signer-specific mock_auths, asserts the stake is unchanged, and the README documents the creator auth requirement. No code change needed.

Closes #1629

mint is admin-only in contracts/myfans-token/src/lib.rs (admin.require_auth(), Error::Unauthorized). Update stale docs:

  • contract/AUTH_MATRIX.md: mint signer changed from none to admin.
  • docs/interfaces/myfans-token.md: mint Auth changed from admin? to admin.

Closes #1630

Verified content-access lifecycle coverage already exists: test_unlock_with_expired_purchase (expired -> PurchaseExpired), test_unlock_content_works (active succeeds), test_unlock_with_wrong_content_id, test_unlock_as_non_buyer, test_access_is_creator_specific, and test_unlock_content_requires_buyer_auth. No "cancelled" state exists in the contract, and the AUTH_MATRIX content-access rows already document the signer requirements.

Summary

Changes

Test Plan

Automated tests added or updated

  • Unit tests (backend/src/**/*.spec.ts) — service/guard/decorator logic in isolation
  • Integration / e2e tests (backend/test/**/*.e2e-spec.ts) — HTTP round-trips with mocked infrastructure
  • Frontend component tests (frontend/src/**/*.test.{ts,tsx}) — React component behaviour
  • Frontend e2e tests (frontend/e2e/**/*.spec.ts) — Playwright browser flows
  • Contract tests (contract/) — Soroban/Rust unit tests via cargo test
  • No new tests required — explain why: ___

How to run the tests locally

# Backend unit tests
cd backend && npm test

# Backend e2e tests (requires no live DB — uses in-memory mocks)
cd backend && npm run test:e2e

# Frontend component tests
cd frontend && npx vitest run

# Frontend e2e tests (requires dev server on :3000 and API on :3001)
cd frontend && npx playwright test

# Contract tests
cd contract && cargo test

Manual verification checklist

  • Happy path works end-to-end in a local environment
  • Error / edge cases handled gracefully (stale state, invalid input, disconnected wallet)
  • No regressions in closely related API or UI flows
  • Rate-limiting, auth guards, and feature flags behave as expected where touched
  • Linting passes: cd backend && npm run lint / cd frontend && npm run lint

…cific auth tests

## Closes MyFanss#1627

Replace `mock_all_auths()` with signer-specific `mock_auths` in
test_unauthorized_deposit_reverts so the deposit/initialize auth test path
uses explicit signer auth, matching the pattern already used by
test_initialize_requires_admin_auth and test_deposit_requires_from_auth.

## Closes MyFanss#1628

Verified test_unauthorized_withdraw_reverts already covers non-creator
withdraw with signer-specific `mock_auths`, asserts the stake is unchanged,
and the README documents the creator auth requirement. No code change needed.

## Closes MyFanss#1629

`mint` is admin-only in contracts/myfans-token/src/lib.rs
(`admin.require_auth()`, `Error::Unauthorized`). Update stale docs:
- contract/AUTH_MATRIX.md: mint signer changed from `none` to `admin`.
- docs/interfaces/myfans-token.md: mint Auth changed from `admin?` to `admin`.

## Closes MyFanss#1630

Verified content-access lifecycle coverage already exists:
test_unlock_with_expired_purchase (expired -> PurchaseExpired),
test_unlock_content_works (active succeeds), test_unlock_with_wrong_content_id,
test_unlock_as_non_buyer, test_access_is_creator_specific, and
test_unlock_content_requires_buyer_auth. No "cancelled" state exists in the
contract, and the AUTH_MATRIX content-access rows already document the
signer requirements.
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@charityagbenu12-cmd Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment