Remix gass estimationa faliure

this is my code

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.21;

contract New  {
    string name;

    function setName(string memory _name)public {
        name=_name;

    }

    function getName()public view returns (string memory){
        return name;
    } 
    
}

im new to this so im following a tutorial

but evry time i try to deploy it this hapend

Hi, welcome to the community! :wave:

Your contract seems like simple enough, I notice you use a custom external provider, so maybe there is something wrong with it.

1 Like

Seems like the network you are using doesn't support PUSH0 opcode, which was introduced in solidity 0.8.20 and some chains still might not support it. That's why other chains can't find the PUSH0(0x5f) opcode and throw this error.

Consider using 0.8.19 for other chains. OR you can compile with an older version of compiler

This should solve your problem.

If you want to learn more about PUSH0 opcode you can check this small article which explains it pretty well.

1 Like