You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 26, 2023. It is now read-only.
github-actionsbot opened this issue
Feb 21, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
fundBountyToken() cannot fund token that has been added before
Summary
token address was previously funded, and now adding funds again will not grow the length of tokenAddresses, so it should not be limited by tokenAddressLimit
Vulnerability Detail
in order to avoid OUT_OF_GAS attacks.
So fundBountyToken() will check that cannot excee the maximum number of token addresses
The code is as follows:
function fundBountyToken(
address_bountyAddress,
address_tokenAddress,
uint256_volume,
uint256_expiration,
stringmemoryfunderUuid
) externalpayable onlyProxy {
IBounty bounty =IBounty(payable(_bountyAddress));
if (!isWhitelisted(_tokenAddress)) {
require(
!tokenAddressLimitReached(_bountyAddress), //@audit <---------check token address amount
Errors.TOO_MANY_TOKEN_ADDRESSES
);
}
function tokenAddressLimitReached(address_bountyAddress)
publicviewreturns (bool)
{
IBounty bounty =IBounty(payable(_bountyAddress));
return
bounty.getTokenAddressesCount() >=//@audit <---------the number of current token addresses cannot exceed the limit
openQTokenWhitelist.TOKEN_ADDRESS_LIMIT();
}
There is a problem: When the maximum number of token addresses has been reached, no more funds can be provided, even for tokens that already exist in tokenAddresses.
If the token address has already been funded before, the array length will not grow again.
It should be possible to add
For example:
Suppose the maximum limit = 3
Once deposited token A = 100 token B = 100 token C = 100
When the user wants to add 50 tokens to token A
At this point the execution of fundBountyToken() will prompt
Errors.TOO_MANY_TOKEN_ADDRESSES
So it is recommended that if the token address has been provided before, it is still possible to add new funds
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
bin2chen
medium
fundBountyToken() cannot fund token that has been added before
Summary
token address was previously funded, and now adding funds again will not grow the length of tokenAddresses, so it should not be limited by tokenAddressLimit
Vulnerability Detail
in order to avoid OUT_OF_GAS attacks.
So fundBountyToken() will check that cannot excee the maximum number of token addresses
The code is as follows:
There is a problem: When the maximum number of token addresses has been reached, no more funds can be provided, even for tokens that already exist in
tokenAddresses
.If the token address has already been funded before, the array length will not grow again.
It should be possible to add
For example:
Suppose the maximum limit = 3
Once deposited token A = 100 token B = 100 token C = 100
When the user wants to add 50 tokens to token A
At this point the execution of fundBountyToken() will prompt
So it is recommended that if the token address has been provided before, it is still possible to add new funds
Impact
can't fund bounty token
Code Snippet
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/DepositManager/Implementations/DepositManagerV1.sol#L45-L50
Tool used
Manual Review
Recommendation
Duplicate of #530
The text was updated successfully, but these errors were encountered: