Skip to content

L-01: Zero-value transfers may revert outside an assertion #425

@0xisk

Description

@0xisk

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.

Metadata

Metadata

Assignees

Labels

auditIssues reported by an audit

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions