Skip to content

Assess deprecating isWithdrawable(uint256) and define withdrawability API semantics #126

@franrolotti

Description

@franrolotti

In PR #121, isWithdrawable(id) changed semantics from “current scheduled withdrawer can withdraw” to an aggregate signal: “at least one member can currently claim/withdraw (incl. late claims)”. We added isMemberWithdrawable(id, member) and the viewer now uses it for canWithdraw.

Review notes:

  • Semantics may be misleading / breaking for consumers expecting current-round-only.
  • Current aggregate implementation can be O(N²) worst-case (nested scans), even if view.

Tasks

  • Decide: keep isWithdrawable, rename to explicit aggregate (e.g. isAnyMemberWithdrawable), or deprecate/remove in favor of explicit APIs.
  • If kept: make semantics explicit in Natspec/docs and reduce worst-case cost (avoid nested full-member loops; consider round-funded flag/index).
  • Add/adjust tests.

Acceptance

Clear API semantics (current-round vs member vs aggregate), no misleading naming, and aggregate check not O(N²).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions