inside fn _swap_exact_out the following check is performed:
// Check if in token_in_amount is as constrained by the user
ensure!(
-> token_in_amount <= max_token_in_amount,
StablePoolError::InsufficientInputAmount
);
This is to ensure that the received token amount is within the constraints of the user, the problem however is that it also reverts whenever it is = max_token_in_amount.
This means that the function will wrongly fail if the token_in_amount is equal to the max token in amount
Github username: -- Twitter username: -- Submission hash (on-chain): 0xad337ae72586ac00818670e5495cdf21bd0aee16b2ea8f6df65c1aafe05ecbb2 Severity: medium
Description:
Description
inside
fn _swap_exact_out
the following check is performed:This is to ensure that the received token amount is within the constraints of the user, the problem however is that it also reverts whenever it is =
max_token_in_amount
.This means that the function will wrongly fail if the
token_in_amount
is equal to the max token in amountRecommendation