Open hats-bug-reporter[bot] opened 9 months ago
Thank you for the submission. The pool_id
will be an LP token that farmers have to lock into the farm in order to earn rewards. It is not intended to be a reward itself.
Thank you for the submission. After carefully reviewing it we've decided to accept it as VALID but assign it a MINOR severity level. The suggested change is a design choice, not a vulnerability, that allows for recovering tokens sent to the contract incorrectly (by mistake) but no funds are at loss (current, future, promised or otherwise).
Github username: @0xmahdirostami Twitter username: 0xmahdirostami Submission hash (on-chain): 0xa23854063fa86292d03055a0da5fb89ee03634e9728d240b66b2ce0d0b60d371 Severity: medium
Description: Description\
The
owner_withdraw_token
function enables the owner to withdraw any additional token from the contract. However, the existing implementation restricts the owner from withdrawing extra tokens associated with thepool_id
. The purpose of this function is to facilitate the withdrawal of extra reward tokens. The current restriction is imposed by theensure!(self.pool_id != token, FarmError::RewardTokenIsPoolToken);
check.Impact\
The owner should have the ability to withdraw any extra token from the contract, including those linked to the
pool_id
.Revised Code File (Optional)
This updated code removes the restriction preventing the owner from withdrawing extra tokens associated with the
pool_id
. The revised implementation allows the owner to withdraw any token from the contract.