Skip to content

Zero-amount release reverts with InsufficientBalance #132

@KumaCrypto

Description

@KumaCrypto

In TransferLib::release, when amount is 0 the call still reverts with InsufficientBalance(). However balance isn’t the problem here - it’s just a zero amount—so the revert can be confusing for users. We can move it to the separate if at the cost of extra bytecode size .

if or(iszero(amount), gt(amount, fromBalance)) {
mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.
revert(0x1c, 0x04)
}

if or(iszero(amount), gt(amount, fromBalance)) {
mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.
revert(0x1c, 0x04)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions