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

Compilation fails because of different solidity versions #238

Open
rappie opened this issue May 23, 2023 · 0 comments
Open

Compilation fails because of different solidity versions #238

rappie opened this issue May 23, 2023 · 0 comments

Comments

@rappie
Copy link

rappie commented May 23, 2023

The protocol code uses 0.5.16 and the tests use 0.8.10.

When I to run yarn test I get the following error:

$ yarn test
yarn run v1.22.19
$ ./script/test
Skipping Scenario Rebuild (set rebuild=true to force)
Compiling Solidity contracts...
(node:1823557) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1823557) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency
(node:1823557) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency
Compiling contracts {contracts,contracts/**,tests/Contracts}/*.sol with solc to /home/rappie/Desktop/targets/compound/compound-protocol/.build/contracts.json...
Error: Command failed: solc --combined-json bin,abi,metadata --metadata-literal --optimize --allow-paths contracts,tests/Contracts --evm-version istanbul {contracts,contracts/**,tests/Contracts}/*.sol
contracts/BaseJumpRateModelV2.sol:2:1: Error: Source file requires different compiler version (current compiler is 0.5.16+commit.9c3226ce.Linux.g++ - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.8.10;
^----------------------^

...
<many more of the same error>
...

I've tried multiple ways to compile, always with the same error:

  • yarn test
  • npx saddle compile
  • solc --combined-json bin,abi,metadata --metadata-literal --optimize --allow-paths contracts,tests/Contracts --evm-version istanbul {contracts,contracts/**,tests/Contracts}/*.sol
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

1 participant