Hey guys I'm working with Alchemy University and we are deploying ERC-20 tokens. When I try and deploy my contract to Goeril test network I am getting an error that says my open zepplin is only compatible with solidity pragma 8.20 but when I try and make this change myself I get a number of errors in my code that are telling me the version is not going to work. Here is my error below when I am using the 8.19 that has worked for me in all my projects up until now. npx hardhat run scripts/deploy.js --network goerli
Error HH606: The project cannot be compiled, see reasons below.
The Solidity version pragma statement in these files doesn't match any of the configured compilers in your config. Change the pragma or configure additional compiler versions in your hardhat config.
These files and its dependencies cannot be compiled with your config. This can happen because they have incompatible Solidity pragmas, or don't match any of your configured Solidity compilers.
contracts/Stan.sol
Is there a way that I can install OpenZeppelin in a way that is compatable with solidity 8.19 or is there something obvious that I am missing in general?
Thanks!!
Change the pragma in each one of your own solidity files to ^0.8.20, and change the compiler version in your hardhat configuration file to 0.8.20 or 0.8.21 or 0.8.22.
Sorry about that, my first time on this forum. When I change my solidity file and my config file to 8.20 within, the contract file will tell me the compiler wont work as well as one of the functions within my deploy scripts. In terms of the line within my deploy.js file that isn't working, its this right here. const weiAmount = (await deployer.getBalance()).toString(); does solidity 8.20 have a new way of calling deploy.getBalance because when I change the pragma to 8.20 its not working
Update on my issue, I went into my hardhat config file and made it to where it can accept both 8.19 and 8.20 and that seemed to fix at least the error for compiling. So now I am just left with my error of TypeError: deployer.getBalance is not a function. Any ideas would be greatly appreciated
I'm closing since the initial issue seems solved. Feel free to post any other question in a different thread but please review the following guidelines for clarity: