Skip to content

Problems compiling SimpleStorage.sol with truffle #1

@enrutador

Description

@enrutador

Hi very increible work ¡¡¡ Congratulations.
I have a problem wit the compilation of the contract SimpleStorage.sol with Truffle:

root@etherserver01:~/truffle/contracts# truffle compile

Node v10.15.2
Truffle v5.0.20 (core: 5.0.20)


Compiling your contracts...
===========================
Error: CompileError: ParsedContract.sol:10:20: ParserError: The state mutability modifier "constant" was removed in version 0.5.0. Use "view" or "pure" instead.
    function get() constant returns (string x) {
                   ^------^

Compilation failed. See above.
    at async.whilst.error (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-compile/profiler.js:368:1)
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-compile/~/async/dist/async.js:969:1
    at next (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-compile/~/async/dist/async.js:5222:1)
    at Promise.all.then.results (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-compile/profiler.js:350:1)
Truffle v5.0.20 (core: 5.0.20)
Node v10.15.2

I use "view or pure" versus constant return , and put pragma solidity >=0.4.21 <0.6.0; , but dont compile. Can you help me ?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions