The burn
and burnBatch
functions in OWPIdentity.sol
restrict burning permissions to accounts with the MINTER_ROLE
. This configuration prevents token holders from burning their tokens unless they have the MINTER_ROLE
, which may lead to user dissatisfaction or loss of intended functionality.
The burn
and burnBatch
functions override the burnable functionality from OpenZeppelin’s ERC1155Burnable
extension. However, instead of allowing any owner or approved account to burn tokens, the current implementation restricts this action to accounts with the MINTER_ROLE
. This restrictive access control limits users' ability to manage their own tokens, which deviates from the expected behavior in token burn functionality. This configuration could frustrate users or potentially result in tokens being permanently locked.
This issue does not directly break security guarantees but restricts flexibility and usability. If the intent was to allow only specific roles to burn, this design is appropriate. However, if the intent was to give token holders burn access, this implementation falls short.
The burn
and burnBatch
functions in OWPIdentity.sol
override OpenZeppelin's ERC1155Burnable
functions, which typically allow the token owner or an approved account to burn tokens. Due to the onlyRole(MINTER_ROLE)
modifier, only accounts with the MINTER_ROLE
can execute these functions. This implementation breaks the usual expected behavior of burnable tokens, leading to potential usability issues.
Impact assessment: Medium
The impact is categorized as medium because this issue does not compromise security but affects usability and could potentially lead to dissatisfaction among users who expect to have control over their tokens. Locked tokens may also affect the perceived value and utility of the tokens in circulation.
The following functions only permit accounts with MINTER_ROLE
to burn tokens:
Attempting to burn tokens without the MINTER_ROLE
will revert with an access control error.
To allow token holders to burn their tokens without needing the MINTER_ROLE
, remove the onlyRole(MINTER_ROLE)
modifier from burn
and burnBatch
. Here is an updated code snippet:
This fix ensures that token holders or approved accounts can burn their tokens, aligning with typical ERC1155 burnable token behavior.
OWPIdentity.sol
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.