Project

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

Unreachable Functions and Role-Management in `MembershipERC1155`

Summary

Due to role assignment limitations, certain MembershipERC1155 functions and role-management features are unreachable, preventing full utilization of the contract.

Vulnerability Details

In MembershipERC1155, roles are assigned during initialization as follows:

_setURI(uri_);
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(DAO_CREATOR, creator_);
_grantRole(OWP_FACTORY_ROLE, msg.sender);

The msg.sender here is MembershipFactory, which creates MembershipERC1155 through createNewDAOMembership.

TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy(
membershipImplementation,
address(proxyAdmin),
abi.encodeWithSignature("initialize(string,string,string,address,address)", daoConfig.ensname, "OWP", baseURI, _msgSender(), daoConfig.currency)
);

The MembershipFactory serves as the entry point for users to mint and burn tokens, requiring the OWP_FACTORY_ROLE role, as shown below:

function mint(address to, uint256 tokenId, uint256 amount) external override onlyRole(OWP_FACTORY_ROLE) {
totalSupply += amount * 2 ** (6 - tokenId); // Update total supply with weight
_mint(to, tokenId, amount, "");
}

However, functions such as burnBatch, burnBatchMultiple, and callExternalContract also require OWP_FACTORY_ROLE, but they cannot be accessed or called through MembershipFactory. Additionally, role-management functions, such as those associated with DEFAULT_ADMIN_ROLE, remain inaccessible, as they require this role to manage permissions, which is exclusively assigned to MembershipFactory. This results in limited functionality for MembershipERC1155 as certain actions cannot be performed.

function callExternalContract(address contractAddress, bytes memory data) external payable onlyRole(OWP_FACTORY_ROLE) returns (bytes memory ) {
...
}

Impact

Functions like burnBatch, burnBatchMultiple, callExternalContract, and role-management functionalities in MembershipERC1155 are effectively unreachable, resulting in incomplete contract functionality and restricting necessary role-management operations.

Tools Used

Manual

Recommendations

Reevaluate the design and integration between MembershipFactory and MembershipERC1155 to ensure that the intended functionalities and role management operations can be accessed and executed.

Updates

Lead Judging Commences

0xbrivan2 Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
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.