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) |
|
} |
In
TransferLib::release, when amount is 0 the call still reverts withInsufficientBalance(). 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 separateifat the cost of extra bytecode size .the-compact/src/lib/TransferLib.sol
Lines 52 to 55 in 0c72827
the-compact/src/lib/TransferLib.sol
Lines 184 to 187 in 0c72827