You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the library Allowance, neither updateAll nor updateAmountAndExpiration check that the expiration passed is not in the past.
That means it's possible to set an approval expiration timestamp that ends up being lower than block.timestamp (and greater than 0, which is the special case), and have the call succeed.
Seems like a minor oversight - I don't think it has worrying consequences. As long as user sets a reasonable expiration for the allowance, things should be fine. Worst case scenario the expired allowance is stored, the user notices the problem, and submits another tx to update the allowance.
My initial take is that the behavior is exactly the same whether we revert on already-expired allowance or succeed and store it anyways.
Reverting saves a little gas for the user who made the mistake, and is a little more clear that the approval is not going to be usable. But I'm not sure it's even worth the added (admittedly tiny) gas to every other permit/approval to check+revert in this rare case. Esp given its a check that can/will be easily caught in interfaces/sdk integrations
In the library
Allowance
, neitherupdateAll
norupdateAmountAndExpiration
check that theexpiration
passed is not in the past.That means it's possible to set an approval expiration timestamp that ends up being lower than
block.timestamp
(and greater than 0, which is the special case), and have the call succeed.Seems like a minor oversight - I don't think it has worrying consequences. As long as user sets a reasonable expiration for the allowance, things should be fine. Worst case scenario the expired allowance is stored, the user notices the problem, and submits another tx to update the allowance.
Here's a simple test case to reproduce:
The text was updated successfully, but these errors were encountered: