Feature Tip: Add private address tag to any address under My Name Tag !
NFT
Overview
TokenID
4271
Total Transfers
-
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
GamingApeClub
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 100000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "prb-math/contracts/PRBMathUD60x18.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./access/DeveloperAccess.sol"; import "./MerkleProof.sol"; import "./ERC721GAC.sol"; contract GamingApeClub is ERC721GAC, MerkleProof, Ownable, DeveloperAccess, ReentrancyGuard { using PRBMathUD60x18 for uint256; uint256 private constant ONE_PERCENT = 10000000000000000; // 1% (18 decimals) uint8 private constant AUCTION_QUANTITY = 1; // 1 for auction bytes32 private _merkleRoot; uint256 public mintPrice; uint256 public whitelistStart; uint256 public whitelistReset; uint256 public whitelistEnd; uint256 public publicStart; string private _baseUri; uint16 public maxWhitelistSupply; uint16 public maximumSupply; uint16 public maxPerWallet; constructor( address devAddress, uint16 maxSupply, uint16 walletMax, uint16 whitelistMax, uint256 price, uint256 presaleMintStart, uint256 presaleResetTime, uint256 presaleMintEnd, uint256 publicMintStart, string memory baseUri ) ERC721GAC("Gaming Ape Club", "GAC") DeveloperAccess(devAddress) { require(maxSupply >= AUCTION_QUANTITY, "Bad supply"); require(whitelistMax <= maxSupply, "Bad wl max"); // GLOBALS maximumSupply = maxSupply; maxPerWallet = walletMax; mintPrice = price; maxWhitelistSupply = whitelistMax; // CONFIGURE PRESALE Mint whitelistStart = presaleMintStart; whitelistReset = presaleResetTime; whitelistEnd = presaleMintEnd; // CONFIGURE PUBLIC MINT publicStart = publicMintStart; // SET BASEURI _baseUri = baseUri; // MINT AUCTION NFTS ownerMint(AUCTION_QUANTITY, msg.sender); } // -------------------------------------------- OWNER/DEV ONLY ---------------------------------------- /** * @dev Throws if called by any account other than the developer/owner. */ modifier onlyOwnerOrDeveloper() { require( developer() == _msgSender() || owner() == _msgSender(), "Ownable: caller is not the owner or developer" ); _; } /** * Allows for the owner to mint for free. * @param quantity - the quantity to mint. * @param to - the address to recieve that minted quantity. */ function ownerMint(uint64 quantity, address to) public onlyOwner { uint256 remaining = maximumSupply - _currentIndex; require(remaining > 0, "Mint over"); require(quantity <= remaining, "Not enough"); _mint(address(this), to, quantity, "", true, 0); // private } /** * Sets the wallet max for both sales * * @param newMax - the new wallet max for the two sales */ function setMaxPerWallet(uint16 newMax) public onlyOwnerOrDeveloper { maxPerWallet = newMax; } /** * Sets the base URI for all tokens * * @dev be sure to terminate with a slash * @param uri - the target base uri (ex: 'https://google.com/') */ function setBaseURI(string calldata uri) public onlyOwnerOrDeveloper { _baseUri = uri; } /** * Updates the mint price * @param price - the price in WEI */ function setMintPrice(uint256 price) public onlyOwnerOrDeveloper { mintPrice = price; } /** * Updates the merkle root * @param root - the new merkle root */ function setMerkleRoot(bytes32 root) public onlyOwnerOrDeveloper { _merkleRoot = root; } /** * Updates the supply cap on whitelist. * If a given transaction will cause the supply to increase * beyond this number, it will fail. */ function setWhitelistMaxSupply(uint16 max) public onlyOwnerOrDeveloper { require(max <= maximumSupply, "Bad wl max"); maxWhitelistSupply = max; } /** * Updates the mint dates. * * @param wlStartDate - the start date for whitelist in UNIX seconds. * @param wlResetDate - the reset date for whitelist in UNIX seconds. * @param wlEndDate - the end date for whitelist in UNIX seconds. * @param pubStartDate - the start date for public in UNIX seconds. */ function setMintDates( uint256 wlStartDate, uint256 wlResetDate, uint256 wlEndDate, uint256 pubStartDate ) public onlyOwnerOrDeveloper { whitelistStart = wlStartDate; whitelistReset = wlResetDate; whitelistEnd = wlEndDate; publicStart = pubStartDate; } /** * Withdraws balance from the contract to the dividend recipients within. */ function withdraw() external onlyOwnerOrDeveloper { uint256 amount = address(this).balance; (bool s1, ) = payable(0x4C21f55d3Ef836aDeFc5b0A9c9C6908C4F8bD545).call{ value: amount.mul(ONE_PERCENT * 85) }(""); (bool s2, ) = payable(0x7436F0949BCa6b6C6fD766b6b9AA57417B0314A9).call{ value: amount.mul(ONE_PERCENT * 4) }(""); (bool s3, ) = payable(0x13c4d22a8dbB2559B516E10FE0DE47ba4b4A03EB).call{ value: amount.mul(ONE_PERCENT * 3) }(""); (bool s4, ) = payable(0xB3D665d27A1AE8F2f3C32cB1178c9E749ce00714).call{ value: amount.mul(ONE_PERCENT * 3) }(""); (bool s5, ) = payable(0x470049b45A5f05c84e9285Cb467642733450acE5).call{ value: amount.mul(ONE_PERCENT * 3) }(""); (bool s6, ) = payable(0xcbFF601C8745a86e39d9dcB4725B7e6019f5e4FE).call{ value: amount.mul(ONE_PERCENT * 2) }(""); if (s1 && s2 && s3 && s4 && s5 && s6) return; // fallback to paying owner (bool s7, ) = payable(owner()).call{value: amount}(""); require(s7, "Payment failed"); } // ------------------------------------------------ MINT ------------------------------------------------ /** * A handy getter to retrieve the number of private mints conducted by a user. * @param user - the user to query for. * @param postReset - retrieves the number of mints after the whitelist reset. */ function getPresaleMints(address user, bool postReset) external view returns (uint256) { if (postReset) return _numberMintedAux(user); return _numberMintedPrivate(user); } /** * A handy getter to retrieve the number of public mints conducted by a user. * @param user - the user to query for. */ function getPublicMints(address user) external view returns (uint256) { return _numberMintedPublic(user); } /** * Mints in the premint stage by using a signed transaction from a merkle tree whitelist. * * @param amount - the amount of tokens to mint. Will fail if exceeds allowable amount. * @param proof - the merkle proof from the root to the whitelisted address. */ function premint(uint16 amount, bytes32[] memory proof) public payable nonReentrant { uint256 remaining = maxWhitelistSupply - _currentIndex; require(remaining > 0, "Mint over"); require(remaining >= amount, "Insuf. amount"); require( verify(_merkleRoot, keccak256(abi.encodePacked(msg.sender)), proof), "Invalid proof" ); require(mintPrice * amount == msg.value, "Bad value"); bool isReset = block.timestamp >= whitelistReset; if (isReset) { require( _numberMintedAux(msg.sender) + amount <= maxPerWallet, "Limit exceeded" ); } else { require( _numberMintedPrivate(msg.sender) + amount <= maxPerWallet, "Limit exceeded" ); } require( whitelistStart <= block.timestamp && whitelistEnd >= block.timestamp, "Inactive" ); // DISTRIBUTE THE TOKENS _safeMint(msg.sender, amount, isReset ? 1 : 0); } /** * Mints one token provided it is possible to. * * @notice This function allows minting in the public sale. */ function mint(uint16 amount) public payable nonReentrant { uint256 remaining = maximumSupply - _currentIndex; require(remaining > 0, "Mint over"); require(remaining >= amount, "Insuf. amount"); require( _numberMintedPublic(msg.sender) + amount <= maxPerWallet, "Limit exceeded" ); require(mintPrice * amount == msg.value, "Bad value"); require(block.timestamp >= publicStart, "Inactive"); // DISTRIBUTE THE TOKENS _safeMint(msg.sender, amount, 2); // public } /** * Burns the provided token id if you own it. * Reduces the supply by 1. * * @param tokenId - the ID of the token to be burned. */ function burn(uint256 tokenId) public { require(ownerOf(tokenId) == msg.sender, "Not owner"); _burn(tokenId); } // ------------------------------------------- INTERNAL ------------------------------------------- /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. */ function _baseURI() internal view virtual override returns (string memory) { return _baseUri; } // --------------------------------------- FALLBACKS --------------------------------------- /** * The receive function, does nothing */ receive() external payable { // DO NOTHING } }
// SPDX-License-Identifier: MIT // Creator: Cory Cherven, inspired by Chiru Labs pragma solidity ^0.8.9; 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"; error ApprovalCallerNotOwnerNorApproved(); error ApprovalQueryForNonexistentToken(); error ApproveToCaller(); error ApprovalToCurrentOwner(); error BalanceQueryForZeroAddress(); error MintedQueryForZeroAddress(); error BurnedQueryForZeroAddress(); error MintToZeroAddress(); error MintZeroQuantity(); error OwnerIndexOutOfBounds(); error OwnerQueryForNonexistentToken(); error TokenIndexOutOfBounds(); error TransferCallerNotOwnerNorApproved(); error TransferFromIncorrectOwner(); error TransferToNonERC721ReceiverImplementer(); error TransferToZeroAddress(); error URIQueryForNonexistentToken(); error MintIdOutOfRange(); /** * @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. * * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..). * * Assumes that an owner cannot have more than 2**16 - 1 (max value of uint16) of supply. * * Assumes that the maximum token id cannot exceed 2**16 - 1 (max value of uint16). * * Assumes that the consumer has both a private (whitelist, perhaps) mint and a public mint. */ contract ERC721GAC is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; uint256 constant MAX_INT16 = 2**16 - 1; // Compiler will pack this into a single 256bit word. struct AddressData { // GAC will never mint over 2**16 - 1 uint16 balance; // Keeps track of public mint count with minimal overhead for tokenomics. uint16 numberMintedPublic; // Keeps track of private mint count with minimal overhead for tokenomics. uint16 numberMintedPrivate; // Keeps track of an additional mint count with minimal overhead for tokenomics. uint16 numberMintedAux; // Keeps track of burn count with minimal overhead for tokenomics. uint16 numberBurned; } // Compiler will pack the following // _currentIndex and _burnCounter into a single 256bit word. // The tokenId of the next token to be minted. uint16 internal _currentIndex; // The number of tokens burned. uint16 internal _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership address mapping(uint16 => address) internal _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // Mapping from token ID to approved address mapping(uint16 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than _currentIndex times unchecked { return _currentIndex - _burnCounter; } } /** * @dev See {IERC721Enumerable-tokenByIndex}. * 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 tokenByIndex(uint256 index) public view override returns (uint256) { uint16 numMintedSoFar = _currentIndex; uint16 tokenIdsIdx; // Counter overflow is impossible as the loop breaks when // uint16 i is equal to another uint16 numMintedSoFar. unchecked { for (uint16 i; i < numMintedSoFar; i++) { address owner = _ownerships[i]; if (owner != address(0)) { if (tokenIdsIdx == index) { return i; } tokenIdsIdx++; } } } revert TokenIndexOutOfBounds(); } /** * @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) { if (index >= balanceOf(owner)) revert OwnerIndexOutOfBounds(); uint16 numMintedSoFar = _currentIndex; uint16 tokenIdsIdx; // Counter overflow is impossible as the loop breaks when // uint256 i is equal to another uint256 numMintedSoFar. unchecked { for (uint16 i; i < numMintedSoFar; i++) { address ownership = _ownerships[i]; if (ownership == owner) { if (tokenIdsIdx == index) { return i; } tokenIdsIdx++; } } } // Execution should never reach this point. revert(); } /** * @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) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return uint256(_addressData[owner].balance); } function _numberMintedPublic(address owner) internal view returns (uint256) { if (owner == address(0)) revert MintedQueryForZeroAddress(); return uint256(_addressData[owner].numberMintedPublic); } function _numberMintedAux(address owner) internal view returns (uint256) { if (owner == address(0)) revert MintedQueryForZeroAddress(); return uint256(_addressData[owner].numberMintedAux); } function _numberMintedPrivate(address owner) internal view returns (uint256) { if (owner == address(0)) revert MintedQueryForZeroAddress(); return uint256(_addressData[owner].numberMintedPrivate); } function _numberBurned(address owner) internal view returns (uint256) { if (owner == address(0)) revert BurnedQueryForZeroAddress(); return uint256(_addressData[owner].numberBurned); } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { if (tokenId > MAX_INT16) revert OwnerQueryForNonexistentToken(); if (_ownerships[uint16(tokenId)] == address(0)) revert OwnerQueryForNonexistentToken(); return _ownerships[uint16(tokenId)]; } /** * @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) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); 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 = ownerOf(tokenId); if (to == owner) revert ApprovalToCurrentOwner(); if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) { revert ApprovalCallerNotOwnerNorApproved(); } _approve(to, uint16(tokenId), owner); // ownerOf asserts id in range } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[uint16(tokenId)]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public override { if (operator == _msgSender()) revert ApproveToCaller(); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { _transfer(from, to, tokenId); if (!_checkOnERC721Received(from, to, uint16(tokenId), _data)) { // transfer asserts id in range revert TransferToNonERC721ReceiverImplementer(); } } /** * @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) { if (tokenId > MAX_INT16) return false; return tokenId < _currentIndex && _ownerships[uint16(tokenId)] != address(0); } /** * Safe mints a given quantity of tokens. * @param to - the recipient * @param quantity - the amount to mint * @param mintId - 0 (presale), 1 (aux), 2 (public) */ function _safeMint( address to, uint256 quantity, uint8 mintId ) internal { _safeMint(to, quantity, "", mintId); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. * @param to - the recipient * @param quantity - the amount to mint * @param mintId - 0 (presale), 1 (aux), 2 (public) * @param _data - mint data to pass to the recipient contract */ function _safeMint( address to, uint256 quantity, bytes memory _data, uint8 mintId ) internal { _mint(to, to, quantity, _data, true, mintId); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * Updates the number minted in the `from` account. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. * @param to - the recipient * @param quantity - the amount to mint * @param mintId - 0 (presale), 1 (aux), 2 (public) * @param _data - mint data to pass to the recipient contract * @param safe - indicates if the mint is safe or not */ function _mint( address from, address to, uint256 quantity, bytes memory _data, bool safe, uint8 mintId ) internal { if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); if (mintId >= 3) revert MintIdOutOfRange(); uint16 startTokenId = _currentIndex; // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 3.4e38 (2**128) - 1 // updatedIndex overflows if _currentIndex + quantity > 3.4e38 (2**128) - 1 unchecked { _addressData[to].balance += uint16(quantity); if (mintId == 0) _addressData[from].numberMintedPrivate += uint16(quantity); else if (mintId == 1) _addressData[from].numberMintedAux += uint16(quantity); else _addressData[from].numberMintedPublic += uint16(quantity); uint16 updatedIndex = startTokenId; for (uint16 i; i < quantity; i++) { _beforeTokenTransfer(address(0), to, updatedIndex); _ownerships[updatedIndex] = to; emit Transfer(address(0), to, updatedIndex); if ( safe && !_checkOnERC721Received(address(0), to, updatedIndex, _data) ) { revert TransferToNonERC721ReceiverImplementer(); } _afterTokenTransfer(address(0), to, updatedIndex); updatedIndex++; } _currentIndex = uint16(updatedIndex); } } /** * @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 { address prevOwnership = ownerOf(tokenId); bool isApprovedOrOwner = (_msgSender() == prevOwnership || isApprovedForAll(prevOwnership, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); if (prevOwnership != from) revert TransferFromIncorrectOwner(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfer(from, to, uint16(tokenId)); // ownerOf asserts token existance // Clear approvals from the previous owner _approve(address(0), uint16(tokenId), prevOwnership); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**128. unchecked { _addressData[from].balance -= 1; _addressData[to].balance += 1; _ownerships[uint16(tokenId)] = to; } emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, uint16(tokenId)); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address prevOwnership = ownerOf(tokenId); _beforeTokenTransfer(prevOwnership, address(0), uint16(tokenId)); // ownerOf assets token in range // Clear approvals from the previous owner _approve(address(0), uint16(tokenId), prevOwnership); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**128. unchecked { _addressData[prevOwnership].balance -= 1; _addressData[prevOwnership].numberBurned += 1; _ownerships[uint16(tokenId)] = address(0); } emit Transfer(prevOwnership, address(0), tokenId); _afterTokenTransfer(prevOwnership, address(0), uint16(tokenId)); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve( address to, uint16 tokenId, address owner ) private { _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint16 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 TransferToNonERC721ReceiverImplementer(); } 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. * And also called before burning one token. * * 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`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfer( address from, address to, uint16 tokenId ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes * minting. * And also called after one token has been burned. * * 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` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfer( address from, address to, uint16 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; /** * A Contract designed to verify a given merkle leaf based on the provided merkle root and proof. */ contract MerkleProof { /** * Verifies that a given leaf lives under the provided root based on the proof. * @param root - the root of the merkle tree (keccak hash) * @param leaf - the leaf you are proving exists in the tree (keccak hash) * @param proof - the proof that verifies that the given leaf exists under that root. * @return boolean - indicating validity. */ function verify( bytes32 root, bytes32 leaf, bytes32[] memory proof ) public pure returns (bool) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = keccak256( abi.encodePacked(computedHash, proofElement) ); } else { // Hash(current element of the proof + current computed hash) computedHash = keccak256( abi.encodePacked(proofElement, computedHash) ); } } // Check if the computed hash (root) is equal to the provided root return computedHash == root; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an developer) that can be granted exclusive access to * specific functions. * * By default, the developer account will be the one that deploys the contract. This * can later be changed with {transferDevelopership}. * * This module is used through inheritance. It will make available the modifier * `onlyDeveloper`, which can be applied to your functions to restrict their use to * the developer. */ abstract contract DeveloperAccess is Context { address private _developer; event DevelopershipTransferred(address indexed previousDeveloper, address indexed newDeveloper); /** * @dev Initializes the contract setting the deployer as the initial developer. */ constructor(address dev) { _setDeveloper(dev); } /** * @dev Returns the address of the current developer. */ function developer() public view virtual returns (address) { return _developer; } /** * @dev Throws if called by any account other than the developer. */ modifier onlyDeveloper() { require(developer() == _msgSender(), "Ownable: caller is not the developer"); _; } /** * @dev Leaves the contract without developer. It will not be possible to call * `onlyDeveloper` functions anymore. Can only be called by the current developer. * * NOTE: Renouncing developership will leave the contract without an developer, * thereby removing any functionality that is only available to the developer. */ function renounceDevelopership() public virtual onlyDeveloper { _setDeveloper(address(0)); } /** * @dev Transfers developership of the contract to a new account (`newDeveloper`). * Can only be called by the current developer. */ function transferDevelopership(address newDeveloper) public virtual onlyDeveloper { require(newDeveloper != address(0), "Ownable: new developer is the zero address"); _setDeveloper(newDeveloper); } function _setDeveloper(address newDeveloper) private { address oldDeveloper = _developer; _developer = newDeveloper; emit DevelopershipTransferred(oldDeveloper, newDeveloper); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) 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 making 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 // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: Unlicense pragma solidity >=0.8.4; import "./PRBMath.sol"; /// @title PRBMathUD60x18 /// @author Paul Razvan Berg /// @notice Smart contract library for advanced fixed-point math that works with uint256 numbers considered to have 18 /// trailing decimals. We call this number representation unsigned 60.18-decimal fixed-point, since there can be up to 60 /// digits in the integer part and up to 18 decimals in the fractional part. The numbers are bound by the minimum and the /// maximum values permitted by the Solidity type uint256. library PRBMathUD60x18 { /// @dev Half the SCALE number. uint256 internal constant HALF_SCALE = 5e17; /// @dev log2(e) as an unsigned 60.18-decimal fixed-point number. uint256 internal constant LOG2_E = 1_442695040888963407; /// @dev The maximum value an unsigned 60.18-decimal fixed-point number can have. uint256 internal constant MAX_UD60x18 = 115792089237316195423570985008687907853269984665640564039457_584007913129639935; /// @dev The maximum whole value an unsigned 60.18-decimal fixed-point number can have. uint256 internal constant MAX_WHOLE_UD60x18 = 115792089237316195423570985008687907853269984665640564039457_000000000000000000; /// @dev How many trailing decimals can be represented. uint256 internal constant SCALE = 1e18; /// @notice Calculates the arithmetic average of x and y, rounding down. /// @param x The first operand as an unsigned 60.18-decimal fixed-point number. /// @param y The second operand as an unsigned 60.18-decimal fixed-point number. /// @return result The arithmetic average as an unsigned 60.18-decimal fixed-point number. function avg(uint256 x, uint256 y) internal pure returns (uint256 result) { // The operations can never overflow. unchecked { // The last operand checks if both x and y are odd and if that is the case, we add 1 to the result. We need // to do this because if both numbers are odd, the 0.5 remainder gets truncated twice. result = (x >> 1) + (y >> 1) + (x & y & 1); } } /// @notice Yields the least unsigned 60.18 decimal fixed-point number greater than or equal to x. /// /// @dev Optimized for fractional value inputs, because for every whole value there are (1e18 - 1) fractional counterparts. /// See https://en.wikipedia.org/wiki/Floor_and_ceiling_functions. /// /// Requirements: /// - x must be less than or equal to MAX_WHOLE_UD60x18. /// /// @param x The unsigned 60.18-decimal fixed-point number to ceil. /// @param result The least integer greater than or equal to x, as an unsigned 60.18-decimal fixed-point number. function ceil(uint256 x) internal pure returns (uint256 result) { if (x > MAX_WHOLE_UD60x18) { revert PRBMathUD60x18__CeilOverflow(x); } assembly { // Equivalent to "x % SCALE" but faster. let remainder := mod(x, SCALE) // Equivalent to "SCALE - remainder" but faster. let delta := sub(SCALE, remainder) // Equivalent to "x + delta * (remainder > 0 ? 1 : 0)" but faster. result := add(x, mul(delta, gt(remainder, 0))) } } /// @notice Divides two unsigned 60.18-decimal fixed-point numbers, returning a new unsigned 60.18-decimal fixed-point number. /// /// @dev Uses mulDiv to enable overflow-safe multiplication and division. /// /// Requirements: /// - The denominator cannot be zero. /// /// @param x The numerator as an unsigned 60.18-decimal fixed-point number. /// @param y The denominator as an unsigned 60.18-decimal fixed-point number. /// @param result The quotient as an unsigned 60.18-decimal fixed-point number. function div(uint256 x, uint256 y) internal pure returns (uint256 result) { result = PRBMath.mulDiv(x, SCALE, y); } /// @notice Returns Euler's number as an unsigned 60.18-decimal fixed-point number. /// @dev See https://en.wikipedia.org/wiki/E_(mathematical_constant). function e() internal pure returns (uint256 result) { result = 2_718281828459045235; } /// @notice Calculates the natural exponent of x. /// /// @dev Based on the insight that e^x = 2^(x * log2(e)). /// /// Requirements: /// - All from "log2". /// - x must be less than 133.084258667509499441. /// /// @param x The exponent as an unsigned 60.18-decimal fixed-point number. /// @return result The result as an unsigned 60.18-decimal fixed-point number. function exp(uint256 x) internal pure returns (uint256 result) { // Without this check, the value passed to "exp2" would be greater than 192. if (x >= 133_084258667509499441) { revert PRBMathUD60x18__ExpInputTooBig(x); } // Do the fixed-point multiplication inline to save gas. unchecked { uint256 doubleScaleProduct = x * LOG2_E; result = exp2((doubleScaleProduct + HALF_SCALE) / SCALE); } } /// @notice Calculates the binary exponent of x using the binary fraction method. /// /// @dev See https://ethereum.stackexchange.com/q/79903/24693. /// /// Requirements: /// - x must be 192 or less. /// - The result must fit within MAX_UD60x18. /// /// @param x The exponent as an unsigned 60.18-decimal fixed-point number. /// @return result The result as an unsigned 60.18-decimal fixed-point number. function exp2(uint256 x) internal pure returns (uint256 result) { // 2^192 doesn't fit within the 192.64-bit format used internally in this function. if (x >= 192e18) { revert PRBMathUD60x18__Exp2InputTooBig(x); } unchecked { // Convert x to the 192.64-bit fixed-point format. uint256 x192x64 = (x << 64) / SCALE; // Pass x to the PRBMath.exp2 function, which uses the 192.64-bit fixed-point number representation. result = PRBMath.exp2(x192x64); } } /// @notice Yields the greatest unsigned 60.18 decimal fixed-point number less than or equal to x. /// @dev Optimized for fractional value inputs, because for every whole value there are (1e18 - 1) fractional counterparts. /// See https://en.wikipedia.org/wiki/Floor_and_ceiling_functions. /// @param x The unsigned 60.18-decimal fixed-point number to floor. /// @param result The greatest integer less than or equal to x, as an unsigned 60.18-decimal fixed-point number. function floor(uint256 x) internal pure returns (uint256 result) { assembly { // Equivalent to "x % SCALE" but faster. let remainder := mod(x, SCALE) // Equivalent to "x - remainder * (remainder > 0 ? 1 : 0)" but faster. result := sub(x, mul(remainder, gt(remainder, 0))) } } /// @notice Yields the excess beyond the floor of x. /// @dev Based on the odd function definition https://en.wikipedia.org/wiki/Fractional_part. /// @param x The unsigned 60.18-decimal fixed-point number to get the fractional part of. /// @param result The fractional part of x as an unsigned 60.18-decimal fixed-point number. function frac(uint256 x) internal pure returns (uint256 result) { assembly { result := mod(x, SCALE) } } /// @notice Converts a number from basic integer form to unsigned 60.18-decimal fixed-point representation. /// /// @dev Requirements: /// - x must be less than or equal to MAX_UD60x18 divided by SCALE. /// /// @param x The basic integer to convert. /// @param result The same number in unsigned 60.18-decimal fixed-point representation. function fromUint(uint256 x) internal pure returns (uint256 result) { unchecked { if (x > MAX_UD60x18 / SCALE) { revert PRBMathUD60x18__FromUintOverflow(x); } result = x * SCALE; } } /// @notice Calculates geometric mean of x and y, i.e. sqrt(x * y), rounding down. /// /// @dev Requirements: /// - x * y must fit within MAX_UD60x18, lest it overflows. /// /// @param x The first operand as an unsigned 60.18-decimal fixed-point number. /// @param y The second operand as an unsigned 60.18-decimal fixed-point number. /// @return result The result as an unsigned 60.18-decimal fixed-point number. function gm(uint256 x, uint256 y) internal pure returns (uint256 result) { if (x == 0) { return 0; } unchecked { // Checking for overflow this way is faster than letting Solidity do it. uint256 xy = x * y; if (xy / x != y) { revert PRBMathUD60x18__GmOverflow(x, y); } // We don't need to multiply by the SCALE here because the x*y product had already picked up a factor of SCALE // during multiplication. See the comments within the "sqrt" function. result = PRBMath.sqrt(xy); } } /// @notice Calculates 1 / x, rounding toward zero. /// /// @dev Requirements: /// - x cannot be zero. /// /// @param x The unsigned 60.18-decimal fixed-point number for which to calculate the inverse. /// @return result The inverse as an unsigned 60.18-decimal fixed-point number. function inv(uint256 x) internal pure returns (uint256 result) { unchecked { // 1e36 is SCALE * SCALE. result = 1e36 / x; } } /// @notice Calculates the natural logarithm of x. /// /// @dev Based on the insight that ln(x) = log2(x) / log2(e). /// /// Requirements: /// - All from "log2". /// /// Caveats: /// - All from "log2". /// - This doesn't return exactly 1 for 2.718281828459045235, for that we would need more fine-grained precision. /// /// @param x The unsigned 60.18-decimal fixed-point number for which to calculate the natural logarithm. /// @return result The natural logarithm as an unsigned 60.18-decimal fixed-point number. function ln(uint256 x) internal pure returns (uint256 result) { // Do the fixed-point multiplication inline to save gas. This is overflow-safe because the maximum value that log2(x) // can return is 196205294292027477728. unchecked { result = (log2(x) * SCALE) / LOG2_E; } } /// @notice Calculates the common logarithm of x. /// /// @dev First checks if x is an exact power of ten and it stops if yes. If it's not, calculates the common /// logarithm based on the insight that log10(x) = log2(x) / log2(10). /// /// Requirements: /// - All from "log2". /// /// Caveats: /// - All from "log2". /// /// @param x The unsigned 60.18-decimal fixed-point number for which to calculate the common logarithm. /// @return result The common logarithm as an unsigned 60.18-decimal fixed-point number. function log10(uint256 x) internal pure returns (uint256 result) { if (x < SCALE) { revert PRBMathUD60x18__LogInputTooSmall(x); } // Note that the "mul" in this block is the assembly multiplication operation, not the "mul" function defined // in this contract. // prettier-ignore assembly { switch x case 1 { result := mul(SCALE, sub(0, 18)) } case 10 { result := mul(SCALE, sub(1, 18)) } case 100 { result := mul(SCALE, sub(2, 18)) } case 1000 { result := mul(SCALE, sub(3, 18)) } case 10000 { result := mul(SCALE, sub(4, 18)) } case 100000 { result := mul(SCALE, sub(5, 18)) } case 1000000 { result := mul(SCALE, sub(6, 18)) } case 10000000 { result := mul(SCALE, sub(7, 18)) } case 100000000 { result := mul(SCALE, sub(8, 18)) } case 1000000000 { result := mul(SCALE, sub(9, 18)) } case 10000000000 { result := mul(SCALE, sub(10, 18)) } case 100000000000 { result := mul(SCALE, sub(11, 18)) } case 1000000000000 { result := mul(SCALE, sub(12, 18)) } case 10000000000000 { result := mul(SCALE, sub(13, 18)) } case 100000000000000 { result := mul(SCALE, sub(14, 18)) } case 1000000000000000 { result := mul(SCALE, sub(15, 18)) } case 10000000000000000 { result := mul(SCALE, sub(16, 18)) } case 100000000000000000 { result := mul(SCALE, sub(17, 18)) } case 1000000000000000000 { result := 0 } case 10000000000000000000 { result := SCALE } case 100000000000000000000 { result := mul(SCALE, 2) } case 1000000000000000000000 { result := mul(SCALE, 3) } case 10000000000000000000000 { result := mul(SCALE, 4) } case 100000000000000000000000 { result := mul(SCALE, 5) } case 1000000000000000000000000 { result := mul(SCALE, 6) } case 10000000000000000000000000 { result := mul(SCALE, 7) } case 100000000000000000000000000 { result := mul(SCALE, 8) } case 1000000000000000000000000000 { result := mul(SCALE, 9) } case 10000000000000000000000000000 { result := mul(SCALE, 10) } case 100000000000000000000000000000 { result := mul(SCALE, 11) } case 1000000000000000000000000000000 { result := mul(SCALE, 12) } case 10000000000000000000000000000000 { result := mul(SCALE, 13) } case 100000000000000000000000000000000 { result := mul(SCALE, 14) } case 1000000000000000000000000000000000 { result := mul(SCALE, 15) } case 10000000000000000000000000000000000 { result := mul(SCALE, 16) } case 100000000000000000000000000000000000 { result := mul(SCALE, 17) } case 1000000000000000000000000000000000000 { result := mul(SCALE, 18) } case 10000000000000000000000000000000000000 { result := mul(SCALE, 19) } case 100000000000000000000000000000000000000 { result := mul(SCALE, 20) } case 1000000000000000000000000000000000000000 { result := mul(SCALE, 21) } case 10000000000000000000000000000000000000000 { result := mul(SCALE, 22) } case 100000000000000000000000000000000000000000 { result := mul(SCALE, 23) } case 1000000000000000000000000000000000000000000 { result := mul(SCALE, 24) } case 10000000000000000000000000000000000000000000 { result := mul(SCALE, 25) } case 100000000000000000000000000000000000000000000 { result := mul(SCALE, 26) } case 1000000000000000000000000000000000000000000000 { result := mul(SCALE, 27) } case 10000000000000000000000000000000000000000000000 { result := mul(SCALE, 28) } case 100000000000000000000000000000000000000000000000 { result := mul(SCALE, 29) } case 1000000000000000000000000000000000000000000000000 { result := mul(SCALE, 30) } case 10000000000000000000000000000000000000000000000000 { result := mul(SCALE, 31) } case 100000000000000000000000000000000000000000000000000 { result := mul(SCALE, 32) } case 1000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 33) } case 10000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 34) } case 100000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 35) } case 1000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 36) } case 10000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 37) } case 100000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 38) } case 1000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 39) } case 10000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 40) } case 100000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 41) } case 1000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 42) } case 10000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 43) } case 100000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 44) } case 1000000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 45) } case 10000000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 46) } case 100000000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 47) } case 1000000000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 48) } case 10000000000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 49) } case 100000000000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 50) } case 1000000000000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 51) } case 10000000000000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 52) } case 100000000000000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 53) } case 1000000000000000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 54) } case 10000000000000000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 55) } case 100000000000000000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 56) } case 1000000000000000000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 57) } case 10000000000000000000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 58) } case 100000000000000000000000000000000000000000000000000000000000000000000000000000 { result := mul(SCALE, 59) } default { result := MAX_UD60x18 } } if (result == MAX_UD60x18) { // Do the fixed-point division inline to save gas. The denominator is log2(10). unchecked { result = (log2(x) * SCALE) / 3_321928094887362347; } } } /// @notice Calculates the binary logarithm of x. /// /// @dev Based on the iterative approximation algorithm. /// https://en.wikipedia.org/wiki/Binary_logarithm#Iterative_approximation /// /// Requirements: /// - x must be greater than or equal to SCALE, otherwise the result would be negative. /// /// Caveats: /// - The results are nor perfectly accurate to the last decimal, due to the lossy precision of the iterative approximation. /// /// @param x The unsigned 60.18-decimal fixed-point number for which to calculate the binary logarithm. /// @return result The binary logarithm as an unsigned 60.18-decimal fixed-point number. function log2(uint256 x) internal pure returns (uint256 result) { if (x < SCALE) { revert PRBMathUD60x18__LogInputTooSmall(x); } unchecked { // Calculate the integer part of the logarithm and add it to the result and finally calculate y = x * 2^(-n). uint256 n = PRBMath.mostSignificantBit(x / SCALE); // The integer part of the logarithm as an unsigned 60.18-decimal fixed-point number. The operation can't overflow // because n is maximum 255 and SCALE is 1e18. result = n * SCALE; // This is y = x * 2^(-n). uint256 y = x >> n; // If y = 1, the fractional part is zero. if (y == SCALE) { return result; } // Calculate the fractional part via the iterative approximation. // The "delta >>= 1" part is equivalent to "delta /= 2", but shifting bits is faster. for (uint256 delta = HALF_SCALE; delta > 0; delta >>= 1) { y = (y * y) / SCALE; // Is y^2 > 2 and so in the range [2,4)? if (y >= 2 * SCALE) { // Add the 2^(-m) factor to the logarithm. result += delta; // Corresponds to z/2 on Wikipedia. y >>= 1; } } } } /// @notice Multiplies two unsigned 60.18-decimal fixed-point numbers together, returning a new unsigned 60.18-decimal /// fixed-point number. /// @dev See the documentation for the "PRBMath.mulDivFixedPoint" function. /// @param x The multiplicand as an unsigned 60.18-decimal fixed-point number. /// @param y The multiplier as an unsigned 60.18-decimal fixed-point number. /// @return result The product as an unsigned 60.18-decimal fixed-point number. function mul(uint256 x, uint256 y) internal pure returns (uint256 result) { result = PRBMath.mulDivFixedPoint(x, y); } /// @notice Returns PI as an unsigned 60.18-decimal fixed-point number. function pi() internal pure returns (uint256 result) { result = 3_141592653589793238; } /// @notice Raises x to the power of y. /// /// @dev Based on the insight that x^y = 2^(log2(x) * y). /// /// Requirements: /// - All from "exp2", "log2" and "mul". /// /// Caveats: /// - All from "exp2", "log2" and "mul". /// - Assumes 0^0 is 1. /// /// @param x Number to raise to given power y, as an unsigned 60.18-decimal fixed-point number. /// @param y Exponent to raise x to, as an unsigned 60.18-decimal fixed-point number. /// @return result x raised to power y, as an unsigned 60.18-decimal fixed-point number. function pow(uint256 x, uint256 y) internal pure returns (uint256 result) { if (x == 0) { result = y == 0 ? SCALE : uint256(0); } else { result = exp2(mul(log2(x), y)); } } /// @notice Raises x (unsigned 60.18-decimal fixed-point number) to the power of y (basic unsigned integer) using the /// famous algorithm "exponentiation by squaring". /// /// @dev See https://en.wikipedia.org/wiki/Exponentiation_by_squaring /// /// Requirements: /// - The result must fit within MAX_UD60x18. /// /// Caveats: /// - All from "mul". /// - Assumes 0^0 is 1. /// /// @param x The base as an unsigned 60.18-decimal fixed-point number. /// @param y The exponent as an uint256. /// @return result The result as an unsigned 60.18-decimal fixed-point number. function powu(uint256 x, uint256 y) internal pure returns (uint256 result) { // Calculate the first iteration of the loop in advance. result = y & 1 > 0 ? x : SCALE; // Equivalent to "for(y /= 2; y > 0; y /= 2)" but faster. for (y >>= 1; y > 0; y >>= 1) { x = PRBMath.mulDivFixedPoint(x, x); // Equivalent to "y % 2 == 1" but faster. if (y & 1 > 0) { result = PRBMath.mulDivFixedPoint(result, x); } } } /// @notice Returns 1 as an unsigned 60.18-decimal fixed-point number. function scale() internal pure returns (uint256 result) { result = SCALE; } /// @notice Calculates the square root of x, rounding down. /// @dev Uses the Babylonian method https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method. /// /// Requirements: /// - x must be less than MAX_UD60x18 / SCALE. /// /// @param x The unsigned 60.18-decimal fixed-point number for which to calculate the square root. /// @return result The result as an unsigned 60.18-decimal fixed-point . function sqrt(uint256 x) internal pure returns (uint256 result) { unchecked { if (x > MAX_UD60x18 / SCALE) { revert PRBMathUD60x18__SqrtOverflow(x); } // Multiply x by the SCALE to account for the factor of SCALE that is picked up when multiplying two unsigned // 60.18-decimal fixed-point numbers together (in this case, those two numbers are both the square root). result = PRBMath.sqrt(x * SCALE); } } /// @notice Converts a unsigned 60.18-decimal fixed-point number to basic integer form, rounding down in the process. /// @param x The unsigned 60.18-decimal fixed-point number to convert. /// @return result The same number in basic integer form. function toUint(uint256 x) internal pure returns (uint256 result) { unchecked { result = x / SCALE; } } }
// SPDX-License-Identifier: Unlicense pragma solidity >=0.8.4; /// @notice Emitted when the result overflows uint256. error PRBMath__MulDivFixedPointOverflow(uint256 prod1); /// @notice Emitted when the result overflows uint256. error PRBMath__MulDivOverflow(uint256 prod1, uint256 denominator); /// @notice Emitted when one of the inputs is type(int256).min. error PRBMath__MulDivSignedInputTooSmall(); /// @notice Emitted when the intermediary absolute result overflows int256. error PRBMath__MulDivSignedOverflow(uint256 rAbs); /// @notice Emitted when the input is MIN_SD59x18. error PRBMathSD59x18__AbsInputTooSmall(); /// @notice Emitted when ceiling a number overflows SD59x18. error PRBMathSD59x18__CeilOverflow(int256 x); /// @notice Emitted when one of the inputs is MIN_SD59x18. error PRBMathSD59x18__DivInputTooSmall(); /// @notice Emitted when one of the intermediary unsigned results overflows SD59x18. error PRBMathSD59x18__DivOverflow(uint256 rAbs); /// @notice Emitted when the input is greater than 133.084258667509499441. error PRBMathSD59x18__ExpInputTooBig(int256 x); /// @notice Emitted when the input is greater than 192. error PRBMathSD59x18__Exp2InputTooBig(int256 x); /// @notice Emitted when flooring a number underflows SD59x18. error PRBMathSD59x18__FloorUnderflow(int256 x); /// @notice Emitted when converting a basic integer to the fixed-point format overflows SD59x18. error PRBMathSD59x18__FromIntOverflow(int256 x); /// @notice Emitted when converting a basic integer to the fixed-point format underflows SD59x18. error PRBMathSD59x18__FromIntUnderflow(int256 x); /// @notice Emitted when the product of the inputs is negative. error PRBMathSD59x18__GmNegativeProduct(int256 x, int256 y); /// @notice Emitted when multiplying the inputs overflows SD59x18. error PRBMathSD59x18__GmOverflow(int256 x, int256 y); /// @notice Emitted when the input is less than or equal to zero. error PRBMathSD59x18__LogInputTooSmall(int256 x); /// @notice Emitted when one of the inputs is MIN_SD59x18. error PRBMathSD59x18__MulInputTooSmall(); /// @notice Emitted when the intermediary absolute result overflows SD59x18. error PRBMathSD59x18__MulOverflow(uint256 rAbs); /// @notice Emitted when the intermediary absolute result overflows SD59x18. error PRBMathSD59x18__PowuOverflow(uint256 rAbs); /// @notice Emitted when the input is negative. error PRBMathSD59x18__SqrtNegativeInput(int256 x); /// @notice Emitted when the calculating the square root overflows SD59x18. error PRBMathSD59x18__SqrtOverflow(int256 x); /// @notice Emitted when addition overflows UD60x18. error PRBMathUD60x18__AddOverflow(uint256 x, uint256 y); /// @notice Emitted when ceiling a number overflows UD60x18. error PRBMathUD60x18__CeilOverflow(uint256 x); /// @notice Emitted when the input is greater than 133.084258667509499441. error PRBMathUD60x18__ExpInputTooBig(uint256 x); /// @notice Emitted when the input is greater than 192. error PRBMathUD60x18__Exp2InputTooBig(uint256 x); /// @notice Emitted when converting a basic integer to the fixed-point format format overflows UD60x18. error PRBMathUD60x18__FromUintOverflow(uint256 x); /// @notice Emitted when multiplying the inputs overflows UD60x18. error PRBMathUD60x18__GmOverflow(uint256 x, uint256 y); /// @notice Emitted when the input is less than 1. error PRBMathUD60x18__LogInputTooSmall(uint256 x); /// @notice Emitted when the calculating the square root overflows UD60x18. error PRBMathUD60x18__SqrtOverflow(uint256 x); /// @notice Emitted when subtraction underflows UD60x18. error PRBMathUD60x18__SubUnderflow(uint256 x, uint256 y); /// @dev Common mathematical functions used in both PRBMathSD59x18 and PRBMathUD60x18. Note that this shared library /// does not always assume the signed 59.18-decimal fixed-point or the unsigned 60.18-decimal fixed-point /// representation. When it does not, it is explicitly mentioned in the NatSpec documentation. library PRBMath { /// STRUCTS /// struct SD59x18 { int256 value; } struct UD60x18 { uint256 value; } /// STORAGE /// /// @dev How many trailing decimals can be represented. uint256 internal constant SCALE = 1e18; /// @dev Largest power of two divisor of SCALE. uint256 internal constant SCALE_LPOTD = 262144; /// @dev SCALE inverted mod 2^256. uint256 internal constant SCALE_INVERSE = 78156646155174841979727994598816262306175212592076161876661_508869554232690281; /// FUNCTIONS /// /// @notice Calculates the binary exponent of x using the binary fraction method. /// @dev Has to use 192.64-bit fixed-point numbers. /// See https://ethereum.stackexchange.com/a/96594/24693. /// @param x The exponent as an unsigned 192.64-bit fixed-point number. /// @return result The result as an unsigned 60.18-decimal fixed-point number. function exp2(uint256 x) internal pure returns (uint256 result) { unchecked { // Start from 0.5 in the 192.64-bit fixed-point format. result = 0x800000000000000000000000000000000000000000000000; // Multiply the result by root(2, 2^-i) when the bit at position i is 1. None of the intermediary results overflows // because the initial result is 2^191 and all magic factors are less than 2^65. if (x & 0x8000000000000000 > 0) { result = (result * 0x16A09E667F3BCC909) >> 64; } if (x & 0x4000000000000000 > 0) { result = (result * 0x1306FE0A31B7152DF) >> 64; } if (x & 0x2000000000000000 > 0) { result = (result * 0x1172B83C7D517ADCE) >> 64; } if (x & 0x1000000000000000 > 0) { result = (result * 0x10B5586CF9890F62A) >> 64; } if (x & 0x800000000000000 > 0) { result = (result * 0x1059B0D31585743AE) >> 64; } if (x & 0x400000000000000 > 0) { result = (result * 0x102C9A3E778060EE7) >> 64; } if (x & 0x200000000000000 > 0) { result = (result * 0x10163DA9FB33356D8) >> 64; } if (x & 0x100000000000000 > 0) { result = (result * 0x100B1AFA5ABCBED61) >> 64; } if (x & 0x80000000000000 > 0) { result = (result * 0x10058C86DA1C09EA2) >> 64; } if (x & 0x40000000000000 > 0) { result = (result * 0x1002C605E2E8CEC50) >> 64; } if (x & 0x20000000000000 > 0) { result = (result * 0x100162F3904051FA1) >> 64; } if (x & 0x10000000000000 > 0) { result = (result * 0x1000B175EFFDC76BA) >> 64; } if (x & 0x8000000000000 > 0) { result = (result * 0x100058BA01FB9F96D) >> 64; } if (x & 0x4000000000000 > 0) { result = (result * 0x10002C5CC37DA9492) >> 64; } if (x & 0x2000000000000 > 0) { result = (result * 0x1000162E525EE0547) >> 64; } if (x & 0x1000000000000 > 0) { result = (result * 0x10000B17255775C04) >> 64; } if (x & 0x800000000000 > 0) { result = (result * 0x1000058B91B5BC9AE) >> 64; } if (x & 0x400000000000 > 0) { result = (result * 0x100002C5C89D5EC6D) >> 64; } if (x & 0x200000000000 > 0) { result = (result * 0x10000162E43F4F831) >> 64; } if (x & 0x100000000000 > 0) { result = (result * 0x100000B1721BCFC9A) >> 64; } if (x & 0x80000000000 > 0) { result = (result * 0x10000058B90CF1E6E) >> 64; } if (x & 0x40000000000 > 0) { result = (result * 0x1000002C5C863B73F) >> 64; } if (x & 0x20000000000 > 0) { result = (result * 0x100000162E430E5A2) >> 64; } if (x & 0x10000000000 > 0) { result = (result * 0x1000000B172183551) >> 64; } if (x & 0x8000000000 > 0) { result = (result * 0x100000058B90C0B49) >> 64; } if (x & 0x4000000000 > 0) { result = (result * 0x10000002C5C8601CC) >> 64; } if (x & 0x2000000000 > 0) { result = (result * 0x1000000162E42FFF0) >> 64; } if (x & 0x1000000000 > 0) { result = (result * 0x10000000B17217FBB) >> 64; } if (x & 0x800000000 > 0) { result = (result * 0x1000000058B90BFCE) >> 64; } if (x & 0x400000000 > 0) { result = (result * 0x100000002C5C85FE3) >> 64; } if (x & 0x200000000 > 0) { result = (result * 0x10000000162E42FF1) >> 64; } if (x & 0x100000000 > 0) { result = (result * 0x100000000B17217F8) >> 64; } if (x & 0x80000000 > 0) { result = (result * 0x10000000058B90BFC) >> 64; } if (x & 0x40000000 > 0) { result = (result * 0x1000000002C5C85FE) >> 64; } if (x & 0x20000000 > 0) { result = (result * 0x100000000162E42FF) >> 64; } if (x & 0x10000000 > 0) { result = (result * 0x1000000000B17217F) >> 64; } if (x & 0x8000000 > 0) { result = (result * 0x100000000058B90C0) >> 64; } if (x & 0x4000000 > 0) { result = (result * 0x10000000002C5C860) >> 64; } if (x & 0x2000000 > 0) { result = (result * 0x1000000000162E430) >> 64; } if (x & 0x1000000 > 0) { result = (result * 0x10000000000B17218) >> 64; } if (x & 0x800000 > 0) { result = (result * 0x1000000000058B90C) >> 64; } if (x & 0x400000 > 0) { result = (result * 0x100000000002C5C86) >> 64; } if (x & 0x200000 > 0) { result = (result * 0x10000000000162E43) >> 64; } if (x & 0x100000 > 0) { result = (result * 0x100000000000B1721) >> 64; } if (x & 0x80000 > 0) { result = (result * 0x10000000000058B91) >> 64; } if (x & 0x40000 > 0) { result = (result * 0x1000000000002C5C8) >> 64; } if (x & 0x20000 > 0) { result = (result * 0x100000000000162E4) >> 64; } if (x & 0x10000 > 0) { result = (result * 0x1000000000000B172) >> 64; } if (x & 0x8000 > 0) { result = (result * 0x100000000000058B9) >> 64; } if (x & 0x4000 > 0) { result = (result * 0x10000000000002C5D) >> 64; } if (x & 0x2000 > 0) { result = (result * 0x1000000000000162E) >> 64; } if (x & 0x1000 > 0) { result = (result * 0x10000000000000B17) >> 64; } if (x & 0x800 > 0) { result = (result * 0x1000000000000058C) >> 64; } if (x & 0x400 > 0) { result = (result * 0x100000000000002C6) >> 64; } if (x & 0x200 > 0) { result = (result * 0x10000000000000163) >> 64; } if (x & 0x100 > 0) { result = (result * 0x100000000000000B1) >> 64; } if (x & 0x80 > 0) { result = (result * 0x10000000000000059) >> 64; } if (x & 0x40 > 0) { result = (result * 0x1000000000000002C) >> 64; } if (x & 0x20 > 0) { result = (result * 0x10000000000000016) >> 64; } if (x & 0x10 > 0) { result = (result * 0x1000000000000000B) >> 64; } if (x & 0x8 > 0) { result = (result * 0x10000000000000006) >> 64; } if (x & 0x4 > 0) { result = (result * 0x10000000000000003) >> 64; } if (x & 0x2 > 0) { result = (result * 0x10000000000000001) >> 64; } if (x & 0x1 > 0) { result = (result * 0x10000000000000001) >> 64; } // We're doing two things at the same time: // // 1. Multiply the result by 2^n + 1, where "2^n" is the integer part and the one is added to account for // the fact that we initially set the result to 0.5. This is accomplished by subtracting from 191 // rather than 192. // 2. Convert the result to the unsigned 60.18-decimal fixed-point format. // // This works because 2^(191-ip) = 2^ip / 2^191, where "ip" is the integer part "2^n". result *= SCALE; result >>= (191 - (x >> 64)); } } /// @notice Finds the zero-based index of the first one in the binary representation of x. /// @dev See the note on msb in the "Find First Set" Wikipedia article https://en.wikipedia.org/wiki/Find_first_set /// @param x The uint256 number for which to find the index of the most significant bit. /// @return msb The index of the most significant bit as an uint256. function mostSignificantBit(uint256 x) internal pure returns (uint256 msb) { if (x >= 2**128) { x >>= 128; msb += 128; } if (x >= 2**64) { x >>= 64; msb += 64; } if (x >= 2**32) { x >>= 32; msb += 32; } if (x >= 2**16) { x >>= 16; msb += 16; } if (x >= 2**8) { x >>= 8; msb += 8; } if (x >= 2**4) { x >>= 4; msb += 4; } if (x >= 2**2) { x >>= 2; msb += 2; } if (x >= 2**1) { // No need to shift x any more. msb += 1; } } /// @notice Calculates floor(x*y÷denominator) with full precision. /// /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv. /// /// Requirements: /// - The denominator cannot be zero. /// - The result must fit within uint256. /// /// Caveats: /// - This function does not work with fixed-point numbers. /// /// @param x The multiplicand as an uint256. /// @param y The multiplier as an uint256. /// @param denominator The divisor as an uint256. /// @return result The result as an uint256. function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { unchecked { result = prod0 / denominator; } return result; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (prod1 >= denominator) { revert PRBMath__MulDivOverflow(prod1, denominator); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. unchecked { // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 lpotdod = denominator & (~denominator + 1); assembly { // Divide denominator by lpotdod. denominator := div(denominator, lpotdod) // Divide [prod1 prod0] by lpotdod. prod0 := div(prod0, lpotdod) // Flip lpotdod such that it is 2^256 / lpotdod. If lpotdod is zero, then it becomes one. lpotdod := add(div(sub(0, lpotdod), lpotdod), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * lpotdod; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /// @notice Calculates floor(x*y÷1e18) with full precision. /// /// @dev Variant of "mulDiv" with constant folding, i.e. in which the denominator is always 1e18. Before returning the /// final result, we add 1 if (x * y) % SCALE >= HALF_SCALE. Without this, 6.6e-19 would be truncated to 0 instead of /// being rounded to 1e-18. See "Listing 6" and text above it at https://accu.org/index.php/journals/1717. /// /// Requirements: /// - The result must fit within uint256. /// /// Caveats: /// - The body is purposely left uncommented; see the NatSpec comments in "PRBMath.mulDiv" to understand how this works. /// - It is assumed that the result can never be type(uint256).max when x and y solve the following two equations: /// 1. x * y = type(uint256).max * SCALE /// 2. (x * y) % SCALE >= SCALE / 2 /// /// @param x The multiplicand as an unsigned 60.18-decimal fixed-point number. /// @param y The multiplier as an unsigned 60.18-decimal fixed-point number. /// @return result The result as an unsigned 60.18-decimal fixed-point number. function mulDivFixedPoint(uint256 x, uint256 y) internal pure returns (uint256 result) { uint256 prod0; uint256 prod1; assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } if (prod1 >= SCALE) { revert PRBMath__MulDivFixedPointOverflow(prod1); } uint256 remainder; uint256 roundUpUnit; assembly { remainder := mulmod(x, y, SCALE) roundUpUnit := gt(remainder, 499999999999999999) } if (prod1 == 0) { unchecked { result = (prod0 / SCALE) + roundUpUnit; return result; } } assembly { result := add( mul( or( div(sub(prod0, remainder), SCALE_LPOTD), mul(sub(prod1, gt(remainder, prod0)), add(div(sub(0, SCALE_LPOTD), SCALE_LPOTD), 1)) ), SCALE_INVERSE ), roundUpUnit ) } } /// @notice Calculates floor(x*y÷denominator) with full precision. /// /// @dev An extension of "mulDiv" for signed numbers. Works by computing the signs and the absolute values separately. /// /// Requirements: /// - None of the inputs can be type(int256).min. /// - The result must fit within int256. /// /// @param x The multiplicand as an int256. /// @param y The multiplier as an int256. /// @param denominator The divisor as an int256. /// @return result The result as an int256. function mulDivSigned( int256 x, int256 y, int256 denominator ) internal pure returns (int256 result) { if (x == type(int256).min || y == type(int256).min || denominator == type(int256).min) { revert PRBMath__MulDivSignedInputTooSmall(); } // Get hold of the absolute values of x, y and the denominator. uint256 ax; uint256 ay; uint256 ad; unchecked { ax = x < 0 ? uint256(-x) : uint256(x); ay = y < 0 ? uint256(-y) : uint256(y); ad = denominator < 0 ? uint256(-denominator) : uint256(denominator); } // Compute the absolute value of (x*y)÷denominator. The result must fit within int256. uint256 rAbs = mulDiv(ax, ay, ad); if (rAbs > uint256(type(int256).max)) { revert PRBMath__MulDivSignedOverflow(rAbs); } // Get the signs of x, y and the denominator. uint256 sx; uint256 sy; uint256 sd; assembly { sx := sgt(x, sub(0, 1)) sy := sgt(y, sub(0, 1)) sd := sgt(denominator, sub(0, 1)) } // XOR over sx, sy and sd. This is checking whether there are one or three negative signs in the inputs. // If yes, the result should be negative. result = sx ^ sy ^ sd == 0 ? -int256(rAbs) : int256(rAbs); } /// @notice Calculates the square root of x, rounding down. /// @dev Uses the Babylonian method https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method. /// /// Caveats: /// - This function does not work with fixed-point numbers. /// /// @param x The uint256 number for which to calculate the square root. /// @return result The result as an uint256. function sqrt(uint256 x) internal pure returns (uint256 result) { if (x == 0) { return 0; } // Set the initial guess to the least power of two that is greater than or equal to sqrt(x). uint256 xAux = uint256(x); result = 1; if (xAux >= 0x100000000000000000000000000000000) { xAux >>= 128; result <<= 64; } if (xAux >= 0x10000000000000000) { xAux >>= 64; result <<= 32; } if (xAux >= 0x100000000) { xAux >>= 32; result <<= 16; } if (xAux >= 0x10000) { xAux >>= 16; result <<= 8; } if (xAux >= 0x100) { xAux >>= 8; result <<= 4; } if (xAux >= 0x10) { xAux >>= 4; result <<= 2; } if (xAux >= 0x8) { result <<= 1; } // The operations can never overflow because the result is max 2^127 when it enters this block. unchecked { result = (result + x / result) >> 1; result = (result + x / result) >> 1; result = (result + x / result) >> 1; result = (result + x / result) >> 1; result = (result + x / result) >> 1; result = (result + x / result) >> 1; result = (result + x / result) >> 1; // Seven iterations should be enough uint256 roundedDownResult = x / result; return result >= roundedDownResult ? roundedDownResult : result; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) 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 // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) 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 // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) 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 // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @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 * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 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 // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) 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); /** * @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 // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) 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 // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol) 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 // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol) 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 // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) 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); }
{ "optimizer": { "enabled": true, "runs": 100000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"devAddress","type":"address"},{"internalType":"uint16","name":"maxSupply","type":"uint16"},{"internalType":"uint16","name":"walletMax","type":"uint16"},{"internalType":"uint16","name":"whitelistMax","type":"uint16"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"presaleMintStart","type":"uint256"},{"internalType":"uint256","name":"presaleResetTime","type":"uint256"},{"internalType":"uint256","name":"presaleMintEnd","type":"uint256"},{"internalType":"uint256","name":"publicMintStart","type":"uint256"},{"internalType":"string","name":"baseUri","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintIdOutOfRange","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"MintedQueryForZeroAddress","type":"error"},{"inputs":[],"name":"OwnerIndexOutOfBounds","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[{"internalType":"uint256","name":"prod1","type":"uint256"}],"name":"PRBMath__MulDivFixedPointOverflow","type":"error"},{"inputs":[],"name":"TokenIndexOutOfBounds","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousDeveloper","type":"address"},{"indexed":true,"internalType":"address","name":"newDeveloper","type":"address"}],"name":"DevelopershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"developer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"bool","name":"postReset","type":"bool"}],"name":"getPresaleMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getPublicMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerWallet","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxWhitelistSupply","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maximumSupply","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"amount","type":"uint16"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"quantity","type":"uint64"},{"internalType":"address","name":"to","type":"address"}],"name":"ownerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"amount","type":"uint16"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"premint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"publicStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceDevelopership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","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":"uint16","name":"newMax","type":"uint16"}],"name":"setMaxPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"root","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"wlStartDate","type":"uint256"},{"internalType":"uint256","name":"wlResetDate","type":"uint256"},{"internalType":"uint256","name":"wlEndDate","type":"uint256"},{"internalType":"uint256","name":"pubStartDate","type":"uint256"}],"name":"setMintDates","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"max","type":"uint16"}],"name":"setWhitelistMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newDeveloper","type":"address"}],"name":"transferDevelopership","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":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"root","type":"bytes32"},{"internalType":"bytes32","name":"leaf","type":"bytes32"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"verify","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"whitelistEnd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistReset","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162004be738038062004be78339810160408190526200003491620008de565b604080518082018252600f81526e23b0b6b4b7339020b8329021b63ab160891b60208083019182528351808501909452600384526247414360e81b9084015281518d939162000087916001919062000746565b5080516200009d90600290602084019062000746565b505050620000ba620000b4620001e360201b60201c565b620001e7565b620000c58162000239565b506001600981905561ffff8a161015620001135760405162461bcd60e51b815260206004820152600a60248201526942616420737570706c7960b01b60448201526064015b60405180910390fd5b8861ffff168761ffff1611156200015a5760405162461bcd60e51b815260206004820152600a602482015269084c2c840eed840dac2f60b31b60448201526064016200010a565b60118054600b88905565ffffffff000019166201000061ffff8c81169190910261ffff60201b1916919091176401000000008b8316021761ffff1916908916179055600c859055600d849055600e839055600f8290558051620001c590601090602084019062000746565b50620001d36001336200028b565b5050505050505050505062000aa3565b3390565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fede61b2c1b6ea8932acda2da1fa8be10c31d93a5ef149f84a2a04c178054044990600090a35050565b6007546001600160a01b03163314620002e75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200010a565b60008054601154620003079161ffff9081169162010000900416620009a7565b61ffff169050600081116200034b5760405162461bcd60e51b815260206004820152600960248201526826b4b73a1037bb32b960b91b60448201526064016200010a565b80836001600160401b03161115620003935760405162461bcd60e51b815260206004820152600a60248201526909cdee840cadcdeeaced60b31b60448201526064016200010a565b620003c33083856001600160401b03166040518060200160405280600081525060016000620003c860201b60201c565b505050565b6001600160a01b038516620003ef57604051622e076360e81b815260040160405180910390fd5b836200040e5760405163b562e8dd60e01b815260040160405180910390fd5b60038160ff16106200043357604051631790624160e31b815260040160405180910390fd5b600080546001600160a01b038716825260046020526040909120805461ffff19811661ffff91821688018216179091551660ff8216620004ae576001600160a01b0387166000908152600460205260409020805461ffff640100000000808304821689019091160261ffff60201b1990911617905562000537565b8160ff1660011415620004fe576001600160a01b0387166000908152600460205260409020805461ffff6601000000000000808304821689019091160261ffff60301b1990911617905562000537565b6001600160a01b0387166000908152600460205260409020805461ffff62010000808304821689019091160263ffff0000199091161790555b8060005b868161ffff161015620005e85761ffff821660008181526003602052604080822080546001600160a01b0319166001600160a01b038d1690811790915590519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4848015620005bc5750620005ba600089848962000608565b155b15620005db576040516368d2bf6b60e11b815260040160405180910390fd5b600191820191016200053b565b506000805461ffff191661ffff9290921691909117905550505050505050565b600062000629846001600160a01b03166200073760201b6200296b1760201c565b156200072b57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029062000663903390899088908890600401620009d9565b602060405180830381600087803b1580156200067e57600080fd5b505af1925050508015620006b1575060408051601f3d908101601f19168201909252620006ae9181019062000a33565b60015b62000710573d808015620006e2576040519150601f19603f3d011682016040523d82523d6000602084013e620006e7565b606091505b50805162000708576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506200072f565b5060015b949350505050565b6001600160a01b03163b151590565b828054620007549062000a66565b90600052602060002090601f016020900481019282620007785760008555620007c3565b82601f106200079357805160ff1916838001178555620007c3565b82800160010185558215620007c3579182015b82811115620007c3578251825591602001919060010190620007a6565b50620007d1929150620007d5565b5090565b5b80821115620007d15760008155600101620007d6565b805161ffff81168114620007ff57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620008375781810151838201526020016200081d565b8381111562000847576000848401525b50505050565b600082601f8301126200085f57600080fd5b81516001600160401b03808211156200087c576200087c62000804565b604051601f8301601f19908116603f01168101908282118183101715620008a757620008a762000804565b81604052838152866020858801011115620008c157600080fd5b620008d48460208301602089016200081a565b9695505050505050565b6000806000806000806000806000806101408b8d031215620008ff57600080fd5b8a516001600160a01b03811681146200091757600080fd5b99506200092760208c01620007ec565b98506200093760408c01620007ec565b97506200094760608c01620007ec565b965060808b0151955060a08b0151945060c08b0151935060e08b015192506101008b015191506101208b015160018060401b038111156200098757600080fd5b620009958d828e016200084d565b9150509295989b9194979a5092959850565b600061ffff83811690831681811015620009d157634e487b7160e01b600052601160045260246000fd5b039392505050565b600060018060a01b03808716835280861660208401525061ffff8416604083015260806060830152825180608084015262000a1c8160a08501602087016200081a565b601f01601f19169190910160a00195945050505050565b60006020828403121562000a4657600080fd5b81516001600160e01b03198116811462000a5f57600080fd5b9392505050565b600181811c9082168062000a7b57607f821691505b6020821081141562000a9d57634e487b7160e01b600052602260045260246000fd5b50919050565b6141348062000ab36000396000f3fe6080604052600436106102eb5760003560e01c80636817c76c11610184578063a5f4c6ff116100d6578063ca4b208b1161008a578063f2fde38b11610064578063f2fde38b14610852578063f4a0a52814610872578063f4b1bfaf1461089257600080fd5b8063ca4b208b146107b1578063e985e9c5146107dc578063e9893cde1461083257600080fd5b8063b88d4fde116100bb578063b88d4fde1461075b578063bfb6e0e71461077b578063c87b56dd1461079157600080fd5b8063a5f4c6ff14610725578063af23ee331461073b57600080fd5b80638da5cb5b11610138578063994d396911610112578063994d3969146106cf5780639bbee240146106e5578063a22cb4651461070557600080fd5b80638da5cb5b14610674578063953f049d1461069f57806395d89b41146106ba57600080fd5b8063715018a611610169578063715018a61461062a5780637cb647591461063f5780638cc401d51461065f57600080fd5b80636817c76c146105f457806370a082311461060a57600080fd5b80633423e5481161023d57806342966c68116101f15780634f6ccce7116101cb5780634f6ccce71461059457806355f804b3146105b45780636352211e146105d457600080fd5b806342966c6814610531578063453c2310146105515780634d56f8f51461057457600080fd5b806341644d121161022257806341644d12146104db578063424aade7146104fb57806342842e0e1461051157600080fd5b80633423e548146104a65780633ccfd60b146104c657600080fd5b8063095ea7b31161029f57806323b872dd1161027957806323b872dd1461045357806323cf0a22146104735780632f745c591461048657600080fd5b8063095ea7b3146103dc57806318160ddd146103fc5780631c88ce001461043357600080fd5b80630480e58b116102d05780630480e58b1461034157806306fdde0314610375578063081812fc1461039757600080fd5b806301c85955146102f757806301ffc9a71461030c57600080fd5b366102f257005b600080fd5b61030a610305366004613a2d565b6108b2565b005b34801561031857600080fd5b5061032c610327366004613aa9565b610d24565b60405190151581526020015b60405180910390f35b34801561034d57600080fd5b506011546103629062010000900461ffff1681565b60405161ffff9091168152602001610338565b34801561038157600080fd5b5061038a610e55565b6040516103389190613b3c565b3480156103a357600080fd5b506103b76103b2366004613b4f565b610ee7565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610338565b3480156103e857600080fd5b5061030a6103f7366004613b8c565b610f55565b34801561040857600080fd5b5061042560005461ffff6201000082048116918116919091031690565b604051908152602001610338565b34801561043f57600080fd5b5061030a61044e366004613bb6565b61103c565b34801561045f57600080fd5b5061030a61046e366004613bf8565b6111e8565b61030a610481366004613c34565b6111f3565b34801561049257600080fd5b506104256104a1366004613b8c565b6114ef565b3480156104b257600080fd5b5061032c6104c1366004613c4f565b6115b4565b3480156104d257600080fd5b5061030a611663565b3480156104e757600080fd5b5061030a6104f6366004613c34565b611b36565b34801561050757600080fd5b50610425600d5481565b34801561051d57600080fd5b5061030a61052c366004613bf8565b611cae565b34801561053d57600080fd5b5061030a61054c366004613b4f565b611cc9565b34801561055d57600080fd5b5060115461036290640100000000900461ffff1681565b34801561058057600080fd5b5061030a61058f366004613c9f565b611d5c565b3480156105a057600080fd5b506104256105af366004613b4f565b611e39565b3480156105c057600080fd5b5061030a6105cf366004613cd1565b611ee0565b3480156105e057600080fd5b506103b76105ef366004613b4f565b611fb5565b34801561060057600080fd5b50610425600b5481565b34801561061657600080fd5b50610425610625366004613d43565b612080565b34801561063657600080fd5b5061030a6120fc565b34801561064b57600080fd5b5061030a61065a366004613b4f565b612187565b34801561066b57600080fd5b5061030a612255565b34801561068057600080fd5b5060075473ffffffffffffffffffffffffffffffffffffffff166103b7565b3480156106ab57600080fd5b506011546103629061ffff1681565b3480156106c657600080fd5b5061038a612305565b3480156106db57600080fd5b50610425600c5481565b3480156106f157600080fd5b5061030a610700366004613d43565b612314565b34801561071157600080fd5b5061030a610720366004613d5e565b612466565b34801561073157600080fd5b50610425600f5481565b34801561074757600080fd5b5061030a610756366004613c34565b61254d565b34801561076757600080fd5b5061030a610776366004613d9a565b612653565b34801561078757600080fd5b50610425600e5481565b34801561079d57600080fd5b5061038a6107ac366004613b4f565b6126a6565b3480156107bd57600080fd5b5060085473ffffffffffffffffffffffffffffffffffffffff166103b7565b3480156107e857600080fd5b5061032c6107f7366004613e78565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260066020908152604080832093909416825291909152205460ff1690565b34801561083e57600080fd5b5061042561084d366004613d43565b612744565b34801561085e57600080fd5b5061030a61086d366004613d43565b61274f565b34801561087e57600080fd5b5061030a61088d366004613b4f565b61287c565b34801561089e57600080fd5b506104256108ad366004613d5e565b61294a565b60026009541415610924576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600955600080546011546109419161ffff9081169116613ec3565b61ffff169050600081116109b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4d696e74206f7665720000000000000000000000000000000000000000000000604482015260640161091b565b8261ffff16811015610a1f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e7375662e20616d6f756e7400000000000000000000000000000000000000604482015260640161091b565b600a546040517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003360601b166020820152610a74919060340160405160208183030381529060405280519060200120846115b4565b610ada576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c69642070726f6f6600000000000000000000000000000000000000604482015260640161091b565b348361ffff16600b54610aed9190613ee6565b14610b54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4261642076616c75650000000000000000000000000000000000000000000000604482015260640161091b565b600d544210801590610bf45760115461ffff6401000000009091048116908516610b7d33612987565b610b879190613f23565b1115610bef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4c696d6974206578636565646564000000000000000000000000000000000000604482015260640161091b565b610c83565b60115461ffff6401000000009091048116908516610c1133612a0d565b610c1b9190613f23565b1115610c83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4c696d6974206578636565646564000000000000000000000000000000000000604482015260640161091b565b42600c5411158015610c97575042600e5410155b610cfd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600860248201527f496e616374697665000000000000000000000000000000000000000000000000604482015260640161091b565b610d19338561ffff1683610d12576000612a91565b6001612a91565b505060016009555050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480610db757507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610e0357507fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d6300000000000000000000000000000000000000000000000000000000145b80610e4f57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b606060018054610e6490613f3b565b80601f0160208091040260200160405190810160405280929190818152602001828054610e9090613f3b565b8015610edd5780601f10610eb257610100808354040283529160200191610edd565b820191906000526020600020905b815481529060010190602001808311610ec057829003601f168201915b5050505050905090565b6000610ef282612aac565b610f28576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5061ffff1660009081526005602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b6000610f6082611fb5565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fc8576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff821614801590610ff55750610ff381336107f7565b155b1561102c576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611037838383612aff565b505050565b60075473ffffffffffffffffffffffffffffffffffffffff1633146110bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161091b565b600080546011546110db9161ffff9081169162010000900416613ec3565b61ffff1690506000811161114b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4d696e74206f7665720000000000000000000000000000000000000000000000604482015260640161091b565b808367ffffffffffffffff1611156111bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e6f7420656e6f75676800000000000000000000000000000000000000000000604482015260640161091b565b61103730838567ffffffffffffffff166040518060200160405280600081525060016000612b86565b611037838383612f0d565b60026009541415611260576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161091b565b6002600955600080546011546112839161ffff9081169162010000900416613ec3565b61ffff169050600081116112f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4d696e74206f7665720000000000000000000000000000000000000000000000604482015260640161091b565b8161ffff16811015611361576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e7375662e20616d6f756e7400000000000000000000000000000000000000604482015260640161091b565b60115461ffff640100000000909104811690831661137e33613162565b6113889190613f23565b11156113f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4c696d6974206578636565646564000000000000000000000000000000000000604482015260640161091b565b348261ffff16600b546114039190613ee6565b1461146a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4261642076616c75650000000000000000000000000000000000000000000000604482015260640161091b565b600f544210156114d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600860248201527f496e616374697665000000000000000000000000000000000000000000000000604482015260640161091b565b6114e6338361ffff166002612a91565b50506001600955565b60006114fa83612080565b8210611532576040517f0ddac30e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805461ffff1690805b8261ffff168161ffff1610156115ae5761ffff811660009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff9081169087168114156115a557858361ffff16141561159e575061ffff169250610e4f915050565b6001909201915b5060010161153d565b50600080fd5b600082815b83518110156116585760008482815181106115d6576115d6613f8f565b60200260200101519050808311611618576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250611645565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b508061165081613fbe565b9150506115b9565b509093149392505050565b60085473ffffffffffffffffffffffffffffffffffffffff163314806116a0575060075473ffffffffffffffffffffffffffffffffffffffff1633145b61172c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201527f206f7220646576656c6f70657200000000000000000000000000000000000000606482015260840161091b565b476000734c21f55d3ef836adefc5b0a9c9c6908c4f8bd545611760611759662386f26fc100006055613ee6565b84906131e4565b604051600081818185875af1925050503d806000811461179c576040519150601f19603f3d011682016040523d82523d6000602084013e6117a1565b606091505b5090915060009050737436f0949bca6b6c6fd766b6b9aa57417b0314a96117da6117d3662386f26fc100006004613ee6565b85906131e4565b604051600081818185875af1925050503d8060008114611816576040519150601f19603f3d011682016040523d82523d6000602084013e61181b565b606091505b50909150600090507313c4d22a8dbb2559b516e10fe0de47ba4b4a03eb61185461184d662386f26fc100006003613ee6565b86906131e4565b604051600081818185875af1925050503d8060008114611890576040519150601f19603f3d011682016040523d82523d6000602084013e611895565b606091505b509091506000905073b3d665d27a1ae8f2f3c32cb1178c9e749ce007146118ce6118c7662386f26fc100006003613ee6565b87906131e4565b604051600081818185875af1925050503d806000811461190a576040519150601f19603f3d011682016040523d82523d6000602084013e61190f565b606091505b509091506000905073470049b45a5f05c84e9285cb467642733450ace5611948611941662386f26fc100006003613ee6565b88906131e4565b604051600081818185875af1925050503d8060008114611984576040519150601f19603f3d011682016040523d82523d6000602084013e611989565b606091505b509091506000905073cbff601c8745a86e39d9dcb4725b7e6019f5e4fe6119c26119bb662386f26fc100006002613ee6565b89906131e4565b604051600081818185875af1925050503d80600081146119fe576040519150601f19603f3d011682016040523d82523d6000602084013e611a03565b606091505b50509050858015611a115750845b8015611a1a5750835b8015611a235750825b8015611a2c5750815b8015611a355750805b15611a435750505050505050565b6000611a6460075473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff168860405160006040518083038185875af1925050503d8060008114611abb576040519150601f19603f3d011682016040523d82523d6000602084013e611ac0565b606091505b5050905080611b2b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f5061796d656e74206661696c6564000000000000000000000000000000000000604482015260640161091b565b50505050505050505b565b60085473ffffffffffffffffffffffffffffffffffffffff16331480611b73575060075473ffffffffffffffffffffffffffffffffffffffff1633145b611bff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201527f206f7220646576656c6f70657200000000000000000000000000000000000000606482015260840161091b565b60115461ffff6201000090910481169082161115611c79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f42616420776c206d617800000000000000000000000000000000000000000000604482015260640161091b565b601180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff92909216919091179055565b61103783838360405180602001604052806000815250612653565b33611cd382611fb5565b73ffffffffffffffffffffffffffffffffffffffff1614611d50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f74206f776e65720000000000000000000000000000000000000000000000604482015260640161091b565b611d59816131f0565b50565b60085473ffffffffffffffffffffffffffffffffffffffff16331480611d99575060075473ffffffffffffffffffffffffffffffffffffffff1633145b611e25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201527f206f7220646576656c6f70657200000000000000000000000000000000000000606482015260840161091b565b600c93909355600d91909155600e55600f55565b6000805461ffff1681805b8261ffff168161ffff161015611ead5761ffff811660009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff168015611ea457858361ffff161415611e9d575061ffff16949350505050565b6001909201915b50600101611e44565b506040517fa723001c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60085473ffffffffffffffffffffffffffffffffffffffff16331480611f1d575060075473ffffffffffffffffffffffffffffffffffffffff1633145b611fa9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201527f206f7220646576656c6f70657200000000000000000000000000000000000000606482015260840161091b565b61103760108383613861565b600061ffff821115611ff3576040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff821660009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff16612053576040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5061ffff1660009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b600073ffffffffffffffffffffffffffffffffffffffff82166120cf576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5073ffffffffffffffffffffffffffffffffffffffff1660009081526004602052604090205461ffff1690565b60075473ffffffffffffffffffffffffffffffffffffffff16331461217d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161091b565b611b346000613366565b60085473ffffffffffffffffffffffffffffffffffffffff163314806121c4575060075473ffffffffffffffffffffffffffffffffffffffff1633145b612250576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201527f206f7220646576656c6f70657200000000000000000000000000000000000000606482015260840161091b565b600a55565b60085473ffffffffffffffffffffffffffffffffffffffff1633146122fb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520646576656c60448201527f6f70657200000000000000000000000000000000000000000000000000000000606482015260840161091b565b611b3460006133dd565b606060028054610e6490613f3b565b60085473ffffffffffffffffffffffffffffffffffffffff1633146123ba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520646576656c60448201527f6f70657200000000000000000000000000000000000000000000000000000000606482015260840161091b565b73ffffffffffffffffffffffffffffffffffffffff811661245d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4f776e61626c653a206e657720646576656c6f70657220697320746865207a6560448201527f726f206164647265737300000000000000000000000000000000000000000000606482015260840161091b565b611d59816133dd565b73ffffffffffffffffffffffffffffffffffffffff82163314156124b6576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600081815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60085473ffffffffffffffffffffffffffffffffffffffff1633148061258a575060075473ffffffffffffffffffffffffffffffffffffffff1633145b612616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201527f206f7220646576656c6f70657200000000000000000000000000000000000000606482015260840161091b565b6011805461ffff909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffff909216919091179055565b61265e848484612f0d565b61266a84848484613454565b6126a0576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b60606126b182612aac565b6126e7576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006126f16135fe565b9050805160001415612712576040518060200160405280600081525061273d565b8061271c8461360d565b60405160200161272d929190613ff7565b6040516020818303038152906040525b9392505050565b6000610e4f82613162565b60075473ffffffffffffffffffffffffffffffffffffffff1633146127d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161091b565b73ffffffffffffffffffffffffffffffffffffffff8116612873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161091b565b611d5981613366565b60085473ffffffffffffffffffffffffffffffffffffffff163314806128b9575060075473ffffffffffffffffffffffffffffffffffffffff1633145b612945576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201527f206f7220646576656c6f70657200000000000000000000000000000000000000606482015260840161091b565b600b55565b600081156129625761295b83612987565b9050610e4f565b61273d83612a0d565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b600073ffffffffffffffffffffffffffffffffffffffff82166129d6576040517f35ebb31900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5073ffffffffffffffffffffffffffffffffffffffff166000908152600460205260409020546601000000000000900461ffff1690565b600073ffffffffffffffffffffffffffffffffffffffff8216612a5c576040517f35ebb31900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5073ffffffffffffffffffffffffffffffffffffffff16600090815260046020526040902054640100000000900461ffff1690565b6110378383604051806020016040528060008152508461373f565b600061ffff821115612ac057506000919050565b60005461ffff1682108015610e4f57505061ffff1660009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff16151590565b61ffff821660008181526005602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88811691821790925591519192908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a4505050565b73ffffffffffffffffffffffffffffffffffffffff8516612bd3576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83612c0a576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60038160ff1610612c47576040517fbc83120800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805473ffffffffffffffffffffffffffffffffffffffff871682526004602052604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000811661ffff91821688018216179091551660ff8216612d115773ffffffffffffffffffffffffffffffffffffffff87166000908152600460205260409020805461ffff64010000000080830482168901909116027fffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffff909116179055612de7565b8160ff1660011415612d865773ffffffffffffffffffffffffffffffffffffffff87166000908152600460205260409020805461ffff660100000000000080830482168901909116027fffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffff909116179055612de7565b73ffffffffffffffffffffffffffffffffffffffff87166000908152600460205260409020805461ffff6201000080830482168901909116027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffff9091161790555b8060005b868161ffff161015612ed05761ffff821660008181526003602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8d1690811790915590519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4848015612e8d5750612e8b6000898489613454565b155b15612ec4576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60019182019101612deb565b50600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff9290921691909117905550505050505050565b6000612f1882611fb5565b905060003373ffffffffffffffffffffffffffffffffffffffff83161480612f455750612f4582336107f7565b80612f6d575033612f5584610ee7565b73ffffffffffffffffffffffffffffffffffffffff16145b905080612fa6576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461300b576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8416613058576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61306460008484612aff565b73ffffffffffffffffffffffffffffffffffffffff858116600081815260046020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000080821661ffff9283167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01831617909255958a1680855282852080549283169288166001018816929092179091559488168352600390915280822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168517905551869392917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a45050505050565b600073ffffffffffffffffffffffffffffffffffffffff82166131b1576040517f35ebb31900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5073ffffffffffffffffffffffffffffffffffffffff1660009081526004602052604090205462010000900461ffff1690565b600061273d838361374e565b60006131fb82611fb5565b905061320960008383612aff565b73ffffffffffffffffffffffffffffffffffffffff8116600081815260046020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffff0000811661ffff8083167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0181169182176001680100000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000090951690931784900482169290920181169092021790915586168352600390915280822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055518492907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a4505060008054600161ffff6201000080840482169290920116027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffff909116179055565b6007805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6008805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907fede61b2c1b6ea8932acda2da1fa8be10c31d93a5ef149f84a2a04c178054044990600090a35050565b600073ffffffffffffffffffffffffffffffffffffffff84163b156135f2576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a02906134cb903390899088908890600401614026565b602060405180830381600087803b1580156134e557600080fd5b505af1925050508015613533575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261353091810190614073565b60015b6135a7573d808015613561576040519150601f19603f3d011682016040523d82523d6000602084013e613566565b606091505b50805161359f576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a02000000000000000000000000000000000000000000000000000000001490506135f6565b5060015b949350505050565b606060108054610e6490613f3b565b60608161364d57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115613677578061366181613fbe565b91506136709050600a836140bf565b9150613651565b60008167ffffffffffffffff8111156136925761369261392f565b6040519080825280601f01601f1916602001820160405280156136bc576020820181803683370190505b5090505b84156135f6576136d16001836140d3565b91506136de600a866140ea565b6136e9906030613f23565b60f81b8183815181106136fe576136fe613f8f565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350613738600a866140bf565b94506136c0565b6126a084858585600186612b86565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848609848602925082811083820303915050670de0b6b3a764000081106137c9576040517fd31b34020000000000000000000000000000000000000000000000000000000081526004810182905260240161091b565b600080670de0b6b3a76400008688099150506706f05b59d3b1ffff8111826138035780670de0b6b3a7640000850401945050505050610e4f565b6204000082850304939091119091037d40000000000000000000000000000000000000000000000000000000000002919091177faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac106690201905092915050565b82805461386d90613f3b565b90600052602060002090601f01602090048101928261388f57600085556138f3565b82601f106138c6578280017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008235161785556138f3565b828001600101855582156138f3579182015b828111156138f35782358255916020019190600101906138d8565b506138ff929150613903565b5090565b5b808211156138ff5760008155600101613904565b803561ffff8116811461392a57600080fd5b919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156139a5576139a561392f565b604052919050565b600082601f8301126139be57600080fd5b8135602067ffffffffffffffff8211156139da576139da61392f565b8160051b6139e982820161395e565b9283528481018201928281019087851115613a0357600080fd5b83870192505b84831015613a2257823582529183019190830190613a09565b979650505050505050565b60008060408385031215613a4057600080fd5b613a4983613918565b9150602083013567ffffffffffffffff811115613a6557600080fd5b613a71858286016139ad565b9150509250929050565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114611d5957600080fd5b600060208284031215613abb57600080fd5b813561273d81613a7b565b60005b83811015613ae1578181015183820152602001613ac9565b838111156126a05750506000910152565b60008151808452613b0a816020860160208601613ac6565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061273d6020830184613af2565b600060208284031215613b6157600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461392a57600080fd5b60008060408385031215613b9f57600080fd5b613ba883613b68565b946020939093013593505050565b60008060408385031215613bc957600080fd5b823567ffffffffffffffff81168114613be157600080fd5b9150613bef60208401613b68565b90509250929050565b600080600060608486031215613c0d57600080fd5b613c1684613b68565b9250613c2460208501613b68565b9150604084013590509250925092565b600060208284031215613c4657600080fd5b61273d82613918565b600080600060608486031215613c6457600080fd5b8335925060208401359150604084013567ffffffffffffffff811115613c8957600080fd5b613c95868287016139ad565b9150509250925092565b60008060008060808587031215613cb557600080fd5b5050823594602084013594506040840135936060013592509050565b60008060208385031215613ce457600080fd5b823567ffffffffffffffff80821115613cfc57600080fd5b818501915085601f830112613d1057600080fd5b813581811115613d1f57600080fd5b866020828501011115613d3157600080fd5b60209290920196919550909350505050565b600060208284031215613d5557600080fd5b61273d82613b68565b60008060408385031215613d7157600080fd5b613d7a83613b68565b915060208301358015158114613d8f57600080fd5b809150509250929050565b60008060008060808587031215613db057600080fd5b613db985613b68565b93506020613dc8818701613b68565b935060408601359250606086013567ffffffffffffffff80821115613dec57600080fd5b818801915088601f830112613e0057600080fd5b813581811115613e1257613e1261392f565b613e42847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161395e565b91508082528984828501011115613e5857600080fd5b808484018584013760008482840101525080935050505092959194509250565b60008060408385031215613e8b57600080fd5b613be183613b68565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061ffff83811690831681811015613ede57613ede613e94565b039392505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613f1e57613f1e613e94565b500290565b60008219821115613f3657613f36613e94565b500190565b600181811c90821680613f4f57607f821691505b60208210811415613f89577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613ff057613ff0613e94565b5060010190565b60008351614009818460208801613ac6565b83519083019061401d818360208801613ac6565b01949350505050565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525061ffff84166040830152608060608301526140696080830184613af2565b9695505050505050565b60006020828403121561408557600080fd5b815161273d81613a7b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826140ce576140ce614090565b500490565b6000828210156140e5576140e5613e94565b500390565b6000826140f9576140f9614090565b50069056fea2646970667358221220fd22a32b88f4ef4f229f20e580855a29fbc25b8679c9a6f3290a5bf806fcbb4364736f6c63430008090033000000000000000000000000cbff601c8745a86e39d9dcb4725b7e6019f5e4fe0000000000000000000000000000000000000000000000000000000000001996000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000017a2000000000000000000000000000000000000000000000000011c37937e08000000000000000000000000000000000000000000000000000000000000623c877000000000000000000000000000000000000000000000000000000000623ca39000000000000000000000000000000000000000000000000000000000623cbfb000000000000000000000000000000000000000000000000000000000623cbfb00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000005768747470733a2f2f63635f6e667473746f72652e6d7970696e6174612e636c6f75642f697066732f516d5150384173425575586b4e4756723951396f6a4332556136727a675553476a397141327a78616f47526b754c2f000000000000000000
Deployed Bytecode
0x6080604052600436106102eb5760003560e01c80636817c76c11610184578063a5f4c6ff116100d6578063ca4b208b1161008a578063f2fde38b11610064578063f2fde38b14610852578063f4a0a52814610872578063f4b1bfaf1461089257600080fd5b8063ca4b208b146107b1578063e985e9c5146107dc578063e9893cde1461083257600080fd5b8063b88d4fde116100bb578063b88d4fde1461075b578063bfb6e0e71461077b578063c87b56dd1461079157600080fd5b8063a5f4c6ff14610725578063af23ee331461073b57600080fd5b80638da5cb5b11610138578063994d396911610112578063994d3969146106cf5780639bbee240146106e5578063a22cb4651461070557600080fd5b80638da5cb5b14610674578063953f049d1461069f57806395d89b41146106ba57600080fd5b8063715018a611610169578063715018a61461062a5780637cb647591461063f5780638cc401d51461065f57600080fd5b80636817c76c146105f457806370a082311461060a57600080fd5b80633423e5481161023d57806342966c68116101f15780634f6ccce7116101cb5780634f6ccce71461059457806355f804b3146105b45780636352211e146105d457600080fd5b806342966c6814610531578063453c2310146105515780634d56f8f51461057457600080fd5b806341644d121161022257806341644d12146104db578063424aade7146104fb57806342842e0e1461051157600080fd5b80633423e548146104a65780633ccfd60b146104c657600080fd5b8063095ea7b31161029f57806323b872dd1161027957806323b872dd1461045357806323cf0a22146104735780632f745c591461048657600080fd5b8063095ea7b3146103dc57806318160ddd146103fc5780631c88ce001461043357600080fd5b80630480e58b116102d05780630480e58b1461034157806306fdde0314610375578063081812fc1461039757600080fd5b806301c85955146102f757806301ffc9a71461030c57600080fd5b366102f257005b600080fd5b61030a610305366004613a2d565b6108b2565b005b34801561031857600080fd5b5061032c610327366004613aa9565b610d24565b60405190151581526020015b60405180910390f35b34801561034d57600080fd5b506011546103629062010000900461ffff1681565b60405161ffff9091168152602001610338565b34801561038157600080fd5b5061038a610e55565b6040516103389190613b3c565b3480156103a357600080fd5b506103b76103b2366004613b4f565b610ee7565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610338565b3480156103e857600080fd5b5061030a6103f7366004613b8c565b610f55565b34801561040857600080fd5b5061042560005461ffff6201000082048116918116919091031690565b604051908152602001610338565b34801561043f57600080fd5b5061030a61044e366004613bb6565b61103c565b34801561045f57600080fd5b5061030a61046e366004613bf8565b6111e8565b61030a610481366004613c34565b6111f3565b34801561049257600080fd5b506104256104a1366004613b8c565b6114ef565b3480156104b257600080fd5b5061032c6104c1366004613c4f565b6115b4565b3480156104d257600080fd5b5061030a611663565b3480156104e757600080fd5b5061030a6104f6366004613c34565b611b36565b34801561050757600080fd5b50610425600d5481565b34801561051d57600080fd5b5061030a61052c366004613bf8565b611cae565b34801561053d57600080fd5b5061030a61054c366004613b4f565b611cc9565b34801561055d57600080fd5b5060115461036290640100000000900461ffff1681565b34801561058057600080fd5b5061030a61058f366004613c9f565b611d5c565b3480156105a057600080fd5b506104256105af366004613b4f565b611e39565b3480156105c057600080fd5b5061030a6105cf366004613cd1565b611ee0565b3480156105e057600080fd5b506103b76105ef366004613b4f565b611fb5565b34801561060057600080fd5b50610425600b5481565b34801561061657600080fd5b50610425610625366004613d43565b612080565b34801561063657600080fd5b5061030a6120fc565b34801561064b57600080fd5b5061030a61065a366004613b4f565b612187565b34801561066b57600080fd5b5061030a612255565b34801561068057600080fd5b5060075473ffffffffffffffffffffffffffffffffffffffff166103b7565b3480156106ab57600080fd5b506011546103629061ffff1681565b3480156106c657600080fd5b5061038a612305565b3480156106db57600080fd5b50610425600c5481565b3480156106f157600080fd5b5061030a610700366004613d43565b612314565b34801561071157600080fd5b5061030a610720366004613d5e565b612466565b34801561073157600080fd5b50610425600f5481565b34801561074757600080fd5b5061030a610756366004613c34565b61254d565b34801561076757600080fd5b5061030a610776366004613d9a565b612653565b34801561078757600080fd5b50610425600e5481565b34801561079d57600080fd5b5061038a6107ac366004613b4f565b6126a6565b3480156107bd57600080fd5b5060085473ffffffffffffffffffffffffffffffffffffffff166103b7565b3480156107e857600080fd5b5061032c6107f7366004613e78565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260066020908152604080832093909416825291909152205460ff1690565b34801561083e57600080fd5b5061042561084d366004613d43565b612744565b34801561085e57600080fd5b5061030a61086d366004613d43565b61274f565b34801561087e57600080fd5b5061030a61088d366004613b4f565b61287c565b34801561089e57600080fd5b506104256108ad366004613d5e565b61294a565b60026009541415610924576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600955600080546011546109419161ffff9081169116613ec3565b61ffff169050600081116109b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4d696e74206f7665720000000000000000000000000000000000000000000000604482015260640161091b565b8261ffff16811015610a1f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e7375662e20616d6f756e7400000000000000000000000000000000000000604482015260640161091b565b600a546040517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003360601b166020820152610a74919060340160405160208183030381529060405280519060200120846115b4565b610ada576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c69642070726f6f6600000000000000000000000000000000000000604482015260640161091b565b348361ffff16600b54610aed9190613ee6565b14610b54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4261642076616c75650000000000000000000000000000000000000000000000604482015260640161091b565b600d544210801590610bf45760115461ffff6401000000009091048116908516610b7d33612987565b610b879190613f23565b1115610bef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4c696d6974206578636565646564000000000000000000000000000000000000604482015260640161091b565b610c83565b60115461ffff6401000000009091048116908516610c1133612a0d565b610c1b9190613f23565b1115610c83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4c696d6974206578636565646564000000000000000000000000000000000000604482015260640161091b565b42600c5411158015610c97575042600e5410155b610cfd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600860248201527f496e616374697665000000000000000000000000000000000000000000000000604482015260640161091b565b610d19338561ffff1683610d12576000612a91565b6001612a91565b505060016009555050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480610db757507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610e0357507fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d6300000000000000000000000000000000000000000000000000000000145b80610e4f57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b606060018054610e6490613f3b565b80601f0160208091040260200160405190810160405280929190818152602001828054610e9090613f3b565b8015610edd5780601f10610eb257610100808354040283529160200191610edd565b820191906000526020600020905b815481529060010190602001808311610ec057829003601f168201915b5050505050905090565b6000610ef282612aac565b610f28576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5061ffff1660009081526005602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b6000610f6082611fb5565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fc8576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff821614801590610ff55750610ff381336107f7565b155b1561102c576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611037838383612aff565b505050565b60075473ffffffffffffffffffffffffffffffffffffffff1633146110bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161091b565b600080546011546110db9161ffff9081169162010000900416613ec3565b61ffff1690506000811161114b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4d696e74206f7665720000000000000000000000000000000000000000000000604482015260640161091b565b808367ffffffffffffffff1611156111bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e6f7420656e6f75676800000000000000000000000000000000000000000000604482015260640161091b565b61103730838567ffffffffffffffff166040518060200160405280600081525060016000612b86565b611037838383612f0d565b60026009541415611260576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161091b565b6002600955600080546011546112839161ffff9081169162010000900416613ec3565b61ffff169050600081116112f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4d696e74206f7665720000000000000000000000000000000000000000000000604482015260640161091b565b8161ffff16811015611361576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e7375662e20616d6f756e7400000000000000000000000000000000000000604482015260640161091b565b60115461ffff640100000000909104811690831661137e33613162565b6113889190613f23565b11156113f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4c696d6974206578636565646564000000000000000000000000000000000000604482015260640161091b565b348261ffff16600b546114039190613ee6565b1461146a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4261642076616c75650000000000000000000000000000000000000000000000604482015260640161091b565b600f544210156114d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600860248201527f496e616374697665000000000000000000000000000000000000000000000000604482015260640161091b565b6114e6338361ffff166002612a91565b50506001600955565b60006114fa83612080565b8210611532576040517f0ddac30e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805461ffff1690805b8261ffff168161ffff1610156115ae5761ffff811660009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff9081169087168114156115a557858361ffff16141561159e575061ffff169250610e4f915050565b6001909201915b5060010161153d565b50600080fd5b600082815b83518110156116585760008482815181106115d6576115d6613f8f565b60200260200101519050808311611618576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250611645565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b508061165081613fbe565b9150506115b9565b509093149392505050565b60085473ffffffffffffffffffffffffffffffffffffffff163314806116a0575060075473ffffffffffffffffffffffffffffffffffffffff1633145b61172c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201527f206f7220646576656c6f70657200000000000000000000000000000000000000606482015260840161091b565b476000734c21f55d3ef836adefc5b0a9c9c6908c4f8bd545611760611759662386f26fc100006055613ee6565b84906131e4565b604051600081818185875af1925050503d806000811461179c576040519150601f19603f3d011682016040523d82523d6000602084013e6117a1565b606091505b5090915060009050737436f0949bca6b6c6fd766b6b9aa57417b0314a96117da6117d3662386f26fc100006004613ee6565b85906131e4565b604051600081818185875af1925050503d8060008114611816576040519150601f19603f3d011682016040523d82523d6000602084013e61181b565b606091505b50909150600090507313c4d22a8dbb2559b516e10fe0de47ba4b4a03eb61185461184d662386f26fc100006003613ee6565b86906131e4565b604051600081818185875af1925050503d8060008114611890576040519150601f19603f3d011682016040523d82523d6000602084013e611895565b606091505b509091506000905073b3d665d27a1ae8f2f3c32cb1178c9e749ce007146118ce6118c7662386f26fc100006003613ee6565b87906131e4565b604051600081818185875af1925050503d806000811461190a576040519150601f19603f3d011682016040523d82523d6000602084013e61190f565b606091505b509091506000905073470049b45a5f05c84e9285cb467642733450ace5611948611941662386f26fc100006003613ee6565b88906131e4565b604051600081818185875af1925050503d8060008114611984576040519150601f19603f3d011682016040523d82523d6000602084013e611989565b606091505b509091506000905073cbff601c8745a86e39d9dcb4725b7e6019f5e4fe6119c26119bb662386f26fc100006002613ee6565b89906131e4565b604051600081818185875af1925050503d80600081146119fe576040519150601f19603f3d011682016040523d82523d6000602084013e611a03565b606091505b50509050858015611a115750845b8015611a1a5750835b8015611a235750825b8015611a2c5750815b8015611a355750805b15611a435750505050505050565b6000611a6460075473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff168860405160006040518083038185875af1925050503d8060008114611abb576040519150601f19603f3d011682016040523d82523d6000602084013e611ac0565b606091505b5050905080611b2b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f5061796d656e74206661696c6564000000000000000000000000000000000000604482015260640161091b565b50505050505050505b565b60085473ffffffffffffffffffffffffffffffffffffffff16331480611b73575060075473ffffffffffffffffffffffffffffffffffffffff1633145b611bff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201527f206f7220646576656c6f70657200000000000000000000000000000000000000606482015260840161091b565b60115461ffff6201000090910481169082161115611c79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f42616420776c206d617800000000000000000000000000000000000000000000604482015260640161091b565b601180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff92909216919091179055565b61103783838360405180602001604052806000815250612653565b33611cd382611fb5565b73ffffffffffffffffffffffffffffffffffffffff1614611d50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f74206f776e65720000000000000000000000000000000000000000000000604482015260640161091b565b611d59816131f0565b50565b60085473ffffffffffffffffffffffffffffffffffffffff16331480611d99575060075473ffffffffffffffffffffffffffffffffffffffff1633145b611e25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201527f206f7220646576656c6f70657200000000000000000000000000000000000000606482015260840161091b565b600c93909355600d91909155600e55600f55565b6000805461ffff1681805b8261ffff168161ffff161015611ead5761ffff811660009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff168015611ea457858361ffff161415611e9d575061ffff16949350505050565b6001909201915b50600101611e44565b506040517fa723001c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60085473ffffffffffffffffffffffffffffffffffffffff16331480611f1d575060075473ffffffffffffffffffffffffffffffffffffffff1633145b611fa9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201527f206f7220646576656c6f70657200000000000000000000000000000000000000606482015260840161091b565b61103760108383613861565b600061ffff821115611ff3576040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff821660009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff16612053576040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5061ffff1660009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b600073ffffffffffffffffffffffffffffffffffffffff82166120cf576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5073ffffffffffffffffffffffffffffffffffffffff1660009081526004602052604090205461ffff1690565b60075473ffffffffffffffffffffffffffffffffffffffff16331461217d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161091b565b611b346000613366565b60085473ffffffffffffffffffffffffffffffffffffffff163314806121c4575060075473ffffffffffffffffffffffffffffffffffffffff1633145b612250576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201527f206f7220646576656c6f70657200000000000000000000000000000000000000606482015260840161091b565b600a55565b60085473ffffffffffffffffffffffffffffffffffffffff1633146122fb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520646576656c60448201527f6f70657200000000000000000000000000000000000000000000000000000000606482015260840161091b565b611b3460006133dd565b606060028054610e6490613f3b565b60085473ffffffffffffffffffffffffffffffffffffffff1633146123ba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4f776e61626c653a2063616c6c6572206973206e6f742074686520646576656c60448201527f6f70657200000000000000000000000000000000000000000000000000000000606482015260840161091b565b73ffffffffffffffffffffffffffffffffffffffff811661245d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4f776e61626c653a206e657720646576656c6f70657220697320746865207a6560448201527f726f206164647265737300000000000000000000000000000000000000000000606482015260840161091b565b611d59816133dd565b73ffffffffffffffffffffffffffffffffffffffff82163314156124b6576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600081815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60085473ffffffffffffffffffffffffffffffffffffffff1633148061258a575060075473ffffffffffffffffffffffffffffffffffffffff1633145b612616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201527f206f7220646576656c6f70657200000000000000000000000000000000000000606482015260840161091b565b6011805461ffff909216640100000000027fffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffff909216919091179055565b61265e848484612f0d565b61266a84848484613454565b6126a0576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b60606126b182612aac565b6126e7576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006126f16135fe565b9050805160001415612712576040518060200160405280600081525061273d565b8061271c8461360d565b60405160200161272d929190613ff7565b6040516020818303038152906040525b9392505050565b6000610e4f82613162565b60075473ffffffffffffffffffffffffffffffffffffffff1633146127d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161091b565b73ffffffffffffffffffffffffffffffffffffffff8116612873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161091b565b611d5981613366565b60085473ffffffffffffffffffffffffffffffffffffffff163314806128b9575060075473ffffffffffffffffffffffffffffffffffffffff1633145b612945576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201527f206f7220646576656c6f70657200000000000000000000000000000000000000606482015260840161091b565b600b55565b600081156129625761295b83612987565b9050610e4f565b61273d83612a0d565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b600073ffffffffffffffffffffffffffffffffffffffff82166129d6576040517f35ebb31900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5073ffffffffffffffffffffffffffffffffffffffff166000908152600460205260409020546601000000000000900461ffff1690565b600073ffffffffffffffffffffffffffffffffffffffff8216612a5c576040517f35ebb31900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5073ffffffffffffffffffffffffffffffffffffffff16600090815260046020526040902054640100000000900461ffff1690565b6110378383604051806020016040528060008152508461373f565b600061ffff821115612ac057506000919050565b60005461ffff1682108015610e4f57505061ffff1660009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff16151590565b61ffff821660008181526005602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88811691821790925591519192908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a4505050565b73ffffffffffffffffffffffffffffffffffffffff8516612bd3576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83612c0a576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60038160ff1610612c47576040517fbc83120800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805473ffffffffffffffffffffffffffffffffffffffff871682526004602052604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000811661ffff91821688018216179091551660ff8216612d115773ffffffffffffffffffffffffffffffffffffffff87166000908152600460205260409020805461ffff64010000000080830482168901909116027fffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffff909116179055612de7565b8160ff1660011415612d865773ffffffffffffffffffffffffffffffffffffffff87166000908152600460205260409020805461ffff660100000000000080830482168901909116027fffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffff909116179055612de7565b73ffffffffffffffffffffffffffffffffffffffff87166000908152600460205260409020805461ffff6201000080830482168901909116027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffff9091161790555b8060005b868161ffff161015612ed05761ffff821660008181526003602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8d1690811790915590519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4848015612e8d5750612e8b6000898489613454565b155b15612ec4576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60019182019101612deb565b50600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff9290921691909117905550505050505050565b6000612f1882611fb5565b905060003373ffffffffffffffffffffffffffffffffffffffff83161480612f455750612f4582336107f7565b80612f6d575033612f5584610ee7565b73ffffffffffffffffffffffffffffffffffffffff16145b905080612fa6576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461300b576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8416613058576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61306460008484612aff565b73ffffffffffffffffffffffffffffffffffffffff858116600081815260046020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000080821661ffff9283167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01831617909255958a1680855282852080549283169288166001018816929092179091559488168352600390915280822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168517905551869392917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a45050505050565b600073ffffffffffffffffffffffffffffffffffffffff82166131b1576040517f35ebb31900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5073ffffffffffffffffffffffffffffffffffffffff1660009081526004602052604090205462010000900461ffff1690565b600061273d838361374e565b60006131fb82611fb5565b905061320960008383612aff565b73ffffffffffffffffffffffffffffffffffffffff8116600081815260046020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffff0000811661ffff8083167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0181169182176001680100000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000090951690931784900482169290920181169092021790915586168352600390915280822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055518492907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a4505060008054600161ffff6201000080840482169290920116027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffff909116179055565b6007805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6008805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907fede61b2c1b6ea8932acda2da1fa8be10c31d93a5ef149f84a2a04c178054044990600090a35050565b600073ffffffffffffffffffffffffffffffffffffffff84163b156135f2576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a02906134cb903390899088908890600401614026565b602060405180830381600087803b1580156134e557600080fd5b505af1925050508015613533575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261353091810190614073565b60015b6135a7573d808015613561576040519150601f19603f3d011682016040523d82523d6000602084013e613566565b606091505b50805161359f576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a02000000000000000000000000000000000000000000000000000000001490506135f6565b5060015b949350505050565b606060108054610e6490613f3b565b60608161364d57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115613677578061366181613fbe565b91506136709050600a836140bf565b9150613651565b60008167ffffffffffffffff8111156136925761369261392f565b6040519080825280601f01601f1916602001820160405280156136bc576020820181803683370190505b5090505b84156135f6576136d16001836140d3565b91506136de600a866140ea565b6136e9906030613f23565b60f81b8183815181106136fe576136fe613f8f565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350613738600a866140bf565b94506136c0565b6126a084858585600186612b86565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848609848602925082811083820303915050670de0b6b3a764000081106137c9576040517fd31b34020000000000000000000000000000000000000000000000000000000081526004810182905260240161091b565b600080670de0b6b3a76400008688099150506706f05b59d3b1ffff8111826138035780670de0b6b3a7640000850401945050505050610e4f565b6204000082850304939091119091037d40000000000000000000000000000000000000000000000000000000000002919091177faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac106690201905092915050565b82805461386d90613f3b565b90600052602060002090601f01602090048101928261388f57600085556138f3565b82601f106138c6578280017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008235161785556138f3565b828001600101855582156138f3579182015b828111156138f35782358255916020019190600101906138d8565b506138ff929150613903565b5090565b5b808211156138ff5760008155600101613904565b803561ffff8116811461392a57600080fd5b919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156139a5576139a561392f565b604052919050565b600082601f8301126139be57600080fd5b8135602067ffffffffffffffff8211156139da576139da61392f565b8160051b6139e982820161395e565b9283528481018201928281019087851115613a0357600080fd5b83870192505b84831015613a2257823582529183019190830190613a09565b979650505050505050565b60008060408385031215613a4057600080fd5b613a4983613918565b9150602083013567ffffffffffffffff811115613a6557600080fd5b613a71858286016139ad565b9150509250929050565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114611d5957600080fd5b600060208284031215613abb57600080fd5b813561273d81613a7b565b60005b83811015613ae1578181015183820152602001613ac9565b838111156126a05750506000910152565b60008151808452613b0a816020860160208601613ac6565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061273d6020830184613af2565b600060208284031215613b6157600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461392a57600080fd5b60008060408385031215613b9f57600080fd5b613ba883613b68565b946020939093013593505050565b60008060408385031215613bc957600080fd5b823567ffffffffffffffff81168114613be157600080fd5b9150613bef60208401613b68565b90509250929050565b600080600060608486031215613c0d57600080fd5b613c1684613b68565b9250613c2460208501613b68565b9150604084013590509250925092565b600060208284031215613c4657600080fd5b61273d82613918565b600080600060608486031215613c6457600080fd5b8335925060208401359150604084013567ffffffffffffffff811115613c8957600080fd5b613c95868287016139ad565b9150509250925092565b60008060008060808587031215613cb557600080fd5b5050823594602084013594506040840135936060013592509050565b60008060208385031215613ce457600080fd5b823567ffffffffffffffff80821115613cfc57600080fd5b818501915085601f830112613d1057600080fd5b813581811115613d1f57600080fd5b866020828501011115613d3157600080fd5b60209290920196919550909350505050565b600060208284031215613d5557600080fd5b61273d82613b68565b60008060408385031215613d7157600080fd5b613d7a83613b68565b915060208301358015158114613d8f57600080fd5b809150509250929050565b60008060008060808587031215613db057600080fd5b613db985613b68565b93506020613dc8818701613b68565b935060408601359250606086013567ffffffffffffffff80821115613dec57600080fd5b818801915088601f830112613e0057600080fd5b813581811115613e1257613e1261392f565b613e42847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161395e565b91508082528984828501011115613e5857600080fd5b808484018584013760008482840101525080935050505092959194509250565b60008060408385031215613e8b57600080fd5b613be183613b68565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061ffff83811690831681811015613ede57613ede613e94565b039392505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613f1e57613f1e613e94565b500290565b60008219821115613f3657613f36613e94565b500190565b600181811c90821680613f4f57607f821691505b60208210811415613f89577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613ff057613ff0613e94565b5060010190565b60008351614009818460208801613ac6565b83519083019061401d818360208801613ac6565b01949350505050565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525061ffff84166040830152608060608301526140696080830184613af2565b9695505050505050565b60006020828403121561408557600080fd5b815161273d81613a7b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826140ce576140ce614090565b500490565b6000828210156140e5576140e5613e94565b500390565b6000826140f9576140f9614090565b50069056fea2646970667358221220fd22a32b88f4ef4f229f20e580855a29fbc25b8679c9a6f3290a5bf806fcbb4364736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000cbff601c8745a86e39d9dcb4725b7e6019f5e4fe0000000000000000000000000000000000000000000000000000000000001996000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000017a2000000000000000000000000000000000000000000000000011c37937e08000000000000000000000000000000000000000000000000000000000000623c877000000000000000000000000000000000000000000000000000000000623ca39000000000000000000000000000000000000000000000000000000000623cbfb000000000000000000000000000000000000000000000000000000000623cbfb00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000005768747470733a2f2f63635f6e667473746f72652e6d7970696e6174612e636c6f75642f697066732f516d5150384173425575586b4e4756723951396f6a4332556136727a675553476a397141327a78616f47526b754c2f000000000000000000
-----Decoded View---------------
Arg [0] : devAddress (address): 0xcbFF601C8745a86e39d9dcB4725B7e6019f5e4FE
Arg [1] : maxSupply (uint16): 6550
Arg [2] : walletMax (uint16): 1
Arg [3] : whitelistMax (uint16): 6050
Arg [4] : price (uint256): 80000000000000000
Arg [5] : presaleMintStart (uint256): 1648134000
Arg [6] : presaleResetTime (uint256): 1648141200
Arg [7] : presaleMintEnd (uint256): 1648148400
Arg [8] : publicMintStart (uint256): 1648148400
Arg [9] : baseUri (string): https://cc_nftstore.mypinata.cloud/ipfs/QmQP8AsBUuXkNGVr9Q9ojC2Ua6rzgUSGj9qA2zxaoGRkuL/
-----Encoded View---------------
14 Constructor Arguments found :
Arg [0] : 000000000000000000000000cbff601c8745a86e39d9dcb4725b7e6019f5e4fe
Arg [1] : 0000000000000000000000000000000000000000000000000000000000001996
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [3] : 00000000000000000000000000000000000000000000000000000000000017a2
Arg [4] : 000000000000000000000000000000000000000000000000011c37937e080000
Arg [5] : 00000000000000000000000000000000000000000000000000000000623c8770
Arg [6] : 00000000000000000000000000000000000000000000000000000000623ca390
Arg [7] : 00000000000000000000000000000000000000000000000000000000623cbfb0
Arg [8] : 00000000000000000000000000000000000000000000000000000000623cbfb0
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000057
Arg [11] : 68747470733a2f2f63635f6e667473746f72652e6d7970696e6174612e636c6f
Arg [12] : 75642f697066732f516d5150384173425575586b4e4756723951396f6a433255
Arg [13] : 6136727a675553476a397141327a78616f47526b754c2f000000000000000000
Loading...
Loading
Loading...
Loading
[ 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.