Open sherlock-admin3 opened 1 month ago
LZ_security
Medium
With the address token::ID set in token_program, token_program of token2022 will not be supported. Therefore, tokens that rely on token2022_program will not be supported.
token::ID
token_program
token2022
token2022_program
The address of token_program must be token::ID:
#[account(address = token::ID)] pub token_program: Program<'info, Token>,
The problem is that the program id for token2022 is TOKEN_2022_PROGRAM_ID.
If the new token relies on token2022, it will not be supported.
Although it currently only supports sol, usdt, and usdc, it cannot be added later when you want to support other token2022
https://spl.solana.com/token-2022
tokens that rely on token2022_program will not be supported.
https://github.com/sherlock-audit/2024-08-woofi-solana-deployment/blob/1c4c9c622e8c44ae2f8cd4219c7c2a0181f25ca0/WOOFi_Solana/programs/woofi/src/instructions/swap.rs#L18-L19
Manual Review
Added support for token2022
Good point. Need further investigation here.
LZ_security
Medium
The protocol does not support token2022
Summary
With the address
token::ID
set intoken_program
,token_program
oftoken2022
will not be supported. Therefore, tokens that rely ontoken2022_program
will not be supported.Vulnerability Detail
The address of
token_program
must betoken::ID
:The problem is that the program id for
token2022
is TOKEN_2022_PROGRAM_ID.If the new token relies on
token2022
, it will not be supported.Although it currently only supports sol, usdt, and usdc, it cannot be added later when you want to support other
token2022
https://spl.solana.com/token-2022
Impact
tokens that rely on
token2022_program
will not be supported.Code Snippet
https://github.com/sherlock-audit/2024-08-woofi-solana-deployment/blob/1c4c9c622e8c44ae2f8cd4219c7c2a0181f25ca0/WOOFi_Solana/programs/woofi/src/instructions/swap.rs#L18-L19
Tool used
Manual Review
Recommendation
Added support for token2022