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

Bug in ERC20 Token #2322

Closed
visheshdvn opened this issue Aug 6, 2020 · 4 comments
Closed

Bug in ERC20 Token #2322

visheshdvn opened this issue Aug 6, 2020 · 4 comments

Comments

@visheshdvn
Copy link

Recently I am having a lot of trouble in using ERC20 token version 3.1.0 because of a minor bug.

pragma solidity ^0.6.0;

import "../../GSN/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

The ERC20 token is written in solidity 0.6.0 and it inherits the import "../../utils/Address.sol"; contract.
The code of Address.sol:

pragma solidity ^0.6.2;
/**
 * @dev Collection of functions related to the address type
 */
library Address {

The Address.sol is written in solidity 0.6.2.

Because if this running migrate command in truffle developer console throws
ParseError: source file require a different compiler vesion (current compiler is 0.6.0)
and
Error: truffle is currrently using solc 0.6.0 but one of your contracts specify "pragma solidity ^0.6.2"."
errors everytime.
Hope you'll look into it soon. :)

@julianmrodri
Copy link
Contributor

Is something preventing you from changing your compiler to 0.6.2 in truffle-config.js ?

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

@abcoathup
Copy link
Contributor

Hi @visheshdvn,

Please use a solc version of 0.6.2 and above as Address.sol needs a minimum of 0.6.2.

For instructions on setting the compiler version in Truffle, please see the Truffle documentation:
https://www.trufflesuite.com/docs/truffle/reference/configuration#solc

@visheshdvn
Copy link
Author

Yes thanks @abcoathup . The solution given by @julianmrodri worked for me. I'm such a newbie in blockchain tech 😕 .. sry for wasting 2 minutes of your life if someone is reading this thread.. 😆

@abcoathup
Copy link
Contributor

Hi @visheshdvn,

Everyone was new once. Ethereum has only been live for five years. Feel free to ask the community all the questions that you need in the community forum: https://forum.openzeppelin.com/
You can also share your knowledge (and learn too) by answering questions.

When I see a question like yours, I think of how we can improve our documentation so that no one else has to have the same problem.

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

3 participants