I'm new to Solidity and Truffle. I'm trying to compile my Solidity code within Truffle to create an ERC-20 token. I have @truffle/hdwallet-provider
and @openzeppelin/contracts
as my dependencies. Now, I only have two Solidity files, both of which have pragma solidity ^0.6.0;
. I have been uninstalling and reinstalling to different versions and changing the compiler version in truffle-config.js
to whichever the error message is telling me to change as well as changing the pragma solidity versions in the two files I have. I also had to change the individual files in node modules to fit the right version.
Finally, I think the change in the version from ^0.6.2
to ^0.6.0
broke a file called Address.sol
in the utility folder of contracts in Node Modules:
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }(""); // here
require(success, "Address: unable to send value, recipient may have reverted");
}
The error message shows:
ParserError: Expected ';' but got '{'
indicating the point right after call
.
First, how do I fix this? And second, is this version incompatibility issue what I should expect every time there's been updates in either Truffle, Solidity, or any of my dependencies?