-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
File-level inline assembly blocks #9282
Comments
Importing should work nicely now that we reserved dots in identifiers! |
Shadowing: if there is a file-level inline-assembly function |
Some relevant issues from the past:
|
Exactly, this is a solution to the problem in #1319. |
To be more precise about importing: Namespaces could be introduced using import statements to get qualified functions like To be more precise about the shadowing: yul functions in file-level blocks would occupy the same namespace as solidity objects (be proper We could reserve one special identifier in Yul, in case we ever decide to expose compiler generated functions in any way (to use it as namespace for those e.g. |
Discussion: Pretty clear how to do it, only question is whether it is useful. |
While working on the yul-phaser I compiled a list of a few publicly available contracts with more substantial assembly blocks to use as input in experiments (#7806 (comment)). It might come in handy if we want to gain more insight into how people organize assembly-heavy contracts in practice: |
Added some examples in #10282: https://github.com/ethereum/solidity/blob/stdlib/stdlib/assembly.sol |
Not sure why we were wondering if this is useful - at the moment I'd say it rather clearly is and we just had a similar request in #13472, so I'd say we can consider this as "nice-to-have" at least. And I don't see any open design questions or blockers on this. I'll actually even move it to "must have eventually". |
Just like free functions, inline assembly blocks could be allowed at file level. This would make it possible to write helper functions in yul that can be called from any inline assembly block. Maybe we could even import these yul functions using import statements.
The text was updated successfully, but these errors were encountered: