-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
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 .
the-compact/src/lib/TransferLib.sol
Lines 52 to 55 in 0c72827
if or(iszero(amount), gt(amount, fromBalance)) { | |
mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`. | |
revert(0x1c, 0x04) | |
} |
the-compact/src/lib/TransferLib.sol
Lines 184 to 187 in 0c72827
if or(iszero(amount), gt(amount, fromBalance)) { | |
mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`. | |
revert(0x1c, 0x04) | |
} |
Metadata
Metadata
Assignees
Labels
No labels