When i run npx hardhat compile
I get
Solidity ^0.8.9; is not fully supported yet. You can still use Hardhat, but some features, like stack traces, might not work correctly.
Learn more at https://hardhat.org/reference/solidity-support
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.
* contracts/Greeter.sol (^0.8.9)
* @openzeppelin/contracts/utils/Strings.sol (^0.8.9)
* @openzeppelin/contracts/token/ERC721/ERC721.sol (^0.8.9)
* @openzeppelin/contracts/utils/introspection/ERC165.sol (^0.8.9)
* @openzeppelin/contracts/utils/introspection/IERC165.sol (^0.8.9)
* @openzeppelin/contracts/token/ERC721/IERC721.sol (^0.8.9)
* @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol (^0.8.9)
* @openzeppelin/contracts/utils/Context.sol (^0.8.9)
* @openzeppelin/contracts/finance/PaymentSplitter.sol (^0.8.9)
* @openzeppelin/contracts/utils/Address.sol (^0.8.1)
* @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol (^0.8.0)
* @openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol (^0.8.0)
* @openzeppelin/contracts/token/ERC20/IERC20.sol (^0.8.0)
* @openzeppelin/contracts/access/Ownable.sol (^0.8.0)
* @openzeppelin/contracts/utils/Counters.sol (^0.8.0)
* @openzeppelin/contracts/utils/cryptography/MerkleProof.sol (^0.8.0)
* @openzeppelin/contracts/security/ReentrancyGuard.sol (^0.8.0)
To learn more, run the command again with --verbose
Read about compiler configuration at https://hardhat.org/config
My Contract has:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import '@openzeppelin/contracts/finance/PaymentSplitter.sol';
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
And my hardhat.config.js
module.exports = {
solidity: {
version: '^0.8.9;',
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
Can´t find a solution for my error. First time creating a contract.
My contract and hardhat.config.js file are matching... already tried to match the version of all mentioned files, but it still doest work.
CodePudding user response:
You are using additional symbols in the used Solidity version in your config
Change your config from version: '^0.8.9;'
to version: '0.8.9'
module.exports = {
solidity: {
version: '0.8.9',
settings: {
optimizer: {
enabled: true,
runs: 200
}
}