Project

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

Missing Event Emission on URI Change

Description:

The setURI function in the MembershipERC1155 contract allows the DAO creator to set a new URI for all token types. However, the function does not emit an event when the URI is changed. Emitting an event when the URI is changed is a good practice as it provides transparency and allows off-chain systems to track changes.

Implementation

/// @notice Set a new URI for all token types
/// @param newURI The new URI to set
function setURI(string memory newURI) external onlyRole(DAO_CREATOR) {
_setURI(newURI);
}

Issue: The function changes the URI without emitting an event, which can make it difficult to track changes to the URI.

Recommendation: Add an event emission to the setURI function to notify when the URI is changed. Here is a suggested implementation:
Define the Event: Add an event definition for URI changes.

event URIChanged(string newURI);

Emit the Event: Modify the setURI function to emit the URIChanged event.

/// @notice Set a new URI for all token types
/// @param newURI The new URI to set
function setURI(string memory newURI) external onlyRole(DAO_CREATOR) {
_setURI(newURI);
emit URIChanged(newURI);
}
Updates

Lead Judging Commences

0xbrivan2 Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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