The lib.rs
contract fails to properly close accounts after their lifecycle completion, specifically contribution accounts after refunds and fund accounts after withdrawals. This leads to persistent storage allocation on the Solana blockchain, incurring unnecessary rent costs and cluttering the blockchain state.
The contract exhibits two primary state management issues:
Contribution Account Persistence:
Location: refund
function
Issue: After processing a refund, the contribution account is reset to 0 amount but not closed
Fund Account Persistence:
Location: withdraw
function
Issue: After creator withdraws funds, the fund account remains allocated with zero balance
The contract uses Anchor's account management but doesn't implement proper cleanup procedures, violating Solana's best practices for account lifecycle management.
Blockchain State Impact:
Persistent dead accounts clutter the blockchain
Increased storage requirements for validators
Potential for state bloat over time
Unnecessary rent costs for users maintaining unused accounts
Manual code review
Implement Account Closure in refund:
Add Fund Closure in withdraw:
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.