Project

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

Passed `amount` in `MembershipERC1155::sendProfit` must be greater than zero

Summary

Passed amountt should be greater than 0.

Vulnerability Details

Passed amount in MembershipERC1155::sendProfit must be greater than zero, otherwise the transaction will be useless.

Impact

Gas usage without actual transfer.

Tools Used

Manual review

Recommendations

Add require to check if amount is greater than 0:

function sendProfit(uint256 amount) external {
uint256 _totalSupply = totalSupply;
// @audit amount must be greater than 0
+ require(amount > 0, "Amount must be greater than zero");
if (_totalSupply > 0) {
totalProfit += (amount * ACCURACY) / _totalSupply;
IERC20(currency).safeTransferFrom(msg.sender, address(this), amount);
emit Profit(amount);
} else {
IERC20(currency).safeTransferFrom(msg.sender, creator, amount); // Redirect profit to creator if no supply
}
}
Updates

Lead Judging Commences

0xbrivan2 Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
0xbrivan2 Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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