Skip to content

Remove dead code — unused functions, enums, and constants #180

Description

@DeFiVC

What

Several functions, types, and constants are defined but never referenced anywhere in the codebase.

Why

Dead code increases maintenance burden, confuses contributors, and may mask incomplete implementations. Removing it keeps the codebase clean and makes the actual API surface clear.

Scope

Remove the following:

  1. get_progress_client helper function in learn-token — never called
  2. EnrollmentStatus enum in packages/shared/src/constants.rs — never used
  3. TOKEN_DECIMALS constant in packages/shared/src/constants.rs — never imported or used

Technical Context

  • File: contracts/learn-token/src/lib.rs (lines ~587-590) — get_progress_client
  • File: packages/shared/src/constants.rs (lines ~55-62) — EnrollmentStatus, TOKEN_DECIMALS
  • claim_reward uses env.invoke_contract directly instead of get_progress_client

Acceptance Criteria

  • All three items removed
  • cargo check passes with no errors
  • cargo test passes — no tests depend on removed code
  • No new warnings introduced

Metadata

Metadata

Assignees

No one assigned

    Labels

    lowCosmetic, minor improvement, code quality, documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions