Replies: 1 comment
-
I'm going to lock this discussion, because I don't think that changing this function to not revert when passing an |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We're currently using the default checked arithmetic in the
decreaseAuthorization
implementation:https://github.com/sablierhq/v2-core/blob/5331ac43f6dcae9bc4ba1b795b89d0153ac2d7da/src/SablierV2.sol#L60-L65
This is good because it prevents underflowing
uint256
. But what if we instead used unchecked arithmetic and took the minimum between the givenamount
and the current authorization in the argument passed toauthorizeInternal
?This would be different to the way OpenZeppelin implements the
decreaseAllowance
function, but if it would save gas, it might be worth it.Beta Was this translation helpful? Give feedback.
All reactions