update dropsBox

This commit is contained in:
owen05
2021-05-20 11:09:59 +08:00
parent 056e8b8ece
commit 4e1466f8f7
7 changed files with 347 additions and 348 deletions

View File

@@ -0,0 +1,46 @@
/*
Copyright 2021 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
import {ERC721} from "../../external/ERC721/ERC721.sol";
import {InitializableOwnable} from "../../lib/InitializableOwnable.sol";
contract DropsERC721 is ERC721, InitializableOwnable {
mapping (address => bool) public _IS_ALLOWED_MINT_;
// ============ Event =============
event addMinter(address account);
event removeMinter(address account);
function addMintAccount(address account) public onlyOwner {
_IS_ALLOWED_MINT_[account] = true;
emit addMinter(account);
}
function removeMintAccount(address account) public onlyOwner {
_IS_ALLOWED_MINT_[account] = false;
emit removeMinter(account);
}
function init(
address owner,
string memory name,
string memory symbol,
string memory uri
) public {
initOwner(owner);
_name = name;
_symbol = symbol;
_baseUri = uri;
}
function mint(address to, uint256 tokenId) external {
require(_IS_ALLOWED_MINT_[msg.sender], "Mint restricted");
_mint(to, tokenId);
}
}