MyCut

First Flight #23
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Invalid

Dependence on External ERC20 Contracts

Summary

The contract assumes the ERC20 token follows standard behavior, but if the token has vulnerabilities or doesn't conform fully, it could lead to issues.

Vulnerability Details

If the ERC20 token contract has non-standard behavior (e.g., fees on transfer, re-entrancy issues), it can compromise the security of the entire contest protocol.

Impact

This could result in unexpected behavior, failed transfers, or even lost funds.

Tools Used

Manual review

Proof of Concept

A misbehaving ERC20 contract might refuse transfers:

i_token.transfer(msg.sender, managerCut); // Could fail in a non-standard ERC20

Recommendations

Ensure compatibility with standard ERC20 tokens or implement safe wrappers like OpenZeppelin's SafeERC20 to handle non-standard tokens.

correct code:

using SafeERC20 for IERC20;
i_token.safeTransfer(msg.sender, managerCut);
Updates

Lead Judging Commences

equious Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

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