1

I am using solidity extension by Juan Blanco.

pragma solidity ^0.4.17;
    
contract Inbox
{
    string public message;
        
    constructor(string initialMessage) public {
        message = initialMessage;
    }
        
    function setMessage(string newMessage) public {
        message = newMessage;
    }
}

I get the error message "Source file requires different compiler version (current compiler is 0.7.4+commit.3f05b770.Emscripten.clang) - note that nightly builds are considered to be strictly less than the released version"

I am getting too many error messages / warnings if I do pragma solidity >=0.4.17; so I prefer 0.4.17.

1

You need to set the compiler version within VSCode through the command palette:

Menu->View->Command Palette->Solidity: Change workspace compiler version (Remote)

or

Menu->View->Command Palette->Solidity: Change global compiler version (Remote)

and then, select the compiler version. Sometimes you need to close/open VSCode so that changes are applied.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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