Area
Project Registry / Code Quality
Complexity
Easy
File(s)
project_registry/src/logic.rs:61-75 (calculate_interest_rate), project_registry/src/storage.rs:4-35 (all six functions), vs. project_registry/src/lib.rs:1214-1218 (compute_rate)
Problem
logic::calculate_interest_rate implements the same rate formula as the private compute_rate in lib.rs, but with an added underflow guard that compute_rate lacks. A grep shows calculate_interest_rate is never called from lib.rs — it's defined but dead. Similarly, storage.rs's read_project/write_project/read_proposal/write_proposal/read_whitelist/write_whitelist are never referenced from lib.rs, which inlines env.storage() calls directly everywhere instead. Both modules are effectively dead abstractions that have drifted from what the contract actually does, risking a future storage/rate change being made in the "live" copy in lib.rs but not mirrored.
Scope
In:
- Either delete the unused functions, or refactor lib.rs to actually call through storage.rs/logic.rs.
Out:
- Any behavior change to the rate formula itself.
Acceptance Criteria
Area
Project Registry / Code Quality
Complexity
Easy
File(s)
project_registry/src/logic.rs:61-75 (calculate_interest_rate), project_registry/src/storage.rs:4-35 (all six functions), vs. project_registry/src/lib.rs:1214-1218 (compute_rate)
Problem
logic::calculate_interest_rate implements the same rate formula as the private compute_rate in lib.rs, but with an added underflow guard that compute_rate lacks. A grep shows calculate_interest_rate is never called from lib.rs — it's defined but dead. Similarly, storage.rs's read_project/write_project/read_proposal/write_proposal/read_whitelist/write_whitelist are never referenced from lib.rs, which inlines env.storage() calls directly everywhere instead. Both modules are effectively dead abstractions that have drifted from what the contract actually does, risking a future storage/rate change being made in the "live" copy in lib.rs but not mirrored.
Scope
In:
Out:
Acceptance Criteria