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

Change Solidity version in Address.sol from 0.6.2 back to 0.6.0 #2231

Closed
pcaversaccio opened this issue May 9, 2020 · 1 comment
Closed

Comments

@pcaversaccio
Copy link
Contributor

pcaversaccio commented May 9, 2020

Hi, I'm currently using the Truffle framework to deploy an ERC20 token contract. For that purpose I use npm install @openzeppelin/contracts and include the needed node_modules into my main code: import "../node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";. However, I can't compile it unless I change in the Address.sol the Solidity version back to 0.6.0 since that is the version all other dependencies use in the OpenZeppelin contracts currently (e.g. Context.sol, IERC20.sol, SafeMath.sol).

An example code that can't be compiled in Truffle using just the npm install @openzeppelin/contracts command would be the following:

pragma solidity ^0.6.0;

import "../node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";

abstract contract TestERC20Contract is ERC20 {

uint256 public initialSupply = 1000;

constructor() public {
  _mint(msg.sender, initialSupply);
}

}

@pcaversaccio
Copy link
Contributor Author

I resolved it by setting

compilers: {
    solc: {
      version: "0.6.2",
    }
  }

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