sherlock-audit / 2024-08-flayer-judging

2 stars 0 forks source link

utsav - `donateThresholdMax` is not implemented in _distributeFees() #792

Open sherlock-admin4 opened 1 month ago

sherlock-admin4 commented 1 month ago

utsav

Medium

donateThresholdMax is not implemented in _distributeFees()

Summary

donateThresholdMax is not implemented in _distributeFees()

Vulnerability Detail

donateThresholdMax is the max amount that can be donated in a single transaction. But the problem is only donateThresholdMin is enforced in _distributeFees()

    function _distributeFees(PoolKey memory _poolKey) internal {
//
        // Ensure that the collection has sufficient fees available
>       if (donateAmount < donateThresholdMin) {
            return;
        }
//
    }

Impact

More token than threshold will be donated in a single transaction

Code Snippet

https://github.com/sherlock-audit/2024-08-flayer/blob/main/flayer/src/contracts/implementation/UniswapImplementation.sol#L308C1-L367C1

Tool used

Manual Review

Recommendation

Enforce donateThresholdMax in distributeFees()