Change EVM version to an older one to support older blockTags #6
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.
I get the following error message when using an old blockTag:
invalid opcode: PUSH0
It looks like
PUSH0
was introduced in Shanghai in Apr 2023.Targeting an older EVM version and recompiling the contract seems to work.
solc has an
--evm-version
argument but solcjs does not. But it's possible to specify it using the standard JSON interface. I created asolidity-config.json
file (or rather ChatGPT did it for me) and modifiedbuild-solc
inpackage.json
. I also adjustedsrc.ts/_build.ts
to use the new output which is a single JSON file with both the ABI and bytecode.Byzantium released in Oct 2017 was the oldest EVM version I managed to get working. When trying to use an even older version I get the following compile error:
TypeError: The "staticcall" instruction is only available for Byzantium-compatible VMs