-
Notifications
You must be signed in to change notification settings - Fork 228
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
Adding checkOp062 allowed precompiles #241
Conversation
@@ -802,4 +834,17 @@ export class ERC7562Parser { | |||
} | |||
} | |||
} | |||
|
|||
private _isPrecompiled (address: string): boolean { |
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.
bad test: instead of checking on the address, check if it has code: a precompiled contract is a call to an address without code (e.g. any L2 has its own precompiles, obviously are all forbidden)
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.
Not all addresses without code are precompiles, so not sure what you suggest. Anyway, I moved the check from the tracer to the parser
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.
Addresses without code are forbidden by OP-041 anyways. This is a double-check I think, in case some "precompile" actually has a solidity code injected into it, right?
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.
right.. we're only showing example precompiles..
also, the separation of isPrecompile and forbidden is not really required... we're only interested in allowedPrecompiles. anything else (without code) is forbidden
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.
you use erc7562Call.contractSize
, so its natural to check the precompiles out of them: those without code.
No description provided.