From instructions::swap::handler(ctx, from_amount, min_to_amount) and transfer_from_owner_to_vault(), it can be seen that WOOFi Swap on Solana does not support the native token SOL, but supports WSOL (Wrapped SOL). This is inconsistent with the statements in the README.
“We manually add the supported token pairs into the swap. The initial list is: SOL, USDT, USDC. Any two of them can form a swap pair.”
According to Sherlock’s rules, issues that break the invariants from the above question, irrespective of whether the impact is low or unknown, will be assigned Medium severity.
Impact
The native token SOL cannot be traded on WOOFi Swap on Solana.
Helpful Jetblack Snake
Medium
WOOFi Swap on Solana does not support the native token SOL.
Summary
WOOFi Swap on Solana does not support the native token SOL.
Vulnerability Detail
From instructions::swap::handler(ctx, from_amount, min_to_amount) and transfer_from_owner_to_vault(), it can be seen that WOOFi Swap on Solana does not support the native token SOL, but supports WSOL (Wrapped SOL). This is inconsistent with the statements in the README. “We manually add the supported token pairs into the swap. The initial list is: SOL, USDT, USDC. Any two of them can form a swap pair.” According to Sherlock’s rules, issues that break the invariants from the above question, irrespective of whether the impact is low or unknown, will be assigned Medium severity.
Impact
The native token SOL cannot be traded on WOOFi Swap on Solana.
Code Snippet
https://github.com/sherlock-audit/2024-08-woofi-solana-deployment/blob/main/WOOFi_Solana/programs/woofi/src/instructions/swap.rs#L96
https://github.com/sherlock-audit/2024-08-woofi-solana-deployment/blob/main/WOOFi_Solana/programs/woofi/src/util/token.rs#L22
Tool used
Manual Review
Recommendation
Add code to handle the native token SOL, or modify the relevant statements.