The contract currently maintains two nearly identical redemption functions (redeem and redeemAll) with duplicated logic. This redundancy increases the maintenance burden and creates a higher risk of inconsistencies when updates are needed.
The current implementation duplicates core redemption logic between two functions, creating unnecessary complexity and maintenance challenges. When updates are required, changes must be implemented in multiple places, increasing the risk of introducing inconsistencies. The functions also employ different validation patterns, which could lead to confusion and potential security issues during maintenance or auditing.
Manual Review
The contract should consolidate the redemption logic into a single internal function that handles all core redemption operations. This would ensure consistent validation, error handling, and event emission across all redemption paths. The public functions can then serve as thin wrappers around this core functionality, each handling only its specific input validation. Here's the recommended implementation:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.