I think you can remove the erc721enumerable import as you already import it in whitelist.sol
emm I think I haven't done it in the Whitelist.sol // SPDX-License-Identifier: MIT pragma solidity 0.8.19; contract WhitelistApp { uint8 public numAddressesWhitelisted; uint8 maxWhitelistedAddresses; mapping(address => bool) public whitelistedAddresses; address private owner; constructor(uint8 _maxWhitelistedAddresses) { owner = msg.sender; maxWhitelistedAddresses = _maxWhitelistedAddresses; } modifier onlyOwner() { require(msg.sender == owner, "You are not the owner. Forbidden."); _; } function changeTheOwner(address _newOwner) public onlyOwner { owner = _newOwner; } function addAddress(address _newAddress) public { require( !whitelistedAddresses[msg.sender], "You are already whitelisted..." ); require( numAddressesWhitelisted < maxWhitelistedAddresses, "Sorry, no spots left..." ); whitelistedAddresses[_newAddress] = true; numAddressesWhitelisted += 1; } function removeAddress(address _addressToRemove) public onlyOwner { require( whitelistedAddresses[msg.sender], "Address has not been whitelisted" ); whitelistedAddresses[_addressToRemove] = false; numAddressesWhitelisted -= 1; } }
put everything on a pastebin, it's kinda hard to understand on tg messages
Обсуждают сегодня