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. :)
Is something preventing you from changing your compiler to 0.6.2 in truffle-config.js ?
compilers: {
solc: {
version: "0.6.2"
}
}
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
Yes thanks @abcoathup . The solution given by @julianmrodri worked for me. I'm such a newbie in blockchain tech :confused: .. sry for wasting 2 minutes of your life if someone is reading this thread.. :laughing:
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.
Most helpful comment
Is something preventing you from changing your compiler to
0.6.2intruffle-config.js?