-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
bug(anvil
): calling function on succesfully deployed contract raises: OpcodeNotFound
#9632
Comments
@blablalf could you provide more details (like if you're using foundry docker image and the version or yours), or a simplified way to reproduce the error. It's quite hard to figure out what goes wrong without such. |
Hello, yes of course. About the image/environnement: From the foundry image I create my own image by adding a private repo and installing a private dependency. The private repo/dependency are foundry projects with evm version set to cancun and solidity
Using this image, when I deploy a container I start a script that compiles the repo, start anvil and deploy the contrats. About the contracts:
About how I get the error:
|
@blablalf could you please try the same with |
After using the nightly I got the same error unfortunately. |
I see, wanted to make sure you run the version with Cancun enabled by default. Just to double check, in
${an_alchemy_mainnet_rpc} is mainnet rpc, any reason you set different chain id? |
I understand, by the way the last time this error was mentioned was in an issue that was over a year old on this repo and was related to cancun support. 31337 is the default anvil chain id, in the current case I don't edit it. I think it can therefore be ignored excepted if you think I should use another chain id. |
Probably won't make any difference but what if you don't specify any (that is inheriting the mainnet chain id)? |
anvil
): calling function on succesfully deployed contract raises: OpcodeNotFound
Oh yes you are right it will follow the forked chain id. I tested it but it didn't change the error. |
Component
Anvil
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.3.0 (a5c5be5 2025-01-06T00:23:40.588668993Z)
What command(s) is the bug in?
Operating System
Linux
Describe the bug
Hello, I am testing my backend with an anvil node inside a docker image. Just after I launch the image container I compile inside it a solidity project with solidity version 0.8.26 that needs cancun upgrade (cancun flag is enabled on these projects). Then I'm forking mainnet with cancun upgrade and deploy the contracts successfully :
Get anvil chain info:
output:
When I call a specific function of my solidity code, I get the following error:
(I anonymised some data like func name and args).
Since the call doesn't revert in mainnet, I wonder where can this error (
OpcodeNotFound
) come from.The text was updated successfully, but these errors were encountered: