Project

One World
NFTDeFi
15,000 USDC
View results
Submission Details
Severity: low
Invalid

Fees are rounded down in favour of user

Summary

In `MembershipFactory::joinDAO` the platformFees are being rounded down in favour of the user.

Vulnerability Details

Looking at the code below we can observe that platformFees is being rounded down and after is subtracted from the tierPrice which is paid by the user. So in cases where there are round downs, the msg_sender() gets a few more wei from the round down resulting in him being favoured.

function joinDAO(address daoMembershipAddress, uint256 tierIndex) external {
...
uint256 tierPrice = daos[daoMembershipAddress].tiers[tierIndex].price;
uint256 platformFees = (20 * tierPrice) / 100; //@audit rounding down of fees
daos[daoMembershipAddress].tiers[tierIndex].minted += 1;
IERC20(daos[daoMembershipAddress].currency).transferFrom(_msgSender(), owpWallet, platformFees);
IERC20(daos[daoMembershipAddress].currency).transferFrom(_msgSender(), daoMembershipAddress, tierPrice - platformFees);
...
}

Impact

Rounding down of fees.

Tools Used

manual review

Recommendations

Platform fees should be rounded against user

Updates

Lead Judging Commences

0xbrivan2 Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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