Overview
TokenID
1701
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:
EnigmaticBox
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.12; import "./ERC721A/extensions/ERC721AQueryable.sol"; import "./libs/BitMaps.sol"; import "./libs/BitMaps4.sol"; import "./SSTORE2/SSTORE2.sol"; import "./Base64.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import {DefaultOperatorFilterer} from "./filter/DefaultOperatorFilterer.sol"; error MaxSupplyReached(); error NotOwnerOfClaim(); error AlreadyClaimed(); error ClaimConditionNotMet(); error FalseInput(); error ImageDataFrozen(); error MaxAllowlist(); error NotAltar(); error BoxOpeningIsClosed(); error ClaimIsDisabled(); error NonUpgradable(); error UpgradesNotActive(); interface IClaimer { function nestingPeriod(uint256 tokenId) external view returns (bool nesting, uint256 current, uint256 total); function ownerOf(uint256 tokenId) external view returns (address); } interface IAltar { function batchStartRitual(address to, uint256[] calldata boxTypes) external; function startRitual(address to, uint256 boxType) external; } contract EnigmaticBox is ERC721AQueryable, Ownable, DefaultOperatorFilterer { using BitMaps for BitMaps.BitMap; using BitMaps4 for BitMaps4.BitMap4; uint256 private claimStart = block.timestamp; IClaimer private immutable claimContract; uint256 public constant maxPerTx = 10; uint256 public constant BATCH_SIZE = 6; uint256 public price = 0.1 ether; uint256 public constant priceClaimUpgrade = 0.015 ether; bool public supplyFrozen; uint256 public publicMaxSupply; uint256 private reservation; bool private reservationMinted; uint256 public publicMinted; uint256 public claim3Minted; uint256 public claim5Minted; mapping(address => uint256) private claim5Whitelist; bool public claim5Limited = true; bool public imageDataFrozen; bool public onChainLocked; bool private offChainFallback = true; bool public upgradesEnabled; BitMaps.BitMap private claimed; mapping(uint256 => uint256) public upgradesClaimed; BitMaps4.BitMap4 private boxType; mapping(uint256 => address[]) private imageChunks; // main collection contract IAltar public masonicAltar; bool private lockedAltar; bool public claimDisabled; uint256 private legendariesAirdropped; string[] private boxNames = ["Soul Box","Spirit Box","Machina Box","Omen Box","Air Box","Water Box","Alchemy Box","Fire Box","Earth Box","Legendary Box"]; string private imagePrefix = "data:image/avif;base64,"; string private baseURI; constructor(address claimer, string memory uri) ERC721A("EnigmaticBox", "EBOX") { claimContract = IClaimer(claimer); baseURI = uri; } function disableClaim() external onlyOwner { claimDisabled = true; } function addAltar(address addr) external onlyOwner { if(lockedAltar) revert(); masonicAltar = IAltar(addr); lockedAltar = true; } function legendaryMint(address[] calldata addr) external onlyOwner { if(legendariesAirdropped>=74) revert(); uint256 nextId = _nextTokenId(); for(uint256 i; i < addr.length; ++i) { _mint(addr[i], 1); boxType.setTo(nextId+i, 9); legendariesAirdropped++; } } function tokenIdToType(uint256 tokenId) external view returns(uint256) { return boxType.get(tokenId); } function claim5AllowlistLeft(address addr) external view returns(uint256) { if(_getAux(msg.sender)>=claim5Whitelist[addr]) { return 0; } else { return claim5Whitelist[addr]-_getAux(msg.sender); } } function disableClaim5Limit() external onlyOwner { claim5Limited=false; } function addClaim5Allowlist(address[] calldata addr, uint256 amount) external { for (uint256 i; i < addr.length; ++i) { claim5Whitelist[addr[i]] = amount; } } function maxSupply() external view returns(uint256) { return 10000-2*claim3Minted-4*claim5Minted+publicMaxSupply+reservation; } function setPublicMaxSupply(uint256 newSupply) external onlyOwner { if(supplyFrozen) revert(); uint256 reducedClaim = 2*claim3Minted+4*claim5Minted-reservation; if(newSupply>reducedClaim) revert(); publicMaxSupply = newSupply; } function setReservation(uint256 amount) external onlyOwner { if(supplyFrozen || reservationMinted) revert(); uint256 reducedClaim = 2*claim3Minted+4*claim5Minted-publicMaxSupply; if(amount>reducedClaim) revert(); reservation = amount; } function freezeSupply() external onlyOwner { supplyFrozen = true; } function mintReservation() external onlyOwner { if(reservationMinted) revert(); uint256 nextId = _nextTokenId(); uint256 newSupply = nextId+reservation; for (; nextId < newSupply; ++nextId) { boxType.setTo(nextId, 6); } _mintWrapper(reservation); reservationMinted = true; } function setPrice(uint256 newPrice) external onlyOwner { price = newPrice; } function withdraw() external onlyOwner { (bool success, ) = msg.sender.call{value: address(this).balance}(""); if (!success) revert(); } function mint(uint256 quantity) external payable { unchecked { uint256 newPublicSupply = publicMinted + quantity; require(newPublicSupply <= publicMaxSupply, "Sold Out"); require(quantity <= maxPerTx, "Max mints per transaction"); require(msg.value >= price * quantity, "Ether value sent is incorrect"); publicMinted = newPublicSupply; uint256 nextId = _nextTokenId(); uint256 newSupply = nextId + quantity; for (; nextId < newSupply; ++nextId) { boxType.setTo(nextId, 6); } _mintWrapper(quantity); } } function freezeImageData() external onlyOwner { imageDataFrozen = true; } function deleteImage(uint256 index) external onlyOwner { if(imageDataFrozen) revert ImageDataFrozen(); delete imageChunks[index]; } function uploadImageChunk(uint256 index, bytes calldata chunk) external onlyOwner { if(imageDataFrozen) revert ImageDataFrozen(); imageChunks[index].push(SSTORE2.write(chunk)); } function setImagePrefix(string calldata prefix) external onlyOwner { if(imageDataFrozen) revert ImageDataFrozen(); imagePrefix = prefix; } function toggleOnChainTokenURI() external onlyOwner { if(onChainLocked) revert(); offChainFallback = !offChainFallback; } function freezeOnChainTokenURI() external onlyOwner { onChainLocked = true; offChainFallback = false; } function setBaseURI(string calldata url) external onlyOwner { if(onChainLocked) revert(); baseURI = url; } function tokenURI(uint256 tokenId) public view override (ERC721A, IERC721A) returns (string memory) { bool isBurned = explicitOwnershipOf(tokenId).burned; if (!_exists(tokenId)&&!isBurned) revert URIQueryForNonexistentToken(); uint256 btype = boxType.get(tokenId); uint256 adjustTier = (btype==5)?6:btype==6?5:btype; ++adjustTier; string memory imageURI = offChainFallback?string.concat(baseURI,_toString(btype)):renderImage(btype); return string.concat( "data:application/json,", '{"name":"#', _toString(tokenId), '","image":"', imageURI, '","attributes":[{"trait_type":"', (isBurned?'Burned':'Unopened'), '","value":"', boxNames[btype], '"},{"trait_type":"Tier","value":"', _toString(adjustTier), '"}]}' //) ); } function renderTokenId(uint256 tokenId) external view returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); return renderImage(boxType.get(tokenId)); } // render images from chunks (License: MIT) function renderImage(uint256 index) public view returns (string memory) { bytes memory image; address[] storage chunks = imageChunks[index]; uint256 size; uint ptr = 0x20; address currentChunk; unchecked { // solhint-disable-next-line no-inline-assembly assembly { image := mload(0x40) } for (uint i = 0; i < chunks.length; i++) { currentChunk = chunks[i]; size = Bytecode.codeSize(currentChunk) - 1; // solhint-disable-next-line no-inline-assembly assembly { extcodecopy(currentChunk, add(image, ptr), 1, size) } ptr += size; } // solhint-disable-next-line no-inline-assembly assembly { mstore(0x40, add(image, and(add(ptr, 0x1f), not(0x1f)))) mstore(image, sub(ptr, 0x20)) } } return string.concat(imagePrefix, Base64.encode(image)); } function tokensClaimable(uint256[] calldata tokenIds) external view returns(bool[] memory) { bool[] memory claimable = new bool[](tokenIds.length); uint256 currentCutoff = block.timestamp - claimStart; for (uint256 i; i < tokenIds.length; ++i) { if(!claimed.get(tokenIds[i])) { (,uint256 current,) = claimContract.nestingPeriod(tokenIds[i]); if(current >= currentCutoff) claimable[i]=true; } } return claimable; } function _setClaimed(uint256[] calldata tokenIds) internal { uint256 currentCutoff = block.timestamp - claimStart; for (uint256 i; i < tokenIds.length; ++i) { if(claimContract.ownerOf(tokenIds[i])!=msg.sender) revert NotOwnerOfClaim(); if(claimed.get(tokenIds[i])) revert AlreadyClaimed(); (,uint256 current,) = claimContract.nestingPeriod(tokenIds[i]); if(current < currentCutoff) revert ClaimConditionNotMet(); claimed.set(tokenIds[i]); } } function claim(uint256[] calldata tokenIds) external payable { if(claimDisabled) revert ClaimIsDisabled(); _setClaimed(tokenIds); uint256 upgradeAmount = msg.value/priceClaimUpgrade; if(upgradeAmount>tokenIds.length) revert FalseInput(); uint256 nextId = _nextTokenId(); for (uint256 i; i < upgradeAmount; ++i) { boxType.setTo(nextId, 1); ++nextId; } _mintWrapper(tokenIds.length); } function claimTypes(uint256[] calldata tokenIds, uint256 type1, uint256 type2, uint256 type3) external payable { if(claimDisabled) revert ClaimIsDisabled(); uint256 newT2Supply = claim3Minted+type2; uint256 newT3Supply = claim5Minted+type3; if(newT2Supply>800 || newT3Supply>300) revert MaxSupplyReached(); claim3Minted = newT2Supply; claim5Minted = newT3Supply; _setClaimed(tokenIds); if(tokenIds.length != type1+type2*3+type3*5) revert FalseInput(); uint256 nextId = _nextTokenId(); _mintWrapper(type1+type2+type3); for (uint256 i; i < type2; ++i) { boxType.setTo(nextId, 7); ++nextId; } for (uint256 i; i < type3; ++i) { boxType.setTo(nextId, 8); ++nextId; } uint256 upgradeAmount = msg.value/priceClaimUpgrade; for (uint256 i; i < upgradeAmount; ++i) { boxType.setTo(nextId, 1); ++nextId; } if(type3>0 && claim5Limited) { uint256 newC5Minted = uint256(_getAux(msg.sender))+type3; if(newC5Minted > claim5Whitelist[msg.sender]) revert MaxAllowlist(); _setAux(msg.sender,uint64(newC5Minted)); } } function _mintWrapper(uint256 numToMint) internal { uint256 numBatches = numToMint / BATCH_SIZE; for (uint256 i; i < numBatches; ++i) { _mint(msg.sender, BATCH_SIZE); } if (numToMint % BATCH_SIZE > 0) { _mint(msg.sender, numToMint % BATCH_SIZE); } } function burn(uint256 tokenId) external { if(!lockedAltar) revert BoxOpeningIsClosed(); _burn(tokenId, true); masonicAltar.startRitual(msg.sender, boxType.get(tokenId)); } function batchBurn(uint256[] calldata tokenIds) external { if(!lockedAltar) revert BoxOpeningIsClosed(); uint256[] memory types = new uint256[](tokenIds.length); for (uint256 i; i < tokenIds.length; ++i) { _burn(tokenIds[i], true); types[i] = boxType.get(tokenIds[i]); } masonicAltar.batchStartRitual(msg.sender, types); } function toggleUpgrading() external onlyOwner { upgradesEnabled = !upgradesEnabled; } function upgradeBoxes(uint256[] calldata tokenIds, uint256[] calldata amounts, uint256[] calldata claimIds) external { if(!upgradesEnabled) revert UpgradesNotActive(); uint256 amount; for(uint256 i; i < tokenIds.length; ++i) { uint256 boxLevelUp = boxType.get(tokenIds[i])+amounts[i]; amount+=amounts[i]; if(boxLevelUp>5) revert NonUpgradable(); boxType.setTo(tokenIds[i],boxLevelUp); } uint256 spent; for(uint256 i; i < claimIds.length; ++i) { (,,uint256 total) = claimContract.nestingPeriod(claimIds[i]); uint256 months = total/2592000-upgradesClaimed[claimIds[i]]; if(months == 0) continue; if(claimContract.ownerOf(claimIds[i])!=msg.sender) revert NotOwnerOfClaim(); uint256 newSpent = months+spent; if(newSpent==amount) { upgradesClaimed[claimIds[i]] += months; spent = newSpent; break; } else if(newSpent<amount) { upgradesClaimed[claimIds[i]] += months; spent = newSpent; } else { upgradesClaimed[claimIds[i]] += amount-spent; spent = amount; break; } } if(spent<amount) revert NonUpgradable(); } function upgradeBox(uint256 tokenId, uint256 amount, uint256[] calldata claimIds) public { if(!upgradesEnabled) revert UpgradesNotActive(); uint256 boxLevelUp = boxType.get(tokenId)+amount; if(boxLevelUp>5) revert NonUpgradable(); boxType.setTo(tokenId,boxLevelUp); uint256 spent; for(uint256 i; i < claimIds.length; ++i) { (,,uint256 total) = claimContract.nestingPeriod(claimIds[i]); uint256 months = total/2592000-upgradesClaimed[claimIds[i]]; if(months == 0) continue; if(claimContract.ownerOf(claimIds[i])!=msg.sender) revert NotOwnerOfClaim(); uint256 newSpent = months+spent; if(newSpent==amount) { upgradesClaimed[claimIds[i]] += months; spent = newSpent; break; } else if(newSpent<amount) { upgradesClaimed[claimIds[i]] += months; spent = newSpent; } else { upgradesClaimed[claimIds[i]] += amount-spent; spent = amount; break; } } if(spent<amount) revert NonUpgradable(); } function upgradesAvailable(uint256[] calldata tokenIds) external view returns(uint256[] memory) { uint256[] memory available = new uint256[](tokenIds.length); for(uint256 i; i < tokenIds.length; ++i) { (,,uint256 total) = claimContract.nestingPeriod(tokenIds[i]); uint256 months = total/2592000-upgradesClaimed[tokenIds[i]]; available[i] = months; } return available; } function transferFrom( address from, address to, uint256 tokenId ) public payable virtual override(ERC721A, IERC721A) onlyAllowedOperator { super.transferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId ) public payable virtual override(ERC721A, IERC721A) onlyAllowedOperator { super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public payable virtual override(ERC721A, IERC721A) onlyAllowedOperator { super.safeTransferFrom(from, to, tokenId, _data); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (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 Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { 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: 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 (last updated v4.7.0) (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Base64.sol) pragma solidity ^0.8.0; /** * @dev Provides a set of functions to operate with Base64 strings. * * _Available since v4.5._ */ library Base64 { /** * @dev Base64 Encoding/Decoding Table */ string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /** * @dev Converts a `bytes` to its Bytes64 `string` representation. */ function encode(bytes memory data) internal pure returns (string memory) { /** * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol */ if (data.length == 0) return ""; // Loads the table into memory string memory table = _TABLE; // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter // and split into 4 numbers of 6 bits. // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up // - `data.length + 2` -> Round up // - `/ 3` -> Number of 3-bytes chunks // - `4 *` -> 4 characters for each chunk string memory result = new string(4 * ((data.length + 2) / 3)); /// @solidity memory-safe-assembly assembly { // Prepare the lookup table (skip the first "length" byte) let tablePtr := add(table, 1) // Prepare result pointer, jump over length let resultPtr := add(result, 32) // Run over the input, 3 bytes at a time for { let dataPtr := data let endPtr := add(data, mload(data)) } lt(dataPtr, endPtr) { } { // Advance 3 bytes dataPtr := add(dataPtr, 3) let input := mload(dataPtr) // To write each character, shift the 3 bytes (18 bits) chunk // 4 times in blocks of 6 bits for each character (18, 12, 6, 0) // and apply logical AND with 0x3F which is the number of // the previous character in the ASCII table prior to the Base64 Table // The result is then added to the table to get the character to write, // and finally write it in the result pointer but with a left shift // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F)))) resultPtr := add(resultPtr, 1) // Advance } // When data `bytes` is not exactly 3 bytes long // it is padded with `=` characters at the end switch mod(mload(data), 3) case 1 { mstore8(sub(resultPtr, 1), 0x3d) mstore8(sub(resultPtr, 2), 0x3d) } case 2 { mstore8(sub(resultPtr, 1), 0x3d) } } return result; } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364). struct TokenApprovalRef { address value; } // ============================================================= // CONSTANTS // ============================================================= // Mask of an entry in packed address data. uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant _BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant _BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant _BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant _BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant _BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant _BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with {_mintERC2309}. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} // is required to cause an overflow, which is unrealistic. uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // STORAGE // ============================================================= // The next token ID to be minted. uint256 private _currentIndex; // The number of tokens burned. uint256 private _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. // See {_packedOwnershipOf} implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` mapping(uint256 => uint256) private _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) private _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => TokenApprovalRef) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // ============================================================= // CONSTRUCTOR // ============================================================= constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID. * To change the starting token ID, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view virtual returns (uint256) { return _currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() public view virtual override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than `_currentIndex - _startTokenId()` times. unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { return _currentIndex - _startTokenId(); } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return _burnCounter; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(_packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal virtual { uint256 packed = _packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); _packedAddressData[owner] = packed; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes // of the XOR of all function selectors in the interface. // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ 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, _toString(tokenId))) : ''; } /** * @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, it can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr) if (curr < _currentIndex) { uint256 packed = _packedOwnerships[curr]; // If not burned. if (packed & _BITMASK_BURNED == 0) { // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `curr` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. while (packed == 0) { packed = _packedOwnerships[--curr]; } return packed; } } } revert OwnerQueryForNonexistentToken(); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @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) public payable virtual override { address owner = ownerOf(tokenId); if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId].value; } /** * @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) public virtual override { _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @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. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && // If within bounds, _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned. } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`. assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approvedAddressSlot) } } // ============================================================= // TRANSFER OPERATIONS // ============================================================= /** * @dev Transfers `tokenId` from `from` to `to`. * * 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 ) public payable virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // 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**256. unchecked { // We can directly increment and decrement the balances. --_packedAddressData[from]; // Updates: `balance -= 1`. ++_packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public payable virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @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 memory _data ) public payable virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @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 _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token IDs * have been transferred. This includes minting. * 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 _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns whether the call correctly returned the expected magic value. */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns ( bytes4 retval ) { return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); uint256 toMasked; uint256 end = startTokenId + quantity; // Use assembly to loop and emit the `Transfer` event for gas savings. // The duplicated `log4` removes an extra check and reduces stack juggling. // The assembly, together with the surrounding Solidity code, have been // delicately arranged to nudge the compiler into producing optimized opcodes. assembly { // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. toMasked := and(to, _BITMASK_ADDRESS) // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. startTokenId // `tokenId`. ) // The `iszero(eq(,))` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. // The compiler will optimize the `iszero` away for performance. for { let tokenId := add(startTokenId, 1) } iszero(eq(tokenId, end)) { tokenId := add(tokenId, 1) } { // Emit the `Transfer` event. Similar to above. log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId) } } if (toMasked == 0) revert MintToZeroAddress(); _currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); _currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @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. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = _currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (index < end); // Reentrancy protection. if (_currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // 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**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = _packedOwnerships[index]; if (packed == 0) revert OwnershipNotInitializedForExtraData(); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); _packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * 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 _extraData( address from, address to, uint24 previousExtraData ) internal view virtual returns (uint24) {} /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString(uint256 value) internal pure virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. let m := add(mload(0x40), 0xa0) // Update the free memory pointer to allocate. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721AQueryable.sol'; import '../ERC721A.sol'; /** * @title ERC721AQueryable. * * @dev ERC721A subclass with convenience query functions. */ abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable { /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * * - `addr = address(0)` * - `startTimestamp = 0` * - `burned = false` * - `extraData = 0` * * If the `tokenId` is burned: * * - `addr = <Address of owner before token was burned>` * - `startTimestamp = <Timestamp when token was burned>` * - `burned = true` * - `extraData = <Extra data when token was burned>` * * Otherwise: * * - `addr = <Address of owner>` * - `startTimestamp = <Timestamp of start of ownership>` * - `burned = false` * - `extraData = <Extra data at start of ownership>` */ function explicitOwnershipOf(uint256 tokenId) public view virtual override returns (TokenOwnership memory) { TokenOwnership memory ownership; if (tokenId < _startTokenId() || tokenId >= _nextTokenId()) { return ownership; } ownership = _ownershipAt(tokenId); if (ownership.burned) { return ownership; } return _ownershipOf(tokenId); } /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] calldata tokenIds) external view virtual override returns (TokenOwnership[] memory) { unchecked { uint256 tokenIdsLength = tokenIds.length; TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength); for (uint256 i; i != tokenIdsLength; ++i) { ownerships[i] = explicitOwnershipOf(tokenIds[i]); } return ownerships; } } /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start < stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view virtual override returns (uint256[] memory) { unchecked { if (start >= stop) revert InvalidQueryRange(); uint256 tokenIdsIdx; uint256 stopLimit = _nextTokenId(); // Set `start = max(start, _startTokenId())`. if (start < _startTokenId()) { start = _startTokenId(); } // Set `stop = min(stop, stopLimit)`. if (stop > stopLimit) { stop = stopLimit; } uint256 tokenIdsMaxLength = balanceOf(owner); // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`, // to cater for cases where `balanceOf(owner)` is too big. if (start < stop) { uint256 rangeLength = stop - start; if (rangeLength < tokenIdsMaxLength) { tokenIdsMaxLength = rangeLength; } } else { tokenIdsMaxLength = 0; } uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength); if (tokenIdsMaxLength == 0) { return tokenIds; } // We need to call `explicitOwnershipOf(start)`, // because the slot at `start` may not be initialized. TokenOwnership memory ownership = explicitOwnershipOf(start); address currOwnershipAddr; // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`. // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range. if (!ownership.burned) { currOwnershipAddr = ownership.addr; } for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) { ownership = _ownershipAt(i); if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } // Downsize the array to fit. assembly { mstore(tokenIds, tokenIdsIdx) } return tokenIds; } } /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(`totalSupply`) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K collections should be fine). */ function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) { unchecked { uint256 tokenIdsIdx; address currOwnershipAddr; uint256 tokenIdsLength = balanceOf(owner); uint256[] memory tokenIds = new uint256[](tokenIdsLength); TokenOwnership memory ownership; for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) { ownership = _ownershipAt(i); if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } return tokenIds; } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import '../IERC721A.sol'; /** * @dev Interface of ERC721AQueryable. */ interface IERC721AQueryable is IERC721A { /** * Invalid query range (`start` >= `stop`). */ error InvalidQueryRange(); /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * * - `addr = address(0)` * - `startTimestamp = 0` * - `burned = false` * - `extraData = 0` * * If the `tokenId` is burned: * * - `addr = <Address of owner before token was burned>` * - `startTimestamp = <Timestamp when token was burned>` * - `burned = true` * - `extraData = <Extra data when token was burned>` * * Otherwise: * * - `addr = <Address of owner>` * - `startTimestamp = <Timestamp of start of ownership>` * - `burned = false` * - `extraData = <Extra data at start of ownership>` */ function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory); /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory); /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start < stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view returns (uint256[] memory); /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(`totalSupply`) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K collections should be fine). */ function tokensOfOwner(address owner) external view returns (uint256[] memory); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721A { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the * ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitializedForExtraData(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @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, bytes calldata data ) external payable; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Transfers `tokenId` 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 payable; /** * @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 payable; /** * @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 the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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); // ============================================================= // IERC721Metadata // ============================================================= /** * @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); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {OperatorFilterer} from "./OperatorFilterer.sol"; contract DefaultOperatorFilterer is OperatorFilterer { address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; interface IOperatorFilterRegistry { function isOperatorAllowed(address registrant, address operator) external returns (bool); function register(address registrant) external; function registerAndSubscribe(address registrant, address subscription) external; function registerAndCopyEntries(address registrant, address registrantToCopy) external; function updateOperator(address registrant, address operator, bool filtered) external; function updateOperators(address registrant, address[] calldata operators, bool filtered) external; function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; function subscribe(address registrant, address registrantToSubscribe) external; function unsubscribe(address registrant, bool copyExistingEntries) external; function subscriptionOf(address addr) external returns (address registrant); function subscribers(address registrant) external returns (address[] memory); function subscriberAt(address registrant, uint256 index) external returns (address); function copyEntriesOf(address registrant, address registrantToCopy) external; function isOperatorFiltered(address registrant, address operator) external returns (bool); function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); function filteredOperators(address addr) external returns (address[] memory); function filteredCodeHashes(address addr) external returns (bytes32[] memory); function filteredOperatorAt(address registrant, uint256 index) external returns (address); function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); function isRegistered(address addr) external returns (bool); function codeHashOf(address addr) external returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol"; contract OperatorFilterer { error OperatorNotAllowed(address operator); IOperatorFilterRegistry constant operatorFilterRegistry = IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E); constructor(address subscriptionOrRegistrantToCopy, bool subscribe) { // If an inheriting token contract is deployed to a network without the registry deployed, the modifier // will not revert, but the contract will need to be registered with the registry once it is deployed in // order for the modifier to filter addresses. if (address(operatorFilterRegistry).code.length > 0) { if (subscribe) { operatorFilterRegistry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); } else { if (subscriptionOrRegistrantToCopy != address(0)) { operatorFilterRegistry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); } else { operatorFilterRegistry.register(address(this)); } } } } modifier onlyAllowedOperator() virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(operatorFilterRegistry).code.length > 0) { if (!operatorFilterRegistry.isOperatorAllowed(address(this), msg.sender)) { revert OperatorNotAllowed(msg.sender); } } _; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/structs/BitMaps.sol) pragma solidity ^0.8.0; /** * @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential. * Largely inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor]. */ library BitMaps { struct BitMap { mapping(uint256 => uint256) _data; } /** * @dev Returns whether the bit at `index` is set. */ function get(BitMap storage bitmap, uint256 index) internal view returns (bool) { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); return bitmap._data[bucket] & mask != 0; } /** * @dev Sets the bit at `index` to the boolean `value`. function setTo( BitMap storage bitmap, uint256 index, bool value ) internal { if (value) { set(bitmap, index); } else { unset(bitmap, index); } }*/ /** * @dev Sets the bit at `index`. */ function set(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); bitmap._data[bucket] |= mask; } /** * @dev Unsets the bit at `index`. function unset(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); bitmap._data[bucket] &= ~mask; }*/ }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; /** * @dev Library for a 4 bit per value map */ library BitMaps4 { struct BitMap4 { mapping(uint256 => uint256) _data; } /** * @dev Returns the value at `index`. */ function get(BitMap4 storage bitmap, uint256 index) internal view returns (uint256) { uint256 bucket = index >> 6; uint256 idx = (index & 0x3f) << 2; return (bitmap._data[bucket] >> idx) & 0xf; } /** * @dev Sets the value at `index`. */ function setTo(BitMap4 storage bitmap, uint256 index, uint256 value) internal { uint256 bucket = index >> 6; uint256 idx = (index & 0x3f) << 2; uint256 mask = ~(0xf << idx); bitmap._data[bucket] = (bitmap._data[bucket] & mask) | (value << idx); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./utils/Bytecode.sol"; /** @title A key-value storage with auto-generated keys for storing chunks of data with a lower write & read cost. @author Agustin Aguilar <[email protected]> Readme: https://github.com/0xsequence/sstore2#readme */ library SSTORE2 { error WriteError(); /** @notice Stores `_data` and returns `pointer` as key for later retrieval @dev The pointer is a contract address with `_data` as code @param _data to be written @return pointer Pointer to the written `_data` */ function write(bytes memory _data) internal returns (address pointer) { // Append 00 to _data so contract can't be called // Build init code bytes memory code = Bytecode.creationCodeFor( abi.encodePacked( hex'00', _data ) ); // Deploy contract using create assembly { pointer := create(0, add(code, 32), mload(code)) } // Address MUST be non-zero if (pointer == address(0)) revert WriteError(); } /** @notice Reads the contents of the `_pointer` code as data, skips the first byte @dev The function is intended for reading pointers generated by `write` @param _pointer to be read @return data read from `_pointer` contract */ function read(address _pointer) internal view returns (bytes memory) { return Bytecode.codeAt(_pointer, 1, type(uint256).max); } /** @notice Reads the contents of the `_pointer` code as data, skips the first byte @dev The function is intended for reading pointers generated by `write` @param _pointer to be read @param _start number of bytes to skip @return data read from `_pointer` contract */ function read(address _pointer, uint256 _start) internal view returns (bytes memory) { return Bytecode.codeAt(_pointer, _start + 1, type(uint256).max); } /** @notice Reads the contents of the `_pointer` code as data, skips the first byte @dev The function is intended for reading pointers generated by `write` @param _pointer to be read @param _start number of bytes to skip @param _end index before which to end extraction @return data read from `_pointer` contract */ function read(address _pointer, uint256 _start, uint256 _end) internal view returns (bytes memory) { return Bytecode.codeAt(_pointer, _start + 1, _end + 1); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library Bytecode { error InvalidCodeAtRange(uint256 _size, uint256 _start, uint256 _end); /** @notice Generate a creation code that results on a contract with `_code` as bytecode @param _code The returning value of the resulting `creationCode` @return creationCode (constructor) for new contract */ function creationCodeFor(bytes memory _code) internal pure returns (bytes memory) { /* 0x00 0x63 0x63XXXXXX PUSH4 _code.length size 0x01 0x80 0x80 DUP1 size size 0x02 0x60 0x600e PUSH1 14 14 size size 0x03 0x60 0x6000 PUSH1 00 0 14 size size 0x04 0x39 0x39 CODECOPY size 0x05 0x60 0x6000 PUSH1 00 0 size 0x06 0xf3 0xf3 RETURN <CODE> */ return abi.encodePacked( hex"63", uint32(_code.length), hex"80_60_0E_60_00_39_60_00_F3", _code ); } /** @notice Returns the size of the code on a given address @param _addr Address that may or may not contain code @return size of the code on the given `_addr` */ function codeSize(address _addr) internal view returns (uint256 size) { assembly { size := extcodesize(_addr) } } /** @notice Returns the code of a given address @dev It will fail if `_end < _start` @param _addr Address that may or may not contain code @param _start number of bytes of code to skip on read @param _end index before which to end extraction @return oCode read from `_addr` deployed bytecode Forked from: https://gist.github.com/KardanovIR/fe98661df9338c842b4a30306d507fbd */ function codeAt(address _addr, uint256 _start, uint256 _end) internal view returns (bytes memory oCode) { uint256 csize = codeSize(_addr); if (csize == 0) return bytes(""); if (_start > csize) return bytes(""); if (_end < _start) revert InvalidCodeAtRange(csize, _start, _end); unchecked { uint256 reqSize = _end - _start; uint256 maxSize = csize - _start; uint256 size = maxSize < reqSize ? maxSize : reqSize; assembly { // allocate output byte array - this could also be done without assembly // by using o_code = new bytes(size) oCode := mload(0x40) // new "memory end" including padding mstore(0x40, add(oCode, and(add(add(size, 0x20), 0x1f), not(0x1f)))) // store length in memory mstore(oCode, size) // actually retrieve the code, this needs assembly extcodecopy(_addr, add(oCode, 0x20), _start, size) } } } }
{ "viaIR": true, "optimizer": { "enabled": true, "runs": 1000, "details": { "yul": true } }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"claimer","type":"address"},{"internalType":"string","name":"uri","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyClaimed","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"BoxOpeningIsClosed","type":"error"},{"inputs":[],"name":"ClaimConditionNotMet","type":"error"},{"inputs":[],"name":"ClaimIsDisabled","type":"error"},{"inputs":[],"name":"FalseInput","type":"error"},{"inputs":[],"name":"ImageDataFrozen","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MaxAllowlist","type":"error"},{"inputs":[],"name":"MaxSupplyReached","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NonUpgradable","type":"error"},{"inputs":[],"name":"NotOwnerOfClaim","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","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"},{"inputs":[],"name":"UpgradesNotActive","type":"error"},{"inputs":[],"name":"WriteError","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":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"BATCH_SIZE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"addAltar","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addr","type":"address[]"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addClaim5Allowlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","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":"tokenIds","type":"uint256[]"}],"name":"batchBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"claim","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"claim3Minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"claim5AllowlistLeft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim5Limited","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim5Minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimDisabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256","name":"type1","type":"uint256"},{"internalType":"uint256","name":"type2","type":"uint256"},{"internalType":"uint256","name":"type3","type":"uint256"}],"name":"claimTypes","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"deleteImage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableClaim5Limit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freezeImageData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"freezeOnChainTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"freezeSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"imageDataFrozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"addr","type":"address[]"}],"name":"legendaryMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"masonicAltar","outputs":[{"internalType":"contract IAltar","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerTx","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintReservation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"onChainLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceClaimUpgrade","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMaxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"renderImage","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"renderTokenId","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","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":"payable","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":"payable","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":"url","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"prefix","type":"string"}],"name":"setImagePrefix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newSupply","type":"uint256"}],"name":"setPublicMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setReservation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"supplyFrozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleOnChainTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleUpgrading","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenIdToType","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":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"tokensClaimable","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256[]","name":"claimIds","type":"uint256[]"}],"name":"upgradeBox","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"claimIds","type":"uint256[]"}],"name":"upgradeBoxes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"upgradesAvailable","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"upgradesClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"upgradesEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"bytes","name":"chunk","type":"bytes"}],"name":"uploadImageChunk","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a060408181523462000a6b57600091620056ae803803809162000024828562000a8c565b8339810192828285031262000a685781516001600160a01b038082169291839003620008725760208401516001600160401b039485821162000a60570186601f8201121562000a64578051908582116200095c5786519762000091601f8401601f19166020018a62000a8c565b8289526020838301011162000a6057908391825b82811062000a485750508701602001528451620000c28162000a70565b600c81526b08adcd2cedac2e8d2c684def60a31b6020820152855190620000e98262000a70565b600482526308a849eb60e31b602083015280519086821162000a345781906200011460025462000ab0565b601f8111620009f3575b50602090601f83116001146200097c57869262000970575b50508160011b916000199060031b1c1916176002555b8051908582116200095c5781906200016660035462000ab0565b601f81116200090a575b50602090601f83116001146200088257859262000876575b50508160011b916000199060031b1c1916176003555b81805560088054336001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a36daaeb6d7670e522a718067333cd4e803b620007f7575b50904260095567016345785d8a0000600a55630100000163ff0000ff1960135416176013558351610140810181811085821117620007e1578086526200023a8162000a70565b60088152670a6deead84084def60c31b610160830152815284516200025f8162000a70565b600a8152690a6e0d2e4d2e84084def60b31b602082015260208201528451620002888162000a70565b600b81526a09ac2c6d0d2dcc24084def60ab1b6020820152858201528451620002b18162000a70565b600881526709edacadc4084def60c31b602082015260608201528451620002d88162000a70565b6007815266082d2e44084def60cb1b602082015260808201528451620002fe8162000a70565b60098152680aec2e8cae44084def60bb1b602082015260a08201528451620003268162000a70565b600b81526a082d8c6d0cadaf24084def60ab1b602082015260c08201528451620003508162000a70565b600881526708cd2e4ca4084def60c31b602082015260e08201528451620003778162000a70565b600981526808ac2e4e8d04084def60bb1b60208201526101008201528451620003a08162000a70565b600d81526c098cacecadcc8c2e4f24084def609b1b6020820152610120820152601a54600a601a5580600a1062000738575b50601a83526000805160206200568e8339815191529083905b600a8210620006015750505062000404601b5462000ab0565b601f8111620005bf575b507f646174613a696d6167652f617669663b6261736536342c00000000000000002e601b556080528351918211620005ab576200044d601c5462000ab0565b601f81116200054c575b50602090601f8311600114620004c7579382939492620004bb575b50508160011b916000199060031b1c191617601c555b51614b67908162000b078239608051818181610faf01528181611d6e015281816124fd01528181612b55015261424a0152f35b01519050388062000472565b601c8152601f198316947f0e4562a10381dec21b205ed72637e6b1b523bdd0e4d4d50af5cd23dd4500a21192915b86811062000533575083600195961062000519575b505050811b01601c5562000488565b015160001960f88460031b161c191690553880806200050a565b91926020600181928685015181550194019201620004f5565b601c60005262000599907f0e4562a10381dec21b205ed72637e6b1b523bdd0e4d4d50af5cd23dd4500a211601f850160051c81019160208610620005a0575b601f0160051c019062000aed565b3862000457565b90915081906200058b565b634e487b7160e01b81526041600452602490fd5b601b600052620005fa90601f0160051c7f3ad8aa4f87544323a9d1e5dd902f40c356527a7955687113db5f9a85ad579dc19081019062000aed565b386200040e565b805180519087821162000724576200061a855462000ab0565b601f8111620006e2575b50602090601f8311600114620006745792826001949360209386958b9262000668575b5050600019600383901b1c191690841b1786555b01930191019091620003eb565b01519050388062000647565b858852602088209190601f198416895b818110620006c9575092600195928592879660209610620006af575b505050831b830186556200065b565b015160001960f88460031b161c19169055388080620006a0565b9293602060018192878601518155019501930162000684565b62000712908660005260206000206005601f8601811c8201926020871062000719575b601f01901c019062000aed565b3862000624565b919250829162000705565b634e487b7160e01b87526041600452602487fd5b601a84526000805160206200568e833981519152017f057c384a7d1c54f3a1b2e5e67b2617b8224fdfd1ea7234eea573a6ff665ff6485b8181106200077e5750620003d2565b806200078d6001925462000ab0565b806200079c575b50016200076f565b601f81118314620007b45750600081555b3862000794565b81875260208720620007d191601f0160051c810190840162000aed565b85602081206000835555620007ad565b634e487b7160e01b600052604160045260246000fd5b803b1562000872578180916044875180948193633e9f1edf60e11b8352306004840152733cc6cdda760b79bafa08df41ecfa224f810dceb660248401525af18015620008685715620001f4578381116200085457845238620001f4565b634e487b7160e01b82526041600452602482fd5b85513d84823e3d90fd5b5080fd5b01519050388062000188565b600386527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9250601f198416865b818110620008f15750908460019594939210620008d7575b505050811b016003556200019e565b015160001960f88460031b161c19169055388080620008c8565b92936020600181928786015181550195019301620008b0565b6003865262000955907fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b601f850160051c81019160208610620005a057601f0160051c019062000aed565b3862000170565b634e487b7160e01b84526041600452602484fd5b01519050388062000136565b600287526000805160206200566e8339815191529250601f198416875b818110620009da5750908460019594939210620009c0575b505050811b016002556200014c565b015160001960f88460031b161c19169055388080620009b1565b9293602060018192878601518155019501930162000999565b6002875262000a2d906000805160206200566e833981519152601f850160051c81019160208610620005a057601f0160051c019062000aed565b386200011e565b634e487b7160e01b85526041600452602485fd5b60208282018101518b830182015286945001620000a5565b8380fd5b8280fd5b80fd5b600080fd5b604081019081106001600160401b03821117620007e157604052565b601f909101601f19168101906001600160401b03821190821017620007e157604052565b90600182811c9216801562000ae2575b602083101462000acc57565b634e487b7160e01b600052602260045260246000fd5b91607f169162000ac0565b81811062000af9575050565b6000815560010162000aed56fe60806040526004361015610013575b600080fd5b60003560e01c8062a9bdc31461058a57806301ffc9a71461058157806306fdde0314610578578063081812fc1461056f578063095ea7b314610566578063102c67811461055d57806310ace5461461055457806318160ddd1461054b57806323b872dd146105425780632c99589b146105395780632fbbfc881461053057806331d543a614610527578063356ee3351461051e57806338337e10146105155780633ccfd60b1461050c57806342842e0e1461050357806342966c68146104fa5780634867eb47146104f157806349faa4d4146104e85780634e92c5dd146104df5780634ff9ca2b146104d657806355f804b3146104cd5780635bbb2177146104c45780635be64d37146104bb5780636352211e146104b257806366a5b524146104a95780636ba4c138146104a05780636cb46f12146104975780636ef151ce1461048e578063708079331461048557806370a082311461047c578063715018a61461047357806372787a811461046a578063774b45f41461046157806378cbcf23146104585780637ec2402f1461044f5780638265b0de146104465780638462151c1461043d578063861d7daf1461043457806389c9f4531461042b5780638d8a6054146104225780638da5cb5b1461041957806391b7f5ed1461041057806395d89b411461040757806399a2557a146103fe5780639e266fe6146103f55780639f5045e5146103ec578063a035b1fe146103e3578063a0712d68146103da578063a22cb465146103d1578063a3fbed6e146103c8578063a4f4f8af146103bf578063aca94db9146103b6578063b88d4fde146103ad578063b94dc222146103a4578063bf6b8adc1461039b578063c23dc68f14610392578063c3a7b31f14610389578063c78e64c114610380578063c810114414610377578063c87b56dd1461036e578063ca698a4714610365578063d5abeb011461035c578063dc8e92ea14610353578063e0e83a5f1461034a578063e985e9c514610341578063f2fde38b14610338578063f968adbe1461032f578063fae48c3d146103265763fed8a8391461031e57600080fd5b61000e613219565b5061000e6131fa565b5061000e6131dd565b5061000e6130f3565b5061000e613088565b5061000e613065565b5061000e612f9b565b5061000e612ed3565b5061000e612d23565b5061000e612c0b565b5061000e612b2c565b5061000e612b0d565b5061000e612ae6565b5061000e612a80565b5061000e612a24565b5061000e612982565b5061000e612896565b5061000e61277a565b5061000e61275b565b5061000e61273b565b5061000e61269d565b5061000e6125ba565b5061000e61259b565b5061000e612575565b5061000e61243a565b5061000e6123b8565b5061000e612310565b5061000e6122ee565b5061000e6122c6565b5061000e61229f565b5061000e612191565b5061000e612122565b5061000e612063565b5061000e611ff6565b5061000e611fcd565b5061000e611fae565b5061000e611f88565b5061000e611cc8565b5061000e611c5e565b5061000e611c36565b5061000e611be9565b5061000e611b6b565b5061000e6119ef565b5061000e611948565b5061000e6118b7565b5061000e611887565b5061000e611863565b5061000e6117be565b5061000e611605565b5061000e611567565b5061000e611543565b5061000e611526565b5061000e6114a7565b5061000e611388565b5061000e6112ed565b5061000e6112b9565b5061000e61128c565b5061000e611249565b5061000e61121e565b5061000e610ee8565b5061000e610e4a565b5061000e610d6c565b5061000e610d1c565b5061000e610a1a565b5061000e610945565b5061000e610853565b5061000e6107d4565b5061000e6106ee565b5061000e6105d7565b5061000e61059e565b600091031261000e57565b503461000e57600036600319011261000e57602060ff60185460a81c166040519015158152f35b6001600160e01b031981160361000e57565b503461000e57602036600319011261000e5760206001600160e01b0319600435610600816105c5565b167f01ffc9a7000000000000000000000000000000000000000000000000000000008114908115610668575b811561063e575b506040519015158152f35b7f5b5e139f0000000000000000000000000000000000000000000000000000000091501438610633565b7f80ac58cd000000000000000000000000000000000000000000000000000000008114915061062c565b60005b8381106106a55750506000910152565b8181015183820152602001610695565b906020916106ce81518092818552858086019101610692565b601f01601f1916010190565b9060206106eb9281815201906106b5565b90565b503461000e576000806003193601126107d1576040519080600254610712816132f3565b808552916001918083169081156107a7575060011461074c575b6107488561073c81870382612812565b604051918291826106da565b0390f35b9250600283527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace5b82841061078f57505050810160200161073c8261074861072c565b80546020858701810191909152909301928101610774565b8695506107489693506020925061073c94915060ff191682840152151560051b820101929361072c565b80fd5b503461000e57602036600319011261000e576004356107f2816133b3565b1561081857600052600660205260206001600160a01b0360406000205416604051908152f35b60046040517fcf4700e4000000000000000000000000000000000000000000000000000000008152fd5b6001600160a01b0381160361000e57565b50604036600319011261000e5760043561086c81610842565b6024356001600160a01b03806108818361332d565b16908133036108e9575b6000838152600660205260408120805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387161790559316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258480a480f35b81600052600760205260ff610915336040600020906001600160a01b0316600052602052604060002090565b541661088b5760046040517fcfb3b942000000000000000000000000000000000000000000000000000000008152fd5b503461000e576000806003193601126107d157610960613247565b60ff600e54166107d1578054600d5481018082116109dc575b905b81811061099e578261098e600d54614416565b600160ff19600e541617600e5580f35b806109d26109d79260fc8160021b169060061c60005260166020526006600f821b1960406000205416911b17604060002055565b6136d6565b61097b565b6109e46136bf565b610979565b9181601f8401121561000e5782359167ffffffffffffffff831161000e576020808501948460051b01011161000e57565b50608036600319011261000e57600467ffffffffffffffff813581811161000e57610a4890369084016109e9565b91906024356044359360643592610a6560185460ff9060a81c1690565b610d0c57610a758660105461370a565b90610a828560115461370a565b9061032083118015610d01575b610cd857610aa98492610aa4610aae95601055565b601155565b614230565b610ad2610ac3610abd87613896565b8461370a565b610acc856138ac565b9061370a565b03610cc857600093610af7610af284610aed8489549661370a565b61370a565b614416565b84905b808210610c83575050835b828110610c46575066354a6ba7a1800034049084905b828210610c035750505080151580610bf7575b610b36578280f35b610b6b90610aed610b5e336001600160a01b0316600052600560205260406000205460c01c90565b67ffffffffffffffff1690565b336000908152601260205260409020548111610bce57610bc792935016336001600160a01b0316600052600560205277ffffffffffffffffffffffffffffffffffffffffffffffff604060002054169060c01b17604060002055565b8038808280f35b836040517f1564918b000000000000000000000000000000000000000000000000000000008152fd5b5060135460ff16610b2e565b610c3a816109d2610c409360fc8160021b169060061c60005260166020526001600f821b1960406000205416911b17604060002055565b916136d6565b90610b1b565b90610c3a816109d2610c7e9360fc8160021b169060061c60005260166020526008600f821b1960406000205416911b17604060002055565b610b05565b9091610cbc816109d2610cc29360fc8160021b169060061c60005260166020526007600f821b1960406000205416911b17604060002055565b926136d6565b90610afa565b8460405163bc449db160e01b8152fd5b886040517fd05cb609000000000000000000000000000000000000000000000000000000008152fd5b5061012c8211610a8f565b8660405163393a828d60e21b8152fd5b503461000e57600036600319011261000e5760206000546001549003604051908152f35b606090600319011261000e57600435610d5881610842565b90602435610d6581610842565b9060443590565b50610d7636610d40565b906daaeb6d7670e522a718067333cd4e803b610d99575b50610d97926146df565b005b604051633185c44d60e21b815230600482015233602482015290602090829060449082906000905af1908115610e3d575b600091610e0f575b5015610dde5738610d8d565b6040517fede71dcc000000000000000000000000000000000000000000000000000000008152336004820152602490fd5b610e30915060203d8111610e36575b610e288183612812565b8101906146ca565b38610dd2565b503d610e1e565b610e4561420e565b610dca565b503461000e57602036600319011261000e57600435610e67613247565b60ff600b541661000e57610eb66010548060011b906001600160ff1b03811603610edb575b6011546001600160fe1b0381168103610ece575b60021b8101809111610ec1575b600d54906137fb565b811161000e57600c55005b610ec96136bf565b610ead565b610ed66136bf565b610ea0565b610ee36136bf565b610e8c565b503461000e5760608060031936011261000e5760049081356024359160443567ffffffffffffffff811161000e57610f2390369086016109e9565b92610f3b610f3760135460ff9060201c1690565b1590565b61120e57610f6885610aed83600f908060061c600052601660205260fc6040600020549160021b161c1690565b600581116111fe57610f9f919060fc8260021b169160061c6000526016602052600f821b1960406000205416911b17604060002055565b60009283916001600160a01b03807f0000000000000000000000000000000000000000000000000000000000000000165b838510610ff4575b50505050505010610fe557005b604051634f6acca960e11b8152fd5b610fff858585613508565b359561106a611029826040998d8b519384928392634ca4fdf560e01b845283019190602083019252565b0381875afa9081156111f1575b6000916111c1575b5062278d006110626110518a8a8a613508565b356000526015602052604060002090565b5491046137fb565b9687156111b35761107c878787613508565b3581516331a9108f60e11b81528c81806110a0602095869483019190602083019252565b0381885afa9182156111a6575b600092611179575b5050843391160361116a57506110cb888861370a565b978989036110fd57505050506110f0926110e89261105192613508565b91825461370a565b9055388080808080610fd8565b8989939799989294981060001461113657509061112d916111256110e86110518b8989613508565b9055966136d6565b93949094610fd0565b905061115c96506110e895506110519492506111569150889793976137fb565b95613508565b905580388080808080610fd8565b8a9051631956fdd160e11b8152fd5b6111989250803d1061119f575b6111908183612812565b81019061421b565b38806110b5565b503d611186565b6111ae61420e565b6110ad565b509195509361112d906136d6565b6111e19150833d85116111ea575b6111d98183612812565b8101906141ea565b9150503861103e565b503d6111cf565b6111f961420e565b611036565b86604051634f6acca960e11b8152fd5b8560405163ae0e1c7560e01b8152fd5b503461000e57600036600319011261000e57611238613247565b6013805461ff001916610100179055005b503461000e57602036600319011261000e576020611284600435600f908060061c600052601660205260fc6040600020549160021b161c1690565b604051908152f35b503461000e57602036600319011261000e5760043560005260156020526020604060002054604051908152f35b503461000e576000806003193601126107d1576112d4613247565b8080808047335af16112e461390b565b50156107d15780f35b506112f736610d40565b906daaeb6d7670e522a718067333cd4e803b611318575b50610d97926148bd565b604051633185c44d60e21b815230600482015233602482015290602090829060449082906000905af190811561137b575b60009161135d575b5015610dde573861130e565b611375915060203d8111610e3657610e288183612812565b38611351565b61138361420e565b611349565b503461000e57602036600319011261000e576004356113b0610f3760185460ff9060a01c1690565b61147d576113bd816144f6565b6114036113e16113d56018546001600160a01b031690565b6001600160a01b031690565b91600f908060061c600052601660205260fc6040600020549160021b161c1690565b90803b1561000e576040517f32dfadd000000000000000000000000000000000000000000000000000000000815233600482015260248101839052906000908290818381604481015b03925af18015611470575b61145d57005b8061146a610d97926127b9565b80610593565b61147861420e565b611457565b60046040517fd7e907e0000000000000000000000000000000000000000000000000000000008152fd5b503461000e57602036600319011261000e576004356114c581610842565b6114cd613247565b60185460ff8160a01c1661000e577fffffffffffffffffffffff000000000000000000000000000000000000000000166001600160a01b0391909116177401000000000000000000000000000000000000000017601855005b503461000e57600036600319011261000e57602060405160068152f35b503461000e57600036600319011261000e57602060ff601354166040519015158152f35b503461000e57600036600319011261000e57611581613247565b60135464ff0000000060ff8260201c161560201b169064ff00000000191617601355600080f35b9181601f8401121561000e5782359167ffffffffffffffff831161000e576020838186019501011161000e57565b602060031982011261000e576004359067ffffffffffffffff821161000e57611601916004016115a8565b9091565b503461000e57611614366115d6565b61161c613247565b60ff60135460101c1661000e5767ffffffffffffffff8111611706575b61164d81611648601c546132f3565b613aa7565b6000601f821160011461168857819260009261167d575b5050600019600383901b1c191660019190911b17601c55005b013590503880611664565b601c600052601f198216927f0e4562a10381dec21b205ed72637e6b1b523bdd0e4d4d50af5cd23dd4500a21191805b8581106116ee575083600195106116d4575b505050811b01601c55005b0135600019600384901b60f8161c191690553880806116c9565b909260206001819286860135815501940191016116b7565b61170e6127a2565b611639565b602060031982011261000e576004359067ffffffffffffffff821161000e57611601916004016109e9565b6020908160408183019282815285518094520193019160005b828110611765575050505090565b90919293826080826117b2600194895162ffffff606080926001600160a01b03815116855267ffffffffffffffff6020820151166020860152604081015115156040860152015116910152565b01950193929101611757565b503461000e576117cd36611713565b906117d7826134ca565b916117e56040519384612812565b808352601f196117f4826134ca565b0160005b81811061184c57505060005b8181036118195760405180610748868261173e565b8061183061182a6001938587613508565b35613420565b61183a8287613520565b526118458186613520565b5001611804565b6020906118576133dc565b828288010152016117f8565b503461000e57600036600319011261000e57602060ff600b54166040519015158152f35b503461000e57602036600319011261000e5760206001600160a01b036118ae60043561332d565b16604051908152f35b503461000e57602036600319011261000e576004356118d5816133b3565b1561191e5761190a61190561074892600f908060061c600052601660205260fc6040600020549160021b161c1690565b613fba565b6040519182916020835260208301906106b5565b60046040517fa14c4b50000000000000000000000000000000000000000000000000000000008152fd5b5061195236611713565b9060ff60185460a81c166119de578161196a91614230565b66354a6ba7a1800034048181116119cd57600080545b82821061199057610d9784614416565b610c3a816109d26119c79360fc8160021b169060061c60005260166020526001600f821b1960406000205416911b17604060002055565b90611980565b600460405163bc449db160e01b8152fd5b600460405163393a828d60e21b8152fd5b503461000e5760408060031936011261000e5760243567ffffffffffffffff811161000e57611a229036906004016115a8565b611a2a613247565b60ff60135460081c16611b5b57611a526000926004358452601760205284842092369161285f565b611b01611b11602e8651611a8d60218260208101978a8952611a7d8151809260208686019101610692565b8101036001810184520182612812565b80519488519485926001600160e01b031960208501987f63000000000000000000000000000000000000000000000000000000000000008a5260e01b1660218501527f80600e6000396000f30000000000000000000000000000000000000000000000602585015251809285850190610692565b810103600e810184520182612812565b519083f0906001600160a01b03821615611b325790611b2f91613a53565b80f35b600484517f08d4abb6000000000000000000000000000000000000000000000000000000008152fd5b6004835163f76ae97360e01b8152fd5b503461000e5760408060031936011261000e5760043567ffffffffffffffff811161000e57611b9e9036906004016109e9565b916024359060005b848110611baf57005b806001600160a01b03611bc6611be4938888613508565b35611bd081610842565b1660005260126020528383600020556136d6565b611ba6565b503461000e576000806003193601126107d157611c04613247565b60135460ff8160101c16611c325763ff00000060ff8260181c161560181b169063ff00000019161760135580f35b5080fd5b503461000e57602036600319011261000e576020611284600435611c5981610842565b61329f565b503461000e576000806003193601126107d157611c79613247565b806001600160a01b0360085473ffffffffffffffffffffffffffffffffffffffff198116600855167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461000e5760608060031936011261000e5760049067ffffffffffffffff823581811161000e57611cfd90369085016109e9565b60249391933583811161000e57611d1790369087016109e9565b9360443590811161000e57611d2f90369088016109e9565b949092611d45610f3760135460ff9060201c1690565b611f785795919060009687935b818510611ebf57505050505060009283916001600160a01b03807f0000000000000000000000000000000000000000000000000000000000000000165b838510611da35750505050505010610fe557005b611dae858585613508565b3595611dd8611029826040998d8b519384928392634ca4fdf560e01b845283019190602083019252565b968715611eb157611dea878787613508565b3581516331a9108f60e11b81528c8180611e0e602095869483019190602083019252565b0381885afa918215611ea4575b600092611e87575b5050843391160361116a5750611e39888861370a565b97898903611e5657505050506110f0926110e89261105192613508565b89899397999892949810600014611136575090611e7e916111256110e86110518b8989613508565b93949094611d8f565b611e9d9250803d1061119f576111908183612812565b3880611e23565b611eac61420e565b611e1b565b5091955093611e7e906136d6565b9091929397611f18611f0c611efa611ed88c8787613508565b35600f908060061c600052601660205260fc6040600020549160021b161c1690565b611f058c888a613508565b359061370a565b91611f058b8789613508565b9860058211611f68576109d2611f5f92611f33838787613508565b359060fc8260021b169160061c6000526016602052600f821b1960406000205416911b17604060002055565b93929190611d52565b8a604051634f6acca960e11b8152fd5b8760405163ae0e1c7560e01b8152fd5b503461000e57600036600319011261000e57611fa2613247565b6013805460ff19169055005b503461000e57600036600319011261000e576020600c54604051908152f35b503461000e57600036600319011261000e57611fe7613247565b600b805460ff19166001179055005b503461000e57602036600319011261000e57602061128460043561201981610842565b613808565b90815180825260208080930193019160005b82811061203e575050505090565b835185529381019392810192600101612030565b9060206106eb92818152019061201e565b503461000e57602036600319011261000e5760043561208181610842565b60008061208d8361329f565b9161209783613542565b936120a06133dc565b506001600160a01b0390811691835b8585036120c457604051806107488982612052565b6120cd8161346e565b604081015161211957516001600160a01b0316838116612110575b5060019084848416146120fc575b016120af565b8061210a838801978a613520565b526120f6565b915060016120e8565b506001906120f6565b503461000e57602036600319011261000e5761213c613247565b60ff60135460081c166121805760006004358152601760205260408120805482825580612167578280f35b61217a91835260208320908101906139d1565b38808280f35b600460405163f76ae97360e01b8152fd5b503461000e576121a0366115d6565b6121a8613247565b60ff60135460081c166121805767ffffffffffffffff8111612292575b6121d9816121d4601b546132f3565b613b08565b6000601f8211600114612214578192600092612209575b5050600019600383901b1c191660019190911b17601b55005b0135905038806121f0565b601b600052601f198216927f3ad8aa4f87544323a9d1e5dd902f40c356527a7955687113db5f9a85ad579dc191805b85811061227a57508360019510612260575b505050811b01601b55005b0135600019600384901b60f8161c19169055388080612255565b90926020600181928686013581550194019101612243565b61229a6127a2565b6121c5565b503461000e57600036600319011261000e57602060ff60135460081c166040519015158152f35b503461000e57600036600319011261000e5760206001600160a01b0360085416604051908152f35b503461000e57602036600319011261000e57612308613247565b600435600a55005b503461000e576000806003193601126107d1576040519080600354612334816132f3565b808552916001918083169081156107a7575060011461235d576107488561073c81870382612812565b9250600383527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8284106123a057505050810160200161073c8261074861072c565b80546020858701810191909152909301928101612385565b503461000e57606036600319011261000e576107486123e96004356123dc81610842565b6044359060243590613574565b60405191829160208352602083019061201e565b6020908160408183019282815285518094520193019160005b828110612424575050505090565b8351151585529381019392810192600101612416565b503461000e5761244936611713565b9061245382613542565b91612460600954426137fb565b90600090815b81811061247b576040518061074888826123fd565b806124b0610f376124906124b994868a613508565b3560ff6001918060081c6000526014602052161b60406000205416151590565b6124be576136d6565b612466565b846124f16124cd83868a613508565b3560405190634ca4fdf560e01b825281806060948593600483019190602083019252565b03816001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165afa918215612568575b8792612548575b5050106136d6576109d26125428289613520565b60019052565b61255e9250803d106111ea576111d98183612812565b509050388061252e565b61257061420e565b612527565b503461000e57600036600319011261000e57602060135460ff60405191831c1615158152f35b503461000e57600036600319011261000e576020600a54604051908152f35b50602036600319011261000e5760043580600f5401600c54811161264f576125fe906125e9600a84111561393b565b6125f983600a5402341015613986565b600f55565b600054818101905b81811061261657610d9783614416565b8061264960019260fc8160021b169060061c60005260166020526006600f821b1960406000205416911b17604060002055565b01612606565b606460405162461bcd60e51b815260206004820152600860248201527f536f6c64204f75740000000000000000000000000000000000000000000000006044820152fd5b8015150361000e57565b503461000e57604036600319011261000e576004356126bb81610842565b6001600160a01b03602435916126d083612693565b3360005260076020526126fa816040600020906001600160a01b0316600052602052604060002090565b9215159260ff1981541660ff851617905560405192835216907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b503461000e57602036600319011261000e5761074861190a600435613fba565b503461000e57600036600319011261000e576020600f54604051908152f35b503461000e57600036600319011261000e5760206001600160a01b0360185416604051908152f35b50634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff81116127cd57604052565b6127d56127a2565b604052565b6040810190811067ffffffffffffffff8211176127cd57604052565b6020810190811067ffffffffffffffff8211176127cd57604052565b90601f8019910116810190811067ffffffffffffffff8211176127cd57604052565b60209067ffffffffffffffff8111612852575b601f01601f19160190565b61285a6127a2565b612847565b92919261286b82612834565b916128796040519384612812565b82948184528183011161000e578281602093846000960137010152565b50608036600319011261000e576004356128af81610842565b602435906128bc82610842565b60643567ffffffffffffffff811161000e573660238201121561000e576128ed90369060248160040135910161285f565b906daaeb6d7670e522a718067333cd4e803b612912575b50610d97926044359161495f565b604051633185c44d60e21b815230600482015233602482015290602090829060449082906000905af1908115612975575b600091612957575b5015610dde5738612904565b61296f915060203d8111610e3657610e288183612812565b3861294b565b61297d61420e565b612943565b503461000e57602036600319011261000e5760043561299f613247565b60ff600b54168015612a18575b61000e576129f36129ea6010546001600160ff1b0381168103612a0b575b6011546001600160fe1b03811681036129fe575b60021b9060011b61370a565b600c54906137fb565b811161000e57600d55005b612a066136bf565b6129de565b612a136136bf565b6129ca565b5060ff600e54166129ac565b503461000e57600036600319011261000e57612a3e613247565b601880547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff167501000000000000000000000000000000000000000000179055005b503461000e57602036600319011261000e576080612a9f600435613420565b612ae4604051809262ffffff606080926001600160a01b03815116855267ffffffffffffffff6020820151166020860152604081015115156040860152015116910152565bf35b503461000e57600036600319011261000e57602060ff60135460101c166040519015158152f35b503461000e57600036600319011261000e576020601054604051908152f35b503461000e57612b3b36611713565b90612b4582613542565b9160009081926001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016935b828110612b8c57604051806107488882612052565b80612bc9612ba16124cd612bd9948787613508565b03818c5afa918215612bfe575b8892612bde575b505062278d00611062611051858989613508565b612bd38289613520565b526136d6565b612b77565b612bf49250803d106111ea576111d98183612812565b9150503880612bb5565b612c0661420e565b612bae565b503461000e57602036600319011261000e57600435612c356040612c2e83613420565b0151151590565b90612c42610f37826133b3565b80612d1b575b61191e576107489181612c7961073c93600f908060061c600052601660205260fc6040600020549160021b161c1690565b600060058203612cff5750612c8e60066136d6565b91612c9f60135460ff9060181c1690565b15612cf357612cbe612cb8612cb384613f7b565b613c83565b91613f7b565b9315612ce557612cdf612cd8612cd2613d94565b936139e8565b5093613f7b565b93613dcd565b612cdf612cd8612cd2613d5b565b612cbe612cb883613fba565b5060068103612d1257612c8e60056136d6565b612c8e816136d6565b508115612c48565b503461000e57612d3236611713565b90612d3b613247565b601991604a8354101561000e5790600092835484934260a01b945b818110612d61578680f35b612d6c818387613508565b3590612d7782610842565b6001600160a01b03885492612d9f816001600160a01b03166000526005602052604060002090565b68010000000000000001815401905516600160e11b88821717612dcc846000526004602052604060002090565b556001808401937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90838c838180a482855b8c878203612ec357505050505015612e9957612e60918855612e4f818501808611612e655760fc8160021b169060061c60005260166020526009600f821b1960406000205416911b17604060002055565b612e5985546136d6565b85556136d6565b612d56565b612e6d6136bf565b60fc8160021b169060061c60005260166020526009600f821b1960406000205416911b17604060002055565b60046040517f2e076300000000000000000000000000000000000000000000000000000000008152fd5b84928185818594a4018390612dfe565b503461000e57600036600319011261000e57610748612f4a6010548060011b906001600160ff1b03811603612f8e575b61271081810391818311612f81575b6011546001600160fe1b0381168103612f74575b60021b019003908111612f67575b600c548101809111612f5a575b600d549061370a565b6040519081529081906020820190565b612f626136bf565b612f41565b612f6f6136bf565b612f34565b612f7c6136bf565b612f26565b612f896136bf565b612f12565b612f966136bf565b612f03565b503461000e57612faa36611713565b90612fbe610f3760185460ff9060a01c1690565b61147d57612fcb82613542565b9160005b8181106130305783612fec6113d56018546001600160a01b031690565b803b1561000e576040517fea6b8a1a00000000000000000000000000000000000000000000000000000000815290600090829081838161144c8833600484016146aa565b80613048613042613060938587613508565b356144f6565b613056611ed8828587613508565b612bd38287613520565b612fcf565b503461000e57600036600319011261000e57602060405166354a6ba7a180008152f35b503461000e57604036600319011261000e57602060ff6130e76004356130ad81610842565b6001600160a01b03602435916130c283610842565b16600052600784526040600020906001600160a01b0316600052602052604060002090565b54166040519015158152f35b503461000e57602036600319011261000e5760043561311181610842565b613119613247565b6001600160a01b03809116908115613173576008548273ffffffffffffffffffffffffffffffffffffffff19821617600855167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b608460405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b503461000e57600036600319011261000e576020604051600a8152f35b503461000e57600036600319011261000e576020601154604051908152f35b503461000e57600036600319011261000e57613233613247565b6013805463ffff0000191662010000179055005b6001600160a01b0360085416330361325b57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b6001600160a01b031680156132c957600052600560205267ffffffffffffffff6040600020541690565b60046040517f8f4eb604000000000000000000000000000000000000000000000000000000008152fd5b90600182811c92168015613323575b602083101461330d57565b634e487b7160e01b600052602260045260246000fd5b91607f1691613302565b60008181548110613363575b60046040517fdf2d9b42000000000000000000000000000000000000000000000000000000008152fd5b81526004906020918083526040928383205494600160e01b86161561338a57505050613339565b93929190935b851561339e57505050505090565b60001901808352818552838320549550613390565b600054811090816133c2575090565b90506000526004602052600160e01b604060002054161590565b604051906080820182811067ffffffffffffffff821117613413575b60405260006060838281528260208201528260408201520152565b61341b6127a2565b6133f8565b6134286133dc565b506134316133dc565b60005482101561346957506134458161346e565b604081015161346957506134646106eb9161345e6133dc565b5061332d565b613489565b905090565b6134766133dc565b5060005260046020526106eb6040600020545b906134926133dc565b916001600160a01b038116835267ffffffffffffffff8160a01c166020840152600160e01b81161515604084015260e81c6060830152565b60209067ffffffffffffffff81116134e4575b60051b0190565b6134ec6127a2565b6134dd565b50634e487b7160e01b600052603260045260246000fd5b91908110156135185760051b0190565b6134ec6134f1565b6020918151811015613535575b60051b010190565b61353d6134f1565b61352d565b9061354c826134ca565b6135596040519182612812565b828152809261356a601f19916134ca565b0190602036910137565b908281101561369557600091825480851161368d575b506135948161329f565b848310156136865782850381811061367e575b505b6135b281613542565b958115613676576135c284613420565b9185946040936135d7610f3786830151151590565b613664575b505b878114158061365a575b1561364d576135f68161346e565b8085015161364457516001600160a01b039081168061363b575b509081600192871690881614613627575b016135de565b80613635838a01998c613520565b52613621565b96506001613610565b50600190613621565b5050959450505050815290565b50818714156135e8565b516001600160a01b03169550386135dc565b945050505050565b9050386135a7565b50826135a9565b93503861358a565b60046040517f32c1995a000000000000000000000000000000000000000000000000000000008152fd5b50634e487b7160e01b600052601160045260246000fd5b60019060001981146136e6570190565b6136ee6136bf565b0190565b906002820180921161370057565b6137086136bf565b565b9190820180921161370057565b9060009081549281156137d157613741816001600160a01b03166000526005602052604060002090565b68010000000000000001830281540190556001600160a01b03600191169181811460e11b4260a01b178317613780866000526004602052604060002090565b55840193817fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91808587858180a4015b8581036137c25750505015612e995755565b8083918587858180a4016137b0565b60046040517fb562e8dd000000000000000000000000000000000000000000000000000000008152fd5b9190820391821161370057565b6001600160a01b03613831336001600160a01b0316600052600560205260406000205460c01c90565b911660009081526012602052604090205467ffffffffffffffff918216106138595750600090565b60406000205490613881336001600160a01b0316600052600560205260406000205460c01c90565b16810390811161388e5790565b6106eb6136bf565b9060038202918083046003149015171561370057565b9060058202918083046005149015171561370057565b908160021b916001600160fe1b0381160361370057565b604051906020820182811067ffffffffffffffff8211176138fe575b60405260008252565b6139066127a2565b6138f5565b3d15613936573d9061391c82612834565b9161392a6040519384612812565b82523d6000602084013e565b606090565b1561394257565b606460405162461bcd60e51b815260206004820152601960248201527f4d6178206d696e747320706572207472616e73616374696f6e000000000000006044820152fd5b1561398d57565b606460405162461bcd60e51b815260206004820152601d60248201527f45746865722076616c75652073656e7420697320696e636f72726563740000006044820152fd5b8181106139dc575050565b600081556001016139d1565b601a54811015613a20575b601a6000527f057c384a7d1c54f3a1b2e5e67b2617b8224fdfd1ea7234eea573a6ff665ff63e0190600090565b613a286134f1565b6139f3565b8054821015613a46575b60005260206000200190600090565b613a4e6134f1565b613a37565b8054613a769168010000000000000000821015613a9a575b600182018155613a2d565b819291549060031b916001600160a01b039283811b93849216901b16911916179055565b613aa26127a2565b613a6b565b90601f8211613ab4575050565b61370891601c6000527f0e4562a10381dec21b205ed72637e6b1b523bdd0e4d4d50af5cd23dd4500a211906020601f840160051c83019310613afe575b601f0160051c01906139d1565b9091508190613af1565b90601f8211613b15575050565b61370891601b6000527f3ad8aa4f87544323a9d1e5dd902f40c356527a7955687113db5f9a85ad579dc1906020601f840160051c83019310613afe57601f0160051c01906139d1565b601b5460009291613b6e826132f3565b91600190818116908115613bda5750600114613b8957505050565b9091929350601b6000527f3ad8aa4f87544323a9d1e5dd902f40c356527a7955687113db5f9a85ad579dc1906000915b848310613bc7575050500190565b8181602092548587015201920191613bb9565b60ff191683525050811515909102019150565b600092918154613bfc816132f3565b92600191808316908115613c555750600114613c19575b50505050565b90919293945060005260209081600020906000915b858310613c445750505050019038808080613c13565b805485840152918301918101613c2e565b60ff1916845250505081151590910201915038808080613c13565b906136ee60209282815194859201610692565b9060405191826000601c54613c97816132f3565b90600190818116908115613d345750600114613cd5575b505080613cc684602093613708965194859201610692565b0103601f198101845283612812565b601c60009081529192507f0e4562a10381dec21b205ed72637e6b1b523bdd0e4d4d50af5cd23dd4500a2115b838310613d1957505050810160200182613cc6613cae565b80546020848a01810191909152889550909201918101613d01565b60ff191660208681019190915283151590930285019092019250849150613cc69050613cae565b60405190613d68826127da565b600882527f556e6f70656e65640000000000000000000000000000000000000000000000006020830152565b60405190613da1826127da565b600682527f4275726e656400000000000000000000000000000000000000000000000000006020830152565b90613e499594613f43613ef4613708966075600497613f4996604080519d8e809b7f646174613a6170706c69636174696f6e2f6a736f6e2c0000000000000000000060208301527f7b226e616d65223a222300000000000000000000000000000000000000000000603683015260208151948593019101610692565b89017f222c22696d616765223a220000000000000000000000000000000000000000006040820152613e85825180936020604b85019101610692565b017f222c2261747472696275746573223a5b7b2274726169745f74797065223a2200604b820152613ec0825180936020606a85019101610692565b01613eed606a82017f222c2276616c7565223a220000000000000000000000000000000000000000009052565b0190613bed565b7f227d2c7b2274726169745f74797065223a2254696572222c2276616c7565223a81527f2200000000000000000000000000000000000000000000000000000000000000602082015260210190565b90613c70565b7f227d5d7d00000000000000000000000000000000000000000000000000000000815203601b19810185520183612812565b9060405160a08101604052608081019260008452925b6000190192600a906030828206018553049283613f9157809350608091030191601f1901918252565b60005260176020526040600020906020604051600084545b80821061402e5750506020929350906140006106eb92601f198381601f81960116830160405201815261410f565b604051938491614021614014838501613b5e565b9182815194859201610692565b0103908101835282612812565b90926001906001600160a01b036140458689613a2d565b90549060031b1c1690813b90600019928484840191838901903c0101930190613fd2565b604051906060820182811067ffffffffffffffff8211176140da575b604052604082527f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f6040837f4142434445464748494a4b4c4d4e4f505152535455565758595a61626364656660208201520152565b6140e26127a2565b614085565b906140f182612834565b6140fe6040519182612812565b828152809261356a601f1991612834565b8051156141e15761411e614069565b61414261413d61413861413185516136f2565b6003900490565b6138c2565b6140e7565b9160208301918182518301915b82821061418f5750505060039051068060011461417c57600214614171575090565b603d90600019015390565b50603d9081600019820153600119015390565b9091936004906003809401938451600190603f9082828260121c16880101518553828282600c1c16880101518386015382828260061c168801015160028601531685010151908201530193919061414f565b506106eb6138d9565b9081606091031261000e57805161420081612693565b916040602083015192015190565b506040513d6000823e3d90fd5b9081602091031261000e57516106eb81610842565b61423c600954426137fb565b9060006001600160a01b03807f000000000000000000000000000000000000000000000000000000000000000016915b85811061427b57505050505050565b614286818786613508565b35604080516331a9108f60e11b81526020908181806142ae6004978883019190602083019252565b03818a5afa918215614409575b6000926143ec575b505084339116036143df576142dc612490848a89613508565b6143b957866143116142ef858b8a613508565b35835190634ca4fdf560e01b8252818060609485938983019190602083019252565b03818b5afa9182156143ac575b60009261438c575b505010614366575050806109d2614341614361938988613508565b358060081c6000526014602052600160ff604060002092161b8154179055565b61426c565b517f24abfe20000000000000000000000000000000000000000000000000000000008152fd5b6143a29250803d106111ea576111d98183612812565b5090503880614326565b6143b461420e565b61431e565b517f646cf558000000000000000000000000000000000000000000000000000000008152fd5b51631956fdd160e11b8152fd5b6144029250803d1061119f576111908183612812565b38806142c3565b61441161420e565b6142bb565b600690334260a01b811790838304901560005b8281106144475750505050068061443d5750565b6137089033613717565b60005490614468336001600160a01b03166000526005602052604060002090565b6806000000000000000681540190558461448c836000526004602052604060002090565b5586820191837fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef82336000838180a460018093015b8581036144e15750509050612e99576144dc916000556136d6565b614429565b8391925080336000858180a4019085916144c1565b6144ff8161332d565b6001600160a01b038116614520836000526006602052604060002090815490565b929061453b6001600160a01b03841633908114908614171590565b61464e575b600093614645575b50614566826001600160a01b03166000526005602052604060002090565b6fffffffffffffffffffffffffffffffff81540190557c03000000000000000000000000000000000000000000000000000000004260a01b8317176145b5856000526004602052604060002090565b55600160e11b8116156145fc575b507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a46137086145f760015460010190565b600155565b60018401614614816000526004602052604060002090565b5415614621575b506145c3565b8354811461461b5761463d906000526004602052604060002090565b55388061461b565b83905538614548565b614694610f3761468d33614675876001600160a01b03166000526007602052604060002090565b906001600160a01b0316600052602052604060002090565b5460ff1690565b15614540576004604051632ce44b5f60e11b8152fd5b6040906001600160a01b036106eb9493168152816020820152019061201e565b9081602091031261000e57516106eb81612693565b906146e98361332d565b6001600160a01b03808416928382841603614893576000868152600660205260409020805490926147296001600160a01b03881633908114908414171590565b614856575b821695861561482c5761477f9361475e92614822575b506001600160a01b03166000526005602052604060002090565b80546000190190556001600160a01b03166000526005602052604060002090565b80546001019055600160e11b804260a01b8517176147a7866000526004602052604060002090565b558116156147d8575b507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4565b600184016147f0816000526004602052604060002090565b54156147fd575b506147b0565b60005481146147f75761481a906000526004602052604060002090565b5538806147f7565b6000905538614744565b60046040517fea553b34000000000000000000000000000000000000000000000000000000008152fd5b61487d610f3761468d336146758b6001600160a01b03166000526007602052604060002090565b1561472e576004604051632ce44b5f60e11b8152fd5b60046040517fa1148100000000000000000000000000000000000000000000000000000000008152fd5b91604051916148cb836127f6565b600083526daaeb6d7670e522a718067333cd4e803b6148ef575b506137089361495f565b604051633185c44d60e21b815230600482015233602482015290602090829060449082906000905af1908115614952575b600091614934575b5015610dde57386148e5565b61494c915060203d8111610e3657610e288183612812565b38614928565b61495a61420e565b614920565b919290926daaeb6d7670e522a718067333cd4e803b6149bc575b506149858185856146df565b833b6149915750505050565b61499e93610f3793614a70565b6149ab5738808080613c13565b60046040516368d2bf6b60e11b8152fd5b604051633185c44d60e21b815230600482015233602482015290602090829060449082906000905af1908115614a1f575b600091614a01575b5015610dde5738614979565b614a19915060203d8111610e3657610e288183612812565b386149f5565b614a2761420e565b6149ed565b9081602091031261000e57516106eb816105c5565b90926106eb94936080936001600160a01b038092168452166020830152604082015281606082015201906106b5565b92602091614aba9360006001600160a01b036040518097819682957f150b7a02000000000000000000000000000000000000000000000000000000009b8c85523360048601614a41565b0393165af160009181614b01575b50614af357614ad561390b565b80519081614aee5760046040516368d2bf6b60e11b8152fd5b602001fd5b6001600160e01b0319161490565b614b2391925060203d8111614b2a575b614b1b8183612812565b810190614a2c565b9038614ac8565b503d614b1156fea26469706673582212201882fdd5d4b0f7c180e59322107b7ee8602cff2fe7f93b04206ec72d57fbdfbd64736f6c63430008110033405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace057c384a7d1c54f3a1b2e5e67b2617b8224fdfd1ea7234eea573a6ff665ff63e000000000000000000000000be82b9533ddf0acaddcaa6af38830ff4b919482c0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000003c68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f656e69676d61746963626f786e66742f646174612f6d61696e2f00000000
Deployed Bytecode
0x60806040526004361015610013575b600080fd5b60003560e01c8062a9bdc31461058a57806301ffc9a71461058157806306fdde0314610578578063081812fc1461056f578063095ea7b314610566578063102c67811461055d57806310ace5461461055457806318160ddd1461054b57806323b872dd146105425780632c99589b146105395780632fbbfc881461053057806331d543a614610527578063356ee3351461051e57806338337e10146105155780633ccfd60b1461050c57806342842e0e1461050357806342966c68146104fa5780634867eb47146104f157806349faa4d4146104e85780634e92c5dd146104df5780634ff9ca2b146104d657806355f804b3146104cd5780635bbb2177146104c45780635be64d37146104bb5780636352211e146104b257806366a5b524146104a95780636ba4c138146104a05780636cb46f12146104975780636ef151ce1461048e578063708079331461048557806370a082311461047c578063715018a61461047357806372787a811461046a578063774b45f41461046157806378cbcf23146104585780637ec2402f1461044f5780638265b0de146104465780638462151c1461043d578063861d7daf1461043457806389c9f4531461042b5780638d8a6054146104225780638da5cb5b1461041957806391b7f5ed1461041057806395d89b411461040757806399a2557a146103fe5780639e266fe6146103f55780639f5045e5146103ec578063a035b1fe146103e3578063a0712d68146103da578063a22cb465146103d1578063a3fbed6e146103c8578063a4f4f8af146103bf578063aca94db9146103b6578063b88d4fde146103ad578063b94dc222146103a4578063bf6b8adc1461039b578063c23dc68f14610392578063c3a7b31f14610389578063c78e64c114610380578063c810114414610377578063c87b56dd1461036e578063ca698a4714610365578063d5abeb011461035c578063dc8e92ea14610353578063e0e83a5f1461034a578063e985e9c514610341578063f2fde38b14610338578063f968adbe1461032f578063fae48c3d146103265763fed8a8391461031e57600080fd5b61000e613219565b5061000e6131fa565b5061000e6131dd565b5061000e6130f3565b5061000e613088565b5061000e613065565b5061000e612f9b565b5061000e612ed3565b5061000e612d23565b5061000e612c0b565b5061000e612b2c565b5061000e612b0d565b5061000e612ae6565b5061000e612a80565b5061000e612a24565b5061000e612982565b5061000e612896565b5061000e61277a565b5061000e61275b565b5061000e61273b565b5061000e61269d565b5061000e6125ba565b5061000e61259b565b5061000e612575565b5061000e61243a565b5061000e6123b8565b5061000e612310565b5061000e6122ee565b5061000e6122c6565b5061000e61229f565b5061000e612191565b5061000e612122565b5061000e612063565b5061000e611ff6565b5061000e611fcd565b5061000e611fae565b5061000e611f88565b5061000e611cc8565b5061000e611c5e565b5061000e611c36565b5061000e611be9565b5061000e611b6b565b5061000e6119ef565b5061000e611948565b5061000e6118b7565b5061000e611887565b5061000e611863565b5061000e6117be565b5061000e611605565b5061000e611567565b5061000e611543565b5061000e611526565b5061000e6114a7565b5061000e611388565b5061000e6112ed565b5061000e6112b9565b5061000e61128c565b5061000e611249565b5061000e61121e565b5061000e610ee8565b5061000e610e4a565b5061000e610d6c565b5061000e610d1c565b5061000e610a1a565b5061000e610945565b5061000e610853565b5061000e6107d4565b5061000e6106ee565b5061000e6105d7565b5061000e61059e565b600091031261000e57565b503461000e57600036600319011261000e57602060ff60185460a81c166040519015158152f35b6001600160e01b031981160361000e57565b503461000e57602036600319011261000e5760206001600160e01b0319600435610600816105c5565b167f01ffc9a7000000000000000000000000000000000000000000000000000000008114908115610668575b811561063e575b506040519015158152f35b7f5b5e139f0000000000000000000000000000000000000000000000000000000091501438610633565b7f80ac58cd000000000000000000000000000000000000000000000000000000008114915061062c565b60005b8381106106a55750506000910152565b8181015183820152602001610695565b906020916106ce81518092818552858086019101610692565b601f01601f1916010190565b9060206106eb9281815201906106b5565b90565b503461000e576000806003193601126107d1576040519080600254610712816132f3565b808552916001918083169081156107a7575060011461074c575b6107488561073c81870382612812565b604051918291826106da565b0390f35b9250600283527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace5b82841061078f57505050810160200161073c8261074861072c565b80546020858701810191909152909301928101610774565b8695506107489693506020925061073c94915060ff191682840152151560051b820101929361072c565b80fd5b503461000e57602036600319011261000e576004356107f2816133b3565b1561081857600052600660205260206001600160a01b0360406000205416604051908152f35b60046040517fcf4700e4000000000000000000000000000000000000000000000000000000008152fd5b6001600160a01b0381160361000e57565b50604036600319011261000e5760043561086c81610842565b6024356001600160a01b03806108818361332d565b16908133036108e9575b6000838152600660205260408120805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387161790559316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258480a480f35b81600052600760205260ff610915336040600020906001600160a01b0316600052602052604060002090565b541661088b5760046040517fcfb3b942000000000000000000000000000000000000000000000000000000008152fd5b503461000e576000806003193601126107d157610960613247565b60ff600e54166107d1578054600d5481018082116109dc575b905b81811061099e578261098e600d54614416565b600160ff19600e541617600e5580f35b806109d26109d79260fc8160021b169060061c60005260166020526006600f821b1960406000205416911b17604060002055565b6136d6565b61097b565b6109e46136bf565b610979565b9181601f8401121561000e5782359167ffffffffffffffff831161000e576020808501948460051b01011161000e57565b50608036600319011261000e57600467ffffffffffffffff813581811161000e57610a4890369084016109e9565b91906024356044359360643592610a6560185460ff9060a81c1690565b610d0c57610a758660105461370a565b90610a828560115461370a565b9061032083118015610d01575b610cd857610aa98492610aa4610aae95601055565b601155565b614230565b610ad2610ac3610abd87613896565b8461370a565b610acc856138ac565b9061370a565b03610cc857600093610af7610af284610aed8489549661370a565b61370a565b614416565b84905b808210610c83575050835b828110610c46575066354a6ba7a1800034049084905b828210610c035750505080151580610bf7575b610b36578280f35b610b6b90610aed610b5e336001600160a01b0316600052600560205260406000205460c01c90565b67ffffffffffffffff1690565b336000908152601260205260409020548111610bce57610bc792935016336001600160a01b0316600052600560205277ffffffffffffffffffffffffffffffffffffffffffffffff604060002054169060c01b17604060002055565b8038808280f35b836040517f1564918b000000000000000000000000000000000000000000000000000000008152fd5b5060135460ff16610b2e565b610c3a816109d2610c409360fc8160021b169060061c60005260166020526001600f821b1960406000205416911b17604060002055565b916136d6565b90610b1b565b90610c3a816109d2610c7e9360fc8160021b169060061c60005260166020526008600f821b1960406000205416911b17604060002055565b610b05565b9091610cbc816109d2610cc29360fc8160021b169060061c60005260166020526007600f821b1960406000205416911b17604060002055565b926136d6565b90610afa565b8460405163bc449db160e01b8152fd5b886040517fd05cb609000000000000000000000000000000000000000000000000000000008152fd5b5061012c8211610a8f565b8660405163393a828d60e21b8152fd5b503461000e57600036600319011261000e5760206000546001549003604051908152f35b606090600319011261000e57600435610d5881610842565b90602435610d6581610842565b9060443590565b50610d7636610d40565b906daaeb6d7670e522a718067333cd4e803b610d99575b50610d97926146df565b005b604051633185c44d60e21b815230600482015233602482015290602090829060449082906000905af1908115610e3d575b600091610e0f575b5015610dde5738610d8d565b6040517fede71dcc000000000000000000000000000000000000000000000000000000008152336004820152602490fd5b610e30915060203d8111610e36575b610e288183612812565b8101906146ca565b38610dd2565b503d610e1e565b610e4561420e565b610dca565b503461000e57602036600319011261000e57600435610e67613247565b60ff600b541661000e57610eb66010548060011b906001600160ff1b03811603610edb575b6011546001600160fe1b0381168103610ece575b60021b8101809111610ec1575b600d54906137fb565b811161000e57600c55005b610ec96136bf565b610ead565b610ed66136bf565b610ea0565b610ee36136bf565b610e8c565b503461000e5760608060031936011261000e5760049081356024359160443567ffffffffffffffff811161000e57610f2390369086016109e9565b92610f3b610f3760135460ff9060201c1690565b1590565b61120e57610f6885610aed83600f908060061c600052601660205260fc6040600020549160021b161c1690565b600581116111fe57610f9f919060fc8260021b169160061c6000526016602052600f821b1960406000205416911b17604060002055565b60009283916001600160a01b03807f000000000000000000000000be82b9533ddf0acaddcaa6af38830ff4b919482c165b838510610ff4575b50505050505010610fe557005b604051634f6acca960e11b8152fd5b610fff858585613508565b359561106a611029826040998d8b519384928392634ca4fdf560e01b845283019190602083019252565b0381875afa9081156111f1575b6000916111c1575b5062278d006110626110518a8a8a613508565b356000526015602052604060002090565b5491046137fb565b9687156111b35761107c878787613508565b3581516331a9108f60e11b81528c81806110a0602095869483019190602083019252565b0381885afa9182156111a6575b600092611179575b5050843391160361116a57506110cb888861370a565b978989036110fd57505050506110f0926110e89261105192613508565b91825461370a565b9055388080808080610fd8565b8989939799989294981060001461113657509061112d916111256110e86110518b8989613508565b9055966136d6565b93949094610fd0565b905061115c96506110e895506110519492506111569150889793976137fb565b95613508565b905580388080808080610fd8565b8a9051631956fdd160e11b8152fd5b6111989250803d1061119f575b6111908183612812565b81019061421b565b38806110b5565b503d611186565b6111ae61420e565b6110ad565b509195509361112d906136d6565b6111e19150833d85116111ea575b6111d98183612812565b8101906141ea565b9150503861103e565b503d6111cf565b6111f961420e565b611036565b86604051634f6acca960e11b8152fd5b8560405163ae0e1c7560e01b8152fd5b503461000e57600036600319011261000e57611238613247565b6013805461ff001916610100179055005b503461000e57602036600319011261000e576020611284600435600f908060061c600052601660205260fc6040600020549160021b161c1690565b604051908152f35b503461000e57602036600319011261000e5760043560005260156020526020604060002054604051908152f35b503461000e576000806003193601126107d1576112d4613247565b8080808047335af16112e461390b565b50156107d15780f35b506112f736610d40565b906daaeb6d7670e522a718067333cd4e803b611318575b50610d97926148bd565b604051633185c44d60e21b815230600482015233602482015290602090829060449082906000905af190811561137b575b60009161135d575b5015610dde573861130e565b611375915060203d8111610e3657610e288183612812565b38611351565b61138361420e565b611349565b503461000e57602036600319011261000e576004356113b0610f3760185460ff9060a01c1690565b61147d576113bd816144f6565b6114036113e16113d56018546001600160a01b031690565b6001600160a01b031690565b91600f908060061c600052601660205260fc6040600020549160021b161c1690565b90803b1561000e576040517f32dfadd000000000000000000000000000000000000000000000000000000000815233600482015260248101839052906000908290818381604481015b03925af18015611470575b61145d57005b8061146a610d97926127b9565b80610593565b61147861420e565b611457565b60046040517fd7e907e0000000000000000000000000000000000000000000000000000000008152fd5b503461000e57602036600319011261000e576004356114c581610842565b6114cd613247565b60185460ff8160a01c1661000e577fffffffffffffffffffffff000000000000000000000000000000000000000000166001600160a01b0391909116177401000000000000000000000000000000000000000017601855005b503461000e57600036600319011261000e57602060405160068152f35b503461000e57600036600319011261000e57602060ff601354166040519015158152f35b503461000e57600036600319011261000e57611581613247565b60135464ff0000000060ff8260201c161560201b169064ff00000000191617601355600080f35b9181601f8401121561000e5782359167ffffffffffffffff831161000e576020838186019501011161000e57565b602060031982011261000e576004359067ffffffffffffffff821161000e57611601916004016115a8565b9091565b503461000e57611614366115d6565b61161c613247565b60ff60135460101c1661000e5767ffffffffffffffff8111611706575b61164d81611648601c546132f3565b613aa7565b6000601f821160011461168857819260009261167d575b5050600019600383901b1c191660019190911b17601c55005b013590503880611664565b601c600052601f198216927f0e4562a10381dec21b205ed72637e6b1b523bdd0e4d4d50af5cd23dd4500a21191805b8581106116ee575083600195106116d4575b505050811b01601c55005b0135600019600384901b60f8161c191690553880806116c9565b909260206001819286860135815501940191016116b7565b61170e6127a2565b611639565b602060031982011261000e576004359067ffffffffffffffff821161000e57611601916004016109e9565b6020908160408183019282815285518094520193019160005b828110611765575050505090565b90919293826080826117b2600194895162ffffff606080926001600160a01b03815116855267ffffffffffffffff6020820151166020860152604081015115156040860152015116910152565b01950193929101611757565b503461000e576117cd36611713565b906117d7826134ca565b916117e56040519384612812565b808352601f196117f4826134ca565b0160005b81811061184c57505060005b8181036118195760405180610748868261173e565b8061183061182a6001938587613508565b35613420565b61183a8287613520565b526118458186613520565b5001611804565b6020906118576133dc565b828288010152016117f8565b503461000e57600036600319011261000e57602060ff600b54166040519015158152f35b503461000e57602036600319011261000e5760206001600160a01b036118ae60043561332d565b16604051908152f35b503461000e57602036600319011261000e576004356118d5816133b3565b1561191e5761190a61190561074892600f908060061c600052601660205260fc6040600020549160021b161c1690565b613fba565b6040519182916020835260208301906106b5565b60046040517fa14c4b50000000000000000000000000000000000000000000000000000000008152fd5b5061195236611713565b9060ff60185460a81c166119de578161196a91614230565b66354a6ba7a1800034048181116119cd57600080545b82821061199057610d9784614416565b610c3a816109d26119c79360fc8160021b169060061c60005260166020526001600f821b1960406000205416911b17604060002055565b90611980565b600460405163bc449db160e01b8152fd5b600460405163393a828d60e21b8152fd5b503461000e5760408060031936011261000e5760243567ffffffffffffffff811161000e57611a229036906004016115a8565b611a2a613247565b60ff60135460081c16611b5b57611a526000926004358452601760205284842092369161285f565b611b01611b11602e8651611a8d60218260208101978a8952611a7d8151809260208686019101610692565b8101036001810184520182612812565b80519488519485926001600160e01b031960208501987f63000000000000000000000000000000000000000000000000000000000000008a5260e01b1660218501527f80600e6000396000f30000000000000000000000000000000000000000000000602585015251809285850190610692565b810103600e810184520182612812565b519083f0906001600160a01b03821615611b325790611b2f91613a53565b80f35b600484517f08d4abb6000000000000000000000000000000000000000000000000000000008152fd5b6004835163f76ae97360e01b8152fd5b503461000e5760408060031936011261000e5760043567ffffffffffffffff811161000e57611b9e9036906004016109e9565b916024359060005b848110611baf57005b806001600160a01b03611bc6611be4938888613508565b35611bd081610842565b1660005260126020528383600020556136d6565b611ba6565b503461000e576000806003193601126107d157611c04613247565b60135460ff8160101c16611c325763ff00000060ff8260181c161560181b169063ff00000019161760135580f35b5080fd5b503461000e57602036600319011261000e576020611284600435611c5981610842565b61329f565b503461000e576000806003193601126107d157611c79613247565b806001600160a01b0360085473ffffffffffffffffffffffffffffffffffffffff198116600855167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461000e5760608060031936011261000e5760049067ffffffffffffffff823581811161000e57611cfd90369085016109e9565b60249391933583811161000e57611d1790369087016109e9565b9360443590811161000e57611d2f90369088016109e9565b949092611d45610f3760135460ff9060201c1690565b611f785795919060009687935b818510611ebf57505050505060009283916001600160a01b03807f000000000000000000000000be82b9533ddf0acaddcaa6af38830ff4b919482c165b838510611da35750505050505010610fe557005b611dae858585613508565b3595611dd8611029826040998d8b519384928392634ca4fdf560e01b845283019190602083019252565b968715611eb157611dea878787613508565b3581516331a9108f60e11b81528c8180611e0e602095869483019190602083019252565b0381885afa918215611ea4575b600092611e87575b5050843391160361116a5750611e39888861370a565b97898903611e5657505050506110f0926110e89261105192613508565b89899397999892949810600014611136575090611e7e916111256110e86110518b8989613508565b93949094611d8f565b611e9d9250803d1061119f576111908183612812565b3880611e23565b611eac61420e565b611e1b565b5091955093611e7e906136d6565b9091929397611f18611f0c611efa611ed88c8787613508565b35600f908060061c600052601660205260fc6040600020549160021b161c1690565b611f058c888a613508565b359061370a565b91611f058b8789613508565b9860058211611f68576109d2611f5f92611f33838787613508565b359060fc8260021b169160061c6000526016602052600f821b1960406000205416911b17604060002055565b93929190611d52565b8a604051634f6acca960e11b8152fd5b8760405163ae0e1c7560e01b8152fd5b503461000e57600036600319011261000e57611fa2613247565b6013805460ff19169055005b503461000e57600036600319011261000e576020600c54604051908152f35b503461000e57600036600319011261000e57611fe7613247565b600b805460ff19166001179055005b503461000e57602036600319011261000e57602061128460043561201981610842565b613808565b90815180825260208080930193019160005b82811061203e575050505090565b835185529381019392810192600101612030565b9060206106eb92818152019061201e565b503461000e57602036600319011261000e5760043561208181610842565b60008061208d8361329f565b9161209783613542565b936120a06133dc565b506001600160a01b0390811691835b8585036120c457604051806107488982612052565b6120cd8161346e565b604081015161211957516001600160a01b0316838116612110575b5060019084848416146120fc575b016120af565b8061210a838801978a613520565b526120f6565b915060016120e8565b506001906120f6565b503461000e57602036600319011261000e5761213c613247565b60ff60135460081c166121805760006004358152601760205260408120805482825580612167578280f35b61217a91835260208320908101906139d1565b38808280f35b600460405163f76ae97360e01b8152fd5b503461000e576121a0366115d6565b6121a8613247565b60ff60135460081c166121805767ffffffffffffffff8111612292575b6121d9816121d4601b546132f3565b613b08565b6000601f8211600114612214578192600092612209575b5050600019600383901b1c191660019190911b17601b55005b0135905038806121f0565b601b600052601f198216927f3ad8aa4f87544323a9d1e5dd902f40c356527a7955687113db5f9a85ad579dc191805b85811061227a57508360019510612260575b505050811b01601b55005b0135600019600384901b60f8161c19169055388080612255565b90926020600181928686013581550194019101612243565b61229a6127a2565b6121c5565b503461000e57600036600319011261000e57602060ff60135460081c166040519015158152f35b503461000e57600036600319011261000e5760206001600160a01b0360085416604051908152f35b503461000e57602036600319011261000e57612308613247565b600435600a55005b503461000e576000806003193601126107d1576040519080600354612334816132f3565b808552916001918083169081156107a7575060011461235d576107488561073c81870382612812565b9250600383527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8284106123a057505050810160200161073c8261074861072c565b80546020858701810191909152909301928101612385565b503461000e57606036600319011261000e576107486123e96004356123dc81610842565b6044359060243590613574565b60405191829160208352602083019061201e565b6020908160408183019282815285518094520193019160005b828110612424575050505090565b8351151585529381019392810192600101612416565b503461000e5761244936611713565b9061245382613542565b91612460600954426137fb565b90600090815b81811061247b576040518061074888826123fd565b806124b0610f376124906124b994868a613508565b3560ff6001918060081c6000526014602052161b60406000205416151590565b6124be576136d6565b612466565b846124f16124cd83868a613508565b3560405190634ca4fdf560e01b825281806060948593600483019190602083019252565b03816001600160a01b037f000000000000000000000000be82b9533ddf0acaddcaa6af38830ff4b919482c165afa918215612568575b8792612548575b5050106136d6576109d26125428289613520565b60019052565b61255e9250803d106111ea576111d98183612812565b509050388061252e565b61257061420e565b612527565b503461000e57600036600319011261000e57602060135460ff60405191831c1615158152f35b503461000e57600036600319011261000e576020600a54604051908152f35b50602036600319011261000e5760043580600f5401600c54811161264f576125fe906125e9600a84111561393b565b6125f983600a5402341015613986565b600f55565b600054818101905b81811061261657610d9783614416565b8061264960019260fc8160021b169060061c60005260166020526006600f821b1960406000205416911b17604060002055565b01612606565b606460405162461bcd60e51b815260206004820152600860248201527f536f6c64204f75740000000000000000000000000000000000000000000000006044820152fd5b8015150361000e57565b503461000e57604036600319011261000e576004356126bb81610842565b6001600160a01b03602435916126d083612693565b3360005260076020526126fa816040600020906001600160a01b0316600052602052604060002090565b9215159260ff1981541660ff851617905560405192835216907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b503461000e57602036600319011261000e5761074861190a600435613fba565b503461000e57600036600319011261000e576020600f54604051908152f35b503461000e57600036600319011261000e5760206001600160a01b0360185416604051908152f35b50634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff81116127cd57604052565b6127d56127a2565b604052565b6040810190811067ffffffffffffffff8211176127cd57604052565b6020810190811067ffffffffffffffff8211176127cd57604052565b90601f8019910116810190811067ffffffffffffffff8211176127cd57604052565b60209067ffffffffffffffff8111612852575b601f01601f19160190565b61285a6127a2565b612847565b92919261286b82612834565b916128796040519384612812565b82948184528183011161000e578281602093846000960137010152565b50608036600319011261000e576004356128af81610842565b602435906128bc82610842565b60643567ffffffffffffffff811161000e573660238201121561000e576128ed90369060248160040135910161285f565b906daaeb6d7670e522a718067333cd4e803b612912575b50610d97926044359161495f565b604051633185c44d60e21b815230600482015233602482015290602090829060449082906000905af1908115612975575b600091612957575b5015610dde5738612904565b61296f915060203d8111610e3657610e288183612812565b3861294b565b61297d61420e565b612943565b503461000e57602036600319011261000e5760043561299f613247565b60ff600b54168015612a18575b61000e576129f36129ea6010546001600160ff1b0381168103612a0b575b6011546001600160fe1b03811681036129fe575b60021b9060011b61370a565b600c54906137fb565b811161000e57600d55005b612a066136bf565b6129de565b612a136136bf565b6129ca565b5060ff600e54166129ac565b503461000e57600036600319011261000e57612a3e613247565b601880547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff167501000000000000000000000000000000000000000000179055005b503461000e57602036600319011261000e576080612a9f600435613420565b612ae4604051809262ffffff606080926001600160a01b03815116855267ffffffffffffffff6020820151166020860152604081015115156040860152015116910152565bf35b503461000e57600036600319011261000e57602060ff60135460101c166040519015158152f35b503461000e57600036600319011261000e576020601054604051908152f35b503461000e57612b3b36611713565b90612b4582613542565b9160009081926001600160a01b037f000000000000000000000000be82b9533ddf0acaddcaa6af38830ff4b919482c16935b828110612b8c57604051806107488882612052565b80612bc9612ba16124cd612bd9948787613508565b03818c5afa918215612bfe575b8892612bde575b505062278d00611062611051858989613508565b612bd38289613520565b526136d6565b612b77565b612bf49250803d106111ea576111d98183612812565b9150503880612bb5565b612c0661420e565b612bae565b503461000e57602036600319011261000e57600435612c356040612c2e83613420565b0151151590565b90612c42610f37826133b3565b80612d1b575b61191e576107489181612c7961073c93600f908060061c600052601660205260fc6040600020549160021b161c1690565b600060058203612cff5750612c8e60066136d6565b91612c9f60135460ff9060181c1690565b15612cf357612cbe612cb8612cb384613f7b565b613c83565b91613f7b565b9315612ce557612cdf612cd8612cd2613d94565b936139e8565b5093613f7b565b93613dcd565b612cdf612cd8612cd2613d5b565b612cbe612cb883613fba565b5060068103612d1257612c8e60056136d6565b612c8e816136d6565b508115612c48565b503461000e57612d3236611713565b90612d3b613247565b601991604a8354101561000e5790600092835484934260a01b945b818110612d61578680f35b612d6c818387613508565b3590612d7782610842565b6001600160a01b03885492612d9f816001600160a01b03166000526005602052604060002090565b68010000000000000001815401905516600160e11b88821717612dcc846000526004602052604060002090565b556001808401937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90838c838180a482855b8c878203612ec357505050505015612e9957612e60918855612e4f818501808611612e655760fc8160021b169060061c60005260166020526009600f821b1960406000205416911b17604060002055565b612e5985546136d6565b85556136d6565b612d56565b612e6d6136bf565b60fc8160021b169060061c60005260166020526009600f821b1960406000205416911b17604060002055565b60046040517f2e076300000000000000000000000000000000000000000000000000000000008152fd5b84928185818594a4018390612dfe565b503461000e57600036600319011261000e57610748612f4a6010548060011b906001600160ff1b03811603612f8e575b61271081810391818311612f81575b6011546001600160fe1b0381168103612f74575b60021b019003908111612f67575b600c548101809111612f5a575b600d549061370a565b6040519081529081906020820190565b612f626136bf565b612f41565b612f6f6136bf565b612f34565b612f7c6136bf565b612f26565b612f896136bf565b612f12565b612f966136bf565b612f03565b503461000e57612faa36611713565b90612fbe610f3760185460ff9060a01c1690565b61147d57612fcb82613542565b9160005b8181106130305783612fec6113d56018546001600160a01b031690565b803b1561000e576040517fea6b8a1a00000000000000000000000000000000000000000000000000000000815290600090829081838161144c8833600484016146aa565b80613048613042613060938587613508565b356144f6565b613056611ed8828587613508565b612bd38287613520565b612fcf565b503461000e57600036600319011261000e57602060405166354a6ba7a180008152f35b503461000e57604036600319011261000e57602060ff6130e76004356130ad81610842565b6001600160a01b03602435916130c283610842565b16600052600784526040600020906001600160a01b0316600052602052604060002090565b54166040519015158152f35b503461000e57602036600319011261000e5760043561311181610842565b613119613247565b6001600160a01b03809116908115613173576008548273ffffffffffffffffffffffffffffffffffffffff19821617600855167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b608460405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b503461000e57600036600319011261000e576020604051600a8152f35b503461000e57600036600319011261000e576020601154604051908152f35b503461000e57600036600319011261000e57613233613247565b6013805463ffff0000191662010000179055005b6001600160a01b0360085416330361325b57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b6001600160a01b031680156132c957600052600560205267ffffffffffffffff6040600020541690565b60046040517f8f4eb604000000000000000000000000000000000000000000000000000000008152fd5b90600182811c92168015613323575b602083101461330d57565b634e487b7160e01b600052602260045260246000fd5b91607f1691613302565b60008181548110613363575b60046040517fdf2d9b42000000000000000000000000000000000000000000000000000000008152fd5b81526004906020918083526040928383205494600160e01b86161561338a57505050613339565b93929190935b851561339e57505050505090565b60001901808352818552838320549550613390565b600054811090816133c2575090565b90506000526004602052600160e01b604060002054161590565b604051906080820182811067ffffffffffffffff821117613413575b60405260006060838281528260208201528260408201520152565b61341b6127a2565b6133f8565b6134286133dc565b506134316133dc565b60005482101561346957506134458161346e565b604081015161346957506134646106eb9161345e6133dc565b5061332d565b613489565b905090565b6134766133dc565b5060005260046020526106eb6040600020545b906134926133dc565b916001600160a01b038116835267ffffffffffffffff8160a01c166020840152600160e01b81161515604084015260e81c6060830152565b60209067ffffffffffffffff81116134e4575b60051b0190565b6134ec6127a2565b6134dd565b50634e487b7160e01b600052603260045260246000fd5b91908110156135185760051b0190565b6134ec6134f1565b6020918151811015613535575b60051b010190565b61353d6134f1565b61352d565b9061354c826134ca565b6135596040519182612812565b828152809261356a601f19916134ca565b0190602036910137565b908281101561369557600091825480851161368d575b506135948161329f565b848310156136865782850381811061367e575b505b6135b281613542565b958115613676576135c284613420565b9185946040936135d7610f3786830151151590565b613664575b505b878114158061365a575b1561364d576135f68161346e565b8085015161364457516001600160a01b039081168061363b575b509081600192871690881614613627575b016135de565b80613635838a01998c613520565b52613621565b96506001613610565b50600190613621565b5050959450505050815290565b50818714156135e8565b516001600160a01b03169550386135dc565b945050505050565b9050386135a7565b50826135a9565b93503861358a565b60046040517f32c1995a000000000000000000000000000000000000000000000000000000008152fd5b50634e487b7160e01b600052601160045260246000fd5b60019060001981146136e6570190565b6136ee6136bf565b0190565b906002820180921161370057565b6137086136bf565b565b9190820180921161370057565b9060009081549281156137d157613741816001600160a01b03166000526005602052604060002090565b68010000000000000001830281540190556001600160a01b03600191169181811460e11b4260a01b178317613780866000526004602052604060002090565b55840193817fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91808587858180a4015b8581036137c25750505015612e995755565b8083918587858180a4016137b0565b60046040517fb562e8dd000000000000000000000000000000000000000000000000000000008152fd5b9190820391821161370057565b6001600160a01b03613831336001600160a01b0316600052600560205260406000205460c01c90565b911660009081526012602052604090205467ffffffffffffffff918216106138595750600090565b60406000205490613881336001600160a01b0316600052600560205260406000205460c01c90565b16810390811161388e5790565b6106eb6136bf565b9060038202918083046003149015171561370057565b9060058202918083046005149015171561370057565b908160021b916001600160fe1b0381160361370057565b604051906020820182811067ffffffffffffffff8211176138fe575b60405260008252565b6139066127a2565b6138f5565b3d15613936573d9061391c82612834565b9161392a6040519384612812565b82523d6000602084013e565b606090565b1561394257565b606460405162461bcd60e51b815260206004820152601960248201527f4d6178206d696e747320706572207472616e73616374696f6e000000000000006044820152fd5b1561398d57565b606460405162461bcd60e51b815260206004820152601d60248201527f45746865722076616c75652073656e7420697320696e636f72726563740000006044820152fd5b8181106139dc575050565b600081556001016139d1565b601a54811015613a20575b601a6000527f057c384a7d1c54f3a1b2e5e67b2617b8224fdfd1ea7234eea573a6ff665ff63e0190600090565b613a286134f1565b6139f3565b8054821015613a46575b60005260206000200190600090565b613a4e6134f1565b613a37565b8054613a769168010000000000000000821015613a9a575b600182018155613a2d565b819291549060031b916001600160a01b039283811b93849216901b16911916179055565b613aa26127a2565b613a6b565b90601f8211613ab4575050565b61370891601c6000527f0e4562a10381dec21b205ed72637e6b1b523bdd0e4d4d50af5cd23dd4500a211906020601f840160051c83019310613afe575b601f0160051c01906139d1565b9091508190613af1565b90601f8211613b15575050565b61370891601b6000527f3ad8aa4f87544323a9d1e5dd902f40c356527a7955687113db5f9a85ad579dc1906020601f840160051c83019310613afe57601f0160051c01906139d1565b601b5460009291613b6e826132f3565b91600190818116908115613bda5750600114613b8957505050565b9091929350601b6000527f3ad8aa4f87544323a9d1e5dd902f40c356527a7955687113db5f9a85ad579dc1906000915b848310613bc7575050500190565b8181602092548587015201920191613bb9565b60ff191683525050811515909102019150565b600092918154613bfc816132f3565b92600191808316908115613c555750600114613c19575b50505050565b90919293945060005260209081600020906000915b858310613c445750505050019038808080613c13565b805485840152918301918101613c2e565b60ff1916845250505081151590910201915038808080613c13565b906136ee60209282815194859201610692565b9060405191826000601c54613c97816132f3565b90600190818116908115613d345750600114613cd5575b505080613cc684602093613708965194859201610692565b0103601f198101845283612812565b601c60009081529192507f0e4562a10381dec21b205ed72637e6b1b523bdd0e4d4d50af5cd23dd4500a2115b838310613d1957505050810160200182613cc6613cae565b80546020848a01810191909152889550909201918101613d01565b60ff191660208681019190915283151590930285019092019250849150613cc69050613cae565b60405190613d68826127da565b600882527f556e6f70656e65640000000000000000000000000000000000000000000000006020830152565b60405190613da1826127da565b600682527f4275726e656400000000000000000000000000000000000000000000000000006020830152565b90613e499594613f43613ef4613708966075600497613f4996604080519d8e809b7f646174613a6170706c69636174696f6e2f6a736f6e2c0000000000000000000060208301527f7b226e616d65223a222300000000000000000000000000000000000000000000603683015260208151948593019101610692565b89017f222c22696d616765223a220000000000000000000000000000000000000000006040820152613e85825180936020604b85019101610692565b017f222c2261747472696275746573223a5b7b2274726169745f74797065223a2200604b820152613ec0825180936020606a85019101610692565b01613eed606a82017f222c2276616c7565223a220000000000000000000000000000000000000000009052565b0190613bed565b7f227d2c7b2274726169745f74797065223a2254696572222c2276616c7565223a81527f2200000000000000000000000000000000000000000000000000000000000000602082015260210190565b90613c70565b7f227d5d7d00000000000000000000000000000000000000000000000000000000815203601b19810185520183612812565b9060405160a08101604052608081019260008452925b6000190192600a906030828206018553049283613f9157809350608091030191601f1901918252565b60005260176020526040600020906020604051600084545b80821061402e5750506020929350906140006106eb92601f198381601f81960116830160405201815261410f565b604051938491614021614014838501613b5e565b9182815194859201610692565b0103908101835282612812565b90926001906001600160a01b036140458689613a2d565b90549060031b1c1690813b90600019928484840191838901903c0101930190613fd2565b604051906060820182811067ffffffffffffffff8211176140da575b604052604082527f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f6040837f4142434445464748494a4b4c4d4e4f505152535455565758595a61626364656660208201520152565b6140e26127a2565b614085565b906140f182612834565b6140fe6040519182612812565b828152809261356a601f1991612834565b8051156141e15761411e614069565b61414261413d61413861413185516136f2565b6003900490565b6138c2565b6140e7565b9160208301918182518301915b82821061418f5750505060039051068060011461417c57600214614171575090565b603d90600019015390565b50603d9081600019820153600119015390565b9091936004906003809401938451600190603f9082828260121c16880101518553828282600c1c16880101518386015382828260061c168801015160028601531685010151908201530193919061414f565b506106eb6138d9565b9081606091031261000e57805161420081612693565b916040602083015192015190565b506040513d6000823e3d90fd5b9081602091031261000e57516106eb81610842565b61423c600954426137fb565b9060006001600160a01b03807f000000000000000000000000be82b9533ddf0acaddcaa6af38830ff4b919482c16915b85811061427b57505050505050565b614286818786613508565b35604080516331a9108f60e11b81526020908181806142ae6004978883019190602083019252565b03818a5afa918215614409575b6000926143ec575b505084339116036143df576142dc612490848a89613508565b6143b957866143116142ef858b8a613508565b35835190634ca4fdf560e01b8252818060609485938983019190602083019252565b03818b5afa9182156143ac575b60009261438c575b505010614366575050806109d2614341614361938988613508565b358060081c6000526014602052600160ff604060002092161b8154179055565b61426c565b517f24abfe20000000000000000000000000000000000000000000000000000000008152fd5b6143a29250803d106111ea576111d98183612812565b5090503880614326565b6143b461420e565b61431e565b517f646cf558000000000000000000000000000000000000000000000000000000008152fd5b51631956fdd160e11b8152fd5b6144029250803d1061119f576111908183612812565b38806142c3565b61441161420e565b6142bb565b600690334260a01b811790838304901560005b8281106144475750505050068061443d5750565b6137089033613717565b60005490614468336001600160a01b03166000526005602052604060002090565b6806000000000000000681540190558461448c836000526004602052604060002090565b5586820191837fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef82336000838180a460018093015b8581036144e15750509050612e99576144dc916000556136d6565b614429565b8391925080336000858180a4019085916144c1565b6144ff8161332d565b6001600160a01b038116614520836000526006602052604060002090815490565b929061453b6001600160a01b03841633908114908614171590565b61464e575b600093614645575b50614566826001600160a01b03166000526005602052604060002090565b6fffffffffffffffffffffffffffffffff81540190557c03000000000000000000000000000000000000000000000000000000004260a01b8317176145b5856000526004602052604060002090565b55600160e11b8116156145fc575b507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a46137086145f760015460010190565b600155565b60018401614614816000526004602052604060002090565b5415614621575b506145c3565b8354811461461b5761463d906000526004602052604060002090565b55388061461b565b83905538614548565b614694610f3761468d33614675876001600160a01b03166000526007602052604060002090565b906001600160a01b0316600052602052604060002090565b5460ff1690565b15614540576004604051632ce44b5f60e11b8152fd5b6040906001600160a01b036106eb9493168152816020820152019061201e565b9081602091031261000e57516106eb81612693565b906146e98361332d565b6001600160a01b03808416928382841603614893576000868152600660205260409020805490926147296001600160a01b03881633908114908414171590565b614856575b821695861561482c5761477f9361475e92614822575b506001600160a01b03166000526005602052604060002090565b80546000190190556001600160a01b03166000526005602052604060002090565b80546001019055600160e11b804260a01b8517176147a7866000526004602052604060002090565b558116156147d8575b507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4565b600184016147f0816000526004602052604060002090565b54156147fd575b506147b0565b60005481146147f75761481a906000526004602052604060002090565b5538806147f7565b6000905538614744565b60046040517fea553b34000000000000000000000000000000000000000000000000000000008152fd5b61487d610f3761468d336146758b6001600160a01b03166000526007602052604060002090565b1561472e576004604051632ce44b5f60e11b8152fd5b60046040517fa1148100000000000000000000000000000000000000000000000000000000008152fd5b91604051916148cb836127f6565b600083526daaeb6d7670e522a718067333cd4e803b6148ef575b506137089361495f565b604051633185c44d60e21b815230600482015233602482015290602090829060449082906000905af1908115614952575b600091614934575b5015610dde57386148e5565b61494c915060203d8111610e3657610e288183612812565b38614928565b61495a61420e565b614920565b919290926daaeb6d7670e522a718067333cd4e803b6149bc575b506149858185856146df565b833b6149915750505050565b61499e93610f3793614a70565b6149ab5738808080613c13565b60046040516368d2bf6b60e11b8152fd5b604051633185c44d60e21b815230600482015233602482015290602090829060449082906000905af1908115614a1f575b600091614a01575b5015610dde5738614979565b614a19915060203d8111610e3657610e288183612812565b386149f5565b614a2761420e565b6149ed565b9081602091031261000e57516106eb816105c5565b90926106eb94936080936001600160a01b038092168452166020830152604082015281606082015201906106b5565b92602091614aba9360006001600160a01b036040518097819682957f150b7a02000000000000000000000000000000000000000000000000000000009b8c85523360048601614a41565b0393165af160009181614b01575b50614af357614ad561390b565b80519081614aee5760046040516368d2bf6b60e11b8152fd5b602001fd5b6001600160e01b0319161490565b614b2391925060203d8111614b2a575b614b1b8183612812565b810190614a2c565b9038614ac8565b503d614b1156fea26469706673582212201882fdd5d4b0f7c180e59322107b7ee8602cff2fe7f93b04206ec72d57fbdfbd64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000be82b9533ddf0acaddcaa6af38830ff4b919482c0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000003c68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f656e69676d61746963626f786e66742f646174612f6d61696e2f00000000
-----Decoded View---------------
Arg [0] : claimer (address): 0xBE82b9533Ddf0ACaDdcAa6aF38830ff4B919482C
Arg [1] : uri (string): https://raw.githubusercontent.com/enigmaticboxnft/data/main/
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000be82b9533ddf0acaddcaa6af38830ff4b919482c
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [2] : 000000000000000000000000000000000000000000000000000000000000003c
Arg [3] : 68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f
Arg [4] : 6d2f656e69676d61746963626f786e66742f646174612f6d61696e2f00000000
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.