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

Bridge.sol - SWC-107: External call may lead to reentrancy

1. Bridge.sol

  • Summary: The Bridge.sol contract has been analyzed for common Solidity vulnerabilities. The analysis identified a reentrancy risk due to an external call and an unchecked arithmetic operation that could lead to an underflow.

  • Vulnerability Details:

    • Reentrancy Risk: SWC-107: External call may lead to reentrancy.

      (bool success, ) = targetContract.call{value: amount}(data);

      Line: 45

    • Unchecked Arithmetic: SWC-101: Subtraction may cause underflow.

      uint256 newBalance = currentBalance - withdrawalAmount;

      Line: 60

  • Impact: Could lead to unauthorized fund transfers or incorrect balances.

  • Tools Used: Manual code inspection.

  • Recommendations:

    • Reentrancy Fix: Implement ReentrancyGuard to protect external calls.

      import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
    • Arithmetic Fix: Use Solidity 0.8+ built-in overflow/underflow protection.

      uint256 newBalance = SafeMath.sub(currentBalance, withdrawalAmount);
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.