Project

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

MembershipERC1155::sendProfit() cannot send profit to creator if the address is blacklisted

Summary

If USDC (or another token) has restrictions such as blocking transfers to certain addresses (including creator), the fallback transfer (IERC20(currency).safeTransferFrom(msg.sender, creator, amount)) could fail. This is a potential vulnerability because the fallback relies on the ability to send tokens to the creator, and if USDC blocks this transfer, the profit could not be sent, breaking the function.

Vulnerability Details

The function handles two cases for sending profits:

  • Normal case: When there is a non-zero total supply, it distributes the profit among holders.

  • Fallback case: When there is no total supply (_totalSupply == 0), it transfers the entire profit to the creator.

So the fallback case is prone to this issue. Vulnerable code :

function sendProfit(uint256 amount) external {
uint256 _totalSupply = totalSupply;
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
}
}

Impact

Potential Loss of Funds

  • Impact: In the worst-case scenario, if the creator's address is permanently blocked and no fallback mechanism exists, profits could be indefinitely stuck and unclaimed.

  • Consequence: Users or token holders could lose their rightful share of profits, and the funds could be rendered unusable, which is a direct financial loss for the project.

Failure to Transfer Profit (Function Breaks)

  • Impact: If the creator address is blocked or restricted by the USDC token (or any other token used for profit distribution), the safeTransferFrom to the creator will fail.

  • Consequence: The function would fail to execute correctly, and profits would not be distributed. This would disrupt the entire profit distribution process, potentially leading to financial losses or unfulfilled obligations to token holders.

Tools Used

Manual Review

Recommendations

Implement a mechanism to send the profit to the contract and check if sending to the creator address is allowed or working fine. If not, then implement mechanism to transfer it to the allowedAddress which could provided or set by the recipient.

Updates

Lead Judging Commences

0xbrivan2 Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
0xbrivan2 Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!