Owner Fees
SupportsOwnerFees.sol
[LOW] Potential Integer Overflow in Fee Calculations
Although highly unlikely, the current implementation of getOwnerFee could overflow when _amount * ownerShare exceeds type(uint256).max. With large amounts and high owner shares, this could cause unexpected behavior or reverts.
We would recommend refactoring the function implementation to instead use FullMath.mulDiv. This provides full precision without intermediate overflow, which is especially important for fee calculations where small precision losses can accumulate over time.
Recommended solution:
// Current: Could overflow with large amounts
return (_amount * ownerShare) / MAX_OWNER_SHARE;
// With FullMath: Protected against overflow
return FullMath.mulDiv(_amount, ownerShare, MAX_OWNER_SHARE);
[INFO] claimableOwnerFees can be simplified
To promote code reuse, the claimableOwnerFees could replace part of it's calculation formula with an internal call. This would slightly increase gas costs, but would promote code reuse.
Recommended solution:
function claimableOwnerFees() public view returns (uint) {
return ownerFees() - _claimedOwnerFees;
}