ethereum / solidity

Solidity, the Smart Contract Programming Language
https://soliditylang.org
GNU General Public License v3.0
22.67k stars 5.62k forks source link

The EVM version used by the selected environment is not compatible with the compiler EVM version. #15114

Open Iverson-cui opened 1 month ago

Iverson-cui commented 1 month ago

Description

I'm using geth to build a private chain and then deploy a smart contract using remix. But when I deploy and call some functions in remix this error comes out"The EVM version used by the selected environment is not compatible with the compiler EVM version." with some "invalid opcode" error. I prefer using geth of version I mentioned below. Can anybody tell me which version of solc is compatible with this version of geth? Or how to solve this problem?

Environment

Steps to Reproduce

// Some *minimal* Solidity source code to reproduce the bug.
// This is the file I have tried. It's just a simple test file.
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.18;

contract SimpleStorage {
    uint256 public favoriteNumber;
    struct person {
        uint256 age;
        string name;
    }
    person[] public array_of_people;
    // type is person[], visibility is public and name is "array_of_people
    mapping(string => uint256) public findnum;
    function addperson(string memory _name, uint256 favnum) public {
        array_of_people.push(person(favnum,_name));
        findnum[_name] = favnum;
    }

    function store(uint256 _favoriteNumber) public  {
        favoriteNumber = _favoriteNumber;
    }
    function retrive() view public returns (uint256) {
        return favoriteNumber;
    }

}