ERC-721
Overview
Max Total Supply
621 MPITEM
Holders
198
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
2 MPITEMLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
MyPunksItem
Compiler Version
v0.8.0+commit.c7dfd78e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./ERC721A.sol"; import "./MyPunksFace.sol"; /** __ ____ _____ _ _ _ _ _ _____ | \/ \ \ / / _ \ | | | \| | |/ / __| | |\/| |\ V /| _/ |_| | .` | ' <\__ \ |_| |_| |_| |_| \___/|_|\_|_|\_\___/ Customize Your Own Punks */ contract MyPunksItem is ERC721A, AccessControl, ReentrancyGuard { // AccessControl bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); uint256 public immutable collectionSize; uint256 public immutable amountReserved; uint256 public reserveMinted; bool public stakingPaused; bool public mintingPaused; // Contract Configs string private _currentBaseURI; address public faceContract; address private owner; struct ItemSale { uint32 saleStartTime; uint64 price; uint256 amountSale; uint256 amountMinted; bool isPublicSale; } mapping(uint256 => ItemSale) public itemSales; uint256 public currentSaleRound; constructor( uint256 maxBatchSize_, uint256 collectionSize_, uint256 amountReserved_, bool stakingPaused_, bool mintingPaused_ ) ERC721A("MyPunks Item", "MPITEM", maxBatchSize_) { collectionSize = collectionSize_; amountReserved = amountReserved_; stakingPaused = stakingPaused_; mintingPaused = mintingPaused_; _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); owner = msg.sender; } modifier mintable() { require(mintingPaused == false, "Mint is disabled"); _; } modifier callerIsUser() { require(tx.origin == msg.sender, "The caller is another contract"); _; } /** * ====================================================================================== * * Token Minting * * ====================================================================================== */ function mintItem(uint256 _amount) external payable mintable callerIsUser { ItemSale memory currentSale = itemSales[currentSaleRound]; require( (currentSale.amountMinted + _amount <= currentSale.amountSale) && (totalSupply() < collectionSize), "Items are all minted" ); require( currentSale.saleStartTime != 0 && currentSale.saleStartTime <= block.timestamp, "Time Locked" ); if (!currentSale.isPublicSale) { MyPunksFace Face = MyPunksFace(faceContract); require( Face.balanceOf(msg.sender) > 0, "You must own at least one face to mint" ); } _safeMint(msg.sender, _amount); refundIfOver(currentSale.price * _amount); itemSales[currentSaleRound].amountMinted += _amount; } /** @dev Reserved Token Minting */ function mintReserved(address _to, uint256 _amount) external mintable onlyRole(DEFAULT_ADMIN_ROLE) { require(totalSupply() < collectionSize, "All Items are minted"); require( reserveMinted + _amount < amountReserved + 1, "Reserved are all minted" ); _safeMint(_to, _amount); reserveMinted += _amount; } /** @dev This is used to plugin other contract to mint the item, eg. staking contract */ function mintByMinter(address _to, uint256 _amount) external mintable onlyRole(MINTER_ROLE) { require(totalSupply() < collectionSize, "All Items are minted"); _safeMint(_to, _amount); } function refundIfOver(uint256 _price) private { require(msg.value >= _price, "Need to send more ETH."); if (msg.value > _price) { payable(msg.sender).transfer(msg.value - _price); } } function getCurrentSale() external view returns (ItemSale memory) { return itemSales[currentSaleRound]; } /** * ====================================================================================== * * Item Equippment (Staking) * * ====================================================================================== */ function getOwnedTokens(address _address) external view returns (uint256[] memory) { uint256 balance = balanceOf(_address); uint256[] memory result = new uint256[](balance); for (uint256 i = 0; i < balance; i++) { result[i] = tokenOfOwnerByIndex(_address, i); } return result; } function stakeItem(uint256[] memory _tokenIds, uint256 _faceId) external { require(stakingPaused == false, "Contract Paused"); for (uint256 i = 0; i < _tokenIds.length; i++) { bytes memory data = abi.encodePacked(_faceId); safeTransferFrom(msg.sender, faceContract, _tokenIds[i], data); } } function unstakeItem(address _to, uint256 _tokenId) external { require(stakingPaused == false, "Contract Paused"); require( msg.sender == faceContract, "This method can only be called by Face Contract." ); safeTransferFrom(msg.sender, _to, _tokenId); } /** * ====================================================================================== * * Contract Configurations & Overrides * * ====================================================================================== */ function setItemSale( uint256 _index, uint256 _amountSale, uint256 _amountMinted, uint64 _price, uint32 _saleStartTime, bool _isPublicSale ) external onlyRole(DEFAULT_ADMIN_ROLE) { itemSales[_index].amountSale = _amountSale; itemSales[_index].amountMinted = _amountMinted; itemSales[_index].price = _price; itemSales[_index].saleStartTime = _saleStartTime; itemSales[_index].isPublicSale = _isPublicSale; } function pauseMint(bool _paused) external onlyRole(DEFAULT_ADMIN_ROLE) { mintingPaused = _paused; } function pauseStaking(bool _paused) external onlyRole(DEFAULT_ADMIN_ROLE) { stakingPaused = _paused; } function _baseURI() internal view virtual override returns (string memory) { return _currentBaseURI; } function setBaseURI(string calldata _URI) public onlyRole(DEFAULT_ADMIN_ROLE) { _currentBaseURI = _URI; } function setFaceContract(address _address) external onlyRole(DEFAULT_ADMIN_ROLE) { faceContract = _address; } function setMinter(address _address) external onlyRole(DEFAULT_ADMIN_ROLE) { grantRole(MINTER_ROLE, _address); } function numberMinted(address _owner) external view returns (uint256) { return _numberMinted(_owner); } function supportsInterface(bytes4 interfaceId) public view override(ERC721A, AccessControl) returns (bool) { return super.supportsInterface(interfaceId); } function withdrawMoney() external onlyRole(DEFAULT_ADMIN_ROLE) nonReentrant { (bool success, ) = msg.sender.call{value: address(this).balance}(""); require(success, "Transfer failed."); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/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 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 // Creator: Chiru Labs pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..). * * Does not support burning tokens to address(0). */ contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } uint256 private currentIndex = 0; uint256 internal immutable maxBatchSize; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details. mapping(uint256 => TokenOwnership) private _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // 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 * `maxBatchSize` refers to how much a minter can mint at a time. */ constructor( string memory name_, string memory symbol_, uint256 maxBatchSize_ ) { require(maxBatchSize_ > 0, "ERC721A: max batch size must be nonzero"); _name = name_; _symbol = symbol_; maxBatchSize = maxBatchSize_; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view override returns (uint256) { return currentIndex; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view override returns (uint256) { require(index < totalSupply(), "ERC721A: global index out of bounds"); return index; } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first. * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) { require(index < balanceOf(owner), "ERC721A: owner index out of bounds"); uint256 numMintedSoFar = totalSupply(); uint256 tokenIdsIdx = 0; address currOwnershipAddr = address(0); for (uint256 i = 0; i < numMintedSoFar; i++) { TokenOwnership memory ownership = _ownerships[i]; if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { if (tokenIdsIdx == index) { return i; } tokenIdsIdx++; } } revert("ERC721A: unable to get token of owner by index"); } /** * @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 || interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { require(owner != address(0), "ERC721A: balance query for the zero address"); return uint256(_addressData[owner].balance); } function _numberMinted(address owner) internal view returns (uint256) { require(owner != address(0), "ERC721A: number minted query for the zero address"); return uint256(_addressData[owner].numberMinted); } function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { require(_exists(tokenId), "ERC721A: owner query for nonexistent token"); uint256 lowestTokenToCheck; if (tokenId >= maxBatchSize) { lowestTokenToCheck = tokenId - maxBatchSize + 1; } for (uint256 curr = tokenId; curr >= lowestTokenToCheck; curr--) { TokenOwnership memory ownership = _ownerships[curr]; if (ownership.addr != address(0)) { return ownership; } } revert("ERC721A: unable to determine the owner of token"); } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { return ownershipOf(tokenId).addr; } /** * @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 override { address owner = ERC721A.ownerOf(tokenId); require(to != owner, "ERC721A: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721A: approve caller is not owner nor approved for all" ); _approve(to, tokenId, owner); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { require(_exists(tokenId), "ERC721A: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public override { require(operator != _msgSender(), "ERC721A: 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 override { _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public override { _transfer(from, to, tokenId); require( _checkOnERC721Received(from, to, tokenId, _data), "ERC721A: 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`), */ function _exists(uint256 tokenId) internal view returns (bool) { return tokenId < currentIndex; } function _safeMint(address to, uint256 quantity) internal { _safeMint(to, quantity, ""); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` cannot be larger than the max batch size. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { uint256 startTokenId = currentIndex; require(to != address(0), "ERC721A: mint to the zero address"); // We know if the first token in the batch doesn't exist, the other ones don't as well, because of serial ordering. require(!_exists(startTokenId), "ERC721A: token already minted"); require(quantity <= maxBatchSize, "ERC721A: quantity to mint too high"); _beforeTokenTransfers(address(0), to, startTokenId, quantity); AddressData memory addressData = _addressData[to]; _addressData[to] = AddressData( addressData.balance + uint128(quantity), addressData.numberMinted + uint128(quantity) ); _ownerships[startTokenId] = TokenOwnership(to, uint64(block.timestamp)); uint256 updatedIndex = startTokenId; for (uint256 i = 0; i < quantity; i++) { emit Transfer(address(0), to, updatedIndex); require( _checkOnERC721Received(address(0), to, updatedIndex, _data), "ERC721A: transfer to non ERC721Receiver implementer" ); updatedIndex++; } currentIndex = updatedIndex; _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Transfers `tokenId` from `from` to `to`. * * 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 ) private { TokenOwnership memory prevOwnership = ownershipOf(tokenId); bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr || getApproved(tokenId) == _msgSender() || isApprovedForAll(prevOwnership.addr, _msgSender())); require(isApprovedOrOwner, "ERC721A: transfer caller is not owner nor approved"); require(prevOwnership.addr == from, "ERC721A: transfer from incorrect owner"); require(to != address(0), "ERC721A: transfer to the zero address"); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, prevOwnership.addr); _addressData[from].balance -= 1; _addressData[to].balance += 1; _ownerships[tokenId] = TokenOwnership(to, uint64(block.timestamp)); // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; if (_ownerships[nextTokenId].addr == address(0)) { if (_exists(nextTokenId)) { _ownerships[nextTokenId] = TokenOwnership(prevOwnership.addr, prevOwnership.startTimestamp); } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve( address to, uint256 tokenId, address owner ) private { _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } uint256 public nextOwnerToExplicitlySet = 0; /** * @dev Explicitly set `owners` to eliminate loops in future calls of ownerOf(). */ function _setOwnersExplicit(uint256 quantity) internal { uint256 oldNextOwnerToSet = nextOwnerToExplicitlySet; require(quantity > 0, "quantity must be nonzero"); uint256 endIndex = oldNextOwnerToSet + quantity - 1; if (endIndex > currentIndex - 1) { endIndex = currentIndex - 1; } // We know if the last one in the group exists, all in the group exist, due to serial ordering. require(_exists(endIndex), "not enough minted yet for this cleanup"); for (uint256 i = oldNextOwnerToSet; i <= endIndex; i++) { if (_ownerships[i].addr == address(0)) { TokenOwnership memory ownership = ownershipOf(i); _ownerships[i] = TokenOwnership(ownership.addr, ownership.startTimestamp); } } nextOwnerToExplicitlySet = endIndex + 1; } /** * @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(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721A: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * 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`. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes * minting. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "./MyPunksItem.sol"; import "./ERC721A.sol"; /** __ ____ _____ _ _ _ _ _ _____ | \/ \ \ / / _ \ | | | \| | |/ / __| | |\/| |\ V /| _/ |_| | .` | ' <\__ \ |_| |_| |_| |_| \___/|_|\_|_|\_\___/ Customize Your Own Punks */ contract MyPunksFace is ERC721A, IERC721Receiver, AccessControl { using ECDSA for bytes32; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); uint256 public immutable collectionSize; uint256 public immutable amountReserved; uint256 public reserveMinted; bool public stakingPaused; bool public mintingPaused; string private _currentBaseURI; address public itemContract; address public cSigner; address private owner; mapping(uint256 => uint256[]) private items; mapping(uint256 => string) public customNames; struct SaleConfig { uint32 saleStartTime; uint256 amountSale; uint256 amountMinted; uint256 maxClaim; bool isPublicSale; } SaleConfig public faceSale; constructor( uint256 maxBatchSize_, uint256 collectionSize_, uint256 amountReserved_, bool stakingPaused_, bool mintingPaused_, address cSigner_ ) ERC721A("MyPunks Face", "MPFACE", maxBatchSize_) { collectionSize = collectionSize_; amountReserved = amountReserved_; stakingPaused = stakingPaused_; mintingPaused = mintingPaused_; _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); cSigner = cSigner_; owner = msg.sender; } modifier mintable() { require(mintingPaused == false, "Mint is disabled"); _; } modifier callerIsUser() { require(tx.origin == msg.sender, "The caller is another contract"); _; } /** * ====================================================================================== * * Token Minting * * ====================================================================================== */ function claimFace(bytes memory _signature) external mintable callerIsUser { uint256 saleStartTime = uint256(faceSale.saleStartTime); require( numberMinted(msg.sender) < faceSale.maxClaim, "You've already claimed, mate." ); require( (faceSale.amountMinted < faceSale.amountSale) && (totalSupply() < collectionSize), "Faces are all minted" ); require( saleStartTime != 0 && saleStartTime <= block.timestamp, "Time Locked" ); if (!faceSale.isPublicSale) { require(isMsgValid(_signature) == true, "Invalid Signature"); // Signed Whitelist Minting Only } _safeMint(msg.sender, 1); faceSale.amountMinted++; } /** @dev Reserved Token Minting */ function mintReserved(address _to, uint256 _amount) external mintable onlyRole(DEFAULT_ADMIN_ROLE) { require(totalSupply() < collectionSize, "All Faces are minted"); require( reserveMinted + _amount < amountReserved + 1, "Reserved are all minted" ); _safeMint(_to, _amount); reserveMinted += _amount; } /** @dev This is used to plugin other contract to mint the item, eg. staking contract */ function mintByMinter(address _to, uint256 _amount) external mintable onlyRole(MINTER_ROLE) { require(totalSupply() < collectionSize, "All Faces are minted"); _safeMint(_to, _amount); } /** * ====================================================================================== * * Item Equipment and Staking * * ====================================================================================== */ function getOwnedTokens(address _address) external view returns (uint256[] memory) { uint256 balance = balanceOf(_address); uint256[] memory result = new uint256[](balance); for (uint256 i = 0; i < balance; i++) { result[i] = tokenOfOwnerByIndex(_address, i); } return result; } /** * @dev Receiver function to receive the NFT Tokens, and then added to item collection associated with Face Token Id * @param _from address of the stakeholder * @param _tokenId the token id * @return selector */ function onERC721Received( address _from, address, uint256 _tokenId, bytes memory data ) public virtual override returns (bytes4) { // locate the face which the item should be put uint256 faceId = toUint256(data); require(msg.sender == itemContract, "Invalid ERC721 Transferred"); require( ownerOf(faceId) == _from, "Invalid Staking. Face does not belongs to the staker." ); items[faceId].push(_tokenId); return this.onERC721Received.selector; } /** * @dev Get staked items * @param _tokenId The Face Token Id * @return array of staked token id */ function stakedItems(uint256 _tokenId) public view returns (uint256[] memory) { return items[_tokenId]; } /** * @dev Check if current user staked the item, and return the index of staked item * @notice if it returns an invalid index(eg. index > arr.length), then the item is absense in this array. * @notice we use this method because it can perform find and return the index within one operation. * @param _itemTokenId Mypunks Item Token Id * @param _faceTokenId Face Token Id * @return index of the token id, if no item present, return a invalid number */ function isItemStaked(uint256 _itemTokenId, uint256 _faceTokenId) public view returns (uint256) { // Default value is invalid uint256 index = items[_faceTokenId].length + 1; for (uint256 i = 0; i < items[_faceTokenId].length; i++) { if (items[_faceTokenId][i] == _itemTokenId) { index = i; } } return index; } /** * @dev Remove an index from an array * @param _index item index * @param _faceTokenId the face token id */ function remove(uint256 _index, uint256 _faceTokenId) private { // move array elements for (uint256 i = _index; i < items[_faceTokenId].length - 1; i++) { items[_faceTokenId][i] = items[_faceTokenId][i + 1]; } // pop the last element items[_faceTokenId].pop(); } /** * @dev Remove an index from an array * @param _itemTokenIds ids of item to withdraw * @param _faceTokenId id of face to withdraw from */ function withdraw(uint256[] memory _itemTokenIds, uint256 _faceTokenId) public { require(stakingPaused == false, "Staking Paused"); require( ownerOf(_faceTokenId) == msg.sender, "Unauthorized withdrawal. You must be the owner." ); for (uint256 i = 0; i < _itemTokenIds.length; i++) { uint256 itemIndex = isItemStaked(_itemTokenIds[i], _faceTokenId); // Check if the item has staked by user require( itemIndex < items[_faceTokenId].length, "Invalid withdrawal. This face does not have the item." ); // Remove the item from staking remove(itemIndex, _faceTokenId); MyPunksItem Item = MyPunksItem(itemContract); Item.unstakeItem(msg.sender, _itemTokenIds[i]); } } /** * ====================================================================================== * * Naming * * ====================================================================================== */ /** @dev Set a customized name of token. Caller must be the token owner. */ function setName(uint256 _tokenId, string memory _customName) external { require( ownerOf(_tokenId) == msg.sender, "You're not authorized to set the name" ); require(bytes(_customName).length <= 20, "Exceed Maximum Name Length"); customNames[_tokenId] = _customName; } /** * ====================================================================================== * * Contract Configurations * * ====================================================================================== */ function setFaceSale( uint32 _saleStartTime, uint256 _amountSale, uint256 _amountMinted, uint256 _maxClaim, bool _isPublicSale ) external onlyRole(DEFAULT_ADMIN_ROLE) { require( _amountSale < collectionSize - (faceSale.amountMinted + amountReserved) + 1, "Exceeding Sale Limit" ); faceSale.amountSale = _amountSale; faceSale.amountMinted = _amountMinted; faceSale.saleStartTime = _saleStartTime; faceSale.maxClaim = _maxClaim; faceSale.isPublicSale = _isPublicSale; } function pauseMint(bool _paused) external onlyRole(DEFAULT_ADMIN_ROLE) { mintingPaused = _paused; } function pauseStaking(bool _paused) external onlyRole(DEFAULT_ADMIN_ROLE) { stakingPaused = _paused; } function _baseURI() internal view virtual override returns (string memory) { return _currentBaseURI; } function setBaseURI(string memory _URI) public onlyRole(DEFAULT_ADMIN_ROLE) { _currentBaseURI = _URI; } function setItemContract(address _address) external onlyRole(DEFAULT_ADMIN_ROLE) { itemContract = _address; } function setMinter(address _address) external onlyRole(DEFAULT_ADMIN_ROLE) { grantRole(MINTER_ROLE, _address); } function numberMinted(address _owner) public view returns (uint256) { return _numberMinted(_owner); } function toUint256(bytes memory _bytes) internal pure returns (uint256 value) { assembly { value := mload(add(_bytes, 0x20)) } } function supportsInterface(bytes4 interfaceId) public view override(ERC721A, AccessControl) returns (bool) { return super.supportsInterface(interfaceId); } function isMsgValid(bytes memory _signature) private view returns (bool) { bytes32 messageHash = keccak256( abi.encodePacked(address(this), msg.sender) ); address signer = messageHash.toEthSignedMessageHash().recover( _signature ); return cSigner == signer; } function setSigner(address _signer) external onlyRole(DEFAULT_ADMIN_ROLE) { cSigner = _signer; } }
// 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 "../../utils/introspection/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; 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; /** * @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; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s; uint8 v; assembly { s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 27) } return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint256","name":"maxBatchSize_","type":"uint256"},{"internalType":"uint256","name":"collectionSize_","type":"uint256"},{"internalType":"uint256","name":"amountReserved_","type":"uint256"},{"internalType":"bool","name":"stakingPaused_","type":"bool"},{"internalType":"bool","name":"mintingPaused_","type":"bool"}],"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":"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":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"amountReserved","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"collectionSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentSaleRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"faceContract","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":[],"name":"getCurrentSale","outputs":[{"components":[{"internalType":"uint32","name":"saleStartTime","type":"uint32"},{"internalType":"uint64","name":"price","type":"uint64"},{"internalType":"uint256","name":"amountSale","type":"uint256"},{"internalType":"uint256","name":"amountMinted","type":"uint256"},{"internalType":"bool","name":"isPublicSale","type":"bool"}],"internalType":"struct MyPunksItem.ItemSale","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getOwnedTokens","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"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":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"itemSales","outputs":[{"internalType":"uint32","name":"saleStartTime","type":"uint32"},{"internalType":"uint64","name":"price","type":"uint64"},{"internalType":"uint256","name":"amountSale","type":"uint256"},{"internalType":"uint256","name":"amountMinted","type":"uint256"},{"internalType":"bool","name":"isPublicSale","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mintByMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mintItem","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mintReserved","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintingPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextOwnerToExplicitlySet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"numberMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"pauseMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"pauseStaking","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":[],"name":"reserveMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"_URI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setFaceContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_amountSale","type":"uint256"},{"internalType":"uint256","name":"_amountMinted","type":"uint256"},{"internalType":"uint64","name":"_price","type":"uint64"},{"internalType":"uint32","name":"_saleStartTime","type":"uint32"},{"internalType":"bool","name":"_isPublicSale","type":"bool"}],"name":"setItemSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256","name":"_faceId","type":"uint256"}],"name":"stakeItem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"unstakeItem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawMoney","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60e06040526000805560006007553480156200001a57600080fd5b50604051620039f6380380620039f68339810160408190526200003d91620002bb565b6040518060400160405280600c81526020016b4d7950756e6b73204974656d60a01b815250604051806040016040528060068152602001654d504954454d60d01b8152508660008111620000ae5760405162461bcd60e51b8152600401620000a5906200030f565b60405180910390fd5b8251620000c3906001906020860190620001ff565b508151620000d9906002906020850190620001ff565b506080525050600160095560a084905260c0839052600b805460ff19168315151761ff001916610100831515021790556200011660003362000134565b5050600e80546001600160a01b031916331790555062000393915050565b62000140828262000144565b5050565b620001508282620001d0565b620001405760008281526008602090815260408083206001600160a01b03851684529091529020805460ff191660011790556200018c620001fb565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60009182526008602090815260408084206001600160a01b0393909316845291905290205460ff1690565b3390565b8280546200020d9062000356565b90600052602060002090601f0160209004810192826200023157600085556200027c565b82601f106200024c57805160ff19168380011785556200027c565b828001600101855582156200027c579182015b828111156200027c5782518255916020019190600101906200025f565b506200028a9291506200028e565b5090565b5b808211156200028a57600081556001016200028f565b80518015158114620002b657600080fd5b919050565b600080600080600060a08688031215620002d3578081fd5b855194506020860151935060408601519250620002f360608701620002a5565b91506200030360808701620002a5565b90509295509295909350565b60208082526027908201527f455243373231413a206d61782062617463682073697a65206d757374206265206040820152666e6f6e7a65726f60c81b606082015260800190565b6002810460018216806200036b57607f821691505b602082108114156200038d57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c051613609620003ed600039600081816111350152611682015260008181610a7601528181610dea01528181610e9501526110ec015260008181611cbf01528181611ce901526120e501526136096000f3fe6080604052600436106102885760003560e01c80636352211e1161015a578063c87b56dd116100c1578063de3a6ba81161007a578063de3a6ba81461077b578063e1a283d61461079b578063e985e9c5146107b0578063ea0d8da4146107d0578063f30e6e77146107e5578063fca3b5aa1461080557610288565b8063c87b56dd146106c4578063d5391393146106e4578063d547741f146106f9578063d7224ba014610719578063d9d616551461072e578063dc33e6811461075b57610288565b806397449171116101135780639744917114610625578063a217fddf14610645578063a22cb4651461065a578063ac4460021461067a578063b88d4fde1461068f578063bbb781cc146106af57610288565b80636352211e14610570578063639388e11461059057806370a08231146105b05780637de55fe1146105d057806391d14854146105f057806395d89b411461061057610288565b80632f55f9f8116101fe5780634f6ccce7116101b75780634f6ccce71461049d57806352491d77146104bd57806355f804b3146104dd5780635769848c146104fd5780635aca16361461051d5780635c64bb721461054e57610288565b80632f55f9f8146103f35780632f745c591461041357806336568abe1461043357806342842e0e1461045357806345c0f533146104735780634c81433f1461048857610288565b806318160ddd1161025057806318160ddd146103475780631e5a58981461036957806323b872dd1461037e578063248a9ca31461039e578063298bfde5146103be5780632f2ff15d146103d357610288565b806301ffc9a71461028d57806306fdde03146102c3578063081812fc146102e5578063095ea7b31461031257806317fb859414610334575b600080fd5b34801561029957600080fd5b506102ad6102a8366004612867565b610825565b6040516102ba9190612b09565b60405180910390f35b3480156102cf57600080fd5b506102d8610838565b6040516102ba9190612b14565b3480156102f157600080fd5b5061030561030036600461282d565b6108ca565b6040516102ba9190612a74565b34801561031e57600080fd5b5061033261032d36600461273e565b610916565b005b61033261034236600461282d565b6109af565b34801561035357600080fd5b5061035c610bfc565b6040516102ba9190612a6b565b34801561037557600080fd5b5061035c610c02565b34801561038a57600080fd5b50610332610399366004612623565b610c08565b3480156103aa57600080fd5b5061035c6103b936600461282d565b610c13565b3480156103ca57600080fd5b50610305610c28565b3480156103df57600080fd5b506103326103ee366004612845565b610c37565b3480156103ff57600080fd5b5061033261040e3660046125d7565b610c5b565b34801561041f57600080fd5b5061035c61042e36600461273e565b610c8c565b34801561043f57600080fd5b5061033261044e366004612845565b610d87565b34801561045f57600080fd5b5061033261046e366004612623565b610dcd565b34801561047f57600080fd5b5061035c610de8565b34801561049457600080fd5b5061035c610e0c565b3480156104a957600080fd5b5061035c6104b836600461282d565b610e12565b3480156104c957600080fd5b506103326104d836600461273e565b610e3e565b3480156104e957600080fd5b506103326104f836600461289f565b610ee3565b34801561050957600080fd5b50610332610518366004612813565b610f03565b34801561052957600080fd5b5061053d61053836600461282d565b610f25565b6040516102ba9594939291906133c3565b34801561055a57600080fd5b50610563610f67565b6040516102ba9190613378565b34801561057c57600080fd5b5061030561058b36600461282d565b610fd9565b34801561059c57600080fd5b506103326105ab366004612923565b610feb565b3480156105bc57600080fd5b5061035c6105cb3660046125d7565b611067565b3480156105dc57600080fd5b506103326105eb36600461273e565b6110b4565b3480156105fc57600080fd5b506102ad61060b366004612845565b6111ac565b34801561061c57600080fd5b506102d86111d7565b34801561063157600080fd5b5061033261064036600461273e565b6111e6565b34801561065157600080fd5b5061035c61123e565b34801561066657600080fd5b50610332610675366004612715565b611243565b34801561068657600080fd5b50610332611311565b34801561069b57600080fd5b506103326106aa36600461265e565b6113c6565b3480156106bb57600080fd5b506102ad6113f9565b3480156106d057600080fd5b506102d86106df36600461282d565b611402565b3480156106f057600080fd5b5061035c611485565b34801561070557600080fd5b50610332610714366004612845565b6114a9565b34801561072557600080fd5b5061035c6114c8565b34801561073a57600080fd5b5061074e6107493660046125d7565b6114ce565b6040516102ba9190612ac5565b34801561076757600080fd5b5061035c6107763660046125d7565b61158b565b34801561078757600080fd5b50610332610796366004612767565b611596565b3480156107a757600080fd5b506102ad611644565b3480156107bc57600080fd5b506102ad6107cb3660046125f1565b611652565b3480156107dc57600080fd5b5061035c611680565b3480156107f157600080fd5b50610332610800366004612813565b6116a4565b34801561081157600080fd5b506103326108203660046125d7565b6116cd565b600061083082611705565b90505b919050565b60606001805461084790613511565b80601f016020809104026020016040519081016040528092919081815260200182805461087390613511565b80156108c05780601f10610895576101008083540402835291602001916108c0565b820191906000526020600020905b8154815290600101906020018083116108a357829003601f168201915b5050505050905090565b60006108d58261172a565b6108fa5760405162461bcd60e51b81526004016108f19061329a565b60405180910390fd5b506000908152600560205260409020546001600160a01b031690565b600061092182610fd9565b9050806001600160a01b0316836001600160a01b031614156109555760405162461bcd60e51b81526004016108f190612f6a565b806001600160a01b0316610967611731565b6001600160a01b031614806109835750610983816107cb611731565b61099f5760405162461bcd60e51b81526004016108f190612d76565b6109aa838383611735565b505050565b600b54610100900460ff16156109d75760405162461bcd60e51b81526004016108f190612fac565b3233146109f65760405162461bcd60e51b81526004016108f190612d3f565b6010546000908152600f6020908152604091829020825160a081018452815463ffffffff8116825264010000000090046001600160401b031692810192909252600181015492820183905260028101546060830181905260039091015460ff1615156080830152909190610a6b908490613444565b11158015610a9f57507f0000000000000000000000000000000000000000000000000000000000000000610a9d610bfc565b105b610abb5760405162461bcd60e51b81526004016108f190612e64565b805163ffffffff1615801590610adb575042816000015163ffffffff1611155b610af75760405162461bcd60e51b81526004016108f190613132565b8060800151610ba457600d546040516370a0823160e01b81526001600160a01b039091169060009082906370a0823190610b35903390600401612a74565b60206040518083038186803b158015610b4d57600080fd5b505afa158015610b61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b85919061290b565b11610ba25760405162461bcd60e51b81526004016108f1906131dc565b505b610bae3383611791565b610bcf8282602001516001600160401b0316610bca9190613470565b6117ab565b6010546000908152600f602052604081206002018054849290610bf3908490613444565b90915550505050565b60005490565b60105481565b6109aa83838361180c565b60009081526008602052604090206001015490565b600d546001600160a01b031681565b610c4082610c13565b610c5181610c4c611731565b611b1e565b6109aa8383611b82565b6000610c6981610c4c611731565b50600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6000610c9783611067565b8210610cb55760405162461bcd60e51b81526004016108f190612b27565b6000610cbf610bfc565b905060008060005b83811015610d68576000818152600360209081526040918290208251808401909352546001600160a01b038116808452600160a01b9091046001600160401b03169183019190915215610d1957805192505b876001600160a01b0316836001600160a01b03161415610d555786841415610d4757509350610d8192505050565b83610d518161354c565b9450505b5080610d608161354c565b915050610cc7565b5060405162461bcd60e51b81526004016108f190613157565b92915050565b610d8f611731565b6001600160a01b0316816001600160a01b031614610dbf5760405162461bcd60e51b81526004016108f190613329565b610dc98282611c09565b5050565b6109aa838383604051806020016040528060008152506113c6565b7f000000000000000000000000000000000000000000000000000000000000000081565b600a5481565b6000610e1c610bfc565b8210610e3a5760405162461bcd60e51b81526004016108f190612c66565b5090565b600b54610100900460ff1615610e665760405162461bcd60e51b81526004016108f190612fac565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610e9381610c4c611731565b7f0000000000000000000000000000000000000000000000000000000000000000610ebc610bfc565b10610ed95760405162461bcd60e51b81526004016108f190612c38565b6109aa8383611791565b6000610ef181610c4c611731565b610efd600c84846124d6565b50505050565b6000610f1181610c4c611731565b50600b805460ff1916911515919091179055565b600f60205260009081526040902080546001820154600283015460039093015463ffffffff8316936401000000009093046001600160401b0316929060ff1685565b610f6f612556565b506010546000908152600f6020908152604091829020825160a081018452815463ffffffff8116825264010000000090046001600160401b0316928101929092526001810154928201929092526002820154606082015260039091015460ff161515608082015290565b6000610fe482611c8e565b5192915050565b6000610ff981610c4c611731565b506000958652600f60205260409095206001810194909455600284019290925582546bffffffffffffffff0000000019166401000000006001600160401b0392909216919091021763ffffffff191663ffffffff909116178155600301805460ff1916911515919091179055565b60006001600160a01b03821661108f5760405162461bcd60e51b81526004016108f190612dd3565b506001600160a01b03166000908152600460205260409020546001600160801b031690565b600b54610100900460ff16156110dc5760405162461bcd60e51b81526004016108f190612fac565b60006110ea81610c4c611731565b7f0000000000000000000000000000000000000000000000000000000000000000611113610bfc565b106111305760405162461bcd60e51b81526004016108f190612c38565b61115b7f00000000000000000000000000000000000000000000000000000000000000006001613444565b82600a546111699190613444565b106111865760405162461bcd60e51b81526004016108f1906130ba565b6111908383611791565b81600a60008282546111a29190613444565b9091555050505050565b60009182526008602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606002805461084790613511565b600b5460ff16156112095760405162461bcd60e51b81526004016108f190613271565b600d546001600160a01b031633146112335760405162461bcd60e51b81526004016108f190612be8565b610dc9338383610dcd565b600081565b61124b611731565b6001600160a01b0316826001600160a01b0316141561127c5760405162461bcd60e51b81526004016108f190612ee1565b8060066000611289611731565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff1916921515929092179091556112cd611731565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516113059190612b09565b60405180910390a35050565b600061131f81610c4c611731565b600260095414156113425760405162461bcd60e51b81526004016108f1906131a5565b60026009556040516000903390479061135a906129f3565b60006040518083038185875af1925050503d8060008114611397576040519150601f19603f3d011682016040523d82523d6000602084013e61139c565b606091505b50509050806113bd5760405162461bcd60e51b81526004016108f190612fd6565b50506001600955565b6113d184848461180c565b6113dd84848484611da0565b610efd5760405162461bcd60e51b81526004016108f190613000565b600b5460ff1681565b606061140d8261172a565b6114295760405162461bcd60e51b81526004016108f190612e92565b6000611433611ebc565b90506000815111611453576040518060200160405280600081525061147e565b8061145d84611ecb565b60405160200161146e9291906129c4565b6040516020818303038152906040525b9392505050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6114b282610c13565b6114be81610c4c611731565b6109aa8383611c09565b60075481565b606060006114db83611067565b90506000816001600160401b0381111561150557634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561152e578160200160208202803683370190505b50905060005b82811015611583576115468582610c8c565b82828151811061156657634e487b7160e01b600052603260045260246000fd5b60209081029190910101528061157b8161354c565b915050611534565b509392505050565b600061083082611fe5565b600b5460ff16156115b95760405162461bcd60e51b81526004016108f190613271565b60005b82518110156109aa576000826040516020016115d89190612a6b565b604051602081830303815290604052905061163133600d60009054906101000a90046001600160a01b031686858151811061162357634e487b7160e01b600052603260045260246000fd5b6020026020010151846113c6565b508061163c8161354c565b9150506115bc565b600b54610100900460ff1681565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000081565b60006116b281610c4c611731565b50600b80549115156101000261ff0019909216919091179055565b60006116db81610c4c611731565b610dc97f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a683610c37565b60006001600160e01b03198216637965db0b60e01b1480610830575061083082612039565b6000541190565b3390565b60008281526005602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b610dc9828260405180602001604052806000815250612094565b803410156117cb5760405162461bcd60e51b81526004016108f190613053565b8034111561180957336108fc6117e183346134b7565b6040518115909202916000818181858888f19350505050158015610dc9573d6000803e3d6000fd5b50565b600061181782611c8e565b9050600081600001516001600160a01b0316611831611731565b6001600160a01b031614806118665750611849611731565b6001600160a01b031661185b846108ca565b6001600160a01b0316145b8061187a5750815161187a906107cb611731565b9050806118995760405162461bcd60e51b81526004016108f190612f18565b846001600160a01b031682600001516001600160a01b0316146118ce5760405162461bcd60e51b81526004016108f190612e1e565b6001600160a01b0384166118f45760405162461bcd60e51b81526004016108f190612ca9565b6119018585856001610efd565b6119116000848460000151611735565b6001600160a01b03851660009081526004602052604081208054600192906119439084906001600160801b031661348f565b82546101009290920a6001600160801b038181021990931691831602179091556001600160a01b0386166000908152600460205260408120805460019450909261198f91859116613422565b82546001600160801b039182166101009390930a9283029190920219909116179055506040805180820182526001600160a01b0380871682526001600160401b03428116602080850191825260008981526003909152948520935184549151909216600160a01b0267ffffffffffffffff60a01b19929093166001600160a01b03199091161716179055611a24846001613444565b6000818152600360205260409020549091506001600160a01b0316611ac857611a4c8161172a565b15611ac85760408051808201825284516001600160a01b0390811682526020808701516001600160401b0390811682850190815260008781526003909352949091209251835494516001600160a01b031990951692169190911767ffffffffffffffff60a01b1916600160a01b93909116929092029190911790555b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611b168686866001610efd565b505050505050565b611b2882826111ac565b610dc957611b40816001600160a01b03166014612306565b611b4b836020612306565b604051602001611b5c9291906129f6565b60408051601f198184030181529082905262461bcd60e51b82526108f191600401612b14565b611b8c82826111ac565b610dc95760008281526008602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611bc5611731565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611c1382826111ac565b15610dc95760008281526008602090815260408083206001600160a01b03851684529091529020805460ff19169055611c4a611731565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b611c96612584565b611c9f8261172a565b611cbb5760405162461bcd60e51b81526004016108f190612b9e565b60007f00000000000000000000000000000000000000000000000000000000000000008310611d1c57611d0e7f0000000000000000000000000000000000000000000000000000000000000000846134b7565b611d19906001613444565b90505b825b818110611d87576000818152600360209081526040918290208251808401909352546001600160a01b038116808452600160a01b9091046001600160401b03169183019190915215611d74579250610833915050565b5080611d7f816134fa565b915050611d1e565b5060405162461bcd60e51b81526004016108f190613222565b6000611db4846001600160a01b03166124b7565b15611eb057836001600160a01b031663150b7a02611dd0611731565b8786866040518563ffffffff1660e01b8152600401611df29493929190612a88565b602060405180830381600087803b158015611e0c57600080fd5b505af1925050508015611e3c575060408051601f3d908101601f19168201909252611e3991810190612883565b60015b611e96573d808015611e6a576040519150601f19603f3d011682016040523d82523d6000602084013e611e6f565b606091505b508051611e8e5760405162461bcd60e51b81526004016108f190613000565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611eb4565b5060015b949350505050565b6060600c805461084790613511565b606081611ef057506040805180820190915260018152600360fc1b6020820152610833565b8160005b8115611f1a5780611f048161354c565b9150611f139050600a8361345c565b9150611ef4565b6000816001600160401b03811115611f4257634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611f6c576020820181803683370190505b5090505b8415611eb457611f816001836134b7565b9150611f8e600a86613567565b611f99906030613444565b60f81b818381518110611fbc57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350611fde600a8661345c565b9450611f70565b60006001600160a01b03821661200d5760405162461bcd60e51b81526004016108f190612cee565b506001600160a01b0316600090815260046020526040902054600160801b90046001600160801b031690565b60006001600160e01b031982166380ac58cd60e01b148061206a57506001600160e01b03198216635b5e139f60e01b145b8061208557506001600160e01b0319821663780e9d6360e01b145b806108305750610830826124bd565b6000546001600160a01b0384166120bd5760405162461bcd60e51b81526004016108f1906130f1565b6120c68161172a565b156120e35760405162461bcd60e51b81526004016108f190613083565b7f00000000000000000000000000000000000000000000000000000000000000008311156121235760405162461bcd60e51b81526004016108f1906132e7565b6121306000858386610efd565b6001600160a01b0384166000908152600460209081526040918290208251808401845290546001600160801b038082168352600160801b909104169181019190915281518083019092528051909190819061218c908790613422565b6001600160801b031681526020018583602001516121aa9190613422565b6001600160801b039081169091526001600160a01b03808816600081815260046020908152604080832087518154988401518816600160801b029088166fffffffffffffffffffffffffffffffff199099169890981790961696909617909455845180860186529182526001600160401b034281168386019081528883526003909552948120915182549451909516600160a01b0267ffffffffffffffff60a01b19959093166001600160a01b031990941693909317939093161790915582905b858110156122f45760405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46122b86000888488611da0565b6122d45760405162461bcd60e51b81526004016108f190613000565b816122de8161354c565b92505080806122ec9061354c565b91505061226b565b506000818155611b1690878588610efd565b60606000612315836002613470565b612320906002613444565b6001600160401b0381111561234557634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561236f576020820181803683370190505b509050600360fc1b8160008151811061239857634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106123d557634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006123f9846002613470565b612404906001613444565b90505b6001811115612498576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061244657634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061246a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93612491816134fa565b9050612407565b50831561147e5760405162461bcd60e51b81526004016108f190612b69565b3b151590565b6001600160e01b031981166301ffc9a760e01b14919050565b8280546124e290613511565b90600052602060002090601f016020900481019282612504576000855561254a565b82601f1061251d5782800160ff1982351617855561254a565b8280016001018555821561254a579182015b8281111561254a57823582559160200191906001019061252f565b50610e3a92915061259b565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b604080518082019091526000808252602082015290565b5b80821115610e3a576000815560010161259c565b80356001600160a01b038116811461083357600080fd5b8035801515811461083357600080fd5b6000602082840312156125e8578081fd5b61147e826125b0565b60008060408385031215612603578081fd5b61260c836125b0565b915061261a602084016125b0565b90509250929050565b600080600060608486031215612637578081fd5b612640846125b0565b925061264e602085016125b0565b9150604084013590509250925092565b60008060008060808587031215612673578081fd5b61267c856125b0565b9350602061268b8187016125b0565b93506040860135925060608601356001600160401b03808211156126ad578384fd5b818801915088601f8301126126c0578384fd5b8135818111156126d2576126d26135a7565b6126e4601f8201601f191685016133f9565b915080825289848285010111156126f9578485fd5b8084840185840137810190920192909252939692955090935050565b60008060408385031215612727578182fd5b612730836125b0565b915061261a602084016125c7565b60008060408385031215612750578182fd5b612759836125b0565b946020939093013593505050565b60008060408385031215612779578182fd5b82356001600160401b038082111561278f578384fd5b818501915085601f8301126127a2578384fd5b81356020828211156127b6576127b66135a7565b80820292506127c68184016133f9565b8281528181019085830185870184018b10156127e0578889fd5b8896505b848710156128025780358352600196909601959183019183016127e4565b509997909101359750505050505050565b600060208284031215612824578081fd5b61147e826125c7565b60006020828403121561283e578081fd5b5035919050565b60008060408385031215612857578182fd5b8235915061261a602084016125b0565b600060208284031215612878578081fd5b813561147e816135bd565b600060208284031215612894578081fd5b815161147e816135bd565b600080602083850312156128b1578182fd5b82356001600160401b03808211156128c7578384fd5b818501915085601f8301126128da578384fd5b8135818111156128e8578485fd5b8660208285010111156128f9578485fd5b60209290920196919550909350505050565b60006020828403121561291c578081fd5b5051919050565b60008060008060008060c0878903121561293b578384fd5b86359550602087013594506040870135935060608701356001600160401b0381168114612966578283fd5b9250608087013563ffffffff8116811461297e578283fd5b915061298c60a088016125c7565b90509295509295509295565b600081518084526129b08160208601602086016134ce565b601f01601f19169290920160200192915050565b600083516129d68184602088016134ce565b8351908301906129ea8183602088016134ce565b01949350505050565b90565b60007f416363657373436f6e74726f6c3a206163636f756e742000000000000000000082528351612a2e8160178501602088016134ce565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612a5f8160288401602088016134ce565b01602801949350505050565b90815260200190565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612abb90830184612998565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015612afd57835183529284019291840191600101612ae1565b50909695505050505050565b901515815260200190565b60006020825261147e6020830184612998565b60208082526022908201527f455243373231413a206f776e657220696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b6020808252818101527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604082015260600190565b6020808252602a908201527f455243373231413a206f776e657220717565727920666f72206e6f6e657869736040820152693a32b73a103a37b5b2b760b11b606082015260800190565b60208082526030908201527f54686973206d6574686f642063616e206f6e6c792062652063616c6c6564206260408201526f3c902330b1b29021b7b73a3930b1ba1760811b606082015260800190565b602080825260149082015273105b1b08125d195b5cc8185c99481b5a5b9d195960621b604082015260600190565b60208082526023908201527f455243373231413a20676c6f62616c20696e646578206f7574206f6620626f756040820152626e647360e81b606082015260800190565b60208082526025908201527f455243373231413a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526031908201527f455243373231413a206e756d626572206d696e74656420717565727920666f7260408201527020746865207a65726f206164647265737360781b606082015260800190565b6020808252601e908201527f5468652063616c6c657220697320616e6f7468657220636f6e74726163740000604082015260600190565b60208082526039908201527f455243373231413a20617070726f76652063616c6c6572206973206e6f74206f60408201527f776e6572206e6f7220617070726f76656420666f7220616c6c00000000000000606082015260800190565b6020808252602b908201527f455243373231413a2062616c616e636520717565727920666f7220746865207a60408201526a65726f206164647265737360a81b606082015260800190565b60208082526026908201527f455243373231413a207472616e736665722066726f6d20696e636f72726563746040820152651037bbb732b960d11b606082015260800190565b602080825260149082015273125d195b5cc8185c9948185b1b081b5a5b9d195960621b604082015260600190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b6020808252601a908201527f455243373231413a20617070726f766520746f2063616c6c6572000000000000604082015260600190565b60208082526032908201527f455243373231413a207472616e736665722063616c6c6572206973206e6f74206040820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b606082015260800190565b60208082526022908201527f455243373231413a20617070726f76616c20746f2063757272656e74206f776e60408201526132b960f11b606082015260800190565b60208082526010908201526f135a5b9d081a5cc8191a5cd8589b195960821b604082015260600190565b60208082526010908201526f2a3930b739b332b9103330b4b632b21760811b604082015260600190565b60208082526033908201527f455243373231413a207472616e7366657220746f206e6f6e204552433732315260408201527232b1b2b4bb32b91034b6b83632b6b2b73a32b960691b606082015260800190565b6020808252601690820152752732b2b2103a379039b2b7321036b7b9329022aa241760511b604082015260600190565b6020808252601d908201527f455243373231413a20746f6b656e20616c7265616479206d696e746564000000604082015260600190565b60208082526017908201527f52657365727665642061726520616c6c206d696e746564000000000000000000604082015260600190565b60208082526021908201527f455243373231413a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b6020808252600b908201526a151a5b5948131bd8dad95960aa1b604082015260600190565b6020808252602e908201527f455243373231413a20756e61626c6520746f2067657420746f6b656e206f662060408201526d0deeedccae440c4f240d2dcc8caf60931b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526026908201527f596f75206d757374206f776e206174206c65617374206f6e65206661636520746040820152651bc81b5a5b9d60d21b606082015260800190565b6020808252602f908201527f455243373231413a20756e61626c6520746f2064657465726d696e652074686560408201526e1037bbb732b91037b3103a37b5b2b760891b606082015260800190565b6020808252600f908201526e10dbdb9d1c9858dd0814185d5cd959608a1b604082015260600190565b6020808252602d908201527f455243373231413a20617070726f76656420717565727920666f72206e6f6e6560408201526c3c34b9ba32b73a103a37b5b2b760991b606082015260800190565b60208082526022908201527f455243373231413a207175616e7469747920746f206d696e7420746f6f2068696040820152610ced60f31b606082015260800190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201526e103937b632b9903337b91039b2b63360891b606082015260800190565b600060a08201905063ffffffff83511682526001600160401b036020840151166020830152604083015160408301526060830151606083015260808301511515608083015292915050565b63ffffffff9590951685526001600160401b03939093166020850152604084019190915260608301521515608082015260a00190565b6040518181016001600160401b038111828210171561341a5761341a6135a7565b604052919050565b60006001600160801b038083168185168083038211156129ea576129ea61357b565b600082198211156134575761345761357b565b500190565b60008261346b5761346b613591565b500490565b600081600019048311821515161561348a5761348a61357b565b500290565b60006001600160801b03838116908316818110156134af576134af61357b565b039392505050565b6000828210156134c9576134c961357b565b500390565b60005b838110156134e95781810151838201526020016134d1565b83811115610efd5750506000910152565b6000816135095761350961357b565b506000190190565b60028104600182168061352557607f821691505b6020821081141561354657634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156135605761356061357b565b5060010190565b60008261357657613576613591565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b03198116811461180957600080fdfea26469706673582212206c7a6b29951e77691b12d5f7588e05f5119b5ae6d2ac20d8e85f11d371fb205f64736f6c63430008000033000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000004e1e00000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106102885760003560e01c80636352211e1161015a578063c87b56dd116100c1578063de3a6ba81161007a578063de3a6ba81461077b578063e1a283d61461079b578063e985e9c5146107b0578063ea0d8da4146107d0578063f30e6e77146107e5578063fca3b5aa1461080557610288565b8063c87b56dd146106c4578063d5391393146106e4578063d547741f146106f9578063d7224ba014610719578063d9d616551461072e578063dc33e6811461075b57610288565b806397449171116101135780639744917114610625578063a217fddf14610645578063a22cb4651461065a578063ac4460021461067a578063b88d4fde1461068f578063bbb781cc146106af57610288565b80636352211e14610570578063639388e11461059057806370a08231146105b05780637de55fe1146105d057806391d14854146105f057806395d89b411461061057610288565b80632f55f9f8116101fe5780634f6ccce7116101b75780634f6ccce71461049d57806352491d77146104bd57806355f804b3146104dd5780635769848c146104fd5780635aca16361461051d5780635c64bb721461054e57610288565b80632f55f9f8146103f35780632f745c591461041357806336568abe1461043357806342842e0e1461045357806345c0f533146104735780634c81433f1461048857610288565b806318160ddd1161025057806318160ddd146103475780631e5a58981461036957806323b872dd1461037e578063248a9ca31461039e578063298bfde5146103be5780632f2ff15d146103d357610288565b806301ffc9a71461028d57806306fdde03146102c3578063081812fc146102e5578063095ea7b31461031257806317fb859414610334575b600080fd5b34801561029957600080fd5b506102ad6102a8366004612867565b610825565b6040516102ba9190612b09565b60405180910390f35b3480156102cf57600080fd5b506102d8610838565b6040516102ba9190612b14565b3480156102f157600080fd5b5061030561030036600461282d565b6108ca565b6040516102ba9190612a74565b34801561031e57600080fd5b5061033261032d36600461273e565b610916565b005b61033261034236600461282d565b6109af565b34801561035357600080fd5b5061035c610bfc565b6040516102ba9190612a6b565b34801561037557600080fd5b5061035c610c02565b34801561038a57600080fd5b50610332610399366004612623565b610c08565b3480156103aa57600080fd5b5061035c6103b936600461282d565b610c13565b3480156103ca57600080fd5b50610305610c28565b3480156103df57600080fd5b506103326103ee366004612845565b610c37565b3480156103ff57600080fd5b5061033261040e3660046125d7565b610c5b565b34801561041f57600080fd5b5061035c61042e36600461273e565b610c8c565b34801561043f57600080fd5b5061033261044e366004612845565b610d87565b34801561045f57600080fd5b5061033261046e366004612623565b610dcd565b34801561047f57600080fd5b5061035c610de8565b34801561049457600080fd5b5061035c610e0c565b3480156104a957600080fd5b5061035c6104b836600461282d565b610e12565b3480156104c957600080fd5b506103326104d836600461273e565b610e3e565b3480156104e957600080fd5b506103326104f836600461289f565b610ee3565b34801561050957600080fd5b50610332610518366004612813565b610f03565b34801561052957600080fd5b5061053d61053836600461282d565b610f25565b6040516102ba9594939291906133c3565b34801561055a57600080fd5b50610563610f67565b6040516102ba9190613378565b34801561057c57600080fd5b5061030561058b36600461282d565b610fd9565b34801561059c57600080fd5b506103326105ab366004612923565b610feb565b3480156105bc57600080fd5b5061035c6105cb3660046125d7565b611067565b3480156105dc57600080fd5b506103326105eb36600461273e565b6110b4565b3480156105fc57600080fd5b506102ad61060b366004612845565b6111ac565b34801561061c57600080fd5b506102d86111d7565b34801561063157600080fd5b5061033261064036600461273e565b6111e6565b34801561065157600080fd5b5061035c61123e565b34801561066657600080fd5b50610332610675366004612715565b611243565b34801561068657600080fd5b50610332611311565b34801561069b57600080fd5b506103326106aa36600461265e565b6113c6565b3480156106bb57600080fd5b506102ad6113f9565b3480156106d057600080fd5b506102d86106df36600461282d565b611402565b3480156106f057600080fd5b5061035c611485565b34801561070557600080fd5b50610332610714366004612845565b6114a9565b34801561072557600080fd5b5061035c6114c8565b34801561073a57600080fd5b5061074e6107493660046125d7565b6114ce565b6040516102ba9190612ac5565b34801561076757600080fd5b5061035c6107763660046125d7565b61158b565b34801561078757600080fd5b50610332610796366004612767565b611596565b3480156107a757600080fd5b506102ad611644565b3480156107bc57600080fd5b506102ad6107cb3660046125f1565b611652565b3480156107dc57600080fd5b5061035c611680565b3480156107f157600080fd5b50610332610800366004612813565b6116a4565b34801561081157600080fd5b506103326108203660046125d7565b6116cd565b600061083082611705565b90505b919050565b60606001805461084790613511565b80601f016020809104026020016040519081016040528092919081815260200182805461087390613511565b80156108c05780601f10610895576101008083540402835291602001916108c0565b820191906000526020600020905b8154815290600101906020018083116108a357829003601f168201915b5050505050905090565b60006108d58261172a565b6108fa5760405162461bcd60e51b81526004016108f19061329a565b60405180910390fd5b506000908152600560205260409020546001600160a01b031690565b600061092182610fd9565b9050806001600160a01b0316836001600160a01b031614156109555760405162461bcd60e51b81526004016108f190612f6a565b806001600160a01b0316610967611731565b6001600160a01b031614806109835750610983816107cb611731565b61099f5760405162461bcd60e51b81526004016108f190612d76565b6109aa838383611735565b505050565b600b54610100900460ff16156109d75760405162461bcd60e51b81526004016108f190612fac565b3233146109f65760405162461bcd60e51b81526004016108f190612d3f565b6010546000908152600f6020908152604091829020825160a081018452815463ffffffff8116825264010000000090046001600160401b031692810192909252600181015492820183905260028101546060830181905260039091015460ff1615156080830152909190610a6b908490613444565b11158015610a9f57507f0000000000000000000000000000000000000000000000000000000000004e1e610a9d610bfc565b105b610abb5760405162461bcd60e51b81526004016108f190612e64565b805163ffffffff1615801590610adb575042816000015163ffffffff1611155b610af75760405162461bcd60e51b81526004016108f190613132565b8060800151610ba457600d546040516370a0823160e01b81526001600160a01b039091169060009082906370a0823190610b35903390600401612a74565b60206040518083038186803b158015610b4d57600080fd5b505afa158015610b61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b85919061290b565b11610ba25760405162461bcd60e51b81526004016108f1906131dc565b505b610bae3383611791565b610bcf8282602001516001600160401b0316610bca9190613470565b6117ab565b6010546000908152600f602052604081206002018054849290610bf3908490613444565b90915550505050565b60005490565b60105481565b6109aa83838361180c565b60009081526008602052604090206001015490565b600d546001600160a01b031681565b610c4082610c13565b610c5181610c4c611731565b611b1e565b6109aa8383611b82565b6000610c6981610c4c611731565b50600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6000610c9783611067565b8210610cb55760405162461bcd60e51b81526004016108f190612b27565b6000610cbf610bfc565b905060008060005b83811015610d68576000818152600360209081526040918290208251808401909352546001600160a01b038116808452600160a01b9091046001600160401b03169183019190915215610d1957805192505b876001600160a01b0316836001600160a01b03161415610d555786841415610d4757509350610d8192505050565b83610d518161354c565b9450505b5080610d608161354c565b915050610cc7565b5060405162461bcd60e51b81526004016108f190613157565b92915050565b610d8f611731565b6001600160a01b0316816001600160a01b031614610dbf5760405162461bcd60e51b81526004016108f190613329565b610dc98282611c09565b5050565b6109aa838383604051806020016040528060008152506113c6565b7f0000000000000000000000000000000000000000000000000000000000004e1e81565b600a5481565b6000610e1c610bfc565b8210610e3a5760405162461bcd60e51b81526004016108f190612c66565b5090565b600b54610100900460ff1615610e665760405162461bcd60e51b81526004016108f190612fac565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610e9381610c4c611731565b7f0000000000000000000000000000000000000000000000000000000000004e1e610ebc610bfc565b10610ed95760405162461bcd60e51b81526004016108f190612c38565b6109aa8383611791565b6000610ef181610c4c611731565b610efd600c84846124d6565b50505050565b6000610f1181610c4c611731565b50600b805460ff1916911515919091179055565b600f60205260009081526040902080546001820154600283015460039093015463ffffffff8316936401000000009093046001600160401b0316929060ff1685565b610f6f612556565b506010546000908152600f6020908152604091829020825160a081018452815463ffffffff8116825264010000000090046001600160401b0316928101929092526001810154928201929092526002820154606082015260039091015460ff161515608082015290565b6000610fe482611c8e565b5192915050565b6000610ff981610c4c611731565b506000958652600f60205260409095206001810194909455600284019290925582546bffffffffffffffff0000000019166401000000006001600160401b0392909216919091021763ffffffff191663ffffffff909116178155600301805460ff1916911515919091179055565b60006001600160a01b03821661108f5760405162461bcd60e51b81526004016108f190612dd3565b506001600160a01b03166000908152600460205260409020546001600160801b031690565b600b54610100900460ff16156110dc5760405162461bcd60e51b81526004016108f190612fac565b60006110ea81610c4c611731565b7f0000000000000000000000000000000000000000000000000000000000004e1e611113610bfc565b106111305760405162461bcd60e51b81526004016108f190612c38565b61115b7f00000000000000000000000000000000000000000000000000000000000000c86001613444565b82600a546111699190613444565b106111865760405162461bcd60e51b81526004016108f1906130ba565b6111908383611791565b81600a60008282546111a29190613444565b9091555050505050565b60009182526008602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606002805461084790613511565b600b5460ff16156112095760405162461bcd60e51b81526004016108f190613271565b600d546001600160a01b031633146112335760405162461bcd60e51b81526004016108f190612be8565b610dc9338383610dcd565b600081565b61124b611731565b6001600160a01b0316826001600160a01b0316141561127c5760405162461bcd60e51b81526004016108f190612ee1565b8060066000611289611731565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff1916921515929092179091556112cd611731565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516113059190612b09565b60405180910390a35050565b600061131f81610c4c611731565b600260095414156113425760405162461bcd60e51b81526004016108f1906131a5565b60026009556040516000903390479061135a906129f3565b60006040518083038185875af1925050503d8060008114611397576040519150601f19603f3d011682016040523d82523d6000602084013e61139c565b606091505b50509050806113bd5760405162461bcd60e51b81526004016108f190612fd6565b50506001600955565b6113d184848461180c565b6113dd84848484611da0565b610efd5760405162461bcd60e51b81526004016108f190613000565b600b5460ff1681565b606061140d8261172a565b6114295760405162461bcd60e51b81526004016108f190612e92565b6000611433611ebc565b90506000815111611453576040518060200160405280600081525061147e565b8061145d84611ecb565b60405160200161146e9291906129c4565b6040516020818303038152906040525b9392505050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6114b282610c13565b6114be81610c4c611731565b6109aa8383611c09565b60075481565b606060006114db83611067565b90506000816001600160401b0381111561150557634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561152e578160200160208202803683370190505b50905060005b82811015611583576115468582610c8c565b82828151811061156657634e487b7160e01b600052603260045260246000fd5b60209081029190910101528061157b8161354c565b915050611534565b509392505050565b600061083082611fe5565b600b5460ff16156115b95760405162461bcd60e51b81526004016108f190613271565b60005b82518110156109aa576000826040516020016115d89190612a6b565b604051602081830303815290604052905061163133600d60009054906101000a90046001600160a01b031686858151811061162357634e487b7160e01b600052603260045260246000fd5b6020026020010151846113c6565b508061163c8161354c565b9150506115bc565b600b54610100900460ff1681565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b7f00000000000000000000000000000000000000000000000000000000000000c881565b60006116b281610c4c611731565b50600b80549115156101000261ff0019909216919091179055565b60006116db81610c4c611731565b610dc97f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a683610c37565b60006001600160e01b03198216637965db0b60e01b1480610830575061083082612039565b6000541190565b3390565b60008281526005602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b610dc9828260405180602001604052806000815250612094565b803410156117cb5760405162461bcd60e51b81526004016108f190613053565b8034111561180957336108fc6117e183346134b7565b6040518115909202916000818181858888f19350505050158015610dc9573d6000803e3d6000fd5b50565b600061181782611c8e565b9050600081600001516001600160a01b0316611831611731565b6001600160a01b031614806118665750611849611731565b6001600160a01b031661185b846108ca565b6001600160a01b0316145b8061187a5750815161187a906107cb611731565b9050806118995760405162461bcd60e51b81526004016108f190612f18565b846001600160a01b031682600001516001600160a01b0316146118ce5760405162461bcd60e51b81526004016108f190612e1e565b6001600160a01b0384166118f45760405162461bcd60e51b81526004016108f190612ca9565b6119018585856001610efd565b6119116000848460000151611735565b6001600160a01b03851660009081526004602052604081208054600192906119439084906001600160801b031661348f565b82546101009290920a6001600160801b038181021990931691831602179091556001600160a01b0386166000908152600460205260408120805460019450909261198f91859116613422565b82546001600160801b039182166101009390930a9283029190920219909116179055506040805180820182526001600160a01b0380871682526001600160401b03428116602080850191825260008981526003909152948520935184549151909216600160a01b0267ffffffffffffffff60a01b19929093166001600160a01b03199091161716179055611a24846001613444565b6000818152600360205260409020549091506001600160a01b0316611ac857611a4c8161172a565b15611ac85760408051808201825284516001600160a01b0390811682526020808701516001600160401b0390811682850190815260008781526003909352949091209251835494516001600160a01b031990951692169190911767ffffffffffffffff60a01b1916600160a01b93909116929092029190911790555b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611b168686866001610efd565b505050505050565b611b2882826111ac565b610dc957611b40816001600160a01b03166014612306565b611b4b836020612306565b604051602001611b5c9291906129f6565b60408051601f198184030181529082905262461bcd60e51b82526108f191600401612b14565b611b8c82826111ac565b610dc95760008281526008602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611bc5611731565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611c1382826111ac565b15610dc95760008281526008602090815260408083206001600160a01b03851684529091529020805460ff19169055611c4a611731565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b611c96612584565b611c9f8261172a565b611cbb5760405162461bcd60e51b81526004016108f190612b9e565b60007f000000000000000000000000000000000000000000000000000000000000000a8310611d1c57611d0e7f000000000000000000000000000000000000000000000000000000000000000a846134b7565b611d19906001613444565b90505b825b818110611d87576000818152600360209081526040918290208251808401909352546001600160a01b038116808452600160a01b9091046001600160401b03169183019190915215611d74579250610833915050565b5080611d7f816134fa565b915050611d1e565b5060405162461bcd60e51b81526004016108f190613222565b6000611db4846001600160a01b03166124b7565b15611eb057836001600160a01b031663150b7a02611dd0611731565b8786866040518563ffffffff1660e01b8152600401611df29493929190612a88565b602060405180830381600087803b158015611e0c57600080fd5b505af1925050508015611e3c575060408051601f3d908101601f19168201909252611e3991810190612883565b60015b611e96573d808015611e6a576040519150601f19603f3d011682016040523d82523d6000602084013e611e6f565b606091505b508051611e8e5760405162461bcd60e51b81526004016108f190613000565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611eb4565b5060015b949350505050565b6060600c805461084790613511565b606081611ef057506040805180820190915260018152600360fc1b6020820152610833565b8160005b8115611f1a5780611f048161354c565b9150611f139050600a8361345c565b9150611ef4565b6000816001600160401b03811115611f4257634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611f6c576020820181803683370190505b5090505b8415611eb457611f816001836134b7565b9150611f8e600a86613567565b611f99906030613444565b60f81b818381518110611fbc57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350611fde600a8661345c565b9450611f70565b60006001600160a01b03821661200d5760405162461bcd60e51b81526004016108f190612cee565b506001600160a01b0316600090815260046020526040902054600160801b90046001600160801b031690565b60006001600160e01b031982166380ac58cd60e01b148061206a57506001600160e01b03198216635b5e139f60e01b145b8061208557506001600160e01b0319821663780e9d6360e01b145b806108305750610830826124bd565b6000546001600160a01b0384166120bd5760405162461bcd60e51b81526004016108f1906130f1565b6120c68161172a565b156120e35760405162461bcd60e51b81526004016108f190613083565b7f000000000000000000000000000000000000000000000000000000000000000a8311156121235760405162461bcd60e51b81526004016108f1906132e7565b6121306000858386610efd565b6001600160a01b0384166000908152600460209081526040918290208251808401845290546001600160801b038082168352600160801b909104169181019190915281518083019092528051909190819061218c908790613422565b6001600160801b031681526020018583602001516121aa9190613422565b6001600160801b039081169091526001600160a01b03808816600081815260046020908152604080832087518154988401518816600160801b029088166fffffffffffffffffffffffffffffffff199099169890981790961696909617909455845180860186529182526001600160401b034281168386019081528883526003909552948120915182549451909516600160a01b0267ffffffffffffffff60a01b19959093166001600160a01b031990941693909317939093161790915582905b858110156122f45760405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46122b86000888488611da0565b6122d45760405162461bcd60e51b81526004016108f190613000565b816122de8161354c565b92505080806122ec9061354c565b91505061226b565b506000818155611b1690878588610efd565b60606000612315836002613470565b612320906002613444565b6001600160401b0381111561234557634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561236f576020820181803683370190505b509050600360fc1b8160008151811061239857634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106123d557634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006123f9846002613470565b612404906001613444565b90505b6001811115612498576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061244657634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061246a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93612491816134fa565b9050612407565b50831561147e5760405162461bcd60e51b81526004016108f190612b69565b3b151590565b6001600160e01b031981166301ffc9a760e01b14919050565b8280546124e290613511565b90600052602060002090601f016020900481019282612504576000855561254a565b82601f1061251d5782800160ff1982351617855561254a565b8280016001018555821561254a579182015b8281111561254a57823582559160200191906001019061252f565b50610e3a92915061259b565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b604080518082019091526000808252602082015290565b5b80821115610e3a576000815560010161259c565b80356001600160a01b038116811461083357600080fd5b8035801515811461083357600080fd5b6000602082840312156125e8578081fd5b61147e826125b0565b60008060408385031215612603578081fd5b61260c836125b0565b915061261a602084016125b0565b90509250929050565b600080600060608486031215612637578081fd5b612640846125b0565b925061264e602085016125b0565b9150604084013590509250925092565b60008060008060808587031215612673578081fd5b61267c856125b0565b9350602061268b8187016125b0565b93506040860135925060608601356001600160401b03808211156126ad578384fd5b818801915088601f8301126126c0578384fd5b8135818111156126d2576126d26135a7565b6126e4601f8201601f191685016133f9565b915080825289848285010111156126f9578485fd5b8084840185840137810190920192909252939692955090935050565b60008060408385031215612727578182fd5b612730836125b0565b915061261a602084016125c7565b60008060408385031215612750578182fd5b612759836125b0565b946020939093013593505050565b60008060408385031215612779578182fd5b82356001600160401b038082111561278f578384fd5b818501915085601f8301126127a2578384fd5b81356020828211156127b6576127b66135a7565b80820292506127c68184016133f9565b8281528181019085830185870184018b10156127e0578889fd5b8896505b848710156128025780358352600196909601959183019183016127e4565b509997909101359750505050505050565b600060208284031215612824578081fd5b61147e826125c7565b60006020828403121561283e578081fd5b5035919050565b60008060408385031215612857578182fd5b8235915061261a602084016125b0565b600060208284031215612878578081fd5b813561147e816135bd565b600060208284031215612894578081fd5b815161147e816135bd565b600080602083850312156128b1578182fd5b82356001600160401b03808211156128c7578384fd5b818501915085601f8301126128da578384fd5b8135818111156128e8578485fd5b8660208285010111156128f9578485fd5b60209290920196919550909350505050565b60006020828403121561291c578081fd5b5051919050565b60008060008060008060c0878903121561293b578384fd5b86359550602087013594506040870135935060608701356001600160401b0381168114612966578283fd5b9250608087013563ffffffff8116811461297e578283fd5b915061298c60a088016125c7565b90509295509295509295565b600081518084526129b08160208601602086016134ce565b601f01601f19169290920160200192915050565b600083516129d68184602088016134ce565b8351908301906129ea8183602088016134ce565b01949350505050565b90565b60007f416363657373436f6e74726f6c3a206163636f756e742000000000000000000082528351612a2e8160178501602088016134ce565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612a5f8160288401602088016134ce565b01602801949350505050565b90815260200190565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612abb90830184612998565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015612afd57835183529284019291840191600101612ae1565b50909695505050505050565b901515815260200190565b60006020825261147e6020830184612998565b60208082526022908201527f455243373231413a206f776e657220696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b6020808252818101527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604082015260600190565b6020808252602a908201527f455243373231413a206f776e657220717565727920666f72206e6f6e657869736040820152693a32b73a103a37b5b2b760b11b606082015260800190565b60208082526030908201527f54686973206d6574686f642063616e206f6e6c792062652063616c6c6564206260408201526f3c902330b1b29021b7b73a3930b1ba1760811b606082015260800190565b602080825260149082015273105b1b08125d195b5cc8185c99481b5a5b9d195960621b604082015260600190565b60208082526023908201527f455243373231413a20676c6f62616c20696e646578206f7574206f6620626f756040820152626e647360e81b606082015260800190565b60208082526025908201527f455243373231413a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526031908201527f455243373231413a206e756d626572206d696e74656420717565727920666f7260408201527020746865207a65726f206164647265737360781b606082015260800190565b6020808252601e908201527f5468652063616c6c657220697320616e6f7468657220636f6e74726163740000604082015260600190565b60208082526039908201527f455243373231413a20617070726f76652063616c6c6572206973206e6f74206f60408201527f776e6572206e6f7220617070726f76656420666f7220616c6c00000000000000606082015260800190565b6020808252602b908201527f455243373231413a2062616c616e636520717565727920666f7220746865207a60408201526a65726f206164647265737360a81b606082015260800190565b60208082526026908201527f455243373231413a207472616e736665722066726f6d20696e636f72726563746040820152651037bbb732b960d11b606082015260800190565b602080825260149082015273125d195b5cc8185c9948185b1b081b5a5b9d195960621b604082015260600190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b6020808252601a908201527f455243373231413a20617070726f766520746f2063616c6c6572000000000000604082015260600190565b60208082526032908201527f455243373231413a207472616e736665722063616c6c6572206973206e6f74206040820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b606082015260800190565b60208082526022908201527f455243373231413a20617070726f76616c20746f2063757272656e74206f776e60408201526132b960f11b606082015260800190565b60208082526010908201526f135a5b9d081a5cc8191a5cd8589b195960821b604082015260600190565b60208082526010908201526f2a3930b739b332b9103330b4b632b21760811b604082015260600190565b60208082526033908201527f455243373231413a207472616e7366657220746f206e6f6e204552433732315260408201527232b1b2b4bb32b91034b6b83632b6b2b73a32b960691b606082015260800190565b6020808252601690820152752732b2b2103a379039b2b7321036b7b9329022aa241760511b604082015260600190565b6020808252601d908201527f455243373231413a20746f6b656e20616c7265616479206d696e746564000000604082015260600190565b60208082526017908201527f52657365727665642061726520616c6c206d696e746564000000000000000000604082015260600190565b60208082526021908201527f455243373231413a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b6020808252600b908201526a151a5b5948131bd8dad95960aa1b604082015260600190565b6020808252602e908201527f455243373231413a20756e61626c6520746f2067657420746f6b656e206f662060408201526d0deeedccae440c4f240d2dcc8caf60931b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526026908201527f596f75206d757374206f776e206174206c65617374206f6e65206661636520746040820152651bc81b5a5b9d60d21b606082015260800190565b6020808252602f908201527f455243373231413a20756e61626c6520746f2064657465726d696e652074686560408201526e1037bbb732b91037b3103a37b5b2b760891b606082015260800190565b6020808252600f908201526e10dbdb9d1c9858dd0814185d5cd959608a1b604082015260600190565b6020808252602d908201527f455243373231413a20617070726f76656420717565727920666f72206e6f6e6560408201526c3c34b9ba32b73a103a37b5b2b760991b606082015260800190565b60208082526022908201527f455243373231413a207175616e7469747920746f206d696e7420746f6f2068696040820152610ced60f31b606082015260800190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201526e103937b632b9903337b91039b2b63360891b606082015260800190565b600060a08201905063ffffffff83511682526001600160401b036020840151166020830152604083015160408301526060830151606083015260808301511515608083015292915050565b63ffffffff9590951685526001600160401b03939093166020850152604084019190915260608301521515608082015260a00190565b6040518181016001600160401b038111828210171561341a5761341a6135a7565b604052919050565b60006001600160801b038083168185168083038211156129ea576129ea61357b565b600082198211156134575761345761357b565b500190565b60008261346b5761346b613591565b500490565b600081600019048311821515161561348a5761348a61357b565b500290565b60006001600160801b03838116908316818110156134af576134af61357b565b039392505050565b6000828210156134c9576134c961357b565b500390565b60005b838110156134e95781810151838201526020016134d1565b83811115610efd5750506000910152565b6000816135095761350961357b565b506000190190565b60028104600182168061352557607f821691505b6020821081141561354657634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156135605761356061357b565b5060010190565b60008261357657613576613591565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b03198116811461180957600080fdfea26469706673582212206c7a6b29951e77691b12d5f7588e05f5119b5ae6d2ac20d8e85f11d371fb205f64736f6c63430008000033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000004e1e00000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : maxBatchSize_ (uint256): 10
Arg [1] : collectionSize_ (uint256): 19998
Arg [2] : amountReserved_ (uint256): 200
Arg [3] : stakingPaused_ (bool): True
Arg [4] : mintingPaused_ (bool): False
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [1] : 0000000000000000000000000000000000000000000000000000000000004e1e
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000c8
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
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.