Trying to use Solidity v0.5.0
with Truffle. Starting v5.0.0
Truffle allows setting solc
version in truffle.js
, as per its docs
I tried both native
compilers: {
solc: {
version: "native"
}
}
with
$ solc --version
solc, the solidity compiler commandline interface
Version: 0.5.0+commit.1d4f565a.Linux.g++
and solc-js v0.5.0
compilers: {
solc: {
version: "0.5.0"
}
}
all that with Truffle v5:
$ truffle version
Truffle v5.0.0-beta.1 (core: 5.0.0-beta.1)
Solidity v0.4.25 (solc-js)
v0.4.25
here is its default packed solc-js version, not what I use in the project.
But even an empty sample contract
pragma solidity ^0.5.0;
contract Sample {
constructor() internal {}
}
fails to compile:
$ truffle compile
TypeError: Error parsing /path/to/project/contracts/Sample.sol: solc.compileStandard is not a function
at Object.parseImports (/home/etsvigun/.nvm/versions/node/v10.13.0/lib/node_modules/truffle/build/webpack:/packages/truffle-compile/parser.js:49:1)
at Object.getImports (/home/etsvigun/.nvm/versions/node/v10.13.0/lib/node_modules/truffle/build/webpack:/packages/truffle-compile/profiler.js:332:1)
at Promise.all.then.results (/home/etsvigun/.nvm/versions/node/v10.13.0/lib/node_modules/truffle/build/webpack:/packages/truffle-compile/profiler.js:305:1)
Is there a way to use Solidity v0.5.0 with Truffle already, or doesn't that work yet?