SSSwap

First Flight #41
Beginner FriendlyRust
100 EXP
View results
Submission Details
Impact: high
Likelihood: high
Invalid

Missing Reentrancy Protection inside the `liquidity_pool.rs`

Description: The contract lacks explicit reentrancy protection. While Solana's account model provides some inherent protection against reentrancy, complex cross-program invocation (CPI) scenarios could still be vulnerable, especially in the liquidity provision and swap functions.

Impact: A malicious contract could potentially reenter the AMM functions during token transfers, manipulating pool state and stealing funds.

Recommended Mitigation: Implement a reentrancy guard pattern:

#[account]
#[derive(InitSpace)]
pub struct LiquidityPool {
pub token_a: Pubkey,
pub token_b: Pubkey,
pub lp_mint: Pubkey,
pub bump: u8,
pub entered: bool, // Add reentrancy guard flag
}
Updates

Lead Judging Commences

0xtimefliez Lead Judge 14 days ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.