Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to compile contracts written with solidity 0.5.0 #37

Open
0Alic opened this issue Jan 24, 2019 · 5 comments
Open

Failed to compile contracts written with solidity 0.5.0 #37

0Alic opened this issue Jan 24, 2019 · 5 comments

Comments

@0Alic
Copy link

0Alic commented Jan 24, 2019

I am trying to generate the documentation of my contracts, but the command doxity build in my truffle's project directory fails while compiling my contracts.

Example of contract failing to compile:

pragma solidity ^0.5.0;

/// @title Strategy
/// @notice This contract interface defines the method to compute the final score of a list of data
interface Strategy {

    function compute(uint[] calldata _data) external pure returns(uint);
}

Message got:

SyntaxError: Error parsing *Strategy.sol: Expected "contract", "import", "library", "pragma", "using", comment, end of input, end of line, or whitespace but "i" found. Line: 5, Column: 1

Tools:

Truffle v5.0.2
Solc version used by truffle: 0.5.0

Possible reason

May be doxity using an older and incompatible compiler version of solc and for this reason fails to compile?

@0Alic 0Alic changed the title Failed to compile contracts written with Failed to compile contracts written with solidity 0.5.0 Jan 24, 2019
@roynalnaruto
Copy link

@0Alic yes, doxity uses solc 0.4.24

@0Alic
Copy link
Author

0Alic commented Jan 25, 2019

Is there a way to let doxity use compiler version 0.5.x?

In any case, why does it fail compiling an interface? On remix with solc 0.4.24 I get compiler error on calldata (which I get also with doxity if I change interface with contract).

@roynalnaruto
Copy link

@0Alic

Is there a way to let doxity use compiler version 0.5.x?

You will have to use a version of truffle-compile that uses solc: 0.5.x. You could fork the repository and do that. Check this commit, it was when I was trying to update the versions to make doxity compatible with 0.4.24. Unfortunately nobody is maintaining this repository anymore, but you could fork and try to make it work with 0.5.x.

@0Alic
Copy link
Author

0Alic commented Jan 25, 2019

Exploring the package.json I saw the truffle-compile keyword and I tried to modify the link github.com/digixglobal/truffle-compile.git#017e1962623f7e84bd0c52d8bea8bf278ae79f5e which points to a fork of a dreprecated repository.

Thank you for your time! I will try to figure something out!

@roynalnaruto
Copy link

roynalnaruto commented Jan 26, 2019

May be you can have a look at this branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants