Project

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

Missing zero address validation in MembershipERC1155::initialize function

Summary

The initialize function in the MembershipERC1155contract is supposed to initialize the contract ,however it does no check for zero addresses during the function call

Vulnerability Details

​
function initialize(
string memory name_,
string memory symbol_,
string memory uri_,
address creator_,
address currency_
) external initializer {
// lacks zero address check
_name = name_;
_symbol = symbol_;
creator = creator_;
currency = currency_;
_setURI(uri_);
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(DAO_CREATOR, creator_);
_grantRole(OWP_FACTORY_ROLE, msg.sender);
}

Impact

The contract could initialize with zero address and would have to Re-deploy the whole contract in order to Re-Initialize the function.

Tools Used

manual review

Recommendations

check for zero address in the function and revert if it is a zero address.

​
function initialize(
string memory name_,
string memory symbol_,
string memory uri_,
address creator_,
address currency_
) external initializer {
+ if (creator_ == address(0)) revert CannotBeZeroAddress();
+ if (currency_ == address(0)) revert CannotBeZeroAddress();
_name = name_;
_symbol = symbol_;
creator = creator_;
currency = currency_;
_setURI(uri_);
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(DAO_CREATOR, creator_);
_grantRole(OWP_FACTORY_ROLE, msg.sender);
}
Updates

Lead Judging Commences

0xbrivan2 Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
0xbrivan2 Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!