Skip to content
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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Conversation

dianakocsis
Copy link

No description provided.

PERMIT2.permit(msgSender(), permitSingle, data);
(success, output) = address(PERMIT2).call(
abi.encodeWithSignature(
'permit(address,((address,uint160,uint48,uint48),address,uint256),bytes)',
Copy link
Collaborator

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

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.

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.

Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants