SSSwap

First Flight #41
Beginner FriendlyRust
100 EXP
View results
Submission Details
Severity: high
Valid

Missing Account Loading in `provide_liquidity` instruction

Description

The provide_liquidity instruction calls accounts and performs operations on account structs (e.g., vaults) without explicitly loading them, which is unusual in Anchor if using AccountLoader or if state mutation is expected.

Impact

May cause logic inconsistencies if mutation or checks rely on up-to-date account data.

Could be an indicator of incorrect Anchor account modeling, especially if state-modifying methods or field access are assumed.

Recommendation

Ensure all accounts that require access to their internal state or mutation are loaded properly using:

context.accounts.liquidity_provider_lp_account.reload()?;
context.accounts.lp_mint.reload()?;
context.accounts.vault_a.reload()?;
context.accounts.vault_b.reload()?;
Updates

Lead Judging Commences

0xtimefliez Lead Judge 5 days ago
Submission Judgement Published
Validated
Assigned finding tags:

lack of account reload causes liquidity calculations to be outdated

Support

FAQs

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