sherlock-audit / 2023-09-Gitcoin-judging

11 stars 7 forks source link

0xaghas - Redundant modifier onlyAllo #870

Closed sherlock-admin closed 11 months ago

sherlock-admin commented 12 months ago

0xaghas

medium

Redundant modifier onlyAllo

Redundant Usage of onlyAllo Modifier in initialize Function

Vulnerability Detail

The function has a modifier onlyAllo to ensure that only the Allo contract can invoke it. However, the same modifer exists in __BaseStrategy_init function.

Impact

Although the redundant modifier doesn't present a direct security risk, it indicates that there might be some unnecessary complexity or misunderstanding in the contract's design. This can lead to maintainability issues, a larger gas cost for deploying or interacting with the contract, and potential confusion for developers.

Code Snippet

DonationVotingMerkleDistributionBaseStrategy.sol https://github.com/sherlock-audit/2023-09-Gitcoin/blob/main/allo-v2/contracts/strategies/donation-voting-merkle-base/DonationVotingMerkleDistributionBaseStrategy.sol#L256

Tool used

Manual Review

Recommendation

Remove the onlyAllo modifier from the initialize function to simplify the code and possibly reduce gas costs.