deposit function redundant check that may lead to DOS
Summary
In deposit_withdraw.rs the function depositmay revert due to the call to balance.
Vulnerability Detail
The revert will be caused due to the unnecessary check to verify that the token_vault.amount is greater than woopool.unclaimed_fee, despite the fact that token_vault.amount will be increased within the deposit function.
Impact
Incorrect check within deposit leads to the function reverting.
dod4ufn
Medium
deposit function redundant check that may lead to DOS
Summary
In
deposit_withdraw.rs
the functiondeposit
may revert due to the call tobalance
.Vulnerability Detail
The revert will be caused due to the unnecessary check to verify that the
token_vault.amount
is greater thanwoopool.unclaimed_fee
, despite the fact thattoken_vault.amount
will be increased within thedeposit
function.Impact
Incorrect check within
deposit
leads to the function reverting.Code Snippet
deposit instruction
Tool used
Manual Review
Recommendation
Remove the incorrect check in the line
let _balance_before = balance(woopool, token_vault)?;
to avoid unintended reverts.