DeFiFoundry
50,000 USDC
View results
Submission Details
Severity: low
Invalid

Governance fee will not be deducted when the profit made is small

Summary

Fee payment can be bypassed because of the rounding issue

Vulnerability Details

small profit is made

/**
* @dev Collect fee from the withdraw amount and transfer tokens to the user.
* Collect fee only when the user got the profit.
*/
function _transferToken(uint256 depositId, uint256 amount) internal {
uint256 fee;
if (amount > depositInfo[depositId].amount) {
@audit>> fee = (amount - depositInfo[depositId].amount) * governanceFee / BASIS_POINTS_DIVISOR; // low IF WE close psotion small small do we still pay fee
if (fee > 0) {
collateralToken.safeTransfer(treasury, fee);
}
}

fee is 5% of the profit made but when the amount is minimal the fee taken will be 0

Impact

Loss of governance fee.

Tools Used

Manual Review

Recommendations

Implement an upward rounding of fees mechanism.

Updates

Lead Judging Commences

n0kto Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational or Gas

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.