文件 1 的 20:AbstractMintVoucherFactory.sol
pragma solidity ^0.8.0;
import "./AccessControl.sol";
import './Ownable.sol';
import './ERC1155Burnable.sol';
import './ERC1155Pausable.sol';
import './ERC1155Supply.sol';
abstract contract AbstractMintVoucherFactory is AccessControl, ERC1155Pausable, ERC1155Supply, ERC1155Burnable, Ownable {
string public name_;
string public symbol_;
function pause() external onlyOwner {
_pause();
}
function unpause() external onlyOwner {
_unpause();
}
function setURI(string memory baseURI) external onlyOwner {
_setURI(baseURI);
}
function name() public view returns (string memory) {
return name_;
}
function symbol() public view returns (string memory) {
return symbol_;
}
function _mint(
address account,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual override(ERC1155) {
super._mint(account, id, amount, data);
}
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override(ERC1155) {
super._mintBatch(to, ids, amounts, data);
}
function _burn(
address account,
uint256 id,
uint256 amount
) internal virtual override(ERC1155) {
super._burn(account, id, amount);
}
function _burnBatch(
address account,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual override(ERC1155) {
super._burnBatch(account, ids, amounts);
}
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override(ERC1155Pausable, ERC1155, ERC1155Supply) {
super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
}
function setOwner(address _addr) public onlyOwner {
transferOwnership(_addr);
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, AccessControl) returns (bool) {
return super.supportsInterface(interfaceId);
}
}
文件 2 的 20:AccessControl.sol
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "./Context.sol";
import "./Strings.sol";
import "./ERC165.sol";
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
modifier onlyRole(bytes32 role) {
_checkRole(role, _msgSender());
_;
}
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
function hasRole(bytes32 role, address account) public view override returns (bool) {
return _roles[role].members[account];
}
function _checkRole(bytes32 role, address account) internal view {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
return _roles[role].adminRole;
}
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
function _grantRole(bytes32 role, address account) private {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
function _revokeRole(bytes32 role, address account) private {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}
文件 3 的 20:Address.sol
pragma solidity ^0.8.0;
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
文件 4 的 20:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 5 的 20:Counters.sol
pragma solidity ^0.8.0;
library Counters {
struct Counter {
uint256 _value;
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}
文件 6 的 20:ERC1155.sol
pragma solidity ^0.8.0;
import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./IERC1155MetadataURI.sol";
import "./Address.sol";
import "./Context.sol";
import "./ERC165.sol";
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
mapping(uint256 => mapping(address => uint256)) private _balances;
mapping(address => mapping(address => bool)) private _operatorApprovals;
string private _uri;
constructor(string memory uri_) {
_setURI(uri_);
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC1155).interfaceId ||
interfaceId == type(IERC1155MetadataURI).interfaceId ||
super.supportsInterface(interfaceId);
}
function uri(uint256) public view virtual override returns (string memory) {
return _uri;
}
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
require(account != address(0), "ERC1155: balance query for the zero address");
return _balances[id][account];
}
function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
virtual
override
returns (uint256[] memory)
{
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts[i], ids[i]);
}
return batchBalances;
}
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
return _operatorApprovals[account][operator];
}
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not owner nor approved"
);
_safeTransferFrom(from, to, id, amount, data);
}
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: transfer caller is not owner nor approved"
);
_safeBatchTransferFrom(from, to, ids, amounts, data);
}
function _safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
emit TransferSingle(operator, from, to, id, amount);
_doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
}
function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
}
emit TransferBatch(operator, from, to, ids, amounts);
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
}
function _setURI(string memory newuri) internal virtual {
_uri = newuri;
}
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);
_balances[id][to] += amount;
emit TransferSingle(operator, address(0), to, id, amount);
_doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
}
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; i++) {
_balances[ids[i]][to] += amounts[i];
}
emit TransferBatch(operator, address(0), to, ids, amounts);
_doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
}
function _burn(
address from,
uint256 id,
uint256 amount
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
emit TransferSingle(operator, from, address(0), id, amount);
}
function _burnBatch(
address from,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
}
emit TransferBatch(operator, from, address(0), ids, amounts);
}
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC1155: setting approval status for self");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
if (response != IERC1155Receiver.onERC1155Received.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
bytes4 response
) {
if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
uint256[] memory array = new uint256[](1);
array[0] = element;
return array;
}
}
文件 7 的 20:ERC1155Burnable.sol
pragma solidity ^0.8.0;
import "./ERC1155.sol";
abstract contract ERC1155Burnable is ERC1155 {
function burn(
address account,
uint256 id,
uint256 value
) public virtual {
require(
account == _msgSender() || isApprovedForAll(account, _msgSender()),
"ERC1155: caller is not owner nor approved"
);
_burn(account, id, value);
}
function burnBatch(
address account,
uint256[] memory ids,
uint256[] memory values
) public virtual {
require(
account == _msgSender() || isApprovedForAll(account, _msgSender()),
"ERC1155: caller is not owner nor approved"
);
_burnBatch(account, ids, values);
}
}
文件 8 的 20:ERC1155Pausable.sol
pragma solidity ^0.8.0;
import "./ERC1155.sol";
import "./Pausable.sol";
abstract contract ERC1155Pausable is ERC1155, Pausable {
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override {
super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
require(!paused(), "ERC1155Pausable: token transfer while paused");
}
}
文件 9 的 20:ERC1155Supply.sol
pragma solidity ^0.8.0;
import "./ERC1155.sol";
abstract contract ERC1155Supply is ERC1155 {
mapping(uint256 => uint256) private _totalSupply;
function totalSupply(uint256 id) public view virtual returns (uint256) {
return _totalSupply[id];
}
function exists(uint256 id) public view virtual returns (bool) {
return ERC1155Supply.totalSupply(id) > 0;
}
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override {
super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
if (from == address(0)) {
for (uint256 i = 0; i < ids.length; ++i) {
_totalSupply[ids[i]] += amounts[i];
}
}
if (to == address(0)) {
for (uint256 i = 0; i < ids.length; ++i) {
_totalSupply[ids[i]] -= amounts[i];
}
}
}
}
文件 10 的 20:ERC165.sol
pragma solidity ^0.8.0;
import "./IERC165.sol";
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
文件 11 的 20:IAccessControl.sol
pragma solidity ^0.8.0;
interface IAccessControl {
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
function hasRole(bytes32 role, address account) external view returns (bool);
function getRoleAdmin(bytes32 role) external view returns (bytes32);
function grantRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
function renounceRole(bytes32 role, address account) external;
}
文件 12 的 20:IERC1155.sol
pragma solidity ^0.8.0;
import "./IERC165.sol";
interface IERC1155 is IERC165 {
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
event URI(string value, uint256 indexed id);
function balanceOf(address account, uint256 id) external view returns (uint256);
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
function setApprovalForAll(address operator, bool approved) external;
function isApprovedForAll(address account, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}
文件 13 的 20:IERC1155MetadataURI.sol
pragma solidity ^0.8.0;
import "./IERC1155.sol";
interface IERC1155MetadataURI is IERC1155 {
function uri(uint256 id) external view returns (string memory);
}
文件 14 的 20:IERC1155Receiver.sol
pragma solidity ^0.8.0;
import "./IERC165.sol";
interface IERC1155Receiver is IERC165 {
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}
文件 15 的 20:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 16 的 20:NeaMintTicketFactory.sol
pragma solidity ^0.8.0;
import "./ReentrancyGuard.sol";
import "./AccessControl.sol";
import "./ERC1155.sol";
import "./Strings.sol";
import "./Counters.sol";
import './AbstractMintVoucherFactory.sol';
contract NeaMintTicketFactory is AbstractMintVoucherFactory, ReentrancyGuard {
using Counters for Counters.Counter;
Counters.Counter private mtCounter;
uint256 private constant MAX_PER_EARLY_ACCESS_ADDRESS = 3;
address payable public treasuryWallet;
address payable public nemusWallet;
uint256 public treasuryPercentage;
uint256 public nemusPercentage;
mapping(address => bool) public isOnEarlyAccessList;
mapping(address => uint256) public earlyAccessMintedCounts;
mapping(uint256 => MintTicket) public mintTickets;
event Claimed(uint index, address indexed account, uint amount);
event ClaimedMultiple(uint[] index, address indexed account, uint[] amount);
struct MintTicketParam {
uint256 mtIndex;
bool saleIsOpen;
uint256 earlyAccessOpens;
uint256 publicSaleOpens;
uint256 publicSaleCloses;
uint256 mintPrice;
uint256 maxSupply;
uint256 maxPerWallet;
uint256 maxMintPerTxn;
uint256 sizeID;
string metadataHash;
address redeemableContract;
}
struct MintTicket {
bool saleIsOpen;
uint256 earlyAccessOpens;
uint256 publicSaleOpens;
uint256 publicSaleCloses;
uint256 mintPrice;
uint256 maxSupply;
uint256 maxPerWallet;
uint256 maxMintPerTxn;
uint256 sizeID;
string metadataHash;
address redeemableContract;
mapping(address => uint256) claimedMTs;
}
constructor(
string memory _name,
string memory _symbol,
address _treasuryAddress,
address _nemusAddress
) ERC1155("https://nemus-media.nyc3.digitaloceanspaces.com/tickets/seruini/genesis/metadata/") {
require(address(_treasuryAddress) != address(0) && address(_nemusAddress) != address(0), "Treasury address cannot be zero");
name_ = _name;
symbol_ = _symbol;
treasuryWallet = payable(_treasuryAddress);
nemusWallet = payable(_nemusAddress);
treasuryPercentage = 30;
nemusPercentage = 70;
}
function addMintTicket(
uint256 _earlyAccessOpens,
uint256 _publicSaleOpens,
uint256 _publicSaleCloses,
uint256 _mintPrice,
uint256 _maxSupply,
uint256 _maxMintPerTxn,
uint256 _sizeID,
string memory _metadataHash,
address _redeemableContract,
uint256 _maxPerWallet
) external onlyOwner {
require(_earlyAccessOpens < _publicSaleOpens, "addMintTicket: open window must be before close window");
require(_publicSaleOpens < _publicSaleCloses, "addMintTicket: open window must be before close window");
require(_publicSaleOpens > 0 && _publicSaleCloses > 0 && _earlyAccessOpens > 0, "addMintTicket: window cannot be 0");
require(_publicSaleOpens > block.timestamp && _earlyAccessOpens > block.timestamp, "addMintTicket: open window cannot be in the past");
require(address(_redeemableContract) != address(0), "addMintTicket: cannot be zero address");
MintTicket storage mt = mintTickets[mtCounter.current()];
mt.saleIsOpen = false;
mt.earlyAccessOpens = _earlyAccessOpens;
mt.publicSaleOpens = _publicSaleOpens;
mt.publicSaleCloses = _publicSaleCloses;
mt.mintPrice = _mintPrice;
mt.maxSupply = _maxSupply;
mt.maxMintPerTxn = _maxMintPerTxn;
mt.maxPerWallet = _maxPerWallet;
mt.sizeID = _sizeID;
mt.metadataHash = _metadataHash;
mt.redeemableContract = _redeemableContract;
mtCounter.increment();
}
function editMintTicket(
MintTicketParam calldata params
) external onlyOwner {
require(mintTicketExists(params.mtIndex), "Mint ticket does not exist");
require(params.earlyAccessOpens < params.publicSaleOpens, "editMintTicket: open window must be before close window");
require(params.publicSaleOpens < params.publicSaleCloses, "editMintTicket: open window must be before close window");
require(params.publicSaleOpens > 0 && params.publicSaleCloses > 0 && params.earlyAccessOpens > 0, "editMintTicket: window cannot be 0");
require(address(params.redeemableContract) != address(0), "addMintTicket: cannot be zero address");
mintTickets[params.mtIndex].earlyAccessOpens = params.earlyAccessOpens;
mintTickets[params.mtIndex].publicSaleOpens = params.publicSaleOpens;
mintTickets[params.mtIndex].publicSaleCloses = params.publicSaleCloses;
mintTickets[params.mtIndex].mintPrice = params.mintPrice;
mintTickets[params.mtIndex].maxSupply = params.maxSupply;
mintTickets[params.mtIndex].maxMintPerTxn = params.maxMintPerTxn;
mintTickets[params.mtIndex].sizeID = params.sizeID;
mintTickets[params.mtIndex].metadataHash = params.metadataHash;
mintTickets[params.mtIndex].redeemableContract = params.redeemableContract;
mintTickets[params.mtIndex].saleIsOpen = params.saleIsOpen;
mintTickets[params.mtIndex].maxPerWallet = params.maxPerWallet;
}
function setMintTicketEarlyAccessOpens(uint256 _index, uint256 _earlyAccess) public onlyOwner {
require(mintTicketExists(_index), "Mint ticket does not exist");
require((_earlyAccess < mintTickets[_index].publicSaleOpens) && (_earlyAccess > 0), "Cannot be after public opening");
mintTickets[_index].earlyAccessOpens = _earlyAccess;
}
function setMintTicketPublicSaleOpens(uint256 _index, uint256 _publicSaleOpens) public onlyOwner {
require(mintTicketExists(_index), "Mint ticket does not exist");
require((_publicSaleOpens < mintTickets[_index].publicSaleCloses) && (_publicSaleOpens > 0), "Cannot be after public closing");
mintTickets[_index].publicSaleOpens = _publicSaleOpens;
}
function setMintTicketPublicSaleCloses(uint256 _index, uint256 _publicSaleCloses) public onlyOwner {
require(mintTicketExists(_index), "Mint ticket does not exist");
require((_publicSaleCloses > mintTickets[_index].publicSaleOpens) && (_publicSaleCloses > 0), "Cannot be after public closing");
mintTickets[_index].publicSaleCloses = _publicSaleCloses;
}
function setMintTicketPrice(uint256 _index, uint256 _mintPrice) public onlyOwner {
require(mintTicketExists(_index), "Mint ticket does not exist");
mintTickets[_index].mintPrice = _mintPrice;
}
function setMintTicketMaxSupplyt(uint256 _index, uint256 _maxSupply) public onlyOwner {
require(mintTicketExists(_index), "Mint ticket does not exist");
mintTickets[_index].maxSupply = _maxSupply;
}
function setMintTicketMaxMint(uint256 _index, uint256 _maxMintPerTxn) public onlyOwner {
require(mintTicketExists(_index), "Mint ticket does not exist");
mintTickets[_index].maxMintPerTxn = _maxMintPerTxn;
}
function setMintTicketMaxPerWallet(uint256 _index, uint256 _maxMintPerWallet) public onlyOwner {
require(mintTicketExists(_index), "Mint ticket does not exist");
mintTickets[_index].maxPerWallet = _maxMintPerWallet;
}
function setMintTicketSizeId(uint256 _index, uint256 _sizeId) public onlyOwner {
require(mintTicketExists(_index), "Mint ticket does not exist");
mintTickets[_index].sizeID = _sizeId;
}
function setMintTicketMetadataId(uint256 _index, string calldata _metadataId) public onlyOwner {
require(mintTicketExists(_index), "Mint ticket does not exist");
mintTickets[_index].metadataHash = _metadataId;
}
function setMintTicketRedeemableContract(uint256 _index, address _redeemableContract) public onlyOwner {
require(mintTicketExists(_index), "Mint ticket does not exist");
require(address(_redeemableContract) != address(0), "Cannot be zero address");
mintTickets[_index].redeemableContract = _redeemableContract;
}
function mintTicketExists(uint256 _index) public view returns (bool) {
require(mintTickets[_index].publicSaleOpens > 0, "Mint Ticket does not exist");
return true;
}
function turnSaleOn(uint256 _index) external onlyOwner{
require(mintTicketExists(_index), "Mint ticket does not exist");
mintTickets[_index].saleIsOpen = true;
}
function turnSaleOff(uint256 _index) external onlyOwner{
require(mintTicketExists(_index), "Mint ticket does not exist");
mintTickets[_index].saleIsOpen = false;
}
function burnFromRedeem(
address account,
uint256 mtIndex,
uint256 amount
) external {
require(mintTickets[mtIndex].redeemableContract == msg.sender, "Burnable: Only allowed from redeemable contract");
_burn(account, mtIndex, amount);
}
function claim(
uint256 amount,
uint256 mtIndex
) external payable nonReentrant {
require(isValidClaim(amount,mtIndex));
uint256 excessPayment = msg.value - (amount * mintTickets[mtIndex].mintPrice);
if (excessPayment > 0) {
(bool returnExcessStatus, ) = _msgSender().call{value: excessPayment}("");
require(returnExcessStatus, "Error returning excess payment");
}
mintTickets[mtIndex].claimedMTs[msg.sender] = mintTickets[mtIndex].claimedMTs[msg.sender] + amount;
_mint(msg.sender, mtIndex, amount, "");
emit Claimed(mtIndex, msg.sender, amount);
}
function claimMultiple(
uint256[] calldata amounts,
uint256[] calldata mtIndexes
) external payable nonReentrant {
uint256 excessPayment = msg.value;
uint256 totalTicketCost = 0;
for (uint i=0; i< mtIndexes.length; i++) {
require(validateNonDupliateIndex(mtIndexes, mtIndexes[i]), "Index is duplcate");
require(isValidClaim(amounts[i],mtIndexes[i]), "One or more claims are invalid");
uint256 totalAmount = amounts[i] * mintTickets[mtIndexes[i]].mintPrice;
totalTicketCost += totalAmount;
excessPayment -= totalAmount ;
mintTickets[mtIndexes[i]].claimedMTs[msg.sender] = mintTickets[mtIndexes[i]].claimedMTs[msg.sender] + amounts[i];
}
require(msg.value >= totalTicketCost, "Not enough ETH sent");
if (excessPayment > 0) {
(bool returnExcessStatus, ) = _msgSender().call{value: excessPayment}("");
require(returnExcessStatus, "Error returning excess payment");
}
_mintBatch(msg.sender, mtIndexes, amounts, "");
emit ClaimedMultiple(mtIndexes, msg.sender, amounts);
}
function claimEarlyAccess(uint256 _count, uint256 mtIndex) external payable nonReentrant {
require(isValidEarlyAccessClaim(_count, mtIndex));
uint256 excessPayment = msg.value - (_count * mintTickets[mtIndex].mintPrice);
if (excessPayment > 0) {
(bool returnExcessStatus, ) = _msgSender().call{value: excessPayment}("");
require(returnExcessStatus, "Error returning excess payment");
}
mintTickets[mtIndex].claimedMTs[msg.sender] = mintTickets[mtIndex].claimedMTs[msg.sender] + _count;
uint256 userMintedAmount = earlyAccessMintedCounts[msg.sender] + _count;
require(userMintedAmount <= MAX_PER_EARLY_ACCESS_ADDRESS, "Max early access count per address exceeded");
_mint(msg.sender, mtIndex, _count, "");
earlyAccessMintedCounts[msg.sender] = userMintedAmount;
emit Claimed(mtIndex, msg.sender, _count);
}
function claimMultipleEarlyAccess(uint256[] calldata _count, uint256[] calldata mtIndexes) external payable nonReentrant {
uint256 excessPayment = msg.value;
uint256 userMintedAmount = earlyAccessMintedCounts[msg.sender];
uint256 totalTicketCost = 0;
for (uint i=0; i< mtIndexes.length; i++) {
require(validateNonDupliateIndex(mtIndexes, mtIndexes[i]), "Index is duplicated");
require(isValidEarlyAccessClaim(_count[i], mtIndexes[i]), "One or more claims are invalid");
mintTickets[mtIndexes[i]].claimedMTs[msg.sender] = mintTickets[mtIndexes[i]].claimedMTs[msg.sender] + _count[i];
uint256 totalAmount = _count[i] * mintTickets[mtIndexes[i]].mintPrice;
userMintedAmount += _count[i];
totalTicketCost += totalAmount;
excessPayment -= totalAmount;
if (msg.sender != nemusWallet) {
require(userMintedAmount <= MAX_PER_EARLY_ACCESS_ADDRESS, "Max early access count per address exceeded");
}
}
require(msg.value >= totalTicketCost, "Not enough ETH sent");
if (excessPayment > 0) {
(bool returnExcessStatus, ) = _msgSender().call{value: excessPayment}("");
require(returnExcessStatus, "Error returning excess payment");
}
_mintBatch(msg.sender, mtIndexes, _count, "");
earlyAccessMintedCounts[msg.sender] = userMintedAmount;
emit ClaimedMultiple(mtIndexes, msg.sender, _count);
}
function mint(
address to,
uint256 numPasses,
uint256 mtIndex) public onlyOwner
{
_mint(to, mtIndex, numPasses, "");
}
function mintBatch(
address to,
uint256[] calldata numPasses,
uint256[] calldata mtIndexes) public onlyOwner
{
_mintBatch(to, mtIndexes, numPasses, "");
}
function isValidClaim(
uint256 numPasses,
uint256 mtIndexes) internal view returns (bool) {
require(mintTickets[mtIndexes].saleIsOpen, "Sale is paused");
require(!paused(), "Claim: claiming is paused");
require (block.timestamp > mintTickets[mtIndexes].publicSaleOpens && block.timestamp < mintTickets[mtIndexes].publicSaleCloses, "Claim: time window closed");
require(msg.value >= (numPasses * mintTickets[mtIndexes].mintPrice), "Claim: Ether value incorrect");
require((mintTickets[mtIndexes].claimedMTs[msg.sender] + numPasses <= mintTickets[mtIndexes].maxPerWallet), "Claim: Not allowed to claim that many from one wallet");
require(numPasses <= mintTickets[mtIndexes].maxMintPerTxn, "Max quantity per transaction exceeded");
require(totalSupply(mtIndexes) + numPasses <= mintTickets[mtIndexes].maxSupply, "Purchase would exceed max supply");
return true;
}
function isValidEarlyAccessClaim(uint256 _count, uint256 mtIndex) internal view returns (bool) {
require(mintTickets[mtIndex].saleIsOpen, "Sale is paused");
require(!paused(), "Claim: claiming is paused");
require(_count != 0, "Invalid count");
require(isOnEarlyAccessList[msg.sender], "Address not on early access list");
require(isEarlyAccessOpen(mtIndex), "Early access window not open");
require(msg.value >= (_count * mintTickets[mtIndex].mintPrice), "Claim: Ether value incorrect");
require(totalSupply(mtIndex) + _count <= mintTickets[mtIndex].maxSupply, "Purchase would exceed max supply");
return true;
}
function getClaimedMts(uint256 mtIndex, address userAdress) public view returns (uint256) {
return mintTickets[mtIndex].claimedMTs[userAdress];
}
function getTicketSizeID(uint256 mtIndex) external view returns(uint256) {
return mintTickets[mtIndex].sizeID;
}
function getRemainingEarlyAccessMints(address _addr) public view returns (uint256) {
if (!isOnEarlyAccessList[_addr]) {
return 0;
}
return MAX_PER_EARLY_ACCESS_ADDRESS - earlyAccessMintedCounts[_addr];
}
function addToEarlyAccessList(address[] memory toEarlyAccessList) external onlyOwner {
for (uint256 i = 0; i < toEarlyAccessList.length; i++) {
isOnEarlyAccessList[toEarlyAccessList[i]] = true;
}
}
function removeFromEarlyAccessList(address[] memory toRemove) external onlyOwner {
for (uint256 i = 0; i < toRemove.length; i++) {
isOnEarlyAccessList[toRemove[i]] = false;
}
}
function isEarlyAccessOpen(uint256 mtIndex) public view returns (bool) {
return (block.timestamp >= mintTickets[mtIndex].earlyAccessOpens && block.timestamp <= mintTickets[mtIndex].publicSaleOpens);
}
function isSaleOpen(uint256 mtIndex) public view returns (bool) {
return mintTickets[mtIndex].saleIsOpen;
}
function validateNonDupliateIndex(uint256[] calldata _indexes, uint256 _search) public pure returns (bool) {
uint256 matchCount = 0;
for (uint i=0; i< _indexes.length; i++) {
if(_indexes[i] == _search) {
matchCount++;
if ( matchCount > 1) {
return false;
}
}
}
return true;
}
function updatePayoutPercentage(uint256 _treasuryPercentage, uint256 _nemusPercentage) external onlyOwner
{
require(_treasuryPercentage + _nemusPercentage <= 100, "Total percentage cannot be greater than 100");
treasuryPercentage = _treasuryPercentage;
nemusPercentage = _nemusPercentage;
}
function withdrawFunds() public onlyOwner
{
uint256 currentBalance = address(this).balance;
uint256 amount1 = (currentBalance * treasuryPercentage)/100;
uint256 amount2 = currentBalance - amount1;
(bool success1, ) = address(treasuryWallet).call{value:amount1}("");
require(success1, "Transfer1 failed.");
(bool success2, ) = address(nemusWallet).call{value:amount2}("");
require(success2, "Transfer2 failed.");
}
function uri(uint256 _id) public view override returns (string memory) {
require(totalSupply(_id) > 0, "URI: nonexistent token");
return string(abi.encodePacked(super.uri(_id), mintTickets[_id].metadataHash));
}
}
文件 17 的 20:Ownable.sol
pragma solidity ^0.8.0;
import "./Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 18 的 20:Pausable.sol
pragma solidity ^0.8.0;
import "./Context.sol";
abstract contract Pausable is Context {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor() {
_paused = false;
}
function paused() public view virtual returns (bool) {
return _paused;
}
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
文件 19 的 20:ReentrancyGuard.sol
pragma solidity ^0.8.0;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
文件 20 的 20:Strings.sol
pragma solidity ^0.8.0;
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
function toString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
{
"compilationTarget": {
"NeaMintTicketFactory.sol": "NeaMintTicketFactory"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_treasuryAddress","type":"address"},{"internalType":"address","name":"_nemusAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"index","type":"uint256[]"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"amount","type":"uint256[]"}],"name":"ClaimedMultiple","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_earlyAccessOpens","type":"uint256"},{"internalType":"uint256","name":"_publicSaleOpens","type":"uint256"},{"internalType":"uint256","name":"_publicSaleCloses","type":"uint256"},{"internalType":"uint256","name":"_mintPrice","type":"uint256"},{"internalType":"uint256","name":"_maxSupply","type":"uint256"},{"internalType":"uint256","name":"_maxMintPerTxn","type":"uint256"},{"internalType":"uint256","name":"_sizeID","type":"uint256"},{"internalType":"string","name":"_metadataHash","type":"string"},{"internalType":"address","name":"_redeemableContract","type":"address"},{"internalType":"uint256","name":"_maxPerWallet","type":"uint256"}],"name":"addMintTicket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"toEarlyAccessList","type":"address[]"}],"name":"addToEarlyAccessList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"mtIndex","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnFromRedeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"mtIndex","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_count","type":"uint256"},{"internalType":"uint256","name":"mtIndex","type":"uint256"}],"name":"claimEarlyAccess","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"mtIndexes","type":"uint256[]"}],"name":"claimMultiple","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_count","type":"uint256[]"},{"internalType":"uint256[]","name":"mtIndexes","type":"uint256[]"}],"name":"claimMultipleEarlyAccess","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"earlyAccessMintedCounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"mtIndex","type":"uint256"},{"internalType":"bool","name":"saleIsOpen","type":"bool"},{"internalType":"uint256","name":"earlyAccessOpens","type":"uint256"},{"internalType":"uint256","name":"publicSaleOpens","type":"uint256"},{"internalType":"uint256","name":"publicSaleCloses","type":"uint256"},{"internalType":"uint256","name":"mintPrice","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"maxPerWallet","type":"uint256"},{"internalType":"uint256","name":"maxMintPerTxn","type":"uint256"},{"internalType":"uint256","name":"sizeID","type":"uint256"},{"internalType":"string","name":"metadataHash","type":"string"},{"internalType":"address","name":"redeemableContract","type":"address"}],"internalType":"struct NeaMintTicketFactory.MintTicketParam","name":"params","type":"tuple"}],"name":"editMintTicket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mtIndex","type":"uint256"},{"internalType":"address","name":"userAdress","type":"address"}],"name":"getClaimedMts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"getRemainingEarlyAccessMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mtIndex","type":"uint256"}],"name":"getTicketSizeID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mtIndex","type":"uint256"}],"name":"isEarlyAccessOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isOnEarlyAccessList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mtIndex","type":"uint256"}],"name":"isSaleOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"numPasses","type":"uint256"},{"internalType":"uint256","name":"mtIndex","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"numPasses","type":"uint256[]"},{"internalType":"uint256[]","name":"mtIndexes","type":"uint256[]"}],"name":"mintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"mintTicketExists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintTickets","outputs":[{"internalType":"bool","name":"saleIsOpen","type":"bool"},{"internalType":"uint256","name":"earlyAccessOpens","type":"uint256"},{"internalType":"uint256","name":"publicSaleOpens","type":"uint256"},{"internalType":"uint256","name":"publicSaleCloses","type":"uint256"},{"internalType":"uint256","name":"mintPrice","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"maxPerWallet","type":"uint256"},{"internalType":"uint256","name":"maxMintPerTxn","type":"uint256"},{"internalType":"uint256","name":"sizeID","type":"uint256"},{"internalType":"string","name":"metadataHash","type":"string"},{"internalType":"address","name":"redeemableContract","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name_","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nemusPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nemusWallet","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"toRemove","type":"address[]"}],"name":"removeFromEarlyAccessList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_earlyAccess","type":"uint256"}],"name":"setMintTicketEarlyAccessOpens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_maxMintPerTxn","type":"uint256"}],"name":"setMintTicketMaxMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_maxMintPerWallet","type":"uint256"}],"name":"setMintTicketMaxPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_maxSupply","type":"uint256"}],"name":"setMintTicketMaxSupplyt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"string","name":"_metadataId","type":"string"}],"name":"setMintTicketMetadataId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_mintPrice","type":"uint256"}],"name":"setMintTicketPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_publicSaleCloses","type":"uint256"}],"name":"setMintTicketPublicSaleCloses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_publicSaleOpens","type":"uint256"}],"name":"setMintTicketPublicSaleOpens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"address","name":"_redeemableContract","type":"address"}],"name":"setMintTicketRedeemableContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_sizeId","type":"uint256"}],"name":"setMintTicketSizeId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol_","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasuryPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasuryWallet","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"turnSaleOff","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"turnSaleOn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_treasuryPercentage","type":"uint256"},{"internalType":"uint256","name":"_nemusPercentage","type":"uint256"}],"name":"updatePayoutPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_indexes","type":"uint256[]"},{"internalType":"uint256","name":"_search","type":"uint256"}],"name":"validateNonDupliateIndex","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"withdrawFunds","outputs":[],"stateMutability":"nonpayable","type":"function"}]