This repository has been archived by the owner on May 26, 2023. It is now read-only.
ak1 - Number of token limit check is not same for ERC20 and ERC721 contracts #549
Labels
Low/Info
A valid Low/Informational severity issue
Non-Reward
This issue will not receive a payout
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
ak1
medium
Number of token limit check is not same for ERC20 and ERC721 contracts
Summary
Protocol limits the total number of tokens that are used to bounty funding. This is due to avoid the potential DOS when the number of tokens are increased
It has logic to check for white listed tokens and number of tokens.
For ERC20 tokens, this number of token limit is done only for non-whitelisted tokens.
But, for ERC721 tokens, there is only whitelisted tokens are allowed.
Vulnerability Detail
fundBountyToken function checks the limit only on the non whitelisted tokens.
receiveNft
strictly checking the number of tokensImpact
When number of whitelisted tokens are increased, again this could lead to DOS.
Code Snippet
NFT limit check
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/AtomicBountyV1.sol#L125-L136
ERC20 limit check
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/DepositManager/Implementations/DepositManagerV1.sol#L36-L50
Tool used
Manual Review
Recommendation
Update the below codes such that it would validate number of tokens also.
The text was updated successfully, but these errors were encountered: