NFTBridge
60,000 USDC
View results
Submission Details
Severity: medium
Invalid

TokenUtil.sol - SWC-101: Potential for arithmetic operations to cause overflows/underflows., SWC-107: External calls during token transfers may be vulnerable.

  • Summary: Analyzed for common Solidity vulnerabilities in utility functions related to tokens.

  • Vulnerability Details:

    • Unchecked Arithmetic: SWC-101: Potential for arithmetic operations to cause overflows/underflows.
      Severity: Medium

      uint256 newBalance = tokenBalance - amount;

      Line: 42

    • Reentrancy Risks: SWC-107: External calls during token transfers may be vulnerable.
      Severity: High

      (bool success, ) = token.call(abi.encodeWithSignature("transfer(address,uint256)", to, amount));

      Line: 65

  • Impact: Could lead to incorrect token balances or reentrancy attacks.

  • Tools Used: Manual code inspection.

  • Recommendations:

    • Arithmetic Fix: Use safe math libraries to prevent overflows and underflows.

      uint256 newBalance = SafeMath.sub(tokenBalance, amount);
    • Reentrancy Fix: Implement ReentrancyGuard for critical functions.

      import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
Updates

Lead Judging Commences

n0kto Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

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