New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imp(erc20): adjust erc20 authorizations handling #2012
Conversation
…nd passing expiration to utils
ENG-2289 Rework authorization handling
ContextCurrently, the authorization mechanism is implemented in a way that only approvals for one token denomination are handled. The discussion around this was held on PR #2005. ExpectedAdjust the authorization handling to allow approvals for multiple denominations.
|
Codecov Report
@@ Coverage Diff @@
## main #2012 +/- ##
==========================================
- Coverage 69.89% 69.87% -0.03%
==========================================
Files 334 334
Lines 24909 24946 +37
==========================================
+ Hits 17411 17431 +20
- Misses 6599 6611 +12
- Partials 899 904 +5
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments, consider using SafeSub
in some places to avoid the panic.
Setting to draft to work on the uint256 overflow behavior. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great work @MalteHerrmann
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, a few lines need to be covered too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Description
This PR adjusts the way the ERC20 precompile handles the authorizations. Most notably, it's now possible to extend pre-existing send authorizations with different denominations instead of having them overwritten with always just one denom. Additionally, over and underflows are checked for approvals & increasing/decreasing allowances.
Closes ENG-2289