Source: OpenZeppelin Midnight - Compact Contracts Audit
Description
The _update function in the MultiToken contract reduces the source account's balance without checking if the token id record has been initialized. In practice, this will only occur when the value is set to zero. This means a zero-value transfer, mint or burn of an uninitialized token will revert due to an invalid lookup, rather than with an explicit error message.
Recommendation
Consider skipping the balance update when the value is zero.
Source: OpenZeppelin Midnight - Compact Contracts Audit
Description
The
_updatefunction in theMultiTokencontract reduces the source account's balance without checking if the tokenidrecord has been initialized. In practice, this will only occur when thevalueis set to zero. This means a zero-value transfer, mint or burn of an uninitialized token will revert due to an invalid lookup, rather than with an explicit error message.Recommendation
Consider skipping the balance update when the
valueis zero.