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

Only consider errors from modifiers in use #714

Open
ericglau opened this issue Jan 18, 2023 · 0 comments
Open

Only consider errors from modifiers in use #714

ericglau opened this issue Jan 18, 2023 · 0 comments

Comments

@ericglau
Copy link
Member

Related to #702

Modifiers with unsafe opcodes in parent contracts are reported, but even if those modifiers are not used. This is because in https://github.com/OpenZeppelin/openzeppelin-upgrades/blob/master/packages/core/src/validate/run.ts, getDirectFunctionOpcodeErrors finds the modifier's FunctionCall containing the unsafe opcode, although the NodeType is a ModifierDefinition rather than a FunctionDefinition. Therefore isInternalFunction evaluates to false since this is not a FunctionDefinition, and the check is not skipped.

Instead, the above should skip modifiers (which are internal), but getReferencedFunctionOpcodeErrors should also look for ModifierInvocation nodes and dereference those.

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

No branches or pull requests

1 participant