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

Adding checkOp062 allowed precompiles #241

Merged
merged 2 commits into from
Feb 17, 2025
Merged

Adding checkOp062 allowed precompiles #241

merged 2 commits into from
Feb 17, 2025

Conversation

shahafn
Copy link
Contributor

@shahafn shahafn commented Jan 27, 2025

No description provided.

@@ -802,4 +834,17 @@ export class ERC7562Parser {
}
}
}

private _isPrecompiled (address: string): boolean {
Copy link
Contributor

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)

Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Contributor

@drortirosh drortirosh left a 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.

@shahafn shahafn merged commit f058ef7 into master Feb 17, 2025
4 checks passed
@shahafn shahafn deleted the allowed-precompiles branch February 17, 2025 12:45
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.

3 participants