1

my ide is vs(can find solc version is 0.4.17),but my solcjs is 0.4.24.when I run this simple code

`pragma solidity^ 0.4.45;
contract test{
    function multiply(uint a) constant returns(uint d){
        return a*7;
    }
}

there is warning "security/enforce-explicit-visibility: No visibility specified explicitly for multiply function."

When I run another simple code a warning come with "[solc] Function state mutability can be restricted to pure".

Is there some wrong with version conflict about solc/solcjs? How I solve it?

0
0

The first warning is saying that you forgot to mark the visibility (public, private, external or internal) of your function.

The second means that your function can be marked as pure, which means that it does not read or write from the blockchain. constant or view functions are allowed to read from the blockchain, but yours doesn't.

See the docs for more specifics

This should elimintae some warnings:

pragma solidity ^0.4.24;
contract test{
    function multiply(uint a) public pure returns(uint d){
        return a*7;
    }
}

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