sherlock-audit / 2024-08-woofi-solana-deployment-judging

0 stars 0 forks source link

Zesty Sage Tapir - Inconsistent Reserve Checks for Fee Deduction #77

Open sherlock-admin4 opened 13 hours ago

sherlock-admin4 commented 13 hours ago

Zesty Sage Tapir

Medium

Inconsistent Reserve Checks for Fee Deduction

Summary

The reserve checks for the swap fee are only performed when woopool_from.token_mint != woopool_from.quote_token_mint.

Vulnerability Detail

Impact

Code Snippet

https://github.com/sherlock-audit/2024-08-woofi-solana-deployment/blob/main/WOOFi_Solana/programs/woofi/src/instructions/query.rs#L118

Tool used

Manual Review

Recommendation

Perform the reserve check for the swap fee regardless of the token being swapped from or to.