OpenST / mosaic-contracts

Mosaic-0: Gateways and anchors on top of Ethereum to scale DApps
https://discuss.openst.org/c/mosaic
MIT License
114 stars 31 forks source link

Publish metadata of contracts while publishing package #801

Open abhayks1 opened 4 years ago

abhayks1 commented 4 years ago

Problem

For compilation of contracts, publisher global truffle version is used. This is a problem since truffle global version can be different everytime mosaic contracts npm is published.

"compile": "truffle compile",

Solution

Use node modules truffle version for contracts compilation

"compile": "./node_modules/.bin/truffle compile",

Problem Contracts are being compiled on different compiler version

Proposed Solution Publish metadata of contracts when publishing package

pgev commented 4 years ago

@abhayks1 as far as I know npm run always uses the binaries first from 'node_modules/.bin', hence we do not explicitly do what is proposed in ticket.

abhayks1 commented 4 years ago

@pgev Thank you for the comment. I did a quick test and it seems you are right.

Strangely contracts on etherscan are being verified on different solc versions(other than 0.5.0). Please see the report for contracts verification. https://github.com/mosaicdao/mosaic-pm/blob/master/specification-discussions/20191206-etherscan-verification.md#chain-contracts-verification This triggered that when publishing package, somehow compilation was done on different solc versions.

Any idea how could that happen?