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

Change EVM version to an older one to support older blockTags #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

peteriscan
Copy link

I get the following error message when using an old blockTag: invalid opcode: PUSH0

It looks likePUSH0 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 a solidity-config.json file (or rather ChatGPT did it for me) and modified build-solc in package.json. I also adjusted src.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

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.

1 participant