DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: low
Invalid

`unstakeFee` is capped at a too low percentage

Summary

unstakeFee is capped only at 2.55% which can be too low for some occasions.

Vulnerability Details

Due to s.bridge[bridge].unstakeFee being a uint8, it's max value is 255. Which when converted to percentage will be 2.55%, this may be too small at times, when the system wants to collect bigger taxes and earn more revenue.

function unstakeFee(address bridge) internal view returns (uint256) {
AppStorage storage s = appStorage();
return (uint256(s.bridge[bridge].unstakeFee) * 1 ether)
/ Constants.FOUR_DECIMAL_PLACES;
}

Impact

System may be limited on this fee.

Tools Used

Manual review

Recommendations

I would suggest to use uint16 in unstakeFee, since it will allow higher fee amount, and will not cost extra gas since there are 224 unused bits in the struct Bridge.

Updates

Lead Judging Commences

0xnevi Lead Judge
almost 2 years ago
0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: User experience and design improvement

Support

FAQs

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