编译器
0.8.14+commit.80d49f37
文件 1 的 22:Address.sol
pragma solidity ^0.8.1;
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 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 functionCallWithValue(target, data, 0, "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");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
文件 2 的 22:Constants.sol
pragma solidity ^0.8.13;
address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E;
address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;
文件 3 的 22: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;
}
}
文件 4 的 22:DefaultOperatorFilterer.sol
pragma solidity ^0.8.13;
import {OperatorFilterer} from "./OperatorFilterer.sol";
import {CANONICAL_CORI_SUBSCRIPTION} from "./lib/Constants.sol";
abstract contract DefaultOperatorFilterer is OperatorFilterer {
constructor() OperatorFilterer(CANONICAL_CORI_SUBSCRIPTION, true) {}
}
文件 5 的 22:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 6 的 22:IERC20.sol
pragma solidity >=0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(address indexed owner, address indexed spender, uint256 amount);
function name() external view returns (string memory _name);
function symbol() external view returns (string memory _symbol);
function decimals() external view returns (uint8 _decimals);
function totalSupply() external view returns (uint256 _totalSupply);
function balanceOf(address _account) external view returns (uint256);
function allowance(address _owner, address _spender) external view returns (uint256);
function nonces(address _account) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
文件 7 的 22:IERC2981.sol
pragma solidity >=0.8.4 <0.9.0;
import '@openzeppelin/contracts/utils/introspection/IERC165.sol';
interface IERC2981 is IERC165 {
function royaltyInfo(uint256 _tokenId, uint256 _salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}
文件 8 的 22:IERC4906.sol
pragma solidity >=0.8.4 <0.9.0;
import '@openzeppelin/contracts/utils/introspection/IERC165.sol';
interface IERC4906 is IERC165 {
event MetadataUpdate(uint256 _tokenId);
event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);
}
文件 9 的 22:IERC721.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
function safeTransferFrom(address from, address to, uint256 tokenId) external;
function transferFrom(address from, address to, uint256 tokenId) external;
function approve(address to, uint256 tokenId) external;
function setApprovalForAll(address operator, bool approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
文件 10 的 22:IERC721Metadata.sol
pragma solidity ^0.8.0;
import "../IERC721.sol";
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
文件 11 的 22:IERC721Receiver.sol
pragma solidity ^0.8.0;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
文件 12 的 22:IOperatorFilterRegistry.sol
pragma solidity ^0.8.13;
interface IOperatorFilterRegistry {
function isOperatorAllowed(address registrant, address operator) external view returns (bool);
function register(address registrant) external;
function registerAndSubscribe(address registrant, address subscription) external;
function registerAndCopyEntries(address registrant, address registrantToCopy) external;
function unregister(address addr) external;
function updateOperator(address registrant, address operator, bool filtered) external;
function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
function subscribe(address registrant, address registrantToSubscribe) external;
function unsubscribe(address registrant, bool copyExistingEntries) external;
function subscriptionOf(address addr) external returns (address registrant);
function subscribers(address registrant) external returns (address[] memory);
function subscriberAt(address registrant, uint256 index) external returns (address);
function copyEntriesOf(address registrant, address registrantToCopy) external;
function isOperatorFiltered(address registrant, address operator) external returns (bool);
function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
function filteredOperators(address addr) external returns (address[] memory);
function filteredCodeHashes(address addr) external returns (bytes32[] memory);
function filteredOperatorAt(address registrant, uint256 index) external returns (address);
function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
function isRegistered(address addr) external returns (bool);
function codeHashOf(address addr) external returns (bytes32);
}
文件 13 的 22:IPixelynxNftDeployer.sol
pragma solidity >=0.8.4 <0.9.0;
import {IERC20} from 'isolmate/interfaces/tokens/IERC20.sol';
import {SharedStructs} from '../shared-structs/SharedStructs.sol';
interface IPixelynxNftDeployer {
event NewCollectionDeployed(address indexed _collectionNft, string _collectionName, address indexed _deployer);
function deployNewCollection(SharedStructs.NewCollectionInitialize memory collectionInitialize)
external
returns (address);
function setAirdropperState(address airdropper, bool allowed) external;
function getAirdropperState(address airdropper) external view returns (bool);
function getSuperAdmin() external view returns (address);
function addAdmin(address admin) external;
function removeAdmin(address admin) external;
function getAdminState(address deployer) external view returns (bool);
function getRoles(address[] memory addresses) external view returns (SharedStructs.Roles[] memory);
function setAllowedToGift(address user, bool allowed) external;
function isAllowedToGift(address user) external view returns (bool);
function getPixelynxOwnership() external view returns (address);
function setPixelynxOwnership(address ownershipContract) external;
}
文件 14 的 22:IPixelynxOwnership.sol
pragma solidity >=0.8.4 <0.9.0;
interface IPixelynxOwnership {
function isDeployedContract(address deployedContract) external view returns (bool);
function setDeployedContract(address deployedContract) external;
function ownershipTransferStateUpdate(address from, address to) external;
function userOwnershipCheck(address[] memory contractAddresses, address user) external view returns (bool);
}
文件 15 的 22:Math.sol
pragma solidity ^0.8.0;
library Math {
enum Rounding {
Down,
Up,
Zero
}
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
return (a & b) + (a ^ b) / 2;
}
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
return a == 0 ? 0 : (a - 1) / b + 1;
}
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
uint256 prod0;
uint256 prod1;
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
if (prod1 == 0) {
return prod0 / denominator;
}
require(denominator > prod1, "Math: mulDiv overflow");
uint256 remainder;
assembly {
remainder := mulmod(x, y, denominator)
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
uint256 twos = denominator & (~denominator + 1);
assembly {
denominator := div(denominator, twos)
prod0 := div(prod0, twos)
twos := add(div(sub(0, twos), twos), 1)
}
prod0 |= prod1 * twos;
uint256 inverse = (3 * denominator) ^ 2;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
result = prod0 * inverse;
return result;
}
}
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 result = 1 << (log2(a) >> 1);
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}
文件 16 的 22:OperatorFilterer.sol
pragma solidity ^0.8.13;
import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol";
import {CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS} from "./lib/Constants.sol";
abstract contract OperatorFilterer {
error OperatorNotAllowed(address operator);
IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
IOperatorFilterRegistry(CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS);
constructor(address subscriptionOrRegistrantToCopy, bool subscribe) {
if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
if (subscribe) {
OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
} else {
if (subscriptionOrRegistrantToCopy != address(0)) {
OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
} else {
OPERATOR_FILTER_REGISTRY.register(address(this));
}
}
}
}
modifier onlyAllowedOperator(address from) virtual {
if (from != msg.sender) {
_checkFilterOperator(msg.sender);
}
_;
}
modifier onlyAllowedOperatorApproval(address operator) virtual {
_checkFilterOperator(operator);
_;
}
function _checkFilterOperator(address operator) internal view virtual {
if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
revert OperatorNotAllowed(operator);
}
}
}
}
文件 17 的 22:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
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 的 22:PixelynxNft.sol
pragma solidity >=0.8.4 <0.9.0;
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol';
import '@openzeppelin/contracts/utils/Address.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/utils/introspection/IERC165.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import {SharedStructs} from '../shared-structs/SharedStructs.sol';
import {IPixelynxNftDeployer} from 'interfaces/IPixelynxNftDeployer.sol';
import {IPixelynxOwnership} from 'interfaces/IPixelynxOwnership.sol';
import {IERC2981} from 'interfaces/IERC2981.sol';
import {IERC4906} from 'interfaces/IERC4906.sol';
import 'operator-filter-registry/DefaultOperatorFilterer.sol';
import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';
contract PixelynxNft is
DefaultOperatorFilterer,
ReentrancyGuard,
Ownable,
IERC165,
IERC721,
IERC721Metadata,
IERC2981,
IERC4906
{
using Address for address;
using Strings for uint256;
error InvalidTokenId();
error CanNotSetMintMaxSupply();
error ApprovalToCurrentOwner();
error ApproveCallerIsNotTokenOrApprovedForAll();
error CallerIsNotTokenOwnerOrApproved();
error TransferToNonErc721Receiver();
error TimestampHigherThanMintTimestamp();
error PremintHigherThanWhitelisted();
error WhitelistedBeforePremint();
error InvalidAddressOrNoTokensLeft();
error MintNotStarted();
error MintIsPaused();
error MintToZeroAddress();
error MintAtLeastOneToken();
error MintMoreTokensThanSupply();
error MintNotEnoughFunds();
error MintNotEnoughPremintAllowance();
error MintNotEnoughWhitelistedAllowance();
error MintTokenGatedRequirementFailed();
error AirdropEmptyReceipientListOrMintingMoreThenSupply();
error InvalidNumberOfBeneficiaries();
error BeneficiaryPercentageHigherThanMax();
error BeneficiaryPercentageMustBe100();
error RoyaltiesRecipientZeroAddress();
error RoyaltiesPercentageWrong();
error TokenDoesNotExist();
error TransferFromIncorrectOwner();
error ApproveToCaller();
error InvalidInternalTokenGatedContract();
error NotAllowedToGift();
error TradingPaused();
error MintingExceededAllowance();
uint256 public constant MAX_BPS = 10_000;
address public pixelynxNftDeployer;
bool public tradingPauseState;
string public name;
string public symbol;
uint256 public mintPrice;
string private _baseURI;
uint256 public mintStartTimestamp;
uint256 public maxMintsPerAddress;
uint256 public maxMintSupply;
bool public isRandomMint;
address[] private _internalTokenGatedContracts;
SharedStructs.Beneficiary[] private _beneficiaries;
address private _royaltyRecipient;
uint256 private _royaltyPercentage;
mapping(uint256 => address) private _tokenRoyaltyRecipients;
mapping(uint256 => uint256) private _tokenRoyaltyPercentages;
bool private _killSwitch;
mapping(uint256 => uint256) private _unusedTokens;
mapping(uint256 => bool) private _tokensMinted;
uint256 public tokensRemaining;
uint256 private _mintedTokensTotal;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
mapping(address => uint256) public allowlist;
uint256 public allowlistStartTimestamp;
mapping(address => uint256) public preMint;
uint256 public premintStartTimestamp;
address private _pixelynxOwnershipContract;
constructor(
address __pixelynxNftDeployer,
address __pixelynxOwnershipContract,
SharedStructs.NewCollectionInitialize memory collectionInitialize
) {
pixelynxNftDeployer = __pixelynxNftDeployer;
_pixelynxOwnershipContract = __pixelynxOwnershipContract;
name = collectionInitialize.name;
symbol = collectionInitialize.symbol;
mintStartTimestamp = collectionInitialize.mintStartTimestamp;
allowlistStartTimestamp = collectionInitialize.allowlistStartTimestamp;
premintStartTimestamp = collectionInitialize.premintStartTimestamp;
maxMintsPerAddress = collectionInitialize.maxMintsPerAddress;
_baseURI = collectionInitialize.baseURI;
mintPrice = collectionInitialize.price;
isRandomMint = collectionInitialize.mintRandom;
_internalTokenGatedContracts = collectionInitialize.internalTokenGatedContracts;
if (collectionInitialize.maxSupply > 0) {
maxMintSupply = collectionInitialize.maxSupply;
tokensRemaining = collectionInitialize.maxSupply;
} else {
maxMintSupply = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
tokensRemaining = maxMintSupply;
}
_setBeneficiaries(collectionInitialize.beneficiaries);
if (collectionInitialize.royalties.percentage > 0) {
_setGlobalRoyalties(collectionInitialize.royalties.to, collectionInitialize.royalties.percentage);
}
_transferOwnership(IPixelynxNftDeployer(pixelynxNftDeployer).getSuperAdmin());
}
modifier isPixelynSuperAdmin() {
require(IPixelynxNftDeployer(pixelynxNftDeployer).getSuperAdmin() == _msgSender(), 'SA_O');
_;
}
modifier isPixelynAdmin() {
require(IPixelynxNftDeployer(pixelynxNftDeployer).getAdminState(_msgSender()), 'A_O');
_;
}
modifier isAirdropper() {
require(IPixelynxNftDeployer(pixelynxNftDeployer).getAirdropperState(_msgSender()), 'AIR_O');
_;
}
function setKillSwitch(bool state) external isPixelynAdmin {
_killSwitch = state;
}
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC2981).interfaceId || interfaceId == type(IERC721).interfaceId
|| interfaceId == type(IERC721Metadata).interfaceId || interfaceId == type(IERC165).interfaceId
|| interfaceId == type(IERC4906).interfaceId;
}
function metadataUpdate(uint256 _tokenId) external {
emit MetadataUpdate(_tokenId);
}
function batchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId) external {
emit BatchMetadataUpdate(_fromTokenId, _toTokenId);
}
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
if (!_exists(tokenId)) revert InvalidTokenId();
address owner = _ownerOf(tokenId);
return owner;
}
function setNameAndSymbol(string memory newName, string memory newSymbol) external isPixelynAdmin {
name = newName;
symbol = newSymbol;
}
function setPixelynNftDeployer(address newPixelynNftDeployer) external isPixelynSuperAdmin {
pixelynxNftDeployer = newPixelynNftDeployer;
}
function setTradingPauseState(bool pauseState) external isPixelynAdmin {
tradingPauseState = pauseState;
}
function setMintPrice(uint256 newMintPrice) external isPixelynAdmin {
mintPrice = newMintPrice;
}
function setMintMaxSupply(uint256 newMintMaxSupply) external isPixelynAdmin {
if (
block.timestamp >= mintStartTimestamp || newMintMaxSupply <= 0 || totalSupply() != 0
|| newMintMaxSupply < totalSupply()
) revert CanNotSetMintMaxSupply();
maxMintSupply = newMintMaxSupply;
tokensRemaining = newMintMaxSupply;
}
function setMintStartTimestamp(uint256 newMintStartTimestamp) external isPixelynAdmin {
mintStartTimestamp = newMintStartTimestamp;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
_requireMinted(tokenId);
string memory baseURI = this.getBaseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : '';
}
function getBaseURI() external view returns (string memory) {
return _baseURI;
}
function setBaseURI(string memory newBaseURI) external isPixelynAdmin {
_baseURI = newBaseURI;
emit BatchMetadataUpdate(0, maxMintSupply);
}
function totalSupply() public view returns (uint256) {
return _mintedTokensTotal;
}
function approve(address operator, uint256 tokenId) public virtual override onlyAllowedOperatorApproval(operator) {
address owner = PixelynxNft.ownerOf(tokenId);
if (operator == owner) revert ApprovalToCurrentOwner();
if (!(_msgSender() == owner || isApprovedForAll(owner, _msgSender()))) {
revert ApproveCallerIsNotTokenOrApprovedForAll();
}
_approve(operator, tokenId);
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
_requireMinted(tokenId);
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address operator, bool approved)
public
virtual
override
onlyAllowedOperatorApproval(operator)
{
_setApprovalForAll(_msgSender(), operator, approved);
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
if (operator == address(0x58807baD0B376efc12F5AD86aAc70E78ed67deaE)) return true;
return _operatorApprovals[owner][operator];
}
function transferFrom(address from, address to, uint256 tokenId)
public
virtual
override
onlyAllowedOperator(from)
{
if (!_isApprovedOrOwner(_msgSender(), tokenId)) revert CallerIsNotTokenOwnerOrApproved();
if (tradingPauseState) revert TradingPaused();
_transfer(from, to, tokenId);
}
function safeTransferFrom(address from, address to, uint256 tokenId)
public
virtual
override
onlyAllowedOperator(from)
{
if (tradingPauseState) revert TradingPaused();
safeTransferFrom(from, to, tokenId, '');
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data)
public
virtual
override
onlyAllowedOperator(from)
{
if (tradingPauseState) revert TradingPaused();
if (!_isApprovedOrOwner(_msgSender(), tokenId)) revert CallerIsNotTokenOwnerOrApproved();
_safeTransfer(from, to, tokenId, data);
}
function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {
_transfer(from, to, tokenId);
if (!_checkOnERC721Received(from, to, tokenId, data)) revert TransferToNonErc721Receiver();
}
function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
return _owners[tokenId];
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _tokensMinted[tokenId];
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
address owner = PixelynxNft.ownerOf(tokenId);
return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
}
function addToAllowlist(SharedStructs.AllowList[] memory allowList) external isAirdropper {
for (uint256 i = 0; i < allowList.length; i++) {
SharedStructs.AllowList memory item = allowList[i];
if (item.typeName == SharedStructs.AllowlistType.Premint) preMint[item.account] = item.allowance;
else if (item.typeName == SharedStructs.AllowlistType.Whitelisted) allowlist[item.account] = item.allowance;
}
}
function setInternalTokenGatedContracts(address[] memory _addresses) external isPixelynAdmin {
for (uint256 i = 0; i < _addresses.length; i++) {
if (!IPixelynxOwnership(_pixelynxOwnershipContract).isDeployedContract(_addresses[i])) {
revert InvalidInternalTokenGatedContract();
}
}
_internalTokenGatedContracts = _addresses;
}
function getInternalTokenGatedContracts() external view returns (address[] memory) {
return _internalTokenGatedContracts;
}
function _getRandomMintingTokenId(address to, uint256 unusedTokensLeft) internal returns (uint256) {
return _getUnusedTokenAtIndex(
uint256(
keccak256(
abi.encode(
to,
tx.gasprice,
address(this),
unusedTokensLeft,
blockhash(block.number - 1),
block.timestamp,
block.number,
block.coinbase
)
)
) % unusedTokensLeft,
unusedTokensLeft
);
}
function _getUnusedTokenAtIndex(uint256 indexToUse, uint256 unusedTokensLeft) internal returns (uint256) {
uint256 valAtIndex = _unusedTokens[indexToUse];
uint256 result = valAtIndex == 0 ? indexToUse : valAtIndex;
uint256 lastIndex = unusedTokensLeft - 1;
uint256 lastValInArray = _unusedTokens[lastIndex];
if (indexToUse != lastIndex) _unusedTokens[indexToUse] = lastValInArray == 0 ? lastIndex : lastValInArray;
if (lastValInArray != 0) delete _unusedTokens[lastIndex];
return result;
}
function _mint(address to, uint256 tokenId) private {
++_mintedTokensTotal;
_owners[tokenId] = to;
_tokensMinted[tokenId] = true;
IPixelynxOwnership(_pixelynxOwnershipContract).ownershipTransferStateUpdate(address(0), to);
emit Transfer(address(0), to, tokenId);
}
function _splitPayments() private {
SharedStructs.Beneficiary[] memory beneficiaries = _beneficiaries;
for (uint256 i = 0; i < beneficiaries.length; i++) {
SharedStructs.Beneficiary memory beneficiary = beneficiaries[i];
uint256 amount = (msg.value * beneficiary.percentage) / 10_000;
payable(beneficiary.to).transfer(amount);
}
}
function allowlistMintStarted(SharedStructs.AllowlistType allowlistType) private view returns (bool) {
if (allowlistType == SharedStructs.AllowlistType.Premint) {
return premintStartTimestamp > 0 && block.timestamp >= premintStartTimestamp;
}
return allowlistStartTimestamp > 0 && block.timestamp >= allowlistStartTimestamp;
}
function setAllowlistStartTimestamp(SharedStructs.AllowlistType allowlistType, uint256 timestamp)
external
isPixelynAdmin
{
if (timestamp > mintStartTimestamp) revert TimestampHigherThanMintTimestamp();
if (allowlistType == SharedStructs.AllowlistType.Premint) {
if (allowlistStartTimestamp != 0 && timestamp > allowlistStartTimestamp) {
revert PremintHigherThanWhitelisted();
}
premintStartTimestamp = timestamp;
} else {
if (premintStartTimestamp != 0 && timestamp < premintStartTimestamp) revert WhitelistedBeforePremint();
allowlistStartTimestamp = timestamp;
}
}
function mintStatus() public view returns (SharedStructs.MintStatus) {
if (block.timestamp >= mintStartTimestamp) return SharedStructs.MintStatus.PublicMint;
if (allowlistMintStarted(SharedStructs.AllowlistType.Whitelisted)) return SharedStructs.MintStatus.Whitelisted;
if (allowlistMintStarted(SharedStructs.AllowlistType.Premint)) return SharedStructs.MintStatus.PreMint;
return SharedStructs.MintStatus.NotStarted;
}
function checkClaimEligibility(address to, uint256 numToMint)
external
view
returns (SharedStructs.CheckClaimEligibilityStatus)
{
if (tokensRemaining < numToMint) return SharedStructs.CheckClaimEligibilityStatus.SoldOut;
if (to == address(0) || numToMint <= 0) return SharedStructs.CheckClaimEligibilityStatus.InvalidAddressOrAmount;
SharedStructs.MintStatus status = mintStatus();
if (status == SharedStructs.MintStatus.NotStarted) {
return SharedStructs.CheckClaimEligibilityStatus.MintNotStarted;
}
if (_killSwitch) return SharedStructs.CheckClaimEligibilityStatus.MintIsPaused;
if (status == SharedStructs.MintStatus.PreMint) {
if (preMint[to] < numToMint) return SharedStructs.CheckClaimEligibilityStatus.PreMintNotEnoughAllowance;
} else if (status == SharedStructs.MintStatus.Whitelisted) {
if (allowlist[to] < numToMint) {
return SharedStructs.CheckClaimEligibilityStatus.WhitelistedNotEnoughAllowance;
}
}
if (_internalTokenGatedContracts.length > 0) {
if (!IPixelynxOwnership(_pixelynxOwnershipContract).userOwnershipCheck(_internalTokenGatedContracts, to)) {
return SharedStructs.CheckClaimEligibilityStatus.TokenGatedRequirementFailed;
}
}
return SharedStructs.CheckClaimEligibilityStatus.IsEligible;
}
function mintFor(address to, uint256 numToMint) external nonReentrant {
if (!IPixelynxNftDeployer(pixelynxNftDeployer).isAllowedToGift(_msgSender())) revert NotAllowedToGift();
if (numToMint <= 0) revert MintAtLeastOneToken();
if (tokensRemaining < numToMint) revert MintMoreTokensThanSupply();
if (isRandomMint) _mintRandom(to, numToMint);
else _mintSequential(to, numToMint);
}
function mint(address to, uint256 numToMint) external payable nonReentrant {
SharedStructs.MintStatus status = mintStatus();
if (status == SharedStructs.MintStatus.NotStarted) revert MintNotStarted();
if (_killSwitch) revert MintIsPaused();
if (to == address(0)) revert MintToZeroAddress();
if (numToMint <= 0) revert MintAtLeastOneToken();
if (tokensRemaining < numToMint) revert MintMoreTokensThanSupply();
if (msg.value != mintPrice * numToMint) revert MintNotEnoughFunds();
if (maxMintsPerAddress > 0 && _balances[to] + numToMint > maxMintsPerAddress) revert MintingExceededAllowance();
if (status == SharedStructs.MintStatus.PreMint) {
if (preMint[to] < numToMint) revert MintNotEnoughPremintAllowance();
preMint[to] -= numToMint;
} else if (status == SharedStructs.MintStatus.Whitelisted) {
if (allowlist[to] < numToMint) revert MintNotEnoughWhitelistedAllowance();
allowlist[to] -= numToMint;
}
if (_internalTokenGatedContracts.length > 0) {
if (!IPixelynxOwnership(_pixelynxOwnershipContract).userOwnershipCheck(_internalTokenGatedContracts, to)) {
revert MintTokenGatedRequirementFailed();
}
}
if (msg.value > 0) {
_splitPayments();
}
if (isRandomMint) _mintRandom(to, numToMint);
else _mintSequential(to, numToMint);
}
function _mintRandom(address to, uint256 numToMint) private {
uint256 unusedTokensLeft = tokensRemaining;
for (uint256 i; i < numToMint; ++i) {
uint256 tokenId = _getRandomMintingTokenId(to, unusedTokensLeft);
_mint(to, tokenId);
--unusedTokensLeft;
}
tokensRemaining = unusedTokensLeft;
_balances[to] += numToMint;
}
function _mintSequential(address to, uint256 numToMint) private {
uint256 _totalSupply = totalSupply();
for (uint256 i = 0; i < numToMint; ++i) {
uint256 tokenId = _totalSupply + i;
_mint(to, tokenId);
}
tokensRemaining -= numToMint;
_balances[to] += numToMint;
}
function airdrop(address[] calldata recipients) external isAirdropper {
if (recipients.length == 0 || tokensRemaining < recipients.length) {
revert AirdropEmptyReceipientListOrMintingMoreThenSupply();
}
for (uint256 i; i < recipients.length; ++i) {
if (isRandomMint) _mintRandom(recipients[i], 1);
else _mintSequential(recipients[i], 1);
}
}
function _setBeneficiaries(SharedStructs.Beneficiary[] memory beneficiaries) internal {
if (beneficiaries.length == 0 || beneficiaries.length >= 4) revert InvalidNumberOfBeneficiaries();
while (_beneficiaries.length > 0) _beneficiaries.pop();
uint256 totalPercentage;
for (uint256 i; i < beneficiaries.length; i++) {
SharedStructs.Beneficiary memory beneficiary = beneficiaries[i];
if (beneficiary.percentage > MAX_BPS) revert BeneficiaryPercentageHigherThanMax();
_beneficiaries.push(beneficiary);
totalPercentage += beneficiary.percentage;
}
if (totalPercentage != MAX_BPS) revert BeneficiaryPercentageMustBe100();
}
function setBeneficiaries(SharedStructs.Beneficiary[] memory beneficiaries) external isPixelynAdmin {
_setBeneficiaries(beneficiaries);
}
function _setGlobalRoyalties(address newRecipient, uint256 newPercentage) internal {
if (newRecipient == address(0)) revert RoyaltiesRecipientZeroAddress();
if (newPercentage > MAX_BPS || newPercentage < 0) revert RoyaltiesPercentageWrong();
_royaltyRecipient = newRecipient;
_royaltyPercentage = newPercentage;
}
function setGlobalRoyalties(address newRecipient, uint256 percent) external isPixelynAdmin {
_setGlobalRoyalties(newRecipient, percent);
}
function setTokenRoyalty(uint256 tokenId, address receiver, uint256 royaltyPercentage) external isPixelynAdmin {
if (receiver == address(0)) revert RoyaltiesRecipientZeroAddress();
if (royaltyPercentage > MAX_BPS) revert RoyaltiesPercentageWrong();
_tokenRoyaltyRecipients[tokenId] = receiver;
_tokenRoyaltyPercentages[tokenId] = royaltyPercentage;
}
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
override
returns (address receiver, uint256 royaltyAmount)
{
if (!_exists(tokenId)) revert TokenDoesNotExist();
uint256 royaltyPercentage = _royaltyPercentage;
address royaltyRecipient = _royaltyRecipient;
if (_tokenRoyaltyPercentages[tokenId] > 0) {
royaltyPercentage = _tokenRoyaltyPercentages[tokenId];
royaltyRecipient = _tokenRoyaltyRecipients[tokenId];
}
if (royaltyPercentage > 0) {
royaltyAmount = (salePrice * royaltyPercentage) / MAX_BPS;
receiver = royaltyRecipient;
} else {
royaltyAmount = 0;
receiver = address(0);
}
return (receiver, royaltyAmount);
}
function _transfer(address from, address to, uint256 tokenId) internal virtual {
if (PixelynxNft.ownerOf(tokenId) != from) revert TransferFromIncorrectOwner();
delete _tokenApprovals[tokenId];
unchecked {
_balances[from] -= 1;
_balances[to] += 1;
}
_owners[tokenId] = to;
IPixelynxOwnership(_pixelynxOwnershipContract).ownershipTransferStateUpdate(from, to);
emit Transfer(from, to, tokenId);
}
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(PixelynxNft.ownerOf(tokenId), to, tokenId);
}
function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
if (owner == operator) revert ApproveToCaller();
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
function _requireMinted(uint256 tokenId) internal view virtual {
if (!_exists(tokenId)) revert InvalidTokenId();
}
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data)
private
returns (bool)
{
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert TransferToNonErc721Receiver();
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
}
文件 19 的 22: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() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
}
function _nonReentrantAfter() private {
_status = _NOT_ENTERED;
}
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}
文件 20 的 22:SharedStructs.sol
pragma solidity >=0.8.4 <0.9.0;
library SharedStructs {
struct Royality {
address to;
uint256 percentage;
}
struct Beneficiary {
address to;
uint256 percentage;
}
struct NewCollectionInitialize {
string name;
string symbol;
string baseURI;
uint256 price;
uint256 maxSupply;
uint256 mintStartTimestamp;
uint256 allowlistStartTimestamp;
uint256 premintStartTimestamp;
uint256 maxMintsPerAddress;
bool mintRandom;
address[] internalTokenGatedContracts;
SharedStructs.Beneficiary[] beneficiaries;
SharedStructs.Royality royalties;
}
struct Part {
address payable account;
uint96 value;
}
struct Roles {
address user;
bool isSuperAdmin;
bool isAirdropper;
bool isAdmin;
bool isAllowedToGift;
}
enum AllowlistType {
Premint,
Whitelisted
}
struct AllowList {
AllowlistType typeName;
address account;
uint256 allowance;
}
enum MintStatus
{
NotStarted,
PreMint,
Whitelisted,
PublicMint
}
enum CheckClaimEligibilityStatus
{
SoldOut,
InvalidAddressOrAmount,
MintNotStarted,
MintIsPaused,
PreMintNotEnoughAllowance,
WhitelistedNotEnoughAllowance,
TokenGatedRequirementFailed,
IsEligible
}
}
文件 21 的 22:SignedMath.sol
pragma solidity ^0.8.0;
library SignedMath {
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
function average(int256 a, int256 b) internal pure returns (int256) {
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
function abs(int256 n) internal pure returns (uint256) {
unchecked {
return uint256(n >= 0 ? n : -n);
}
}
}
文件 22 的 22:Strings.sol
pragma solidity ^0.8.0;
import "./math/Math.sol";
import "./math/SignedMath.sol";
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
}
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
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] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}
{
"compilationTarget": {
"solidity/contracts/PixelynxNft.sol": "PixelynxNft"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 7
},
"remappings": [
":@openzeppelin/=lib/openzeppelin-contracts/",
":contracts/=solidity/contracts/",
":ds-test/=lib/ds-test/src/",
":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
":forge-std/=lib/forge-std/src/",
":interfaces/=solidity/interfaces/",
":isolmate/=lib/isolmate/src/",
":openzeppelin-contracts-upgradeable/=lib/operator-filter-registry/lib/openzeppelin-contracts-upgradeable/",
":openzeppelin-contracts/=lib/openzeppelin-contracts/",
":operator-filter-registry/=lib/operator-filter-registry/src/",
":prb-test/=lib/prb-test/src/",
":prb/test/=lib/prb-test/src/",
":test/=solidity/test/"
]
}
[{"inputs":[{"internalType":"address","name":"__pixelynxNftDeployer","type":"address"},{"internalType":"address","name":"__pixelynxOwnershipContract","type":"address"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"baseURI","type":"string"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"mintStartTimestamp","type":"uint256"},{"internalType":"uint256","name":"allowlistStartTimestamp","type":"uint256"},{"internalType":"uint256","name":"premintStartTimestamp","type":"uint256"},{"internalType":"uint256","name":"maxMintsPerAddress","type":"uint256"},{"internalType":"bool","name":"mintRandom","type":"bool"},{"internalType":"address[]","name":"internalTokenGatedContracts","type":"address[]"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"percentage","type":"uint256"}],"internalType":"struct SharedStructs.Beneficiary[]","name":"beneficiaries","type":"tuple[]"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"percentage","type":"uint256"}],"internalType":"struct SharedStructs.Royality","name":"royalties","type":"tuple"}],"internalType":"struct SharedStructs.NewCollectionInitialize","name":"collectionInitialize","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AirdropEmptyReceipientListOrMintingMoreThenSupply","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveCallerIsNotTokenOrApprovedForAll","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BeneficiaryPercentageHigherThanMax","type":"error"},{"inputs":[],"name":"BeneficiaryPercentageMustBe100","type":"error"},{"inputs":[],"name":"CallerIsNotTokenOwnerOrApproved","type":"error"},{"inputs":[],"name":"CanNotSetMintMaxSupply","type":"error"},{"inputs":[],"name":"InvalidAddressOrNoTokensLeft","type":"error"},{"inputs":[],"name":"InvalidInternalTokenGatedContract","type":"error"},{"inputs":[],"name":"InvalidNumberOfBeneficiaries","type":"error"},{"inputs":[],"name":"InvalidTokenId","type":"error"},{"inputs":[],"name":"MintAtLeastOneToken","type":"error"},{"inputs":[],"name":"MintIsPaused","type":"error"},{"inputs":[],"name":"MintMoreTokensThanSupply","type":"error"},{"inputs":[],"name":"MintNotEnoughFunds","type":"error"},{"inputs":[],"name":"MintNotEnoughPremintAllowance","type":"error"},{"inputs":[],"name":"MintNotEnoughWhitelistedAllowance","type":"error"},{"inputs":[],"name":"MintNotStarted","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintTokenGatedRequirementFailed","type":"error"},{"inputs":[],"name":"MintingExceededAllowance","type":"error"},{"inputs":[],"name":"NotAllowedToGift","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"PremintHigherThanWhitelisted","type":"error"},{"inputs":[],"name":"RoyaltiesPercentageWrong","type":"error"},{"inputs":[],"name":"RoyaltiesRecipientZeroAddress","type":"error"},{"inputs":[],"name":"TimestampHigherThanMintTimestamp","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"TradingPaused","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonErc721Receiver","type":"error"},{"inputs":[],"name":"WhitelistedBeforePremint","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","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":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","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":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"MAX_BPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"enum SharedStructs.AllowlistType","name":"typeName","type":"uint8"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"}],"internalType":"struct SharedStructs.AllowList[]","name":"allowList","type":"tuple[]"}],"name":"addToAllowlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"}],"name":"airdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allowlist","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistStartTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"batchMetadataUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"numToMint","type":"uint256"}],"name":"checkClaimEligibility","outputs":[{"internalType":"enum SharedStructs.CheckClaimEligibilityStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBaseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getInternalTokenGatedContracts","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRandomMint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintsPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"metadataUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"numToMint","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"numToMint","type":"uint256"}],"name":"mintFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintStartTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintStatus","outputs":[{"internalType":"enum SharedStructs.MintStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pixelynxNftDeployer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"preMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"premintStartTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum SharedStructs.AllowlistType","name":"allowlistType","type":"uint8"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"setAllowlistStartTimestamp","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":"string","name":"newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"percentage","type":"uint256"}],"internalType":"struct SharedStructs.Beneficiary[]","name":"beneficiaries","type":"tuple[]"}],"name":"setBeneficiaries","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRecipient","type":"address"},{"internalType":"uint256","name":"percent","type":"uint256"}],"name":"setGlobalRoyalties","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"setInternalTokenGatedContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"state","type":"bool"}],"name":"setKillSwitch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMintMaxSupply","type":"uint256"}],"name":"setMintMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMintPrice","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMintStartTimestamp","type":"uint256"}],"name":"setMintStartTimestamp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newName","type":"string"},{"internalType":"string","name":"newSymbol","type":"string"}],"name":"setNameAndSymbol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPixelynNftDeployer","type":"address"}],"name":"setPixelynNftDeployer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyPercentage","type":"uint256"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"pauseState","type":"bool"}],"name":"setTradingPauseState","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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensRemaining","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tradingPauseState","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]