pragma solidity ^0.8.4;
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
contract NewMintContract is ERC721, Ownable {
uint256 public mintprice = 0.03 ether;
uint256 public totalsupply;
uint256 public maxsupply;
bool public isMintenabled;
mapping(address => uint256) public mintedwallets;
constructor() payable ERC721('Simple Mint', 'SIMPLEMINT') {
maxsupply = 2;
}
}
Asked
Active
Viewed 363 times
1
Riccardo Perego
- 353
- 2
- 7
Learner
- 11
- 1
1 Answers
1
You're wrong to import ERC721 smart contract. Change your smart contract in this way:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
// NOTE: Change this from 'IERC721' to 'ERC721'
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract NewMintContract is ERC721, Ownable {
uint256 public mintprice = 0.03 ether;
uint256 public totalsupply;
uint256 public maxsupply;
bool public isMintenabled;
mapping(address => uint256) public mintedwallets;
constructor() payable ERC721("Simple Mint", "SIMPLEMINT") {
maxsupply = 2;
}
}
Antonio Carito
- 2,445
- 3
- 10
- 23
IERC721but it seems you wantERC721. Change it for : import "@openzeppelin/contracts/token/ERC721/ERC721.sol" – hroussille Apr 27 '22 at 13:31