Add std/opcodes#405
Merged
Merged
Conversation
axic
commented
May 22, 2026
| return res; | ||
| } | ||
|
|
||
| function revert(a: word, b: word) -> () { |
Contributor
Author
There was a problem hiding this comment.
This will likely conflict with special handling for revert(string literal).
67c581b to
68715bf
Compare
axic
commented
May 22, 2026
| } | ||
|
|
||
| return tail; | ||
| function encodeIntoFromBytesLike(srcPtr:word, basePtr:word, offset:word, tail:word) -> word { |
Contributor
Author
There was a problem hiding this comment.
As an example using the opcode helpers assembly blocks can be rewritten line-by-line, and after that it is easy to simplify it too.
d021af3 to
b4b79f2
Compare
255f6c9 to
6096b30
Compare
Contributor
Author
|
Will split this into two parts:
|
47fa1b8 to
3fb17a4
Compare
Introduces a small Python generator that builds std/opcodes.solc from a declarative opcode list (name, inputs, output). Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
The `return` mnemonic clashes with solcore's `return` statement keyword, so the generated wrapper for the EVM `return` opcode now uses the name `return_`. The inner assembly call still emits the real `return` opcode. Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
Exercises each of the four wrapper shape categories with two opcodes each: stop/invalid (no input, no return), address/timestamp (no input, returns word), pop/mstore (input, no return), add/mload (input, returns word). Also regenerates std/opcodes.solc from gen-std-opcodes.py so the `return` wrapper rename to `return_` is reflected on disk (the script was already updated, but the generated file was stale and unparseable because `return` is a reserved word). Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
Contributor
Author
|
@rodrigogribeiro this should be ready. Moved the usage to #449 (blocked by #435) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The goal here is to reduce ad-hoc helpers. The
std/opcodes.solcfile could be auto-generated, following fixed templates.