3
Ajeeth Kannan
Ajeeth Kannan

Source file requires different version

Hi, I am getting the source file requires different version error while running the code in remix.ethereum.org

pragma solidity 0.4.24;

contract SimpleCounter {
    int counter; //state variable
    
    constructor() public {
        counter = 0;
    }
    
    function getCounter() view public returns(int) {
        return counter;
    }
    
    function increment() public {
        counter = counter + 1;
    }
    
    function decrement() public {
        counter = counter - 1;
    } 
    
}

Answers

  1. 3
    Bardia Pourvakil
    Bardia Pourvakil
    Hey Ajeeth, make sure that your Remix compiler version matches up to the compiler version you have declared at the top of your file! Also, we are moving our student questions to Discord, please join here and ask any further questions you have in the appropriate channel: https://discord.gg/phUqFtV
  2. 3
    Dayle Long
    Dayle Long
    Hi, make sure that your computer is updated to the correct version and try to update the application. You can also look at some recommendations on this site or google it.
  3. 3
    Dayle Long
    Dayle Long
    Hi, make sure that your computer is updated to the correct version and try to update the application. You can also look at some recommendations on this site or google it.