DigixGlobal / doxity

📑 Documentation Generator for Solidity
BSD 3-Clause "New" or "Revised" License
212 stars 59 forks source link

Failed to compile contracts written with solidity 0.5.0 #37

Open 0Alic opened 5 years ago

0Alic commented 5 years ago

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?

roynalnaruto commented 5 years ago

@0Alic yes, doxity uses solc 0.4.24

0Alic commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

May be you can have a look at this branch