enzymefinance / protocol

Enzyme Protocol Implementation
https://enzyme.finance
GNU General Public License v3.0
374 stars 155 forks source link

Deploy to ETHPM #28

Closed retotrinkler closed 7 years ago

retotrinkler commented 7 years ago

Relevant branch: https://github.com/melonproject/protocol/tree/ethpm

root@x2:~/Melon/protocol$ truffle publish
Gathering contracts...
SyntaxError: Expected "!", "!=", "(", ")", "+", "++", "-", "--", "0", "<", "<=", "==", ">", ">=", "[", "^", "delete", "false", "hex", "mapping", "new", "this", "true", "v", "~", [1-9], comment, end of line, identifier, number, string, or whitespace but "{" found.
    at peg$buildStructuredError (/home/reto/.nvm/versions/node/v7.3.0/lib/node_modules/truffle/node_modules/solidity-parser/build/parser.js:1272:12)
    at Object.peg$parse [as parse] (/home/reto/.nvm/versions/node/v7.3.0/lib/node_modules/truffle/node_modules/solidity-parser/build/parser.js:13858:11)
    at Object.parse (/home/reto/.nvm/versions/node/v7.3.0/lib/node_modules/truffle/node_modules/solidity-parser/index.js:34:23)
    at /home/reto/.nvm/versions/node/v7.3.0/lib/node_modules/truffle/node_modules/truffle-compile/profiler.js:259:36
    at tryToString (fs.js:425:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:412:12)
travs commented 7 years ago

Waiting for ConsenSys/solidity-parser#71

cgewecke commented 7 years ago

Hi @travs, this bug should be resolved on master at solidity-parser with Consensys/solidity-parser#72. Thanks for reporting.

If you want to run with this fix before Truffle updates to a new version of the parser I think you'll need to unpin the dependency in your local truffle and tie it to the solidity-parser repo.

travs commented 7 years ago

@cgewecke Excellent, thanks for getting on this so quickly! :smile: Have updated ConsenSys/solidity-parser#71

Edit:

err, still a small issue... check my updated comment

travs commented 7 years ago

Note: have added shrinkwrap file to specify solidity-parser repo so we can use their latest commits before the version is updated, and truffle incorporates that new version.

We should remove the shrinkwrap file when truffle has a version of the parser that works for our contracts (#40); the shrinkwrap file is only useful for deploying a version of the protocol to ethpm before those changes are made in truffle.

federicobond commented 7 years ago

Should be fixed in solidity-parser's master branch now. All credit goes to @cgewecke.

federicobond commented 7 years ago

@travs turns out that trailing commas are not permitted in Solidity and were only allowed because of a bug in the implementation. See discussion here: https://github.com/ethereum/solidity/pull/2378

I will eventually roll back the support for trailing commas, and solc will be fixed as well, so please update your contracts accordingly.

travs commented 7 years ago

@federicobond Really appreciate you letting us know this, will update contracts.

retotrinkler commented 7 years ago

will stash this for now