Project

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

Smart Contract Audit Report: OWPIdentity.sol

Summary

The OWPIdentity smart contract implements an ERC1155 token system with role-based access control. It inherits from OpenZeppelin contracts for enhanced security. While the contract follows many good practices, there are several vulnerabilities and areas for improvement identified during the audit.

Vulnerability Details

Reentrancy Risk in Burn Functions

  • Location: burnBatchMultiple function

  • Description: The function contains a loop calling _burn for each token, which could be vulnerable to reentrancy attacks if not properly protected.

Precision Loss in Burning Mechanism

  • Location: burn and burnBatch functions

  • Description: The use of uint256 for token amounts could lead to precision loss, potentially allowing users to burn more tokens than intended.

Lack of Event Emission

  • Location: All burning-related functions

  • Description: No events are emitted when tokens are burned, making it difficult to track off-chain transactions.

Potential Denial of Service (DoS)

  • Location: supportsInterface function

  • Description: The function always returns true, which could potentially be exploited if not properly implemented in derived contracts.

Unbounded Loops

  • Location: burnBatchMultiple function

  • Description: The function uses a loop without bounds checking, which could cause issues if passed very large arrays.

Lack of Access Control

  • Location: uri function

  • Description: The function is public and doesn't check roles, allowing anyone to modify the URI.

Impact

These vulnerabilities could potentially lead to:

  • Unauthorized access to sensitive functions

  • Unexpected behavior during token burning operations

  • Difficulty in tracking on-chain transactions

  • Potential denial of service attacks

  • Unintended token burning due to precision loss

  • The impact ranges from minor inconvenience to significant financial losses depending on the specific attack vector and implementation details.

Tools Used

Manual code review

Recommendations

  • Implement checks-effects-interactions pattern in critical functions like burnBatchMultiple.

  • Add events for important state changes, particularly for token burning operations.

  • Implement a maximum balance per user to prevent accidental over-burns.

  • Restrict access to sensitive functions like setURI and uri to authorized roles only.

  • Implement proper error handling and revert conditions throughout the contract.

  • Consider adding a maximum number of tokens that can be burned in a single transaction.

  • Review and possibly restrict the supportsInterface function to avoid potential exploits.

  • Implement bounds checking in loops, especially in functions like burnBatchMultiple.

Updates

Lead Judging Commences

0xbrivan2 Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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