diff --git a/contracts/MinterFactory.sol b/contracts/MinterFactory.sol index 630e79b..8900385 100644 --- a/contracts/MinterFactory.sol +++ b/contracts/MinterFactory.sol @@ -13,7 +13,7 @@ contract MinterFactory is Ownable, Initializable { IMintableERC721 public hero; IMintableERC721 public equip; IMintableERC721 public chip; - bool public publicMintAllowed; + event TokenMinted( address contractAddress, @@ -30,8 +30,8 @@ contract MinterFactory is Ownable, Initializable { /** * @dev mint function to distribute Blissful Elites Hero NFT to user */ - function mintHeroTo(address to, uint256 tokenId) external { - require(publicMintAllowed || _msgSender() == owner()); + function mintHeroTo(address to, uint256 tokenId) external onlyOwner{ + require(to != address(0), 'to address can not be zero'); hero.mint(to, tokenId); emit TokenMinted(address(hero), to, tokenId); } @@ -39,8 +39,8 @@ contract MinterFactory is Ownable, Initializable { /** * @dev mint function to distribute Blissful Elites Equipment NFT to user */ - function mintEquipTo(address to, uint256 tokenId) external { - require(publicMintAllowed || _msgSender() == owner()); + function mintEquipTo(address to, uint256 tokenId) external onlyOwner{ + require(to != address(0), 'to address can not be zero'); equip.mint(to, tokenId); emit TokenMinted(address(equip), to, tokenId); } @@ -48,16 +48,10 @@ contract MinterFactory is Ownable, Initializable { /** * @dev mint function to distribute Blissful Elites Chip NFT to user */ - function mintChipTo(address to, uint256 tokenId) external { - require(publicMintAllowed || _msgSender() == owner()); + function mintChipTo(address to, uint256 tokenId) external onlyOwner{ + require(to != address(0), 'to address can not be zero'); chip.mint(to, tokenId); emit TokenMinted(address(chip), to, tokenId); } - /** - * @dev function to allow user mint items - */ - function allowPublicMint() public onlyOwner { - publicMintAllowed = true; - } }