Feature Tip: Add private address tag to any address under My Name Tag !
ERC-721
NFT
Overview
Max Total Supply
271 BOOBR
Holders
146
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 BOOBRLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
BooBears
Compiler Version
v0.8.9+commit.e5eed63a
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import {ERC721Essentials} from "ERC721Essentials.sol"; import {ERC721EssentialsWithdrawable} from "ERC721EssentialsWithdrawable.sol"; import {ERC721ClaimFromContracts} from "ERC721ClaimFromContracts.sol"; import {BaseErrorCodes} from "ErrorCodes.sol"; //===================================================================================================================== /// 😈 OOGA BOOGA SPOOKY BEARA 😈 //===================================================================================================================== contract BooBears is ERC721EssentialsWithdrawable, ERC721ClaimFromContracts { //================================================================================================================= /// State Variables //================================================================================================================= mapping(address => bool) internal hasMinted; string private constant kErrOnlyMintOne = "Only allowed to Mint 1 Boo Bear"; /* solhint-disable-line */ //================================================================================================================= /// Constructor //================================================================================================================= constructor( string memory name_, string memory symbol_, string memory baseURI_, uint256[] memory uintArgs_, bool publicMintingEnabled_, address[] memory contractAddrs_, uint16 maxForPurchase_, uint16 maxForClaim_ ) ERC721EssentialsWithdrawable(name_, symbol_, baseURI_, uintArgs_, publicMintingEnabled_) ERC721ClaimFromContracts(contractAddrs_, maxForPurchase_, maxForClaim_) { return; } //================================================================================================================= /// Minting Functionality //================================================================================================================= /** * @dev Public function that mints a specified number of ERC721 tokens. * @param numMint uint16: The number of tokens that are going to be minted. */ function mint(uint16 numMint) public payable virtual override(ERC721ClaimFromContracts, ERC721Essentials) limitToOneMint { super.mint(numMint); // ERC721ClaimFromContracts.sol, ERC721Essentials.sol } /** * @dev Modifier to limit the number of mints to one per user. */ modifier limitToOneMint() { require(!hasMinted[_msgSender()], kErrOnlyMintOne); hasMinted[_msgSender()] = true; _; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; /* External Imports */ import {AccessControl} from "AccessControl.sol"; import {ERC721} from "ERC721.sol"; import {ERC721Enumerable} from "ERC721Enumerable.sol"; import {Ownable} from "Ownable.sol"; import {ReentrancyGuard} from "ReentrancyGuard.sol"; import {Strings} from "Strings.sol"; /* Internal Imports */ import {BaseErrorCodes} from "ErrorCodes.sol"; import {ERC721Metadata} from "ERC721Metadata.sol"; import {Modifiers} from "Modifiers.sol"; //===================================================================================================================== /// 😎 Free Internet Money 😎 //===================================================================================================================== /** * @dev Essential state and behavior that every ERC721 contract should have. */ contract ERC721Essentials is AccessControl, ERC721Enumerable, ERC721Metadata, Modifiers, Ownable, ReentrancyGuard { using Strings for uint256; //================================================================================================================= /// State Variables //================================================================================================================= /* Internal */ uint16 internal _maxSupply; uint16 internal _maxMintPerTx; uint256 internal _priceInWei; bool internal _publicMintingEnabled; //================================================================================================================= /// Constructor //================================================================================================================= constructor( string memory name_, string memory symbol_, string memory baseURI_, uint256[] memory uintArgs_, bool publicMintingEnabled_ ) ERC721(name_, symbol_) { _maxSupply = uint16(uintArgs_[0]); _priceInWei = uintArgs_[1]; _maxMintPerTx = uint16(uintArgs_[2]); _publicMintingEnabled = publicMintingEnabled_; _setBaseURI(baseURI_); _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); } //================================================================================================================= /// Minting Functionality //================================================================================================================= /** * @dev Public function that mints a specified number of ERC721 tokens. * @param numMint uint16: The number of tokens that are going to be minted. */ function mint(uint16 numMint) public payable virtual nonReentrant whenPublicMintingOpen costs(numMint, _priceInWei) { _mint(numMint); } /** * @dev Internal function that mints a specified number of ERC721 tokens. Contains * safety checks related to supply. * @param numMint uint16: The number of tokens that are going to be minted. */ function _mint(uint16 numMint) internal virtual _supplySafetyChecks(numMint) { _safeMintTokens(_msgSender(), numMint); } /** * @dev Public function that mints tokens to a set of wallet addresses. Each address has a specified number of * ERC721 tokens minted to it. Contains basic safety checks to ensure supply of tokens stays within limits. * This function is non-payable and thus is only callable by contract admins. The function is a naïve way to perform an * an airdrop and is pretty rough on gas. That being said, for small drops, the added surprise of users just "finding it" * in their wallet is kind of cool. Unless you don't mind eating a ton of gas, a merkle tree redemption method is recommended * for anything large scale. * @param addrs address[] memory: List of addresses to which tokens will be sent to. Setting this to an empty list will mint * the tokens to _msgSender(). * @param numMint uint16: The number of tokens that are going to be minted to each address. */ function mintAirDrop(address[] memory addrs, uint16 numMint) public virtual nonReentrant onlyRole(DEFAULT_ADMIN_ROLE) { if (addrs.length == 0) { // If no specified addresses, mint to the caller. address[] memory temp = new address[](1); temp[0] = _msgSender(); _mintAirDrop(temp, numMint); } else { _mintAirDrop(addrs, numMint); } } /** * @dev Internal function that mints tokens to set a of wallet addresses. * @param addrs address[] memory: List of addresses to which tokens will be sent to. Setting this to an empty list will mint * the tokens to _msgSender(). * @param numMint uint16: The number of tokens that are going to be minted to each address. */ function _mintAirDrop(address[] memory addrs, uint16 numMint) internal virtual _supplySafetyChecks(uint16(addrs.length * numMint)) { for (uint16 i = 0; i < addrs.length; i += 1) { _safeMintTokens(addrs[i], numMint); } } /** * @dev Internal function that mints a specified number of ERC721 tokens to a specific address. * contains NO SAFETY CHECKS and thus should be wrapped in a function that does. * @param to_ address: The address to mint the tokens to. * @param numMint uint16: The number of tokens to be minted. */ function _safeMintTokens(address to_, uint16 numMint) internal { for (uint16 i = 0; i < numMint; i += 1) { _safeMint(to_, totalSupply() + 1); } } //================================================================================================================= /// Accessors //================================================================================================================= /** * @dev returns minting access. */ function publicMintingEnabled() public view virtual returns (bool) { return _publicMintingEnabled; } /** * @dev Public function that returns the maximum number of ERC721 tokens that can exist under this contract. */ function maxSupply() public view virtual returns (uint16) { return _maxSupply; } /** * @dev Public function that returns the price for the mint. */ function priceInWei() public view virtual returns (uint256) { return _priceInWei; } /** * @dev Public function that returns the max number of mints per sent transaction. */ function maxMintPerTx() public view virtual returns (uint16) { return _maxMintPerTx; } //================================================================================================================= /// Mutators //================================================================================================================= /** * @dev Set minting access. Only callable by contract admins. */ function setPublicMinting(bool publicMintingEnabled_) external virtual onlyRole(DEFAULT_ADMIN_ROLE) { _publicMintingEnabled = publicMintingEnabled_; } /** * @dev Public function that sets the maximum number of ERC721 tokens that can exist under this contract. * @param newSupply uint16: The new maximum number of tokens. */ function setSupply(uint16 newSupply) public virtual onlyRole(DEFAULT_ADMIN_ROLE) { _maxSupply = newSupply; } /** * @dev Public function that sets the price for the mint. Only callable by contract admins. * @param newPrice uint256: The new price. */ function setPriceInWei(uint256 newPrice) public virtual onlyRole(DEFAULT_ADMIN_ROLE) { _priceInWei = newPrice; } /** * @dev Public function that sets the max number of mints per sent transaction. Only callable by contract admins. * @param newMaxMintPerTx uint256: The new max. */ function setMaxMintPerTx(uint16 newMaxMintPerTx) public virtual onlyRole(DEFAULT_ADMIN_ROLE) { _maxMintPerTx = newMaxMintPerTx; } //================================================================================================================= /// Metadata URI //================================================================================================================= /** * @dev Public function that sets the baseURI of this ERC721 token. * @param newBaseURI string memory: The baseURI of the contract. */ function setBaseURI(string memory newBaseURI) public virtual onlyRole(DEFAULT_ADMIN_ROLE) { _setBaseURI(newBaseURI); } /** * @dev Internal function that retrieves the baseURI of this ERC721 token. * @return string memory: The baseURI of the contract. */ function _baseURI() internal view virtual override(ERC721, ERC721Metadata) returns (string memory) { return super._baseURI(); } /** * @dev Public function that retrieves the tokenURI of a ERC721 token. For more info please view the * ERC721 spec: https://eips.ethereum.org/EIPS/eip-721. * @param tokenId uint256: The tokenId to be queried. * @return string memory: The tokenURI of the queried token. */ function tokenURI(uint256 tokenId) public view virtual override(ERC721, ERC721Metadata) returns (string memory) { return super.tokenURI(tokenId); } //================================================================================================================= /// Required Overrides //================================================================================================================= /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(AccessControl, ERC721, ERC721Enumerable) returns (bool) { return super.supportsInterface(interfaceId); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override(ERC721, ERC721Enumerable) { super._beforeTokenTransfer(from, to, tokenId); } //================================================================================================================= /// Useful Checks & Modifiers //================================================================================================================= /** * @dev A function to verify that the token supply will is in a valid state and will remain in a valid * state after the creation of a set number of tokens. * @param numMint uint16: The number of tokens requested to be created. */ function _requireBasicSupplySafetyChecks(uint16 numMint) internal view { require(totalSupply() < _maxSupply, kErrSoldOut); require(totalSupply() + numMint <= _maxSupply, kErrRequestTooLarge); require( (numMint > 0 && numMint <= _maxMintPerTx) || hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), kErrOutsideMintPerTransaction ); } /** * See {ERC721BasicMint-_requireBasicSupplySafetyChecks} */ modifier _supplySafetyChecks(uint16 numMint) { _requireBasicSupplySafetyChecks(numMint); _; } /** * @dev A modifier to guard the minting functions thus allowing minting to be enabled & disabled. */ modifier whenPublicMintingOpen() { require(_publicMintingEnabled || hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), kErrMintingIsDisabled); _; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "IAccessControl.sol"; import "Context.sol"; import "Strings.sol"; import "ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ 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; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ 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) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ 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()); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol 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); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ 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); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed 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); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "IERC721.sol"; import "IERC721Receiver.sol"; import "IERC721Metadata.sol"; import "Address.sol"; import "Context.sol"; import "Strings.sol"; import "ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ 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("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ 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"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ 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"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ 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); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ 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); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ 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); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "ERC721.sol"; import "IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; /* TODO: Refactor error codes from string -> bytes32 */ /* For ERC721Essentials.sol */ abstract contract BaseErrorCodes { /* solhint-disable const-name-snakecase */ string internal constant kErrInsufficientFunds = "Insufficient Funds"; string internal constant kErrSoldOut = "Sold Out"; string internal constant kErrTokenDoesNotExist = "nonexistent token"; string internal constant kErrRequestTooLarge = "Requested too many Tokens"; string internal constant kErrOutsideMintPerTransaction = "Outside mint per tx range"; string internal constant kErrMintingIsDisabled = "Minting is disabled"; string internal constant kErrIncorrectConfirmationCode = "Bad confirmation"; string internal constant kErrExternalCallFailed = "Failure calling external contract"; /* solhint-enable const-name-snakecase */ } /* For ERC721PresaleMintWithOffchainAllowlist.sol */ abstract contract AllowlistErrorCodes { /* solhint-disable const-name-snakecase */ string internal constant kErrPublicMintSoldout = "Remaining Tokens are restricted"; string internal constant kErrRestrictedRequestTooLarge = "Requested too many restricted Tokens"; /* solhint-enable const-name-snakecase */ } /* For ERC721ClaimFromContracts.sol */ abstract contract ClaimFromContractErrorCodes { /* solhint-disable const-name-snakecase */ string internal constant kErrAlreadyClaimed = "Already redeemed your new tokens"; string internal constant kErrOutOfPurchasable = "Remaining mints reserved for claims"; string internal constant kErrOutOfClaimable = "Remaining mints reserved for purchases"; string internal constant kErrClaimingNotEnabled = "Claiming is currently disabled"; /* solhint-enable const-name-snakecase */ }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; /* External Imports */ import {ERC721} from "ERC721.sol"; import {Strings} from "Strings.sol"; /* Internal Imports */ import {BaseErrorCodes} from "ErrorCodes.sol"; //===================================================================================================================== /// 😎 Free Internet Money 😎 //===================================================================================================================== /** * @dev Lightweight version of OpenZeppelin's ERC721URIStorage.sol */ abstract contract ERC721Metadata is BaseErrorCodes, ERC721 { using Strings for uint256; //================================================================================================================= /// State Variables //================================================================================================================= /* Private */ string private baseURI_; /** * @dev Retrieves tokenURI of `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function tokenURI(uint256 tokenId) public view virtual override(ERC721) returns (string memory) { require(_exists(tokenId), kErrTokenDoesNotExist); return string(abi.encodePacked(_baseURI(), Strings.toString(tokenId), ".json")); } /** * @dev External function that retrieves the baseURI of this ERC721 token. Useful for confirming the baseURI is correct and/or unit testing. * @return string memory: The baseURI of the contract. */ function baseURI() external view virtual returns (string memory) { return _baseURI(); } /** * @dev Retrieve `baseURI_` * @return string memory: The baseURI of the contract. */ function _baseURI() internal view virtual override(ERC721) returns (string memory) { return baseURI_; } /** * @dev Set `baseURI_` * */ function _setBaseURI(string memory newBaseURI) internal virtual { baseURI_ = newBaseURI; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import {BaseErrorCodes} from "ErrorCodes.sol"; abstract contract Modifiers is BaseErrorCodes { /** * @dev A modifier that verifies that the correct amount of Ether has been recieved prior to executing * the function is it applied to. */ modifier requireTrue(bool x, string memory errMsg) { require(x, errMsg); _; } modifier requireFalse(bool x, string memory errMsg) { require(!x, errMsg); _; } modifier costs(uint16 num, uint256 price) { require(msg.value >= price * num, kErrInsufficientFunds); _; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; /* External Imports */ import {AccessControl} from "AccessControl.sol"; import {ERC721} from "ERC721.sol"; import {ERC721Enumerable} from "ERC721Enumerable.sol"; import {ReentrancyGuard} from "ReentrancyGuard.sol"; import {Strings} from "Strings.sol"; /* Internal Imports */ import {ERC721Essentials} from "ERC721Essentials.sol"; import {Constants} from "Constants.sol"; //===================================================================================================================== /// 😎 Free Internet Money 😎 //===================================================================================================================== contract ERC721EssentialsWithdrawable is ERC721Essentials { using Strings for string; //================================================================================================================= /// Constructor //================================================================================================================= constructor( string memory name_, string memory symbol_, string memory baseURI_, uint256[] memory uintArgs_, bool publicMintingEnabled_ ) ERC721Essentials(name_, symbol_, baseURI_, uintArgs_, publicMintingEnabled_) { return; } //================================================================================================================= /// Finance //================================================================================================================= /** * @dev Public function that pulls a set amount of Ether from the contract. Only callable by contract admins. * @param amount uint256: The amount of wei to withdraw from the contract. */ function withdraw(uint256 amount) public nonReentrant onlyRole(DEFAULT_ADMIN_ROLE) { payable(msg.sender).transfer(amount); } /** * @dev Public function that pulls the entire balance of Ether from the contract. Only callable by contract admins. */ function withdrawAll() public nonReentrant onlyRole(DEFAULT_ADMIN_ROLE) { payable(msg.sender).transfer(address(this).balance); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; library Constants { /* Constants */ uint256 private constant _WEI_PER_ETH = 10**18; uint16 private constant _IPFS_URI_LENGTH = 54; // len("ipfs://") == 7, len(hash) == 46, len("/") == 1, sum => 54 function getWeiPerEth() internal pure returns (uint256) { return _WEI_PER_ETH; } function getIpfsUriLength() internal pure returns (uint16) { return _IPFS_URI_LENGTH; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; /* External Imports */ import {AccessControl} from "AccessControl.sol"; import {Address} from "Address.sol"; import {ERC721} from "ERC721.sol"; import {ERC721Enumerable} from "ERC721Enumerable.sol"; import {ReentrancyGuard} from "ReentrancyGuard.sol"; /* Internal Imports */ import {ERC721Essentials} from "ERC721Essentials.sol"; import {ClaimFromContractErrorCodes} from "ErrorCodes.sol"; //===================================================================================================================== /// 😎 Free Internet Money 😎 //===================================================================================================================== /** * @dev Lightweight package to allow users to mint token(s) for free if they own tokens in * another set of contracts. */ abstract contract ERC721ClaimFromContracts is ERC721Essentials, ClaimFromContractErrorCodes { //================================================================================================================= /// State Variables //================================================================================================================= /* Internal */ address[] internal _claimContractAddrs; bool internal _claimingEnabled; mapping(address => bool) internal _userHasClaimed; uint16 internal _numPurchased = 0; uint16 internal _numClaimed = 0; // TODO: Future we can calculate maxForClaim by reading other contracts totalSupply() uint16 internal _maxForPurchase; uint16 internal _maxForClaim; /* Private */ string private constant kBalanceOfAbi = "balanceOf(address)"; /* solhint-disable-line */ constructor( address[] memory contractAddrs_, uint16 maxForPurchase_, uint16 maxForClaim_ ) { setContractAddrsForClaim(contractAddrs_); setMaxForPurchase(maxForPurchase_); setMaxForClaim(maxForClaim_); setClaimingEnabled(false); } //================================================================================================================= /// Claiming Functionality //================================================================================================================= /** * @dev Public function that claims new tokens based on owning tokens from other contracts. */ function claim() public nonReentrant whenClaimingEnabled { _claim(); } /** * @dev An internal function to claim a certain number of new ERC721 tokens based on ownership from a set of previous * contracts. This function calls the balanceof(address) function in each contract to determine the number of tokens a user holds * and then mints them the corresponding number of tokens in this contract. Contains NO safety checks, as it should be * implied that if all eligible users run the claim function token supply numbers for this contract stay valid. * You can add safety checks to an external / public wrapping of this function if you wish to do so. */ function _claim() internal { require(!_userHasClaimed[_msgSender()], kErrAlreadyClaimed); bytes memory payload = abi.encodeWithSignature(kBalanceOfAbi, address(_msgSender())); uint16 length = uint16(_claimContractAddrs.length); uint16 sum = 0; _userHasClaimed[_msgSender()] = true; for (uint16 i = 0; i < length; i += 1) { bytes memory result = Address.functionStaticCall(_claimContractAddrs[i], payload); /* solhint-disable-line */ sum += uint16(abi.decode(result, (uint256))); } _numClaimed += sum; require(_numClaimed <= _maxForClaim, kErrOutOfClaimable); _safeMintTokens(_msgSender(), uint16(sum)); } /** * @dev Public function that mints a specified number of ERC721 tokens. * @param numMint uint16: The number of tokens that are going to be minted. */ function mint(uint16 numMint) public payable virtual override(ERC721Essentials) limitAndTrackPurchases(numMint) { return super.mint(numMint); // ERC721Essentials.sol } //================================================================================================================= /// Mutators //================================================================================================================= /** * @dev A public function to set what contracts will be queired during the execution of _claim. * @param addrs address[] memory: The list of addresses to be queried */ function setContractAddrsForClaim(address[] memory addrs) public onlyRole(DEFAULT_ADMIN_ROLE) { _claimContractAddrs = addrs; } /** * @dev A public function to set the number of tokens that can be minted via a payment. * @param maxForPurchase_ uint16: The max number that can be payable minted. */ function setMaxForPurchase(uint16 maxForPurchase_) public onlyRole(DEFAULT_ADMIN_ROLE) { _maxForPurchase = maxForPurchase_; } /** * @dev A public function to set the number of tokens that can be minted via a claim. * @param maxForClaim_ uint16: The max number that can be claim minted. */ function setMaxForClaim(uint16 maxForClaim_) public onlyRole(DEFAULT_ADMIN_ROLE) { _maxForClaim = maxForClaim_; } /** * @dev A public function to enable/disable claiming. */ function setClaimingEnabled(bool claiming_) public onlyRole(DEFAULT_ADMIN_ROLE) { _claimingEnabled = claiming_; } //================================================================================================================= /// Accessors //================================================================================================================= function contractAddrsForClaim() public view returns (address[] memory) { return _claimContractAddrs; } //================================================================================================================= /// Useful Checks & Modifiers //================================================================================================================= /** * @dev Modifier to limit the number of mints for purchase. */ modifier limitAndTrackPurchases(uint16 numMint) { _numPurchased += numMint; require(_numPurchased <= _maxForPurchase, kErrOutOfPurchasable); _; } /** * @dev Modifier to ensure claiming is enabled */ modifier whenClaimingEnabled() { require(_claimingEnabled, kErrClaimingNotEnabled); _; } }
{ "evmVersion": "istanbul", "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"string","name":"baseURI_","type":"string"},{"internalType":"uint256[]","name":"uintArgs_","type":"uint256[]"},{"internalType":"bool","name":"publicMintingEnabled_","type":"bool"},{"internalType":"address[]","name":"contractAddrs_","type":"address[]"},{"internalType":"uint16","name":"maxForPurchase_","type":"uint16"},{"internalType":"uint16","name":"maxForClaim_","type":"uint16"}],"stateMutability":"nonpayable","type":"constructor"},{"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":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":"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":"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":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","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":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractAddrsForClaim","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"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":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintPerTx","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"numMint","type":"uint16"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addrs","type":"address[]"},{"internalType":"uint16","name":"numMint","type":"uint16"}],"name":"mintAirDrop","outputs":[],"stateMutability":"nonpayable","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":"priceInWei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMintingEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":"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":"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":[{"internalType":"bool","name":"claiming_","type":"bool"}],"name":"setClaimingEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addrs","type":"address[]"}],"name":"setContractAddrsForClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"maxForClaim_","type":"uint16"}],"name":"setMaxForClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"maxForPurchase_","type":"uint16"}],"name":"setMaxForPurchase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"newMaxMintPerTx","type":"uint16"}],"name":"setMaxMintPerTx","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setPriceInWei","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"publicMintingEnabled_","type":"bool"}],"name":"setPublicMinting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"newSupply","type":"uint16"}],"name":"setSupply","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":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"totalSupply","outputs":[{"internalType":"uint256","name":"","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":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040526014805463ffffffff191690553480156200001e57600080fd5b5060405162003eec38038062003eec83398101604081905262000041916200090a565b8282828a8a8a8a8a84848484848484816001908051906020019062000068929190620005e1565b5080516200007e906002906020840190620005e1565b5050506200009b62000095620001b260201b60201c565b620001b6565b6001600d5581518290600090620000b657620000b662000a23565b6020026020010151600e60006101000a81548161ffff021916908361ffff16021790555081600181518110620000f057620000f062000a23565b6020026020010151600f819055508160028151811062000114576200011462000a23565b6020908102919091010151600e805463ffff000019166201000061ffff909316929092029190911790556010805460ff1916821515179055620001578362000208565b6200016460003362000221565b505050505050505050506200017f836200022d60201b60201c565b6200018a8262000255565b620001958162000287565b620001a16000620002bb565b505050505050505050505062000b91565b3390565b600c80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516200021d90600b906020840190620005e1565b5050565b6200021d8282620002dd565b60006200023b81336200037d565b81516200025090601190602085019062000670565b505050565b60006200026381336200037d565b506014805461ffff9092166401000000000261ffff60201b19909216919091179055565b60006200029581336200037d565b506014805461ffff90921666010000000000000261ffff60301b19909216919091179055565b6000620002c981336200037d565b506012805460ff1916911515919091179055565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200021d576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620003393390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200021d57620003c7816001600160a01b031660146200042160201b6200146f1760201c565b620003dd8360206200146f62000421821b17811c565b604051602001620003f092919062000a39565b60408051601f198184030181529082905262461bcd60e51b8252620004189160040162000ab2565b60405180910390fd5b606060006200043283600262000afd565b6200043f90600262000b1f565b6001600160401b03811115620004595762000459620006df565b6040519080825280601f01601f19166020018201604052801562000484576020820181803683370190505b509050600360fc1b81600081518110620004a257620004a262000a23565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110620004d457620004d462000a23565b60200101906001600160f81b031916908160001a9053506000620004fa84600262000afd565b6200050790600162000b1f565b90505b600181111562000589576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106200053f576200053f62000a23565b1a60f81b82828151811062000558576200055862000a23565b60200101906001600160f81b031916908160001a90535060049490941c93620005818162000b3a565b90506200050a565b508315620005da5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640162000418565b9392505050565b828054620005ef9062000b54565b90600052602060002090601f0160209004810192826200061357600085556200065e565b82601f106200062e57805160ff19168380011785556200065e565b828001600101855582156200065e579182015b828111156200065e57825182559160200191906001019062000641565b506200066c929150620006c8565b5090565b8280548282559060005260206000209081019282156200065e579160200282015b828111156200065e57825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000691565b5b808211156200066c5760008155600101620006c9565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620007205762000720620006df565b604052919050565b60005b83811015620007455781810151838201526020016200072b565b8381111562000755576000848401525b50505050565b600082601f8301126200076d57600080fd5b81516001600160401b03811115620007895762000789620006df565b6200079e601f8201601f1916602001620006f5565b818152846020838601011115620007b457600080fd5b620007c782602083016020870162000728565b949350505050565b60006001600160401b03821115620007eb57620007eb620006df565b5060051b60200190565b600082601f8301126200080757600080fd5b81516020620008206200081a83620007cf565b620006f5565b82815260059290921b840181019181810190868411156200084057600080fd5b8286015b848110156200085d578051835291830191830162000844565b509695505050505050565b805180151581146200087957600080fd5b919050565b600082601f8301126200089057600080fd5b81516020620008a36200081a83620007cf565b82815260059290921b84018101918181019086841115620008c357600080fd5b8286015b848110156200085d5780516001600160a01b0381168114620008e95760008081fd5b8352918301918301620008c7565b805161ffff811681146200087957600080fd5b600080600080600080600080610100898b0312156200092857600080fd5b88516001600160401b03808211156200094057600080fd5b6200094e8c838d016200075b565b995060208b01519150808211156200096557600080fd5b620009738c838d016200075b565b985060408b01519150808211156200098a57600080fd5b620009988c838d016200075b565b975060608b0151915080821115620009af57600080fd5b620009bd8c838d01620007f5565b9650620009cd60808c0162000868565b955060a08b0151915080821115620009e457600080fd5b50620009f38b828c016200087e565b93505062000a0460c08a01620008f7565b915062000a1460e08a01620008f7565b90509295985092959890939650565b634e487b7160e01b600052603260045260246000fd5b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835162000a7381601785016020880162000728565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835162000aa681602884016020880162000728565b01602801949350505050565b602081526000825180602084015262000ad381604085016020870162000728565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161562000b1a5762000b1a62000ae7565b500290565b6000821982111562000b355762000b3562000ae7565b500190565b60008162000b4c5762000b4c62000ae7565b506000190190565b600181811c9082168062000b6957607f821691505b6020821081141562000b8b57634e487b7160e01b600052602260045260246000fd5b50919050565b61334b8062000ba16000396000f3fe6080604052600436106102725760003560e01c80636b3f1ab11161014f578063a22cb465116100c1578063c87b56dd1161007a578063c87b56dd14610735578063d547741f14610755578063d5abeb0114610775578063de7fcb1d1461079d578063e985e9c5146107bc578063f2fde38b1461080557600080fd5b8063a22cb46514610675578063adc4be5f14610695578063b6a74121146106b5578063b6c72888146106d5578063b88d4fde146106f5578063c75313d81461071557600080fd5b80638774e5d0116101135780638774e5d0146105d55780638da5cb5b146105f55780638dec9f7a1461061357806391d148541461062b57806395d89b411461064b578063a217fddf1461066057600080fd5b80636b3f1ab1146105565780636c0360eb1461057657806370a082311461058b578063715018a6146105ab578063853828b6146105c057600080fd5b80632f2ff15d116101e857806342cc2697116101ac57806342cc26971461049f5780634e71d92d146104bf5780634f6ccce7146104d457806355f804b3146104f45780636248220a146105145780636352211e1461053657600080fd5b80632f2ff15d1461040a5780632f745c591461042a57806336568abe1461044a5780633c8da5881461046a57806342842e0e1461047f57600080fd5b806318160ddd1161023a57806318160ddd1461034857806323b872dd1461036757806323cf0a2214610387578063248a9ca31461039a578063254a4737146103ca5780632e1a7d4d146103ea57600080fd5b806301ffc9a71461027757806306fdde03146102ac578063081812fc146102ce578063095ea7b3146103065780630f2ee0b114610328575b600080fd5b34801561028357600080fd5b50610297610292366004612a6b565b610825565b60405190151581526020015b60405180910390f35b3480156102b857600080fd5b506102c1610836565b6040516102a39190612ae0565b3480156102da57600080fd5b506102ee6102e9366004612af3565b6108c8565b6040516001600160a01b0390911681526020016102a3565b34801561031257600080fd5b50610326610321366004612b28565b610962565b005b34801561033457600080fd5b50610326610343366004612b64565b610a78565b34801561035457600080fd5b506009545b6040519081526020016102a3565b34801561037357600080fd5b50610326610382366004612b7f565b610a9d565b610326610395366004612b64565b610ace565b3480156103a657600080fd5b506103596103b5366004612af3565b60009081526020819052604090206001015490565b3480156103d657600080fd5b506103266103e5366004612bcb565b610b5e565b3480156103f657600080fd5b50610326610405366004612af3565b610b7e565b34801561041657600080fd5b50610326610425366004612be6565b610be9565b34801561043657600080fd5b50610359610445366004612b28565b610c0f565b34801561045657600080fd5b50610326610465366004612be6565b610ca5565b34801561047657600080fd5b50600f54610359565b34801561048b57600080fd5b5061032661049a366004612b7f565b610d23565b3480156104ab57600080fd5b506103266104ba366004612ce0565b610d3e565b3480156104cb57600080fd5b50610326610de8565b3480156104e057600080fd5b506103596104ef366004612af3565b610e78565b34801561050057600080fd5b5061032661050f366004612d7d565b610f0b565b34801561052057600080fd5b50610529610f20565b6040516102a39190612dc6565b34801561054257600080fd5b506102ee610551366004612af3565b610f81565b34801561056257600080fd5b50610326610571366004612b64565b610ff8565b34801561058257600080fd5b506102c1611029565b34801561059757600080fd5b506103596105a6366004612e13565b611038565b3480156105b757600080fd5b506103266110bf565b3480156105cc57600080fd5b50610326611125565b3480156105e157600080fd5b506103266105f0366004612af3565b61118e565b34801561060157600080fd5b50600c546001600160a01b03166102ee565b34801561061f57600080fd5b5060105460ff16610297565b34801561063757600080fd5b50610297610646366004612be6565b6111a0565b34801561065757600080fd5b506102c16111c9565b34801561066c57600080fd5b50610359600081565b34801561068157600080fd5b50610326610690366004612e2e565b6111d8565b3480156106a157600080fd5b506103266106b0366004612b64565b61129d565b3480156106c157600080fd5b506103266106d0366004612b64565b6112d2565b3480156106e157600080fd5b506103266106f0366004612bcb565b6112ff565b34801561070157600080fd5b50610326610710366004612e58565b61131f565b34801561072157600080fd5b50610326610730366004612ed4565b611357565b34801561074157600080fd5b506102c1610750366004612af3565b611376565b34801561076157600080fd5b50610326610770366004612be6565b611381565b34801561078157600080fd5b50600e5461ffff165b60405161ffff90911681526020016102a3565b3480156107a957600080fd5b50600e5462010000900461ffff1661078a565b3480156107c857600080fd5b506102976107d7366004612f09565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b34801561081157600080fd5b50610326610820366004612e13565b6113a7565b600061083082611612565b92915050565b60606001805461084590612f33565b80601f016020809104026020016040519081016040528092919081815260200182805461087190612f33565b80156108be5780601f10610893576101008083540402835291602001916108be565b820191906000526020600020905b8154815290600101906020018083116108a157829003601f168201915b5050505050905090565b6000818152600360205260408120546001600160a01b03166109465760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600560205260409020546001600160a01b031690565b600061096d82610f81565b9050806001600160a01b0316836001600160a01b031614156109db5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161093d565b336001600160a01b03821614806109f757506109f781336107d7565b610a695760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161093d565b610a738383611637565b505050565b6000610a8481336116a5565b50600e805461ffff191661ffff92909216919091179055565b610aa73382611709565b610ac35760405162461bcd60e51b815260040161093d90612f6e565b610a73838383611800565b33600090815260156020908152604091829020548251808401909352601f83527f4f6e6c7920616c6c6f77656420746f204d696e74203120426f6f2042656172009183019190915260ff1615610b375760405162461bcd60e51b815260040161093d9190612ae0565b50336000908152601560205260409020805460ff19166001179055610b5b816119ab565b50565b6000610b6a81336116a5565b506010805460ff1916911515919091179055565b6002600d541415610ba15760405162461bcd60e51b815260040161093d90612fbf565b6002600d556000610bb281336116a5565b604051339083156108fc029084906000818181858888f19350505050158015610bdf573d6000803e3d6000fd5b50506001600d5550565b600082815260208190526040902060010154610c0581336116a5565b610a738383611a39565b6000610c1a83611038565b8210610c7c5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b606482015260840161093d565b506001600160a01b03919091166000908152600760209081526040808320938352929052205490565b6001600160a01b0381163314610d155760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161093d565b610d1f8282611abd565b5050565b610a738383836040518060200160405280600081525061131f565b6002600d541415610d615760405162461bcd60e51b815260040161093d90612fbf565b6002600d556000610d7281336116a5565b8251610dde57604080516001808252818301909252600091602080830190803683370190505090503381600081518110610dae57610dae612ff6565b60200260200101906001600160a01b031690816001600160a01b031681525050610dd88184611b22565b50610bdf565b610bdf8383611b22565b6002600d541415610e0b5760405162461bcd60e51b815260040161093d90612fbf565b6002600d5560125460408051808201909152601e81527f436c61696d696e672069732063757272656e746c792064697361626c6564000060208201529060ff16610e685760405162461bcd60e51b815260040161093d9190612ae0565b50610e71611b85565b6001600d55565b6000610e8360095490565b8210610ee65760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b606482015260840161093d565b60098281548110610ef957610ef9612ff6565b90600052602060002001549050919050565b6000610f1781336116a5565b610d1f82611de2565b606060118054806020026020016040519081016040528092919081815260200182805480156108be57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610f5a575050505050905090565b6000818152600360205260408120546001600160a01b0316806108305760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b606482015260840161093d565b600061100481336116a5565b506014805461ffff9092166401000000000265ffff0000000019909216919091179055565b6060611033611df5565b905090565b60006001600160a01b0382166110a35760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b606482015260840161093d565b506001600160a01b031660009081526004602052604090205490565b600c546001600160a01b031633146111195760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161093d565b6111236000611dff565b565b6002600d5414156111485760405162461bcd60e51b815260040161093d90612fbf565b6002600d55600061115981336116a5565b60405133904780156108fc02916000818181858888f19350505050158015611185573d6000803e3d6000fd5b50506001600d55565b600061119a81336116a5565b50600f55565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60606002805461084590612f33565b6001600160a01b0382163314156112315760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161093d565b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60006112a981336116a5565b506014805461ffff90921666010000000000000267ffff00000000000019909216919091179055565b60006112de81336116a5565b50600e805461ffff909216620100000263ffff000019909216919091179055565b600061130b81336116a5565b506012805460ff1916911515919091179055565b6113293383611709565b6113455760405162461bcd60e51b815260040161093d90612f6e565b61135184848484611e51565b50505050565b600061136381336116a5565b8151610a73906011906020850190612967565b606061083082611e84565b60008281526020819052604090206001015461139d81336116a5565b610a738383611abd565b600c546001600160a01b031633146114015760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161093d565b6001600160a01b0381166114665760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161093d565b610b5b81611dff565b6060600061147e836002613022565b611489906002613041565b67ffffffffffffffff8111156114a1576114a1612c12565b6040519080825280601f01601f1916602001820160405280156114cb576020820181803683370190505b509050600360fc1b816000815181106114e6576114e6612ff6565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061151557611515612ff6565b60200101906001600160f81b031916908160001a9053506000611539846002613022565b611544906001613041565b90505b60018111156115bc576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061157857611578612ff6565b1a60f81b82828151811061158e5761158e612ff6565b60200101906001600160f81b031916908160001a90535060049490941c936115b581613059565b9050611547565b50831561160b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161093d565b9392505050565b60006001600160e01b0319821663780e9d6360e01b1480610830575061083082611f22565b600081815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061166c82610f81565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6116af82826111a0565b610d1f576116c7816001600160a01b0316601461146f565b6116d283602061146f565b6040516020016116e3929190613070565b60408051601f198184030181529082905262461bcd60e51b825261093d91600401612ae0565b6000818152600360205260408120546001600160a01b03166117825760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161093d565b600061178d83610f81565b9050806001600160a01b0316846001600160a01b031614806117c85750836001600160a01b03166117bd846108c8565b6001600160a01b0316145b806117f857506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661181382610f81565b6001600160a01b03161461187b5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b606482015260840161093d565b6001600160a01b0382166118dd5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161093d565b6118e8838383611f62565b6118f3600082611637565b6001600160a01b038316600090815260046020526040812080546001929061191c9084906130e5565b90915550506001600160a01b038216600090815260046020526040812080546001929061194a908490613041565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60148054829182916000906119c590849061ffff166130fc565b82546101009290920a61ffff81810219909316918316021790915560145460408051606081019091526023808252640100000000830484169290931691909111159250906132ce602083013990611a2f5760405162461bcd60e51b815260040161093d9190612ae0565b50610d1f82611f6d565b611a4382826111a0565b610d1f576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055611a793390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611ac782826111a0565b15610d1f576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b8061ffff168251611b339190613022565b611b3c81612060565b60005b83518161ffff16101561135157611b73848261ffff1681518110611b6557611b65612ff6565b6020026020010151846121b0565b611b7e6001826130fc565b9050611b3f565b336000908152601360209081526040918290205482518084019093528183527f416c72656164792072656465656d656420796f7572206e657720746f6b656e739183019190915260ff1615611bed5760405162461bcd60e51b815260040161093d9190612ae0565b5060006040518060400160405280601281526020017162616c616e63654f6628616464726573732960701b815250611c223390565b6040516001600160a01b03909116602482015260440160408051601f198184030181529082905291611c5391613122565b6040519081900390206020820180516001600160e01b03166001600160e01b031990921691909117905260115490915060006001601382611c913390565b6001600160a01b0316815260208101919091526040016000908120805460ff1916921515929092179091555b8261ffff168161ffff161015611d3a576000611d0460118361ffff1681548110611ce957611ce9612ff6565b6000918252602090912001546001600160a01b0316866121f2565b905080806020019051810190611d1a919061313e565b611d2490846130fc565b9250611d3390506001826130fc565b9050611cbd565b5080601460028282829054906101000a900461ffff16611d5a91906130fc565b92506101000a81548161ffff021916908361ffff160217905550601460069054906101000a900461ffff1661ffff16601460029054906101000a900461ffff1661ffff1611156040518060600160405280602681526020016132a86026913990611dd75760405162461bcd60e51b815260040161093d9190612ae0565b50610a7333826121b0565b8051610d1f90600b9060208401906129cc565b6060611033612217565b600c80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611e5c848484611800565b611e6884848484612226565b6113515760405162461bcd60e51b815260040161093d90613157565b6000818152600360205260409020546060906001600160a01b03161515604051806040016040528060118152602001703737b732bc34b9ba32b73a103a37b5b2b760791b81525090611ee95760405162461bcd60e51b815260040161093d9190612ae0565b50611ef2611df5565b611efb83612333565b604051602001611f0c9291906131a9565b6040516020818303038152906040529050919050565b60006001600160e01b031982166380ac58cd60e01b1480611f5357506001600160e01b03198216635b5e139f60e01b145b80610830575061083082612431565b610a73838383612466565b6002600d541415611f905760405162461bcd60e51b815260040161093d90612fbf565b6002600d5560105460ff1680611fac5750611fac6000336111a0565b60405180604001604052806013815260200172135a5b9d1a5b99c81a5cc8191a5cd8589b1959606a1b81525090611ff65760405162461bcd60e51b815260040161093d9190612ae0565b50600f54819061200a61ffff831682613022565b34101560405180604001604052806012815260200171496e73756666696369656e742046756e647360701b815250906120565760405162461bcd60e51b815260040161093d9190612ae0565b50610bdf8361251e565b600e5461ffff1661207060095490565b106040518060400160405280600881526020016714dbdb190813dd5d60c21b815250906120b05760405162461bcd60e51b815260040161093d9190612ae0565b50600e5461ffff9081169082166120c660095490565b6120d09190613041565b11156040518060400160405280601981526020017f52657175657374656420746f6f206d616e7920546f6b656e7300000000000000815250906121265760405162461bcd60e51b815260040161093d9190612ae0565b5060008161ffff1611801561214b5750600e5461ffff62010000909104811690821611155b8061215c575061215c6000336111a0565b6040518060400160405280601981526020017f4f757473696465206d696e74207065722074782072616e67650000000000000081525090610d1f5760405162461bcd60e51b815260040161093d9190612ae0565b60005b8161ffff168161ffff161015610a73576121e0836121d060095490565b6121db906001613041565b612532565b6121eb6001826130fc565b90506121b3565b606061160b83836040518060600160405280602581526020016132f16025913961254c565b6060600b805461084590612f33565b60006001600160a01b0384163b1561232857604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061226a9033908990889088906004016131e8565b602060405180830381600087803b15801561228457600080fd5b505af19250505080156122b4575060408051601f3d908101601f191682019092526122b19181019061321b565b60015b61230e573d8080156122e2576040519150601f19603f3d011682016040523d82523d6000602084013e6122e7565b606091505b5080516123065760405162461bcd60e51b815260040161093d90613157565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506117f8565b506001949350505050565b6060816123575750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612381578061236b81613238565b915061237a9050600a83613269565b915061235b565b60008167ffffffffffffffff81111561239c5761239c612c12565b6040519080825280601f01601f1916602001820160405280156123c6576020820181803683370190505b5090505b84156117f8576123db6001836130e5565b91506123e8600a8661327d565b6123f3906030613041565b60f81b81838151811061240857612408612ff6565b60200101906001600160f81b031916908160001a90535061242a600a86613269565b94506123ca565b60006001600160e01b03198216637965db0b60e01b148061083057506301ffc9a760e01b6001600160e01b0319831614610830565b6001600160a01b0383166124c1576124bc81600980546000838152600a60205260408120829055600182018355919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0155565b6124e4565b816001600160a01b0316836001600160a01b0316146124e4576124e4838261261d565b6001600160a01b0382166124fb57610a73816126ba565b826001600160a01b0316826001600160a01b031614610a7357610a738282612769565b8061252881612060565b610d1f33836121b0565b610d1f8282604051806020016040528060008152506127ad565b6060833b6125a85760405162461bcd60e51b8152602060048201526024808201527f416464726573733a207374617469632063616c6c20746f206e6f6e2d636f6e746044820152631c9858dd60e21b606482015260840161093d565b600080856001600160a01b0316856040516125c39190613122565b600060405180830381855afa9150503d80600081146125fe576040519150601f19603f3d011682016040523d82523d6000602084013e612603565b606091505b50915091506126138282866127e0565b9695505050505050565b6000600161262a84611038565b61263491906130e5565b600083815260086020526040902054909150808214612687576001600160a01b03841660009081526007602090815260408083208584528252808320548484528184208190558352600890915290208190555b5060009182526008602090815260408084208490556001600160a01b039094168352600781528383209183525290812055565b6009546000906126cc906001906130e5565b6000838152600a6020526040812054600980549394509092849081106126f4576126f4612ff6565b90600052602060002001549050806009838154811061271557612715612ff6565b6000918252602080832090910192909255828152600a9091526040808220849055858252812055600980548061274d5761274d613291565b6001900381819060005260206000200160009055905550505050565b600061277483611038565b6001600160a01b039093166000908152600760209081526040808320868452825280832085905593825260089052919091209190915550565b6127b78383612819565b6127c46000848484612226565b610a735760405162461bcd60e51b815260040161093d90613157565b606083156127ef57508161160b565b8251156127ff5782518084602001fd5b8160405162461bcd60e51b815260040161093d9190612ae0565b6001600160a01b03821661286f5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161093d565b6000818152600360205260409020546001600160a01b0316156128d45760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161093d565b6128e060008383611f62565b6001600160a01b0382166000908152600460205260408120805460019290612909908490613041565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b8280548282559060005260206000209081019282156129bc579160200282015b828111156129bc57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190612987565b506129c8929150612a40565b5090565b8280546129d890612f33565b90600052602060002090601f0160209004810192826129fa57600085556129bc565b82601f10612a1357805160ff19168380011785556129bc565b828001600101855582156129bc579182015b828111156129bc578251825591602001919060010190612a25565b5b808211156129c85760008155600101612a41565b6001600160e01b031981168114610b5b57600080fd5b600060208284031215612a7d57600080fd5b813561160b81612a55565b60005b83811015612aa3578181015183820152602001612a8b565b838111156113515750506000910152565b60008151808452612acc816020860160208601612a88565b601f01601f19169290920160200192915050565b60208152600061160b6020830184612ab4565b600060208284031215612b0557600080fd5b5035919050565b80356001600160a01b0381168114612b2357600080fd5b919050565b60008060408385031215612b3b57600080fd5b612b4483612b0c565b946020939093013593505050565b803561ffff81168114612b2357600080fd5b600060208284031215612b7657600080fd5b61160b82612b52565b600080600060608486031215612b9457600080fd5b612b9d84612b0c565b9250612bab60208501612b0c565b9150604084013590509250925092565b80358015158114612b2357600080fd5b600060208284031215612bdd57600080fd5b61160b82612bbb565b60008060408385031215612bf957600080fd5b82359150612c0960208401612b0c565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c5157612c51612c12565b604052919050565b600082601f830112612c6a57600080fd5b8135602067ffffffffffffffff821115612c8657612c86612c12565b8160051b612c95828201612c28565b9283528481018201928281019087851115612caf57600080fd5b83870192505b84831015612cd557612cc683612b0c565b82529183019190830190612cb5565b979650505050505050565b60008060408385031215612cf357600080fd5b823567ffffffffffffffff811115612d0a57600080fd5b612d1685828601612c59565b925050612c0960208401612b52565b600067ffffffffffffffff831115612d3f57612d3f612c12565b612d52601f8401601f1916602001612c28565b9050828152838383011115612d6657600080fd5b828260208301376000602084830101529392505050565b600060208284031215612d8f57600080fd5b813567ffffffffffffffff811115612da657600080fd5b8201601f81018413612db757600080fd5b6117f884823560208401612d25565b6020808252825182820181905260009190848201906040850190845b81811015612e075783516001600160a01b031683529284019291840191600101612de2565b50909695505050505050565b600060208284031215612e2557600080fd5b61160b82612b0c565b60008060408385031215612e4157600080fd5b612e4a83612b0c565b9150612c0960208401612bbb565b60008060008060808587031215612e6e57600080fd5b612e7785612b0c565b9350612e8560208601612b0c565b925060408501359150606085013567ffffffffffffffff811115612ea857600080fd5b8501601f81018713612eb957600080fd5b612ec887823560208401612d25565b91505092959194509250565b600060208284031215612ee657600080fd5b813567ffffffffffffffff811115612efd57600080fd5b6117f884828501612c59565b60008060408385031215612f1c57600080fd5b612f2583612b0c565b9150612c0960208401612b0c565b600181811c90821680612f4757607f821691505b60208210811415612f6857634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561303c5761303c61300c565b500290565b600082198211156130545761305461300c565b500190565b6000816130685761306861300c565b506000190190565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516130a8816017850160208801612a88565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516130d9816028840160208801612a88565b01602801949350505050565b6000828210156130f7576130f761300c565b500390565b600061ffff8083168185168083038211156131195761311961300c565b01949350505050565b60008251613134818460208701612a88565b9190910192915050565b60006020828403121561315057600080fd5b5051919050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600083516131bb818460208801612a88565b8351908301906131cf818360208801612a88565b64173539b7b760d91b9101908152600501949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061261390830184612ab4565b60006020828403121561322d57600080fd5b815161160b81612a55565b600060001982141561324c5761324c61300c565b5060010190565b634e487b7160e01b600052601260045260246000fd5b60008261327857613278613253565b500490565b60008261328c5761328c613253565b500690565b634e487b7160e01b600052603160045260246000fdfe52656d61696e696e67206d696e747320726573657276656420666f722070757263686173657352656d61696e696e67206d696e747320726573657276656420666f7220636c61696d73416464726573733a206c6f772d6c6576656c207374617469632063616c6c206661696c6564a264697066735822122029e252aa7c22e6270f139ecf87c7a3a023b296e6f21e0f5f7a8754808372863a64736f6c6343000809003300000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000007c0000000000000000000000000000000000000000000000000000000000000009426f6f20426561727300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005424f4f42520000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d64627973515557367472555351525a6a6e73617838714e4750524844737a327264544b7a744a5757616167372f000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000010f000000000000000000000000000000000000000000000000093e1b78ac69000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f17bb82b6e9cc0075ae308e406e5198ba7320545
Deployed Bytecode
0x6080604052600436106102725760003560e01c80636b3f1ab11161014f578063a22cb465116100c1578063c87b56dd1161007a578063c87b56dd14610735578063d547741f14610755578063d5abeb0114610775578063de7fcb1d1461079d578063e985e9c5146107bc578063f2fde38b1461080557600080fd5b8063a22cb46514610675578063adc4be5f14610695578063b6a74121146106b5578063b6c72888146106d5578063b88d4fde146106f5578063c75313d81461071557600080fd5b80638774e5d0116101135780638774e5d0146105d55780638da5cb5b146105f55780638dec9f7a1461061357806391d148541461062b57806395d89b411461064b578063a217fddf1461066057600080fd5b80636b3f1ab1146105565780636c0360eb1461057657806370a082311461058b578063715018a6146105ab578063853828b6146105c057600080fd5b80632f2ff15d116101e857806342cc2697116101ac57806342cc26971461049f5780634e71d92d146104bf5780634f6ccce7146104d457806355f804b3146104f45780636248220a146105145780636352211e1461053657600080fd5b80632f2ff15d1461040a5780632f745c591461042a57806336568abe1461044a5780633c8da5881461046a57806342842e0e1461047f57600080fd5b806318160ddd1161023a57806318160ddd1461034857806323b872dd1461036757806323cf0a2214610387578063248a9ca31461039a578063254a4737146103ca5780632e1a7d4d146103ea57600080fd5b806301ffc9a71461027757806306fdde03146102ac578063081812fc146102ce578063095ea7b3146103065780630f2ee0b114610328575b600080fd5b34801561028357600080fd5b50610297610292366004612a6b565b610825565b60405190151581526020015b60405180910390f35b3480156102b857600080fd5b506102c1610836565b6040516102a39190612ae0565b3480156102da57600080fd5b506102ee6102e9366004612af3565b6108c8565b6040516001600160a01b0390911681526020016102a3565b34801561031257600080fd5b50610326610321366004612b28565b610962565b005b34801561033457600080fd5b50610326610343366004612b64565b610a78565b34801561035457600080fd5b506009545b6040519081526020016102a3565b34801561037357600080fd5b50610326610382366004612b7f565b610a9d565b610326610395366004612b64565b610ace565b3480156103a657600080fd5b506103596103b5366004612af3565b60009081526020819052604090206001015490565b3480156103d657600080fd5b506103266103e5366004612bcb565b610b5e565b3480156103f657600080fd5b50610326610405366004612af3565b610b7e565b34801561041657600080fd5b50610326610425366004612be6565b610be9565b34801561043657600080fd5b50610359610445366004612b28565b610c0f565b34801561045657600080fd5b50610326610465366004612be6565b610ca5565b34801561047657600080fd5b50600f54610359565b34801561048b57600080fd5b5061032661049a366004612b7f565b610d23565b3480156104ab57600080fd5b506103266104ba366004612ce0565b610d3e565b3480156104cb57600080fd5b50610326610de8565b3480156104e057600080fd5b506103596104ef366004612af3565b610e78565b34801561050057600080fd5b5061032661050f366004612d7d565b610f0b565b34801561052057600080fd5b50610529610f20565b6040516102a39190612dc6565b34801561054257600080fd5b506102ee610551366004612af3565b610f81565b34801561056257600080fd5b50610326610571366004612b64565b610ff8565b34801561058257600080fd5b506102c1611029565b34801561059757600080fd5b506103596105a6366004612e13565b611038565b3480156105b757600080fd5b506103266110bf565b3480156105cc57600080fd5b50610326611125565b3480156105e157600080fd5b506103266105f0366004612af3565b61118e565b34801561060157600080fd5b50600c546001600160a01b03166102ee565b34801561061f57600080fd5b5060105460ff16610297565b34801561063757600080fd5b50610297610646366004612be6565b6111a0565b34801561065757600080fd5b506102c16111c9565b34801561066c57600080fd5b50610359600081565b34801561068157600080fd5b50610326610690366004612e2e565b6111d8565b3480156106a157600080fd5b506103266106b0366004612b64565b61129d565b3480156106c157600080fd5b506103266106d0366004612b64565b6112d2565b3480156106e157600080fd5b506103266106f0366004612bcb565b6112ff565b34801561070157600080fd5b50610326610710366004612e58565b61131f565b34801561072157600080fd5b50610326610730366004612ed4565b611357565b34801561074157600080fd5b506102c1610750366004612af3565b611376565b34801561076157600080fd5b50610326610770366004612be6565b611381565b34801561078157600080fd5b50600e5461ffff165b60405161ffff90911681526020016102a3565b3480156107a957600080fd5b50600e5462010000900461ffff1661078a565b3480156107c857600080fd5b506102976107d7366004612f09565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b34801561081157600080fd5b50610326610820366004612e13565b6113a7565b600061083082611612565b92915050565b60606001805461084590612f33565b80601f016020809104026020016040519081016040528092919081815260200182805461087190612f33565b80156108be5780601f10610893576101008083540402835291602001916108be565b820191906000526020600020905b8154815290600101906020018083116108a157829003601f168201915b5050505050905090565b6000818152600360205260408120546001600160a01b03166109465760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600560205260409020546001600160a01b031690565b600061096d82610f81565b9050806001600160a01b0316836001600160a01b031614156109db5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161093d565b336001600160a01b03821614806109f757506109f781336107d7565b610a695760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161093d565b610a738383611637565b505050565b6000610a8481336116a5565b50600e805461ffff191661ffff92909216919091179055565b610aa73382611709565b610ac35760405162461bcd60e51b815260040161093d90612f6e565b610a73838383611800565b33600090815260156020908152604091829020548251808401909352601f83527f4f6e6c7920616c6c6f77656420746f204d696e74203120426f6f2042656172009183019190915260ff1615610b375760405162461bcd60e51b815260040161093d9190612ae0565b50336000908152601560205260409020805460ff19166001179055610b5b816119ab565b50565b6000610b6a81336116a5565b506010805460ff1916911515919091179055565b6002600d541415610ba15760405162461bcd60e51b815260040161093d90612fbf565b6002600d556000610bb281336116a5565b604051339083156108fc029084906000818181858888f19350505050158015610bdf573d6000803e3d6000fd5b50506001600d5550565b600082815260208190526040902060010154610c0581336116a5565b610a738383611a39565b6000610c1a83611038565b8210610c7c5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b606482015260840161093d565b506001600160a01b03919091166000908152600760209081526040808320938352929052205490565b6001600160a01b0381163314610d155760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161093d565b610d1f8282611abd565b5050565b610a738383836040518060200160405280600081525061131f565b6002600d541415610d615760405162461bcd60e51b815260040161093d90612fbf565b6002600d556000610d7281336116a5565b8251610dde57604080516001808252818301909252600091602080830190803683370190505090503381600081518110610dae57610dae612ff6565b60200260200101906001600160a01b031690816001600160a01b031681525050610dd88184611b22565b50610bdf565b610bdf8383611b22565b6002600d541415610e0b5760405162461bcd60e51b815260040161093d90612fbf565b6002600d5560125460408051808201909152601e81527f436c61696d696e672069732063757272656e746c792064697361626c6564000060208201529060ff16610e685760405162461bcd60e51b815260040161093d9190612ae0565b50610e71611b85565b6001600d55565b6000610e8360095490565b8210610ee65760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b606482015260840161093d565b60098281548110610ef957610ef9612ff6565b90600052602060002001549050919050565b6000610f1781336116a5565b610d1f82611de2565b606060118054806020026020016040519081016040528092919081815260200182805480156108be57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610f5a575050505050905090565b6000818152600360205260408120546001600160a01b0316806108305760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b606482015260840161093d565b600061100481336116a5565b506014805461ffff9092166401000000000265ffff0000000019909216919091179055565b6060611033611df5565b905090565b60006001600160a01b0382166110a35760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b606482015260840161093d565b506001600160a01b031660009081526004602052604090205490565b600c546001600160a01b031633146111195760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161093d565b6111236000611dff565b565b6002600d5414156111485760405162461bcd60e51b815260040161093d90612fbf565b6002600d55600061115981336116a5565b60405133904780156108fc02916000818181858888f19350505050158015611185573d6000803e3d6000fd5b50506001600d55565b600061119a81336116a5565b50600f55565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60606002805461084590612f33565b6001600160a01b0382163314156112315760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161093d565b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60006112a981336116a5565b506014805461ffff90921666010000000000000267ffff00000000000019909216919091179055565b60006112de81336116a5565b50600e805461ffff909216620100000263ffff000019909216919091179055565b600061130b81336116a5565b506012805460ff1916911515919091179055565b6113293383611709565b6113455760405162461bcd60e51b815260040161093d90612f6e565b61135184848484611e51565b50505050565b600061136381336116a5565b8151610a73906011906020850190612967565b606061083082611e84565b60008281526020819052604090206001015461139d81336116a5565b610a738383611abd565b600c546001600160a01b031633146114015760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161093d565b6001600160a01b0381166114665760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161093d565b610b5b81611dff565b6060600061147e836002613022565b611489906002613041565b67ffffffffffffffff8111156114a1576114a1612c12565b6040519080825280601f01601f1916602001820160405280156114cb576020820181803683370190505b509050600360fc1b816000815181106114e6576114e6612ff6565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061151557611515612ff6565b60200101906001600160f81b031916908160001a9053506000611539846002613022565b611544906001613041565b90505b60018111156115bc576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061157857611578612ff6565b1a60f81b82828151811061158e5761158e612ff6565b60200101906001600160f81b031916908160001a90535060049490941c936115b581613059565b9050611547565b50831561160b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161093d565b9392505050565b60006001600160e01b0319821663780e9d6360e01b1480610830575061083082611f22565b600081815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061166c82610f81565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6116af82826111a0565b610d1f576116c7816001600160a01b0316601461146f565b6116d283602061146f565b6040516020016116e3929190613070565b60408051601f198184030181529082905262461bcd60e51b825261093d91600401612ae0565b6000818152600360205260408120546001600160a01b03166117825760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161093d565b600061178d83610f81565b9050806001600160a01b0316846001600160a01b031614806117c85750836001600160a01b03166117bd846108c8565b6001600160a01b0316145b806117f857506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661181382610f81565b6001600160a01b03161461187b5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b606482015260840161093d565b6001600160a01b0382166118dd5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161093d565b6118e8838383611f62565b6118f3600082611637565b6001600160a01b038316600090815260046020526040812080546001929061191c9084906130e5565b90915550506001600160a01b038216600090815260046020526040812080546001929061194a908490613041565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60148054829182916000906119c590849061ffff166130fc565b82546101009290920a61ffff81810219909316918316021790915560145460408051606081019091526023808252640100000000830484169290931691909111159250906132ce602083013990611a2f5760405162461bcd60e51b815260040161093d9190612ae0565b50610d1f82611f6d565b611a4382826111a0565b610d1f576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055611a793390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611ac782826111a0565b15610d1f576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b8061ffff168251611b339190613022565b611b3c81612060565b60005b83518161ffff16101561135157611b73848261ffff1681518110611b6557611b65612ff6565b6020026020010151846121b0565b611b7e6001826130fc565b9050611b3f565b336000908152601360209081526040918290205482518084019093528183527f416c72656164792072656465656d656420796f7572206e657720746f6b656e739183019190915260ff1615611bed5760405162461bcd60e51b815260040161093d9190612ae0565b5060006040518060400160405280601281526020017162616c616e63654f6628616464726573732960701b815250611c223390565b6040516001600160a01b03909116602482015260440160408051601f198184030181529082905291611c5391613122565b6040519081900390206020820180516001600160e01b03166001600160e01b031990921691909117905260115490915060006001601382611c913390565b6001600160a01b0316815260208101919091526040016000908120805460ff1916921515929092179091555b8261ffff168161ffff161015611d3a576000611d0460118361ffff1681548110611ce957611ce9612ff6565b6000918252602090912001546001600160a01b0316866121f2565b905080806020019051810190611d1a919061313e565b611d2490846130fc565b9250611d3390506001826130fc565b9050611cbd565b5080601460028282829054906101000a900461ffff16611d5a91906130fc565b92506101000a81548161ffff021916908361ffff160217905550601460069054906101000a900461ffff1661ffff16601460029054906101000a900461ffff1661ffff1611156040518060600160405280602681526020016132a86026913990611dd75760405162461bcd60e51b815260040161093d9190612ae0565b50610a7333826121b0565b8051610d1f90600b9060208401906129cc565b6060611033612217565b600c80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611e5c848484611800565b611e6884848484612226565b6113515760405162461bcd60e51b815260040161093d90613157565b6000818152600360205260409020546060906001600160a01b03161515604051806040016040528060118152602001703737b732bc34b9ba32b73a103a37b5b2b760791b81525090611ee95760405162461bcd60e51b815260040161093d9190612ae0565b50611ef2611df5565b611efb83612333565b604051602001611f0c9291906131a9565b6040516020818303038152906040529050919050565b60006001600160e01b031982166380ac58cd60e01b1480611f5357506001600160e01b03198216635b5e139f60e01b145b80610830575061083082612431565b610a73838383612466565b6002600d541415611f905760405162461bcd60e51b815260040161093d90612fbf565b6002600d5560105460ff1680611fac5750611fac6000336111a0565b60405180604001604052806013815260200172135a5b9d1a5b99c81a5cc8191a5cd8589b1959606a1b81525090611ff65760405162461bcd60e51b815260040161093d9190612ae0565b50600f54819061200a61ffff831682613022565b34101560405180604001604052806012815260200171496e73756666696369656e742046756e647360701b815250906120565760405162461bcd60e51b815260040161093d9190612ae0565b50610bdf8361251e565b600e5461ffff1661207060095490565b106040518060400160405280600881526020016714dbdb190813dd5d60c21b815250906120b05760405162461bcd60e51b815260040161093d9190612ae0565b50600e5461ffff9081169082166120c660095490565b6120d09190613041565b11156040518060400160405280601981526020017f52657175657374656420746f6f206d616e7920546f6b656e7300000000000000815250906121265760405162461bcd60e51b815260040161093d9190612ae0565b5060008161ffff1611801561214b5750600e5461ffff62010000909104811690821611155b8061215c575061215c6000336111a0565b6040518060400160405280601981526020017f4f757473696465206d696e74207065722074782072616e67650000000000000081525090610d1f5760405162461bcd60e51b815260040161093d9190612ae0565b60005b8161ffff168161ffff161015610a73576121e0836121d060095490565b6121db906001613041565b612532565b6121eb6001826130fc565b90506121b3565b606061160b83836040518060600160405280602581526020016132f16025913961254c565b6060600b805461084590612f33565b60006001600160a01b0384163b1561232857604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061226a9033908990889088906004016131e8565b602060405180830381600087803b15801561228457600080fd5b505af19250505080156122b4575060408051601f3d908101601f191682019092526122b19181019061321b565b60015b61230e573d8080156122e2576040519150601f19603f3d011682016040523d82523d6000602084013e6122e7565b606091505b5080516123065760405162461bcd60e51b815260040161093d90613157565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506117f8565b506001949350505050565b6060816123575750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612381578061236b81613238565b915061237a9050600a83613269565b915061235b565b60008167ffffffffffffffff81111561239c5761239c612c12565b6040519080825280601f01601f1916602001820160405280156123c6576020820181803683370190505b5090505b84156117f8576123db6001836130e5565b91506123e8600a8661327d565b6123f3906030613041565b60f81b81838151811061240857612408612ff6565b60200101906001600160f81b031916908160001a90535061242a600a86613269565b94506123ca565b60006001600160e01b03198216637965db0b60e01b148061083057506301ffc9a760e01b6001600160e01b0319831614610830565b6001600160a01b0383166124c1576124bc81600980546000838152600a60205260408120829055600182018355919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0155565b6124e4565b816001600160a01b0316836001600160a01b0316146124e4576124e4838261261d565b6001600160a01b0382166124fb57610a73816126ba565b826001600160a01b0316826001600160a01b031614610a7357610a738282612769565b8061252881612060565b610d1f33836121b0565b610d1f8282604051806020016040528060008152506127ad565b6060833b6125a85760405162461bcd60e51b8152602060048201526024808201527f416464726573733a207374617469632063616c6c20746f206e6f6e2d636f6e746044820152631c9858dd60e21b606482015260840161093d565b600080856001600160a01b0316856040516125c39190613122565b600060405180830381855afa9150503d80600081146125fe576040519150601f19603f3d011682016040523d82523d6000602084013e612603565b606091505b50915091506126138282866127e0565b9695505050505050565b6000600161262a84611038565b61263491906130e5565b600083815260086020526040902054909150808214612687576001600160a01b03841660009081526007602090815260408083208584528252808320548484528184208190558352600890915290208190555b5060009182526008602090815260408084208490556001600160a01b039094168352600781528383209183525290812055565b6009546000906126cc906001906130e5565b6000838152600a6020526040812054600980549394509092849081106126f4576126f4612ff6565b90600052602060002001549050806009838154811061271557612715612ff6565b6000918252602080832090910192909255828152600a9091526040808220849055858252812055600980548061274d5761274d613291565b6001900381819060005260206000200160009055905550505050565b600061277483611038565b6001600160a01b039093166000908152600760209081526040808320868452825280832085905593825260089052919091209190915550565b6127b78383612819565b6127c46000848484612226565b610a735760405162461bcd60e51b815260040161093d90613157565b606083156127ef57508161160b565b8251156127ff5782518084602001fd5b8160405162461bcd60e51b815260040161093d9190612ae0565b6001600160a01b03821661286f5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161093d565b6000818152600360205260409020546001600160a01b0316156128d45760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161093d565b6128e060008383611f62565b6001600160a01b0382166000908152600460205260408120805460019290612909908490613041565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b8280548282559060005260206000209081019282156129bc579160200282015b828111156129bc57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190612987565b506129c8929150612a40565b5090565b8280546129d890612f33565b90600052602060002090601f0160209004810192826129fa57600085556129bc565b82601f10612a1357805160ff19168380011785556129bc565b828001600101855582156129bc579182015b828111156129bc578251825591602001919060010190612a25565b5b808211156129c85760008155600101612a41565b6001600160e01b031981168114610b5b57600080fd5b600060208284031215612a7d57600080fd5b813561160b81612a55565b60005b83811015612aa3578181015183820152602001612a8b565b838111156113515750506000910152565b60008151808452612acc816020860160208601612a88565b601f01601f19169290920160200192915050565b60208152600061160b6020830184612ab4565b600060208284031215612b0557600080fd5b5035919050565b80356001600160a01b0381168114612b2357600080fd5b919050565b60008060408385031215612b3b57600080fd5b612b4483612b0c565b946020939093013593505050565b803561ffff81168114612b2357600080fd5b600060208284031215612b7657600080fd5b61160b82612b52565b600080600060608486031215612b9457600080fd5b612b9d84612b0c565b9250612bab60208501612b0c565b9150604084013590509250925092565b80358015158114612b2357600080fd5b600060208284031215612bdd57600080fd5b61160b82612bbb565b60008060408385031215612bf957600080fd5b82359150612c0960208401612b0c565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c5157612c51612c12565b604052919050565b600082601f830112612c6a57600080fd5b8135602067ffffffffffffffff821115612c8657612c86612c12565b8160051b612c95828201612c28565b9283528481018201928281019087851115612caf57600080fd5b83870192505b84831015612cd557612cc683612b0c565b82529183019190830190612cb5565b979650505050505050565b60008060408385031215612cf357600080fd5b823567ffffffffffffffff811115612d0a57600080fd5b612d1685828601612c59565b925050612c0960208401612b52565b600067ffffffffffffffff831115612d3f57612d3f612c12565b612d52601f8401601f1916602001612c28565b9050828152838383011115612d6657600080fd5b828260208301376000602084830101529392505050565b600060208284031215612d8f57600080fd5b813567ffffffffffffffff811115612da657600080fd5b8201601f81018413612db757600080fd5b6117f884823560208401612d25565b6020808252825182820181905260009190848201906040850190845b81811015612e075783516001600160a01b031683529284019291840191600101612de2565b50909695505050505050565b600060208284031215612e2557600080fd5b61160b82612b0c565b60008060408385031215612e4157600080fd5b612e4a83612b0c565b9150612c0960208401612bbb565b60008060008060808587031215612e6e57600080fd5b612e7785612b0c565b9350612e8560208601612b0c565b925060408501359150606085013567ffffffffffffffff811115612ea857600080fd5b8501601f81018713612eb957600080fd5b612ec887823560208401612d25565b91505092959194509250565b600060208284031215612ee657600080fd5b813567ffffffffffffffff811115612efd57600080fd5b6117f884828501612c59565b60008060408385031215612f1c57600080fd5b612f2583612b0c565b9150612c0960208401612b0c565b600181811c90821680612f4757607f821691505b60208210811415612f6857634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561303c5761303c61300c565b500290565b600082198211156130545761305461300c565b500190565b6000816130685761306861300c565b506000190190565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516130a8816017850160208801612a88565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516130d9816028840160208801612a88565b01602801949350505050565b6000828210156130f7576130f761300c565b500390565b600061ffff8083168185168083038211156131195761311961300c565b01949350505050565b60008251613134818460208701612a88565b9190910192915050565b60006020828403121561315057600080fd5b5051919050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600083516131bb818460208801612a88565b8351908301906131cf818360208801612a88565b64173539b7b760d91b9101908152600501949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061261390830184612ab4565b60006020828403121561322d57600080fd5b815161160b81612a55565b600060001982141561324c5761324c61300c565b5060010190565b634e487b7160e01b600052601260045260246000fd5b60008261327857613278613253565b500490565b60008261328c5761328c613253565b500690565b634e487b7160e01b600052603160045260246000fdfe52656d61696e696e67206d696e747320726573657276656420666f722070757263686173657352656d61696e696e67206d696e747320726573657276656420666f7220636c61696d73416464726573733a206c6f772d6c6576656c207374617469632063616c6c206661696c6564a264697066735822122029e252aa7c22e6270f139ecf87c7a3a023b296e6f21e0f5f7a8754808372863a64736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000007c0000000000000000000000000000000000000000000000000000000000000009426f6f20426561727300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005424f4f42520000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d64627973515557367472555351525a6a6e73617838714e4750524844737a327264544b7a744a5757616167372f000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000010f000000000000000000000000000000000000000000000000093e1b78ac69000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f17bb82b6e9cc0075ae308e406e5198ba7320545
-----Decoded View---------------
Arg [0] : name_ (string): Boo Bears
Arg [1] : symbol_ (string): BOOBR
Arg [2] : baseURI_ (string): ipfs://QmdbysQUW6trUSQRZjnsax8qNGPRHDsz2rdTKztJWWaag7/
Arg [3] : uintArgs_ (uint256[]): 271,666000000000000000,1
Arg [4] : publicMintingEnabled_ (bool): False
Arg [5] : contractAddrs_ (address[]): 0xF17Bb82b6e9cC0075ae308e406e5198BA7320545
Arg [6] : maxForPurchase_ (uint16): 44
Arg [7] : maxForClaim_ (uint16): 124
-----Encoded View---------------
21 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000180
Arg [3] : 00000000000000000000000000000000000000000000000000000000000001e0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000260
Arg [6] : 000000000000000000000000000000000000000000000000000000000000002c
Arg [7] : 000000000000000000000000000000000000000000000000000000000000007c
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000009
Arg [9] : 426f6f2042656172730000000000000000000000000000000000000000000000
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [11] : 424f4f4252000000000000000000000000000000000000000000000000000000
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000036
Arg [13] : 697066733a2f2f516d64627973515557367472555351525a6a6e73617838714e
Arg [14] : 4750524844737a327264544b7a744a5757616167372f00000000000000000000
Arg [15] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [16] : 000000000000000000000000000000000000000000000000000000000000010f
Arg [17] : 000000000000000000000000000000000000000000000000093e1b78ac690000
Arg [18] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [19] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [20] : 000000000000000000000000f17bb82b6e9cc0075ae308e406e5198ba7320545
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.