Skip to content
This repository was archived by the owner on Apr 18, 2021. It is now read-only.

Compile error: The version of openzeppelin's "pragma solidity" statement doesn't match with the version of VvispRegistry.sol #123

Closed
nujabes403 opened this issue Mar 17, 2019 · 2 comments
Labels
bug Something isn't working contracts About Smart Contract Libraries

Comments

@nujabes403
Copy link
Contributor

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Current behavior

After initializing vvisp, vvisp compile command throws following error:

{ component: 'general',
  formattedMessage: 'openzeppelin-solidity/contracts/ownership/Ownable.sol:1:1: SyntaxError: Source file requires different compiler version (current compiler is 0.5.0+commit.1d4f565a.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version\npragma solidity ^0.5.2;\n^---------------------^\n',
  message: 'Source file requires different compiler version (current compiler is 0.5.0+commit.1d4f565a.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version',
  severity: 'error',
  sourceLocation: 
   { end: 23,
     file: 'openzeppelin-solidity/contracts/ownership/Ownable.sol',
     start: 0 },
  type: 'SyntaxError' }
{ component: 'general',
  formattedMessage: 'openzeppelin-solidity/contracts/math/SafeMath.sol:1:1: SyntaxError: Source file requires different compiler version (current compiler is 0.5.0+commit.1d4f565a.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version\npragma solidity ^0.5.2;\n^---------------------^\n',
  message: 'Source file requires different compiler version (current compiler is 0.5.0+commit.1d4f565a.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version',
  severity: 'error',
  sourceLocation: 
   { end: 23,
     file: 'openzeppelin-solidity/contracts/math/SafeMath.sol',
     start: 0 },
  type: 'SyntaxError' }

Expected behavior

vvisp compile command should compile Migrations.sol without an error.

Minimal reproduction of the problem with instructions

mkdir myDapp && cd myDapp && vvisp init && vvisp compile

What is the motivation / use case for changing the behavior?

Environment


vvisp version: X.Y.Z


Environment:
- Node version: v8.11.3
- Operating system: OS X high sierra

Others:

@nujabes403 nujabes403 changed the title Compile error: openzeppelin's pragma solidity statement doesn't match with VvispRegistry.sol Compile error: The version of openzeppelin's "pragma solidity" statement doesn't match with the version of VvispRegistry.sol Mar 17, 2019
nujabes403 added a commit to nujabes403/HAECHI-CLI that referenced this issue Mar 17, 2019
@nujabes403 nujabes403 mentioned this issue Mar 17, 2019
13 tasks
@nujabes403
Copy link
Contributor Author

Currently, vvisp has a dependency on openzeppelin-solidity library. The version is specified as "openzeppelin-solidity": "^2.1.0" in package.json which means allowing update to the most recent major version as long as the first number of version matches.

However, openzeppelin released 2.2.0 version with chaning pragma solidity versioning to "^0.5.2". (You can see the change in this PR: OpenZeppelin/openzeppelin-contracts@b7d60f2#diff-ff7dca5f7cee2c9e49ab96d5f85d00a0)

In vvisp, the pragma statement for all contracts is pragma solidity >=0.5.0 <0.6.0; which doesn't match with openzeppelin 2.2.0 version's. So there are 2 solution.
1: Downgrade openzeppelin version to 2.1.3
2: Modify pragma statement for all contracts in vvisp.

I think 1 is better than 2, so I downgraded the version of openzeppelin-solidity to 2.1.3.

JhChoy pushed a commit that referenced this issue Mar 17, 2019
@JhChoy
Copy link
Contributor

JhChoy commented Mar 17, 2019

Closed with #124

@JhChoy JhChoy closed this as completed Mar 17, 2019
@JhChoy JhChoy added bug Something isn't working contracts About Smart Contract Libraries labels Mar 17, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Something isn't working contracts About Smart Contract Libraries
Projects
None yet
Development

No branches or pull requests

2 participants