0

I am trying to deploy a simple smart contract for testing. Attached are the output of: 'npm run test' as well as my test.js file and my package.json file

I hope its something obvious sorry if this is a noob question. Thank you for your time.

enter image description here

enter image description here

enter image description here

enter image description here

2 Answers 2

0

well i figured it out. It was an issue with solc version 0.8.21

to fix it, I ran: 'npm uninstall solc'

then: npm install --save [email protected]

then, I of course changed the contract code from "pragma solidity ^0.8.21;" to "pragma solidity ^0.8.17;"

It works now, as to why, I couldnt tell you, but now 'npm run test' executes without throwing any errors.

enter image description here

0

Here is the reason why it worked with lesser version.

This is because solidity 0.8.20 introduces the PUSH0(0x5f) opcode which is only supported on the ETH mainnet and not on any other chains. That's why other chains can't find the PUSH0(0x5f) opcode and throw this error.

Consider either using a version less than 0.8.20 for other chains or using a different EVM version other than the Shanghai one.

If you want to learn more about PUSH0 opcode you can check this small article which explains it pretty well. https://www.zaryabs.com/push0-opcode/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.