Skip to content

Lesson 5 | "VM Exception while processing transaction: invalid opcode" error when trying to deploy a contract #5497

Answered by MattBCarr
semokka asked this question in Q&A
Discussion options

You must be logged in to vote

Seems like for some reason the version of solidity you're using is causing issues... change the solidity version in your SimpleStorage.sol to

pragma solidity 0.8.19;

and then go ahead and upgrade the solidity compiler in your terminal by running

npm install --save-dev solc@0.8.19

and then finally you want to go ahead delete both the SimpleStorage abi and bin files, making sure to recompile with

npx solcjs --bin --abi --include-path node_modules/ --base-path . -o . SimpleStorage.sol

Should be good after that! Let me know if that works for you...

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@semokka
Comment options

@MattBCarr
Comment options

Answer selected by semokka
@semokka
Comment options

@r-bytes
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants