-
Notifications
You must be signed in to change notification settings - Fork 208
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
allow permit2 to silently fail to avoid dos #417
base: dev
Are you sure you want to change the base?
Conversation
PERMIT2.permit(msgSender(), permitSingle, data); | ||
(success, output) = address(PERMIT2).call( | ||
abi.encodeWithSignature( | ||
'permit(address,((address,uint160,uint48,uint48),address,uint256),bytes)', |
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.
auditors: would love to know if theres a better practice as i know encodeWithSignature
is considered error-prone. permit
is an overloaded function so we cannot use encodeCall
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.
Nothing comes to mind, unfortunately.
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.
encodeWithSelector
can't be used for the same reason. Could define a separate interface that uniquely defines the permit functions, but it'll complicate the issue as opposed to just inlining it.
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.
Probably you could use try-catch
instead of low-level call.
No description provided.