ERC-721
Source Code
Overview
Max Total Supply
15,366 CP
Holders
14,077
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 CPLoading...
Loading
Loading...
Loading
Loading...
Loading
Contract Name:
CustomPunks
Compiler Version
v0.8.14+commit.80d49f37
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.14;
import "@minteeble/smart-contracts/contracts/token/ERC721/MinteebleERC721A.sol";
import "@minteeble/smart-contracts/contracts/token/ERC721/extensions/RequestMapper.sol";
contract CustomPunks is MinteebleERC721A, RequestMapper {
struct LayerInfo {
uint256 defaultPrice;
uint256 premiumPrice;
bool required;
uint256[] suppliableItems;
}
struct ItemInfo {
uint256 appliedLayers;
}
LayerInfo[] public layers;
mapping(uint256 => ItemInfo) internal itemInfo;
address public withdrawAccount1;
address public withdrawAccount2;
constructor() MinteebleERC721A("CustomPunks", "CP", 1000000000000, 0) {
setPaused(true);
baseUri = "https://p765cpbvm0.execute-api.eu-central-1.amazonaws.com/p1/renderer/Minteeble/chain/base/collection/6e0b39a5-8569-4e67-b330-d352593c9629/metadata/";
revealed = true;
mintPrice = 1500000000000000;
addLayer(1500000000000000, 1500000000000000, true); // Body
addLayer(0, 690000000000000, false); // Clothes
addLayer(0, 420000000000000, false); // Logo
addLayer(0, 420000000000000, false); // LogoTwo
addLayer(0, 420000000000000, false); // LogoThree
addLayer(0, 420000000000000, false); // LogoFour
addLayer(0, 420000000000000, false); // HatLogo
addLayer(0, 420000000000000, false); // HatLogoTwo
addLayer(0, 420000000000000, false); // HatLogoThree
addLayer(0, 0, false); // Custom group
addLayer(0, 0, false); // Custom group
uint256[] memory clothesItems = new uint256[](58);
clothesItems[0] = 9980;
clothesItems[1] = 9992;
clothesItems[2] = 9977;
clothesItems[3] = 9973;
clothesItems[4] = 9985;
clothesItems[5] = 9983;
clothesItems[6] = 9948;
clothesItems[7] = 9973;
clothesItems[8] = 9992;
clothesItems[9] = 9995;
clothesItems[10] = 9987;
clothesItems[11] = 9988;
clothesItems[12] = 9992;
clothesItems[13] = 9996;
clothesItems[14] = 9995;
clothesItems[15] = 9985;
clothesItems[16] = 9989;
clothesItems[17] = 9969;
clothesItems[18] = 9977;
clothesItems[19] = 9988;
clothesItems[20] = 9995;
clothesItems[21] = 9991;
clothesItems[22] = 9990;
clothesItems[23] = 9995;
clothesItems[24] = 9990;
clothesItems[25] = 9979;
clothesItems[26] = 9974;
clothesItems[27] = 9982;
clothesItems[28] = 9988;
clothesItems[29] = 9989;
clothesItems[30] = 9989;
clothesItems[31] = 9994;
clothesItems[32] = 9987;
clothesItems[33] = 9982;
clothesItems[34] = 9968;
clothesItems[35] = 9986;
clothesItems[36] = 9970;
clothesItems[37] = 9988;
clothesItems[38] = 9976;
clothesItems[39] = 9967;
clothesItems[40] = 9988;
clothesItems[41] = 9989;
clothesItems[42] = 9993;
clothesItems[43] = 9995;
clothesItems[44] = 9995;
clothesItems[45] = 9993;
clothesItems[46] = 9997;
clothesItems[47] = 9989;
clothesItems[48] = 9995;
clothesItems[49] = 9994;
clothesItems[50] = 9998;
clothesItems[51] = 9994;
clothesItems[52] = 9995;
clothesItems[53] = 9993;
clothesItems[54] = 9999;
clothesItems[55] = 9992;
clothesItems[56] = 9998;
clothesItems[57] = 10000;
// Clothes - Suppliable items (34)
for (uint256 i = 0; i < 58; i++) {
addSuppliableItem(1, clothesItems[i]);
}
// Set suppliable items in custom groups
addSuppliableItem(9, 500000);
addSuppliableItem(9, 500000);
addSuppliableItem(10, 500000);
addSuppliableItem(10, 500000);
// Setting default withdraw addresses
withdrawAccount1 = 0xE63B7625b4543fb0D55E605d08D32C5AE07C3b84;
withdrawAccount2 = 0xB96fB3Ef787F0c785c3AAe333aa1126B98D4F8Fe;
}
modifier canMintPfp(address _account) {
require(totalSupply() + 1 <= maxSupply, "Max supply exceed!");
require(
totalMintedByAddress[msg.sender] + 1 <= maxMintAmountPerAddress,
"Exceeded maximum total amount per address!"
);
_;
}
function addLayer(
uint256 _defaultPrice,
uint256 _premiumPrice,
bool _required
) public onlyOwner {
uint256[] memory items;
layers.push(LayerInfo(_defaultPrice, _premiumPrice, _required, items));
}
function addSuppliableItem(
uint256 _layerIndex,
uint256 _supply
) public onlyOwner {
layers[_layerIndex].suppliableItems.push(_supply);
}
function setItemSupply(
uint256 _layerIndex,
uint256 _itemIndex,
uint256 _newSupply
) public onlyOwner {
layers[_layerIndex].suppliableItems[_itemIndex] = _newSupply;
}
function setMaxSupply(uint256 _maxSupply) public onlyOwner {
maxSupply = _maxSupply;
}
function getSupply(
uint256 _layerIndex,
uint256 _itemIndex
) public view returns (uint256) {
return layers[_layerIndex].suppliableItems[_itemIndex];
}
function setDefaultPrice(
uint256 _layerId,
uint256 _defaultPrice
) public onlyOwner {
require(_layerId < layers.length, "Invalid layerId");
layers[_layerId].defaultPrice = _defaultPrice;
}
function setRequired(uint256 _layerId, bool _required) public onlyOwner {
require(_layerId < layers.length, "Invalid layerId");
layers[_layerId].required = _required;
}
function setPremiumPrice(
uint256 _layerId,
uint256 _premiumPrice
) public onlyOwner {
require(_layerId < layers.length, "Invalid layerId");
layers[_layerId].premiumPrice = _premiumPrice;
}
function getLayers() public view returns (LayerInfo[] memory) {
return layers;
}
function getlayer(
uint256 _layerIndex
) public view returns (LayerInfo memory) {
return layers[_layerIndex];
}
function removeLayer() public onlyOwner {
require(layers.length > 0, "No layers available");
layers.pop();
}
function _setItemInfo(uint256 _id, ItemInfo memory _itemInfo) internal {
itemInfo[_id] = _itemInfo;
}
function getItemInfo(uint256 _id) public view returns (ItemInfo memory) {
return itemInfo[_id];
}
function appliedLayerInfo(
uint256 _appliedLayers,
uint256 _layerIndex
) public pure returns (uint256) {
bool hasDefaultSlot = (_appliedLayers & (2 ** (_layerIndex * 2))) != 0;
bool hasPremiumSlot = (_appliedLayers &
(2 ** ((_layerIndex * 2) + 1))) != 0;
if (hasDefaultSlot && hasPremiumSlot) revert("Invalid configuration");
if (hasDefaultSlot) return 1;
if (hasPremiumSlot) return 2;
return 0;
}
function evalPrice(uint256 _appliedLayers) public view returns (uint256) {
require(
_appliedLayers < 2 ** (layers.length * 2),
"Invalid applied layers"
);
uint256 tot = 0;
for (uint256 i = 0; i < layers.length; i++) {
uint256 layerInfo = appliedLayerInfo(_appliedLayers, i);
if (layerInfo == 2) tot += layers[i].premiumPrice;
else if (layerInfo == 1) tot += layers[i].defaultPrice;
else {
require(!layers[i].required, "Missing required layer");
}
}
return tot;
}
function _consumeSuppliableItem(
uint256 _layerIndex,
uint256 _itemIndex
) internal {
require(
layers[_layerIndex].suppliableItems[_itemIndex] > 0,
"No items left"
);
layers[_layerIndex].suppliableItems[_itemIndex]--;
}
function migrate(
address[] memory _accounts,
uint256[] memory _appliedLayers
) public onlyOwner {
require(_accounts.length == _appliedLayers.length, "Invalid length");
uint256 startTotalSupply = totalSupply();
for (uint16 i = 0; i < _accounts.length; i++) {
itemInfo[startTotalSupply + i + 1] = ItemInfo(_appliedLayers[i]);
_safeMint(_accounts[i], 1);
}
}
function _mintPfp(
address _account,
uint256 _appliedLayers,
uint256[] memory _suppliableLayersIndexes,
uint256[] memory _suppliableItemsIndexes
) internal canMintPfp(_account) active nonReentrant {
require(
_suppliableItemsIndexes.length == _suppliableLayersIndexes.length,
"Invalid suppliable items length"
);
uint256 price = evalPrice(_appliedLayers);
require(msg.value >= price, "Insufficient funds!");
uint256[] memory usedLayers = new uint256[](
_suppliableLayersIndexes.length
);
for (uint256 j = 0; j < usedLayers.length; j++) {
usedLayers[j] = layers.length;
}
for (uint256 i = 0; i < _suppliableLayersIndexes.length; i++) {
for (uint256 j = 0; j < usedLayers.length; j++) {
require(
_suppliableLayersIndexes[i] != usedLayers[j],
"Layer already used"
);
}
usedLayers[i] = _suppliableLayersIndexes[i];
require(
_appliedLayers &
(2 ** ((_suppliableLayersIndexes[i] * 2) + 1)) !=
0,
"Missing suppliable item"
);
_consumeSuppliableItem(
_suppliableLayersIndexes[i],
_suppliableItemsIndexes[i]
);
}
ItemInfo memory newItemInfo = ItemInfo(_appliedLayers);
_setItemInfo(totalSupply(), newItemInfo);
_safeMint(_account, 1);
totalMintedByAddress[_account] += 1;
}
function mintRequestedPfp(
bytes32 _requestId,
uint256 _appliedLayers,
uint256[] memory _suppliableLayersIndexes,
uint256[] memory _suppliableItemsIndexes
) public payable active {
_mintPfp(
_msgSender(),
_appliedLayers,
_suppliableLayersIndexes,
_suppliableItemsIndexes
);
_setRequest(_requestId, totalSupply());
}
function mintRequestedPfpForAddress(
address _account,
bytes32 _requestId,
uint256 _appliedLayers,
uint256[] memory _suppliableLayersIndexes,
uint256[] memory _suppliableItemsIndexes
) public payable active {
_mintPfp(
_account,
_appliedLayers,
_suppliableLayersIndexes,
_suppliableItemsIndexes
);
_setRequest(_requestId, totalSupply());
}
function mint(
uint256 _mintAmount
)
public
payable
override
canMint(_mintAmount)
enoughFunds(_mintAmount)
active
nonReentrant
{
revert("Method not allowed.");
}
function mintForAddress(
address _receiver,
uint256 _mintAmount
) public payable override active {
revert("Method not allowed.");
}
function setWithdrawAccounts(
address _account1,
address _account2
) public onlyOwner {
withdrawAccount1 = _account1;
withdrawAccount2 = _account2;
}
function withdrawBalance() public override onlyOwner {
uint256 tot = address(this).balance;
(bool s1, ) = payable(withdrawAccount1).call{value: (tot / 100) * 20}(
""
);
require(s1);
(bool s2, ) = payable(withdrawAccount2).call{value: (tot / 100) * 80}(
""
);
require(s2);
}
}// SPDX-License-Identifier: MIT pragma solidity ^0.8.14; // ============================================= // _ _ _ _ _ ___ ___ ___ ___ _ ___ // | \_/ || || \| ||_ _|| __|| __|| o ) | | __| // | \_/ || || \\ | | | | _| | _| | o \ |_ | _| // |_| |_||_||_|\_| |_| |___||___||___/___||___| // // Website: https://minteeble.com // Email: [email protected] // // ============================================= import "erc721a/contracts/ERC721A.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; interface IMinteebleERC721A is IERC721A { function setBaseUri(string memory _baseUri) external; function setUriSuffix(string memory _uriSuffix) external; function setRevealed(bool _revealed) external; function setPaused(bool _paused) external; function setPreRevealUri(string memory _preRevealUri) external; function setMintPrice(uint256 _mintPrice) external; function setMaxMintAmountPerTrx(uint256 _maxAmount) external; function setMaxMintAmountPerAddress(uint256 _maxAmount) external; function withdrawBalance() external; function mint(uint256 _mintAmount) external payable; function mintForAddress(address receiver, uint256 _mintAmount) external payable; function ownerMintForAddress(uint256 _mintAmount, address _receiver) external; function walletOfOwner(address _owner) external view returns (uint256[] memory); } contract MinteebleERC721A is ERC721A, Ownable, ReentrancyGuard { using Counters for Counters.Counter; using Strings for uint256; bytes4 public constant IMINTEEBLE_ERC721A_INTERFACE_ID = type(IMinteebleERC721A).interfaceId; uint256 public maxSupply; uint256 public mintPrice; string public baseUri = ""; string public uriSuffix = ".json"; string public preRevealUri = ""; bool public revealed = false; bool public paused = true; uint256 public maxMintAmountPerTrx = 5; uint256 public maxMintAmountPerAddress = 20; mapping(address => uint256) public totalMintedByAddress; /** * @notice MinteebleERC721 constructor * @param _tokenName Token name * @param _tokenName Token symbol */ constructor( string memory _tokenName, string memory _tokenSymbol, uint256 _maxSupply, uint256 _mintPrice ) ERC721A(_tokenName, _tokenSymbol) { mintPrice = _mintPrice; maxSupply = _maxSupply; } /** * @dev Checks if caller can mint */ modifier canMint(uint256 _mintAmount) { require(totalSupply() + _mintAmount <= maxSupply, "Max supply exceed!"); require( _mintAmount <= maxMintAmountPerTrx, "Exceeded maximum total amount per trx!" ); require( totalMintedByAddress[msg.sender] + _mintAmount <= maxMintAmountPerAddress, "Exceeded maximum total amount per address!" ); _; } /** * @dev Checks if caller provided enough funds for minting */ modifier enoughFunds(uint256 _mintAmount) { require(msg.value >= _mintAmount * mintPrice, "Insufficient funds!"); _; } modifier active() { require(!paused, "Contract is paused."); _; } /** * @notice Sets new base URI * @param _baseUri New base URI to be set */ function setBaseUri(string memory _baseUri) public onlyOwner { baseUri = _baseUri; } /** * @notice Sets new URI suffix * @param _uriSuffix New URI suffix to be set */ function setUriSuffix(string memory _uriSuffix) public onlyOwner { uriSuffix = _uriSuffix; } /** * @notice Reveals (or unreveals) the collection * @param _revealed New revealed value to be set. True if revealed, false otherwise */ function setRevealed(bool _revealed) public onlyOwner { revealed = _revealed; } /** * @notice Change paused state * @param _paused Paused state */ function setPaused(bool _paused) public onlyOwner { paused = _paused; } /** * @notice Sets new pre-reveal URI * @param _preRevealUri New pre-reveal URI to be used */ function setPreRevealUri(string memory _preRevealUri) public onlyOwner { preRevealUri = _preRevealUri; } /** * @notice Allows owner to set a new mint price * @param _mintPrice New mint price to be set */ function setMintPrice(uint256 _mintPrice) public onlyOwner { mintPrice = _mintPrice; } /** * @notice Allows owner to set the max number of mintable items in a single transaction * @param _maxAmount Max amount */ function setMaxMintAmountPerTrx(uint256 _maxAmount) public onlyOwner { maxMintAmountPerTrx = _maxAmount; } /** * @notice Allows owner to set the max number of items mintable per wallet * @param _maxAmount Max amount */ function setMaxMintAmountPerAddress(uint256 _maxAmount) public onlyOwner { maxMintAmountPerAddress = _maxAmount; } /** * @notice Withdraws contract balance to onwer account */ function withdrawBalance() public virtual onlyOwner { (bool success, ) = payable(owner()).call{value: address(this).balance}( "" ); require(success); } /** * @inheritdoc ERC721A */ function _startTokenId() internal view virtual override returns (uint256) { return 1; } /** * @inheritdoc ERC721A */ function _baseURI() internal view override returns (string memory) { return baseUri; } /** * @inheritdoc ERC721A */ function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { require(_exists(_tokenId), "Token ID do es not exist."); // Checks if collection is revealed if (!revealed) return preRevealUri; // Evaluating full URI for the specified ID return string.concat(_baseURI(), _tokenId.toString(), uriSuffix); } /** * @notice Mints one or more items */ function mint(uint256 _mintAmount) public payable virtual canMint(_mintAmount) enoughFunds(_mintAmount) active nonReentrant { _safeMint(_msgSender(), _mintAmount); totalMintedByAddress[_msgSender()] += _mintAmount; } function mintForAddress(address receiver, uint256 _mintAmount) public payable virtual enoughFunds(_mintAmount) active { require( _mintAmount <= maxMintAmountPerTrx, "Exceeded maximum total amount per trx!" ); require( totalMintedByAddress[receiver] + _mintAmount <= maxMintAmountPerAddress, "Exceeded maximum total amount!" ); for (uint256 i = 0; i < _mintAmount; i++) { totalMintedByAddress[receiver]++; } _safeMint(receiver, _mintAmount); } /** * @notice Mints item for another address. (Reserved to contract owner) */ function ownerMintForAddress(uint256 _mintAmount, address _receiver) public virtual onlyOwner { require(totalSupply() + _mintAmount <= maxSupply, "Max supply exceed!"); _safeMint(_receiver, _mintAmount); } function walletOfOwner(address _owner) public view returns (uint256[] memory) { uint256 ownerTokenCount = balanceOf(_owner); uint256[] memory ownedTokenIds = new uint256[](ownerTokenCount); uint256 currentTokenId = _startTokenId(); uint256 ownedTokenIndex = 0; address latestOwnerAddress; while ( ownedTokenIndex < ownerTokenCount && currentTokenId <= maxSupply ) { TokenOwnership memory ownership = _ownershipOf(currentTokenId); if (!ownership.burned && ownership.addr != address(0)) { latestOwnerAddress = ownership.addr; } if (latestOwnerAddress == _owner) { ownedTokenIds[ownedTokenIndex] = currentTokenId; ownedTokenIndex++; } currentTokenId++; } return ownedTokenIds; } function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IMinteebleERC721A).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.14; // ============================================= // _ _ _ _ _ ___ ___ ___ ___ _ ___ // | \_/ || || \| ||_ _|| __|| __|| o ) | | __| // | \_/ || || \\ | | | | _| | _| | o \ |_ | _| // |_| |_||_||_|\_| |_| |___||___||___/___||___| // // Website: https://minteeble.com // Email: [email protected] // // ============================================= /// @title IRequestMapper Interface /// @dev This interface defines the function to retrieve an ID associated with a request hash. interface IRequestMapper { /// @notice Retrieves the ID associated with a given request hash. /// @param _request The hash of the request to get the ID for. /// @return The ID associated with the provided request hash. function getIdByRequest(bytes32 _request) external view returns (uint256); } /// @title RequestMapper Contract /// @dev This abstract contract extends ERC721 functionality and provides a way to map request hashes to unique IDs. abstract contract RequestMapper { // The interface ID of the IRequestMapper interface. bytes4 public constant IREQUEST_MAPPER_INTERFACE_ID = type(IRequestMapper).interfaceId; // Mapping to store request hashes to their corresponding IDs. mapping(bytes32 => uint256) internal requestToId; /// @notice Retrieves the ID associated with a given request hash. /// @param _request The hash of the request to get the ID for. /// @return The ID associated with the provided request hash. function getIdByRequest(bytes32 _request) public view returns (uint256) { return requestToId[_request]; } /// @notice Internal function to set a request hash and its associated ID. /// @dev It is important to ensure that the request is new (ID equal to zero is safe because ERC721 IDs start from 1). /// @param _request The hash of the request to set. /// @param _id The ID to associate with the provided request hash. function _setRequest(bytes32 _request, uint256 _id) internal { // Make sure request is new (ID equal to zero is safe because ERC721 IDs start from 1). require(requestToId[_request] == 0, "Request already set"); // Associate the provided ID with the given request hash. requestToId[_request] = _id; } }
// 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
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}// 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 (last updated v4.8.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
// 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
// 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.8.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1);
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
}
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","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"},{"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":"IMINTEEBLE_ERC721A_INTERFACE_ID","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"IREQUEST_MAPPER_INTERFACE_ID","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_defaultPrice","type":"uint256"},{"internalType":"uint256","name":"_premiumPrice","type":"uint256"},{"internalType":"bool","name":"_required","type":"bool"}],"name":"addLayer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_layerIndex","type":"uint256"},{"internalType":"uint256","name":"_supply","type":"uint256"}],"name":"addSuppliableItem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_appliedLayers","type":"uint256"},{"internalType":"uint256","name":"_layerIndex","type":"uint256"}],"name":"appliedLayerInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","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":[],"name":"baseUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_appliedLayers","type":"uint256"}],"name":"evalPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_request","type":"bytes32"}],"name":"getIdByRequest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getItemInfo","outputs":[{"components":[{"internalType":"uint256","name":"appliedLayers","type":"uint256"}],"internalType":"struct CustomPunks.ItemInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLayers","outputs":[{"components":[{"internalType":"uint256","name":"defaultPrice","type":"uint256"},{"internalType":"uint256","name":"premiumPrice","type":"uint256"},{"internalType":"bool","name":"required","type":"bool"},{"internalType":"uint256[]","name":"suppliableItems","type":"uint256[]"}],"internalType":"struct CustomPunks.LayerInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_layerIndex","type":"uint256"},{"internalType":"uint256","name":"_itemIndex","type":"uint256"}],"name":"getSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_layerIndex","type":"uint256"}],"name":"getlayer","outputs":[{"components":[{"internalType":"uint256","name":"defaultPrice","type":"uint256"},{"internalType":"uint256","name":"premiumPrice","type":"uint256"},{"internalType":"bool","name":"required","type":"bool"},{"internalType":"uint256[]","name":"suppliableItems","type":"uint256[]"}],"internalType":"struct CustomPunks.LayerInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"layers","outputs":[{"internalType":"uint256","name":"defaultPrice","type":"uint256"},{"internalType":"uint256","name":"premiumPrice","type":"uint256"},{"internalType":"bool","name":"required","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintAmountPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintAmountPerTrx","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":"address[]","name":"_accounts","type":"address[]"},{"internalType":"uint256[]","name":"_appliedLayers","type":"uint256[]"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintAmount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_mintAmount","type":"uint256"}],"name":"mintForAddress","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"uint256","name":"_appliedLayers","type":"uint256"},{"internalType":"uint256[]","name":"_suppliableLayersIndexes","type":"uint256[]"},{"internalType":"uint256[]","name":"_suppliableItemsIndexes","type":"uint256[]"}],"name":"mintRequestedPfp","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"uint256","name":"_appliedLayers","type":"uint256"},{"internalType":"uint256[]","name":"_suppliableLayersIndexes","type":"uint256[]"},{"internalType":"uint256[]","name":"_suppliableItemsIndexes","type":"uint256[]"}],"name":"mintRequestedPfpForAddress","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintAmount","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"ownerMintForAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"preRevealUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"removeLayer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"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":"_baseUri","type":"string"}],"name":"setBaseUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_layerId","type":"uint256"},{"internalType":"uint256","name":"_defaultPrice","type":"uint256"}],"name":"setDefaultPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_layerIndex","type":"uint256"},{"internalType":"uint256","name":"_itemIndex","type":"uint256"},{"internalType":"uint256","name":"_newSupply","type":"uint256"}],"name":"setItemSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxAmount","type":"uint256"}],"name":"setMaxMintAmountPerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxAmount","type":"uint256"}],"name":"setMaxMintAmountPerTrx","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintPrice","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_preRevealUri","type":"string"}],"name":"setPreRevealUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_layerId","type":"uint256"},{"internalType":"uint256","name":"_premiumPrice","type":"uint256"}],"name":"setPremiumPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_layerId","type":"uint256"},{"internalType":"bool","name":"_required","type":"bool"}],"name":"setRequired","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_revealed","type":"bool"}],"name":"setRevealed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uriSuffix","type":"string"}],"name":"setUriSuffix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account1","type":"address"},{"internalType":"address","name":"_account2","type":"address"}],"name":"setWithdrawAccounts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalMintedByAddress","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":[],"name":"uriSuffix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"walletOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawAccount1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawAccount2","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawBalance","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a06040819052600060808190526200001b91600c9162000ded565b5060408051808201909152600580825264173539b7b760d91b60209092019182526200004a91600d9162000ded565b506040805160208101918290526000908190526200006b91600e9162000ded565b50600f805461ffff1916610100179055600560105560146011553480156200009257600080fd5b506040518060400160405280600b81526020016a437573746f6d50756e6b7360a81b81525060405180604001604052806002815260200161043560f41b81525064e8d4a51000600083838160029080519060200190620000f492919062000ded565b5080516200010a90600390602084019062000ded565b50506001600055506200011d3362000bc5565b60016009819055600b91909155600a919091556200013e9250905062000c17565b6040518060c00160405280609481526020016200482f6094913980516200016e91600c9160209091019062000ded565b50600f805460ff191660019081179091556605543df729c000600b8190556200019991819062000c3b565b620001ae60006602738d24e520008162000c3b565b620001c3600066017dfcdece40008162000c3b565b620001d8600066017dfcdece40008162000c3b565b620001ed600066017dfcdece40008162000c3b565b62000202600066017dfcdece40008162000c3b565b62000217600066017dfcdece40008162000c3b565b6200022c600066017dfcdece40008162000c3b565b62000241600066017dfcdece40008162000c3b565b6200024f6000808062000c3b565b6200025d6000808062000c3b565b60408051603a808252610760820190925260009160208201610740803683370190505090506126fc816000815181106200029b576200029b62000ed0565b60200260200101818152505061270881600181518110620002c057620002c062000ed0565b6020026020010181815250506126f981600281518110620002e557620002e562000ed0565b6020026020010181815250506126f5816003815181106200030a576200030a62000ed0565b602002602001018181525050612701816004815181106200032f576200032f62000ed0565b6020026020010181815250506126ff8160058151811062000354576200035462000ed0565b6020026020010181815250506126dc8160068151811062000379576200037962000ed0565b6020026020010181815250506126f5816007815181106200039e576200039e62000ed0565b60200260200101818152505061270881600881518110620003c357620003c362000ed0565b60200260200101818152505061270b81600981518110620003e857620003e862000ed0565b60200260200101818152505061270381600a815181106200040d576200040d62000ed0565b60200260200101818152505061270481600b8151811062000432576200043262000ed0565b60200260200101818152505061270881600c8151811062000457576200045762000ed0565b60200260200101818152505061270c81600d815181106200047c576200047c62000ed0565b60200260200101818152505061270b81600e81518110620004a157620004a162000ed0565b60200260200101818152505061270181600f81518110620004c657620004c662000ed0565b60200260200101818152505061270581601081518110620004eb57620004eb62000ed0565b6020026020010181815250506126f18160118151811062000510576200051062000ed0565b6020026020010181815250506126f98160128151811062000535576200053562000ed0565b602002602001018181525050612704816013815181106200055a576200055a62000ed0565b60200260200101818152505061270b816014815181106200057f576200057f62000ed0565b60200260200101818152505061270781601581518110620005a457620005a462000ed0565b60200260200101818152505061270681601681518110620005c957620005c962000ed0565b60200260200101818152505061270b81601781518110620005ee57620005ee62000ed0565b6020026020010181815250506127068160188151811062000613576200061362000ed0565b6020026020010181815250506126fb8160198151811062000638576200063862000ed0565b6020026020010181815250506126f681601a815181106200065d576200065d62000ed0565b6020026020010181815250506126fe81601b8151811062000682576200068262000ed0565b60200260200101818152505061270481601c81518110620006a757620006a762000ed0565b60200260200101818152505061270581601d81518110620006cc57620006cc62000ed0565b60200260200101818152505061270581601e81518110620006f157620006f162000ed0565b60200260200101818152505061270a81601f8151811062000716576200071662000ed0565b602002602001018181525050612703816020815181106200073b576200073b62000ed0565b6020026020010181815250506126fe8160218151811062000760576200076062000ed0565b6020026020010181815250506126f08160228151811062000785576200078562000ed0565b60200260200101818152505061270281602381518110620007aa57620007aa62000ed0565b6020026020010181815250506126f281602481518110620007cf57620007cf62000ed0565b60200260200101818152505061270481602581518110620007f457620007f462000ed0565b6020026020010181815250506126f88160268151811062000819576200081962000ed0565b6020026020010181815250506126ef816027815181106200083e576200083e62000ed0565b6020026020010181815250506127048160288151811062000863576200086362000ed0565b6020026020010181815250506127058160298151811062000888576200088862000ed0565b60200260200101818152505061270981602a81518110620008ad57620008ad62000ed0565b60200260200101818152505061270b81602b81518110620008d257620008d262000ed0565b60200260200101818152505061270b81602c81518110620008f757620008f762000ed0565b60200260200101818152505061270981602d815181106200091c576200091c62000ed0565b60200260200101818152505061270d81602e8151811062000941576200094162000ed0565b60200260200101818152505061270581602f8151811062000966576200096662000ed0565b60200260200101818152505061270b816030815181106200098b576200098b62000ed0565b60200260200101818152505061270a81603181518110620009b057620009b062000ed0565b60200260200101818152505061270e81603281518110620009d557620009d562000ed0565b60200260200101818152505061270a81603381518110620009fa57620009fa62000ed0565b60200260200101818152505061270b8160348151811062000a1f5762000a1f62000ed0565b6020026020010181815250506127098160358151811062000a445762000a4462000ed0565b60200260200101818152505061270f8160368151811062000a695762000a6962000ed0565b6020026020010181815250506127088160378151811062000a8e5762000a8e62000ed0565b60200260200101818152505061270e8160388151811062000ab35762000ab362000ed0565b6020026020010181815250506127108160398151811062000ad85762000ad862000ed0565b60200260200101818152505060005b603a81101562000b355762000b20600183838151811062000b0c5762000b0c62000ed0565b602002602001015162000d4460201b60201c565b8062000b2c8162000ee6565b91505062000ae7565b5062000b4660096207a12062000d44565b62000b5660096207a12062000d44565b62000b66600a6207a12062000d44565b62000b76600a6207a12062000d44565b50601680546001600160a01b031990811673e63b7625b4543fb0d55e605d08d32c5ae07c3b84179091556017805490911673b96fb3ef787f0c785c3aae333aa1126b98d4f8fe17905562000f4a565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b62000c2162000d8c565b600f80549115156101000261ff0019909216919091179055565b62000c4562000d8c565b604080516080810182528481526020808201858152841515938301938452606083810181815260148054600181018255600091909152855160049091027fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec810191825593517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ed85015595517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ee8401805491151560ff1990921691909117905551805191959362000d3b937fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ef019291019062000e7c565b50505050505050565b62000d4e62000d8c565b6014828154811062000d645762000d6462000ed0565b6000918252602080832060036004909302019190910180546001810182559083529120015550565b6008546001600160a01b0316331462000deb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640160405180910390fd5b565b82805462000dfb9062000f0e565b90600052602060002090601f01602090048101928262000e1f576000855562000e6a565b82601f1062000e3a57805160ff191683800117855562000e6a565b8280016001018555821562000e6a579182015b8281111562000e6a57825182559160200191906001019062000e4d565b5062000e7892915062000eb9565b5090565b82805482825590600052602060002090810192821562000e6a579160200282018281111562000e6a57825182559160200191906001019062000e4d565b5b8082111562000e78576000815560010162000eba565b634e487b7160e01b600052603260045260246000fd5b60006001820162000f0757634e487b7160e01b600052601160045260246000fd5b5060010190565b600181811c9082168062000f2357607f821691505b60208210810362000f4457634e487b7160e01b600052602260045260246000fd5b50919050565b6138d58062000f5a6000396000f3fe6080604052600436106103c25760003560e01c806372f882e6116101f2578063b88d4fde1161010d578063de7fe3e7116100a0578063f254933d1161006f578063f254933d14610b60578063f2fde38b14610b73578063f471e55f14610b93578063f4a0a52814610bb357600080fd5b8063de7fe3e714610a84578063e0a8085314610ad7578063e693b57a14610af7578063e985e9c514610b1757600080fd5b8063bebdd3d2116100dc578063bebdd3d214610a18578063c87b56dd14610a2e578063d5abeb0114610a4e578063de01e15114610a6457600080fd5b8063b88d4fde146109b0578063b9e1cdeb146109c3578063bd7d28cd146109d6578063bd8624e6146109f857600080fd5b80639abc832011610185578063a22cb46511610154578063a22cb46514610923578063a40b698b14610943578063aae4690614610963578063b6f8d8131461099057600080fd5b80639abc83201461089e5780639e9198c2146108b3578063a0712d68146108f0578063a0bcfc7f1461090357600080fd5b80638f7b9379116101c15780638f7b93791461082757806395d89b411461083c57806397b991491461085157806397cf84fc1461087157600080fd5b806372f882e6146107a957806389c734a0146107c95780638da5cb5b146107e95780638f26035d1461080757600080fd5b80634304d58a116102e25780635fd8c710116102755780636817c76c116102445780636817c76c1461073e5780636f8b44b01461075457806370a0823114610774578063715018a61461079457600080fd5b80635fd8c710146106ce5780636352211e146106e357806365ea71f41461070357806366ab1d811461071e57600080fd5b80635503a0e8116102b15780635503a0e8146106645780635697f53e146106795780635c41d75e146106995780635c975abb146106af57600080fd5b80634304d58a146105d0578063438b6300146105f057806346b29e551461061d578063518302271461064a57600080fd5b80630f54a43f1161035a57806318160ddd1161032957806318160ddd146105615780631bbca5031461057657806323b872dd146105aa57806342842e0e146105bd57600080fd5b80630f54a43f146104d357806312b6f7261461050157806316ba10e01461052157806316c38b3c1461054157600080fd5b8063026886e211610396578063026886e21461045357806306fdde0314610466578063081812fc14610488578063095ea7b3146104c057600080fd5b80627b572c146103c7578063012fe98a146103de578063013eee1f146103fe57806301ffc9a71461041e575b600080fd5b3480156103d357600080fd5b506103dc610bd3565b005b3480156103ea57600080fd5b506103dc6103f9366004612d81565b610c75565b34801561040a57600080fd5b506103dc610419366004612e4a565b610cbf565b34801561042a57600080fd5b5061043e610439366004612ea8565b610cda565b60405190151581526020015b60405180910390f35b6103dc610461366004612f53565b610d05565b34801561047257600080fd5b5061047b610d51565b60405161044a9190613032565b34801561049457600080fd5b506104a86104a3366004613045565b610de3565b6040516001600160a01b03909116815260200161044a565b6103dc6104ce36600461305e565b610e27565b3480156104df57600080fd5b506104f36104ee366004613045565b610ec7565b60405190815260200161044a565b34801561050d57600080fd5b506104f361051c366004613088565b611047565b34801561052d57600080fd5b506103dc61053c366004612e4a565b611091565b34801561054d57600080fd5b506103dc61055c3660046130ba565b6110ac565b34801561056d57600080fd5b506104f36110ce565b34801561058257600080fd5b5061059163584cc76960e01b81565b6040516001600160e01b0319909116815260200161044a565b6103dc6105b83660046130d5565b6110dc565b6103dc6105cb3660046130d5565b611274565b3480156105dc57600080fd5b506016546104a8906001600160a01b031681565b3480156105fc57600080fd5b5061061061060b366004613111565b611294565b60405161044a9190613167565b34801561062957600080fd5b506104f3610638366004613045565b60009081526013602052604090205490565b34801561065657600080fd5b50600f5461043e9060ff1681565b34801561067057600080fd5b5061047b61139a565b34801561068557600080fd5b506103dc610694366004613045565b611428565b3480156106a557600080fd5b506104f360115481565b3480156106bb57600080fd5b50600f5461043e90610100900460ff1681565b3480156106da57600080fd5b506103dc611435565b3480156106ef57600080fd5b506104a86106fe366004613045565b611527565b34801561070f57600080fd5b506105916346b29e5560e01b81565b34801561072a57600080fd5b506103dc61073936600461317a565b611532565b34801561074a57600080fd5b506104f3600b5481565b34801561076057600080fd5b506103dc61076f366004613045565b611581565b34801561078057600080fd5b506104f361078f366004613111565b61158e565b3480156107a057600080fd5b506103dc6115dc565b3480156107b557600080fd5b506103dc6107c4366004613088565b6115f0565b3480156107d557600080fd5b506103dc6107e43660046131a6565b611642565b3480156107f557600080fd5b506008546001600160a01b03166104a8565b34801561081357600080fd5b506104f3610822366004613088565b611747565b34801561083357600080fd5b5061047b61180b565b34801561084857600080fd5b5061047b611818565b34801561085d57600080fd5b506017546104a8906001600160a01b031681565b34801561087d57600080fd5b506104f361088c366004613111565b60126020526000908152604090205481565b3480156108aa57600080fd5b5061047b611827565b3480156108bf57600080fd5b506108d36108ce366004613045565b611834565b60408051938452602084019290925215159082015260600161044a565b6103dc6108fe366004613045565b61186a565b34801561090f57600080fd5b506103dc61091e366004612e4a565b6119fe565b34801561092f57600080fd5b506103dc61093e3660046131db565b611a19565b34801561094f57600080fd5b506103dc61095e366004613205565b611a85565b34801561096f57600080fd5b5061098361097e366004613045565b611abb565b60405161044a9190613264565b34801561099c57600080fd5b506103dc6109ab366004613088565b611b91565b6103dc6109be366004613277565b611bd4565b6103dc6109d13660046132f2565b611c1e565b3480156109e257600080fd5b506109eb611c5e565b60405161044a919061335c565b348015610a0457600080fd5b506103dc610a13366004613088565b611d30565b348015610a2457600080fd5b506104f360105481565b348015610a3a57600080fd5b5061047b610a49366004613045565b611d86565b348015610a5a57600080fd5b506104f3600a5481565b348015610a7057600080fd5b506103dc610a7f3660046133be565b611eb4565b348015610a9057600080fd5b50610ac8610a9f366004613045565b604080516020808201835260009182905292815260158352819020815192830190915254815290565b6040519051815260200161044a565b348015610ae357600080fd5b506103dc610af23660046130ba565b611fb6565b348015610b0357600080fd5b506103dc610b1236600461347d565b611fd1565b348015610b2357600080fd5b5061043e610b32366004613205565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b6103dc610b6e36600461305e565b612034565b348015610b7f57600080fd5b506103dc610b8e366004613111565b61205c565b348015610b9f57600080fd5b506103dc610bae366004613045565b6120d5565b348015610bbf57600080fd5b506103dc610bce366004613045565b6120e2565b610bdb6120ef565b601454610c255760405162461bcd60e51b81526020600482015260136024820152724e6f206c617965727320617661696c61626c6560681b60448201526064015b60405180910390fd5b6014805480610c3657610c366134a0565b6000828152602081206004600019909301928302018181556001810182905560028101805460ff1916905590610c6f6003830182612c74565b50509055565b610c7d6120ef565b600a5482610c896110ce565b610c9391906134cc565b1115610cb15760405162461bcd60e51b8152600401610c1c906134e4565b610cbb8183612149565b5050565b610cc76120ef565b8051610cbb90600e906020840190612c92565b60006001600160e01b0319821663584cc76960e01b1480610cff5750610cff82612163565b92915050565b600f54610100900460ff1615610d2d5760405162461bcd60e51b8152600401610c1c90613510565b610d39858484846121b1565b610d4a84610d456110ce565b6125a7565b5050505050565b606060028054610d609061353d565b80601f0160208091040260200160405190810160405280929190818152602001828054610d8c9061353d565b8015610dd95780601f10610dae57610100808354040283529160200191610dd9565b820191906000526020600020905b815481529060010190602001808311610dbc57829003601f168201915b5050505050905090565b6000610dee8261260b565b610e0b576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610e3282611527565b9050336001600160a01b03821614610e6b57610e4e8133610b32565b610e6b576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b601454600090610ed8906002613577565b610ee390600261367a565b8210610f2a5760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964206170706c696564206c617965727360501b6044820152606401610c1c565b6000805b601454811015611040576000610f448583611747565b905080600203610f855760148281548110610f6157610f61613686565b90600052602060002090600402016001015483610f7e91906134cc565b925061102d565b80600103610fbd5760148281548110610fa057610fa0613686565b90600052602060002090600402016000015483610f7e91906134cc565b60148281548110610fd057610fd0613686565b600091825260209091206002600490920201015460ff161561102d5760405162461bcd60e51b815260206004820152601660248201527526b4b9b9b4b733903932b8bab4b932b2103630bcb2b960511b6044820152606401610c1c565b50806110388161369c565b915050610f2e565b5092915050565b60006014838154811061105c5761105c613686565b9060005260206000209060040201600301828154811061107e5761107e613686565b9060005260206000200154905092915050565b6110996120ef565b8051610cbb90600d906020840190612c92565b6110b46120ef565b600f80549115156101000261ff0019909216919091179055565b600154600054036000190190565b60006110e782612640565b9050836001600160a01b0316816001600160a01b03161461111a5760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054338082146001600160a01b038816909114176111675761114a8633610b32565b61116757604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03851661118e57604051633a954ecd60e21b815260040160405180910390fd5b801561119957600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040812091909155600160e11b8416900361122b576001840160008181526004602052604081205490036112295760005481146112295760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b61128f83838360405180602001604052806000815250611bd4565b505050565b606060006112a18361158e565b90506000816001600160401b038111156112bd576112bd612dad565b6040519080825280602002602001820160405280156112e6578160200160208202803683370190505b50905060016000805b84821080156113005750600a548311155b1561138f576000611310846126b6565b9050806040015115801561132d575080516001600160a01b031615155b1561133757805191505b876001600160a01b0316826001600160a01b03160361137c578385848151811061136357611363613686565b6020908102919091010152826113788161369c565b9350505b836113868161369c565b945050506112ef565b509195945050505050565b600d80546113a79061353d565b80601f01602080910402602001604051908101604052809291908181526020018280546113d39061353d565b80156114205780601f106113f557610100808354040283529160200191611420565b820191906000526020600020905b81548152906001019060200180831161140357829003601f168201915b505050505081565b6114306120ef565b601155565b61143d6120ef565b60165447906000906001600160a01b03166114596064846136b5565b611464906014613577565b604051600081818185875af1925050503d80600081146114a0576040519150601f19603f3d011682016040523d82523d6000602084013e6114a5565b606091505b50509050806114b357600080fd5b6017546000906001600160a01b03166114cd6064856136b5565b6114d8906050613577565b604051600081818185875af1925050503d8060008114611514576040519150601f19603f3d011682016040523d82523d6000602084013e611519565b606091505b505090508061128f57600080fd5b6000610cff82612640565b61153a6120ef565b806014848154811061154e5761154e613686565b9060005260206000209060040201600301838154811061157057611570613686565b600091825260209091200155505050565b6115896120ef565b600a55565b60006001600160a01b0382166115b7576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b6115e46120ef565b6115ee600061272d565b565b6115f86120ef565b60145482106116195760405162461bcd60e51b8152600401610c1c906136d7565b806014838154811061162d5761162d613686565b60009182526020909120600490910201555050565b61164a6120ef565b604080516080810182528481526020808201858152841515938301938452606083810181815260148054600181018255600091909152855160049091027fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec810191825593517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ed85015595517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ee8401805491151560ff1990921691909117905551805191959361173e937fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ef0192910190612d16565b50505050505050565b600080611755836002613577565b61176090600261367a565b8416151590506000611773846002613577565b61177e9060016134cc565b61178990600261367a565b8516151590508180156117995750805b156117de5760405162461bcd60e51b815260206004820152601560248201527424b73b30b634b21031b7b73334b3bab930ba34b7b760591b6044820152606401610c1c565b81156117ef57600192505050610cff565b801561180057600292505050610cff565b506000949350505050565b600e80546113a79061353d565b606060038054610d609061353d565b600c80546113a79061353d565b6014818154811061184457600080fd5b600091825260209091206004909102018054600182015460029092015490925060ff1683565b80600a54816118776110ce565b61188191906134cc565b111561189f5760405162461bcd60e51b8152600401610c1c906134e4565b6010548111156119005760405162461bcd60e51b815260206004820152602660248201527f4578636565646564206d6178696d756d20746f74616c20616d6f756e7420706560448201526572207472782160d01b6064820152608401610c1c565b6011543360009081526012602052604090205461191e9083906134cc565b111561193c5760405162461bcd60e51b8152600401610c1c90613700565b81600b548161194b9190613577565b3410156119905760405162461bcd60e51b8152602060048201526013602482015272496e73756666696369656e742066756e64732160681b6044820152606401610c1c565b600f54610100900460ff16156119b85760405162461bcd60e51b8152600401610c1c90613510565b6119c061277f565b60405162461bcd60e51b815260206004820152601360248201527226b2ba3437b2103737ba1030b63637bbb2b21760691b6044820152606401610c1c565b611a066120ef565b8051610cbb90600c906020840190612c92565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611a8d6120ef565b601680546001600160a01b039384166001600160a01b03199182161790915560178054929093169116179055565b611ae860405180608001604052806000815260200160008152602001600015158152602001606081525090565b60148281548110611afb57611afb613686565b600091825260209182902060408051608081018252600490930290910180548352600181015483850152600281015460ff1615158383015260038101805483518187028101870190945280845293949193606086019392830182828015611b8157602002820191906000526020600020905b815481526020019060010190808311611b6d575b5050505050815250509050919050565b611b996120ef565b60148281548110611bac57611bac613686565b6000918252602080832060036004909302019190910180546001810182559083529120015550565b611bdf8484846110dc565b6001600160a01b0383163b15611c1857611bfb848484846127d8565b611c18576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b600f54610100900460ff1615611c465760405162461bcd60e51b8152600401610c1c90613510565b611c52338484846121b1565b611c1884610d456110ce565b60606014805480602002602001604051908101604052809291908181526020016000905b82821015611d27576000848152602090819020604080516080810182526004860290920180548352600181015483850152600281015460ff1615158383015260038101805483518187028101870190945280845293949193606086019392830182828015611d0f57602002820191906000526020600020905b815481526020019060010190808311611cfb575b50505050508152505081526020019060010190611c82565b50505050905090565b611d386120ef565b6014548210611d595760405162461bcd60e51b8152600401610c1c906136d7565b8060148381548110611d6d57611d6d613686565b9060005260206000209060040201600101819055505050565b6060611d918261260b565b611ddd5760405162461bcd60e51b815260206004820152601960248201527f546f6b656e20494420646f206573206e6f742065786973742e000000000000006044820152606401610c1c565b600f5460ff16611e7957600e8054611df49061353d565b80601f0160208091040260200160405190810160405280929190818152602001828054611e209061353d565b8015611e6d5780601f10611e4257610100808354040283529160200191611e6d565b820191906000526020600020905b815481529060010190602001808311611e5057829003601f168201915b50505050509050919050565b611e816128c4565b611e8a836128d3565b600d604051602001611e9e9392919061374a565b6040516020818303038152906040529050919050565b611ebc6120ef565b8051825114611efe5760405162461bcd60e51b815260206004820152600e60248201526d092dcecc2d8d2c840d8cadccee8d60931b6044820152606401610c1c565b6000611f086110ce565b905060005b83518161ffff161015611c18576040518060200160405280848361ffff1681518110611f3b57611f3b613686565b6020026020010151815250601560008361ffff1685611f5a91906134cc565b611f659060016134cc565b81526020810191909152604001600020905190558351611fa490859061ffff8416908110611f9557611f95613686565b60200260200101516001612149565b80611fae8161380d565b915050611f0d565b611fbe6120ef565b600f805460ff1916911515919091179055565b611fd96120ef565b6014548210611ffa5760405162461bcd60e51b8152600401610c1c906136d7565b806014838154811061200e5761200e613686565b60009182526020909120600490910201600201805460ff19169115159190911790555050565b600f54610100900460ff16156119c05760405162461bcd60e51b8152600401610c1c90613510565b6120646120ef565b6001600160a01b0381166120c95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c1c565b6120d28161272d565b50565b6120dd6120ef565b601055565b6120ea6120ef565b600b55565b6008546001600160a01b031633146115ee5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c1c565b610cbb828260405180602001604052806000815250612965565b60006301ffc9a760e01b6001600160e01b03198316148061219457506380ac58cd60e01b6001600160e01b03198316145b80610cff5750506001600160e01b031916635b5e139f60e01b1490565b83600a546121bd6110ce565b6121c89060016134cc565b11156121e65760405162461bcd60e51b8152600401610c1c906134e4565b601154336000908152601260205260409020546122049060016134cc565b11156122225760405162461bcd60e51b8152600401610c1c90613700565b600f54610100900460ff161561224a5760405162461bcd60e51b8152600401610c1c90613510565b61225261277f565b82518251146122a35760405162461bcd60e51b815260206004820152601f60248201527f496e76616c696420737570706c6961626c65206974656d73206c656e677468006044820152606401610c1c565b60006122ae85610ec7565b9050803410156122f65760405162461bcd60e51b8152602060048201526013602482015272496e73756666696369656e742066756e64732160681b6044820152606401610c1c565b600084516001600160401b0381111561231157612311612dad565b60405190808252806020026020018201604052801561233a578160200160208202803683370190505b50905060005b815181101561237d57601454825183908390811061236057612360613686565b6020908102919091010152806123758161369c565b915050612340565b5060005b85518110156125325760005b825181101561241e578281815181106123a8576123a8613686565b60200260200101518783815181106123c2576123c2613686565b60200260200101510361240c5760405162461bcd60e51b815260206004820152601260248201527113185e595c88185b1c9958591e481d5cd95960721b6044820152606401610c1c565b806124168161369c565b91505061238d565b5085818151811061243157612431613686565b602002602001015182828151811061244b5761244b613686565b60200260200101818152505085818151811061246957612469613686565b6020026020010151600261247d9190613577565b6124889060016134cc565b61249390600261367a565b87166000036124e45760405162461bcd60e51b815260206004820152601760248201527f4d697373696e6720737570706c6961626c65206974656d0000000000000000006044820152606401610c1c565b6125208682815181106124f9576124f9613686565b602002602001015186838151811061251357612513613686565b60200260200101516129cb565b8061252a8161369c565b915050612381565b50604080516020810190915286815261256061254c6110ce565b600090815260156020526040902082519055565b61256b886001612149565b6001600160a01b03881660009081526012602052604081208054600192906125949084906134cc565b9091555050600160095550610d4a915050565b600082815260136020526040902054156125f95760405162461bcd60e51b815260206004820152601360248201527214995c5d595cdd08185b1c9958591e481cd95d606a1b6044820152606401610c1c565b60009182526013602052604090912055565b60008160011115801561261f575060005482105b8015610cff575050600090815260046020526040902054600160e01b161590565b6000818060011161269d5760005481101561269d5760008181526004602052604081205490600160e01b8216900361269b575b80600003612694575060001901600081815260046020526040902054612673565b9392505050565b505b604051636f96cda160e11b815260040160405180910390fd5b604080516080810182526000808252602082018190529181018290526060810191909152610cff6126e683612640565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6002600954036127d15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c1c565b6002600955565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061280d90339089908890889060040161382e565b6020604051808303816000875af1925050508015612848575060408051601f3d908101601f191682019092526128459181019061386b565b60015b6128a6573d808015612876576040519150601f19603f3d011682016040523d82523d6000602084013e61287b565b606091505b50805160000361289e576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6060600c8054610d609061353d565b606060006128e083612a9e565b60010190506000816001600160401b038111156128ff576128ff612dad565b6040519080825280601f01601f191660200182016040528015612929576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461293357509392505050565b61296f8383612b76565b6001600160a01b0383163b1561128f576000548281035b61299960008683806001019450866127d8565b6129b6576040516368d2bf6b60e11b815260040160405180910390fd5b818110612986578160005414610d4a57600080fd5b6000601483815481106129e0576129e0613686565b90600052602060002090600402016003018281548110612a0257612a02613686565b906000526020600020015411612a4a5760405162461bcd60e51b815260206004820152600d60248201526c139bc81a5d195b5cc81b19599d609a1b6044820152606401610c1c565b60148281548110612a5d57612a5d613686565b90600052602060002090600402016003018181548110612a7f57612a7f613686565b60009182526020822001805491612a9583613888565b91905055505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612add5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612b09576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612b2757662386f26fc10000830492506010015b6305f5e1008310612b3f576305f5e100830492506008015b6127108310612b5357612710830492506004015b60648310612b65576064830492506002015b600a8310610cff5760010192915050565b6000805490829003612b9b5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114612c4a57808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101612c12565b5081600003612c6b57604051622e076360e81b815260040160405180910390fd5b60005550505050565b50805460008255906000526020600020908101906120d29190612d50565b828054612c9e9061353d565b90600052602060002090601f016020900481019282612cc05760008555612d06565b82601f10612cd957805160ff1916838001178555612d06565b82800160010185558215612d06579182015b82811115612d06578251825591602001919060010190612ceb565b50612d12929150612d50565b5090565b828054828255906000526020600020908101928215612d065791602002820182811115612d06578251825591602001919060010190612ceb565b5b80821115612d125760008155600101612d51565b80356001600160a01b0381168114612d7c57600080fd5b919050565b60008060408385031215612d9457600080fd5b82359150612da460208401612d65565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612deb57612deb612dad565b604052919050565b60006001600160401b03831115612e0c57612e0c612dad565b612e1f601f8401601f1916602001612dc3565b9050828152838383011115612e3357600080fd5b828260208301376000602084830101529392505050565b600060208284031215612e5c57600080fd5b81356001600160401b03811115612e7257600080fd5b8201601f81018413612e8357600080fd5b6128bc84823560208401612df3565b6001600160e01b0319811681146120d257600080fd5b600060208284031215612eba57600080fd5b813561269481612e92565b60006001600160401b03821115612ede57612ede612dad565b5060051b60200190565b600082601f830112612ef957600080fd5b81356020612f0e612f0983612ec5565b612dc3565b82815260059290921b84018101918181019086841115612f2d57600080fd5b8286015b84811015612f485780358352918301918301612f31565b509695505050505050565b600080600080600060a08688031215612f6b57600080fd5b612f7486612d65565b9450602086013593506040860135925060608601356001600160401b0380821115612f9e57600080fd5b612faa89838a01612ee8565b93506080880135915080821115612fc057600080fd5b50612fcd88828901612ee8565b9150509295509295909350565b60005b83811015612ff5578181015183820152602001612fdd565b83811115611c185750506000910152565b6000815180845261301e816020860160208601612fda565b601f01601f19169290920160200192915050565b6020815260006126946020830184613006565b60006020828403121561305757600080fd5b5035919050565b6000806040838503121561307157600080fd5b61307a83612d65565b946020939093013593505050565b6000806040838503121561309b57600080fd5b50508035926020909101359150565b80358015158114612d7c57600080fd5b6000602082840312156130cc57600080fd5b612694826130aa565b6000806000606084860312156130ea57600080fd5b6130f384612d65565b925061310160208501612d65565b9150604084013590509250925092565b60006020828403121561312357600080fd5b61269482612d65565b600081518084526020808501945080840160005b8381101561315c57815187529582019590820190600101613140565b509495945050505050565b602081526000612694602083018461312c565b60008060006060848603121561318f57600080fd5b505081359360208301359350604090920135919050565b6000806000606084860312156131bb57600080fd5b83359250602084013591506131d2604085016130aa565b90509250925092565b600080604083850312156131ee57600080fd5b6131f783612d65565b9150612da4602084016130aa565b6000806040838503121561321857600080fd5b61322183612d65565b9150612da460208401612d65565b805182526020810151602083015260408101511515604083015260006060820151608060608501526128bc608085018261312c565b602081526000612694602083018461322f565b6000806000806080858703121561328d57600080fd5b61329685612d65565b93506132a460208601612d65565b92506040850135915060608501356001600160401b038111156132c657600080fd5b8501601f810187136132d757600080fd5b6132e687823560208401612df3565b91505092959194509250565b6000806000806080858703121561330857600080fd5b843593506020850135925060408501356001600160401b038082111561332d57600080fd5b61333988838901612ee8565b9350606087013591508082111561334f57600080fd5b506132e687828801612ee8565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156133b157603f1988860301845261339f85835161322f565b94509285019290850190600101613383565b5092979650505050505050565b600080604083850312156133d157600080fd5b82356001600160401b03808211156133e857600080fd5b818501915085601f8301126133fc57600080fd5b8135602061340c612f0983612ec5565b82815260059290921b8401810191818101908984111561342b57600080fd5b948201945b838610156134505761344186612d65565b82529482019490820190613430565b9650508601359250508082111561346657600080fd5b5061347385828601612ee8565b9150509250929050565b6000806040838503121561349057600080fd5b82359150612da4602084016130aa565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156134df576134df6134b6565b500190565b6020808252601290820152714d617820737570706c79206578636565642160701b604082015260600190565b60208082526013908201527221b7b73a3930b1ba1034b9903830bab9b2b21760691b604082015260600190565b600181811c9082168061355157607f821691505b60208210810361357157634e487b7160e01b600052602260045260246000fd5b50919050565b6000816000190483118215151615613591576135916134b6565b500290565b600181815b808511156135d15781600019048211156135b7576135b76134b6565b808516156135c457918102915b93841c939080029061359b565b509250929050565b6000826135e857506001610cff565b816135f557506000610cff565b816001811461360b576002811461361557613631565b6001915050610cff565b60ff841115613626576136266134b6565b50506001821b610cff565b5060208310610133831016604e8410600b8410161715613654575081810a610cff565b61365e8383613596565b8060001904821115613672576136726134b6565b029392505050565b600061269483836135d9565b634e487b7160e01b600052603260045260246000fd5b6000600182016136ae576136ae6134b6565b5060010190565b6000826136d257634e487b7160e01b600052601260045260246000fd5b500490565b6020808252600f908201526e125b9d985b1a59081b185e595c9259608a1b604082015260600190565b6020808252602a908201527f4578636565646564206d6178696d756d20746f74616c20616d6f756e742070656040820152697220616464726573732160b01b606082015260800190565b60008451602061375d8285838a01612fda565b8551918401916137708184848a01612fda565b8554920191600090600181811c908083168061378d57607f831692505b85831081036137aa57634e487b7160e01b85526022600452602485fd5b8080156137be57600181146137cf576137fc565b60ff198516885283880195506137fc565b60008b81526020902060005b858110156137f45781548a8201529084019088016137db565b505083880195505b50939b9a5050505050505050505050565b600061ffff808316818103613824576138246134b6565b6001019392505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061386190830184613006565b9695505050505050565b60006020828403121561387d57600080fd5b815161269481612e92565b600081613897576138976134b6565b50600019019056fea26469706673582212203cd07ec6168e2d837c072865e414b99163b2f6c213137389a5f39c1ed5f082e664736f6c634300080e003368747470733a2f2f70373635637062766d302e657865637574652d6170692e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f70312f72656e64657265722f4d696e746565626c652f636861696e2f626173652f636f6c6c656374696f6e2f36653062333961352d383536392d346536372d623333302d6433353235393363393632392f6d657461646174612f
Deployed Bytecode
0x6080604052600436106103c25760003560e01c806372f882e6116101f2578063b88d4fde1161010d578063de7fe3e7116100a0578063f254933d1161006f578063f254933d14610b60578063f2fde38b14610b73578063f471e55f14610b93578063f4a0a52814610bb357600080fd5b8063de7fe3e714610a84578063e0a8085314610ad7578063e693b57a14610af7578063e985e9c514610b1757600080fd5b8063bebdd3d2116100dc578063bebdd3d214610a18578063c87b56dd14610a2e578063d5abeb0114610a4e578063de01e15114610a6457600080fd5b8063b88d4fde146109b0578063b9e1cdeb146109c3578063bd7d28cd146109d6578063bd8624e6146109f857600080fd5b80639abc832011610185578063a22cb46511610154578063a22cb46514610923578063a40b698b14610943578063aae4690614610963578063b6f8d8131461099057600080fd5b80639abc83201461089e5780639e9198c2146108b3578063a0712d68146108f0578063a0bcfc7f1461090357600080fd5b80638f7b9379116101c15780638f7b93791461082757806395d89b411461083c57806397b991491461085157806397cf84fc1461087157600080fd5b806372f882e6146107a957806389c734a0146107c95780638da5cb5b146107e95780638f26035d1461080757600080fd5b80634304d58a116102e25780635fd8c710116102755780636817c76c116102445780636817c76c1461073e5780636f8b44b01461075457806370a0823114610774578063715018a61461079457600080fd5b80635fd8c710146106ce5780636352211e146106e357806365ea71f41461070357806366ab1d811461071e57600080fd5b80635503a0e8116102b15780635503a0e8146106645780635697f53e146106795780635c41d75e146106995780635c975abb146106af57600080fd5b80634304d58a146105d0578063438b6300146105f057806346b29e551461061d578063518302271461064a57600080fd5b80630f54a43f1161035a57806318160ddd1161032957806318160ddd146105615780631bbca5031461057657806323b872dd146105aa57806342842e0e146105bd57600080fd5b80630f54a43f146104d357806312b6f7261461050157806316ba10e01461052157806316c38b3c1461054157600080fd5b8063026886e211610396578063026886e21461045357806306fdde0314610466578063081812fc14610488578063095ea7b3146104c057600080fd5b80627b572c146103c7578063012fe98a146103de578063013eee1f146103fe57806301ffc9a71461041e575b600080fd5b3480156103d357600080fd5b506103dc610bd3565b005b3480156103ea57600080fd5b506103dc6103f9366004612d81565b610c75565b34801561040a57600080fd5b506103dc610419366004612e4a565b610cbf565b34801561042a57600080fd5b5061043e610439366004612ea8565b610cda565b60405190151581526020015b60405180910390f35b6103dc610461366004612f53565b610d05565b34801561047257600080fd5b5061047b610d51565b60405161044a9190613032565b34801561049457600080fd5b506104a86104a3366004613045565b610de3565b6040516001600160a01b03909116815260200161044a565b6103dc6104ce36600461305e565b610e27565b3480156104df57600080fd5b506104f36104ee366004613045565b610ec7565b60405190815260200161044a565b34801561050d57600080fd5b506104f361051c366004613088565b611047565b34801561052d57600080fd5b506103dc61053c366004612e4a565b611091565b34801561054d57600080fd5b506103dc61055c3660046130ba565b6110ac565b34801561056d57600080fd5b506104f36110ce565b34801561058257600080fd5b5061059163584cc76960e01b81565b6040516001600160e01b0319909116815260200161044a565b6103dc6105b83660046130d5565b6110dc565b6103dc6105cb3660046130d5565b611274565b3480156105dc57600080fd5b506016546104a8906001600160a01b031681565b3480156105fc57600080fd5b5061061061060b366004613111565b611294565b60405161044a9190613167565b34801561062957600080fd5b506104f3610638366004613045565b60009081526013602052604090205490565b34801561065657600080fd5b50600f5461043e9060ff1681565b34801561067057600080fd5b5061047b61139a565b34801561068557600080fd5b506103dc610694366004613045565b611428565b3480156106a557600080fd5b506104f360115481565b3480156106bb57600080fd5b50600f5461043e90610100900460ff1681565b3480156106da57600080fd5b506103dc611435565b3480156106ef57600080fd5b506104a86106fe366004613045565b611527565b34801561070f57600080fd5b506105916346b29e5560e01b81565b34801561072a57600080fd5b506103dc61073936600461317a565b611532565b34801561074a57600080fd5b506104f3600b5481565b34801561076057600080fd5b506103dc61076f366004613045565b611581565b34801561078057600080fd5b506104f361078f366004613111565b61158e565b3480156107a057600080fd5b506103dc6115dc565b3480156107b557600080fd5b506103dc6107c4366004613088565b6115f0565b3480156107d557600080fd5b506103dc6107e43660046131a6565b611642565b3480156107f557600080fd5b506008546001600160a01b03166104a8565b34801561081357600080fd5b506104f3610822366004613088565b611747565b34801561083357600080fd5b5061047b61180b565b34801561084857600080fd5b5061047b611818565b34801561085d57600080fd5b506017546104a8906001600160a01b031681565b34801561087d57600080fd5b506104f361088c366004613111565b60126020526000908152604090205481565b3480156108aa57600080fd5b5061047b611827565b3480156108bf57600080fd5b506108d36108ce366004613045565b611834565b60408051938452602084019290925215159082015260600161044a565b6103dc6108fe366004613045565b61186a565b34801561090f57600080fd5b506103dc61091e366004612e4a565b6119fe565b34801561092f57600080fd5b506103dc61093e3660046131db565b611a19565b34801561094f57600080fd5b506103dc61095e366004613205565b611a85565b34801561096f57600080fd5b5061098361097e366004613045565b611abb565b60405161044a9190613264565b34801561099c57600080fd5b506103dc6109ab366004613088565b611b91565b6103dc6109be366004613277565b611bd4565b6103dc6109d13660046132f2565b611c1e565b3480156109e257600080fd5b506109eb611c5e565b60405161044a919061335c565b348015610a0457600080fd5b506103dc610a13366004613088565b611d30565b348015610a2457600080fd5b506104f360105481565b348015610a3a57600080fd5b5061047b610a49366004613045565b611d86565b348015610a5a57600080fd5b506104f3600a5481565b348015610a7057600080fd5b506103dc610a7f3660046133be565b611eb4565b348015610a9057600080fd5b50610ac8610a9f366004613045565b604080516020808201835260009182905292815260158352819020815192830190915254815290565b6040519051815260200161044a565b348015610ae357600080fd5b506103dc610af23660046130ba565b611fb6565b348015610b0357600080fd5b506103dc610b1236600461347d565b611fd1565b348015610b2357600080fd5b5061043e610b32366004613205565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b6103dc610b6e36600461305e565b612034565b348015610b7f57600080fd5b506103dc610b8e366004613111565b61205c565b348015610b9f57600080fd5b506103dc610bae366004613045565b6120d5565b348015610bbf57600080fd5b506103dc610bce366004613045565b6120e2565b610bdb6120ef565b601454610c255760405162461bcd60e51b81526020600482015260136024820152724e6f206c617965727320617661696c61626c6560681b60448201526064015b60405180910390fd5b6014805480610c3657610c366134a0565b6000828152602081206004600019909301928302018181556001810182905560028101805460ff1916905590610c6f6003830182612c74565b50509055565b610c7d6120ef565b600a5482610c896110ce565b610c9391906134cc565b1115610cb15760405162461bcd60e51b8152600401610c1c906134e4565b610cbb8183612149565b5050565b610cc76120ef565b8051610cbb90600e906020840190612c92565b60006001600160e01b0319821663584cc76960e01b1480610cff5750610cff82612163565b92915050565b600f54610100900460ff1615610d2d5760405162461bcd60e51b8152600401610c1c90613510565b610d39858484846121b1565b610d4a84610d456110ce565b6125a7565b5050505050565b606060028054610d609061353d565b80601f0160208091040260200160405190810160405280929190818152602001828054610d8c9061353d565b8015610dd95780601f10610dae57610100808354040283529160200191610dd9565b820191906000526020600020905b815481529060010190602001808311610dbc57829003601f168201915b5050505050905090565b6000610dee8261260b565b610e0b576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610e3282611527565b9050336001600160a01b03821614610e6b57610e4e8133610b32565b610e6b576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b601454600090610ed8906002613577565b610ee390600261367a565b8210610f2a5760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964206170706c696564206c617965727360501b6044820152606401610c1c565b6000805b601454811015611040576000610f448583611747565b905080600203610f855760148281548110610f6157610f61613686565b90600052602060002090600402016001015483610f7e91906134cc565b925061102d565b80600103610fbd5760148281548110610fa057610fa0613686565b90600052602060002090600402016000015483610f7e91906134cc565b60148281548110610fd057610fd0613686565b600091825260209091206002600490920201015460ff161561102d5760405162461bcd60e51b815260206004820152601660248201527526b4b9b9b4b733903932b8bab4b932b2103630bcb2b960511b6044820152606401610c1c565b50806110388161369c565b915050610f2e565b5092915050565b60006014838154811061105c5761105c613686565b9060005260206000209060040201600301828154811061107e5761107e613686565b9060005260206000200154905092915050565b6110996120ef565b8051610cbb90600d906020840190612c92565b6110b46120ef565b600f80549115156101000261ff0019909216919091179055565b600154600054036000190190565b60006110e782612640565b9050836001600160a01b0316816001600160a01b03161461111a5760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054338082146001600160a01b038816909114176111675761114a8633610b32565b61116757604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03851661118e57604051633a954ecd60e21b815260040160405180910390fd5b801561119957600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040812091909155600160e11b8416900361122b576001840160008181526004602052604081205490036112295760005481146112295760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b61128f83838360405180602001604052806000815250611bd4565b505050565b606060006112a18361158e565b90506000816001600160401b038111156112bd576112bd612dad565b6040519080825280602002602001820160405280156112e6578160200160208202803683370190505b50905060016000805b84821080156113005750600a548311155b1561138f576000611310846126b6565b9050806040015115801561132d575080516001600160a01b031615155b1561133757805191505b876001600160a01b0316826001600160a01b03160361137c578385848151811061136357611363613686565b6020908102919091010152826113788161369c565b9350505b836113868161369c565b945050506112ef565b509195945050505050565b600d80546113a79061353d565b80601f01602080910402602001604051908101604052809291908181526020018280546113d39061353d565b80156114205780601f106113f557610100808354040283529160200191611420565b820191906000526020600020905b81548152906001019060200180831161140357829003601f168201915b505050505081565b6114306120ef565b601155565b61143d6120ef565b60165447906000906001600160a01b03166114596064846136b5565b611464906014613577565b604051600081818185875af1925050503d80600081146114a0576040519150601f19603f3d011682016040523d82523d6000602084013e6114a5565b606091505b50509050806114b357600080fd5b6017546000906001600160a01b03166114cd6064856136b5565b6114d8906050613577565b604051600081818185875af1925050503d8060008114611514576040519150601f19603f3d011682016040523d82523d6000602084013e611519565b606091505b505090508061128f57600080fd5b6000610cff82612640565b61153a6120ef565b806014848154811061154e5761154e613686565b9060005260206000209060040201600301838154811061157057611570613686565b600091825260209091200155505050565b6115896120ef565b600a55565b60006001600160a01b0382166115b7576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b6115e46120ef565b6115ee600061272d565b565b6115f86120ef565b60145482106116195760405162461bcd60e51b8152600401610c1c906136d7565b806014838154811061162d5761162d613686565b60009182526020909120600490910201555050565b61164a6120ef565b604080516080810182528481526020808201858152841515938301938452606083810181815260148054600181018255600091909152855160049091027fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec810191825593517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ed85015595517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ee8401805491151560ff1990921691909117905551805191959361173e937fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ef0192910190612d16565b50505050505050565b600080611755836002613577565b61176090600261367a565b8416151590506000611773846002613577565b61177e9060016134cc565b61178990600261367a565b8516151590508180156117995750805b156117de5760405162461bcd60e51b815260206004820152601560248201527424b73b30b634b21031b7b73334b3bab930ba34b7b760591b6044820152606401610c1c565b81156117ef57600192505050610cff565b801561180057600292505050610cff565b506000949350505050565b600e80546113a79061353d565b606060038054610d609061353d565b600c80546113a79061353d565b6014818154811061184457600080fd5b600091825260209091206004909102018054600182015460029092015490925060ff1683565b80600a54816118776110ce565b61188191906134cc565b111561189f5760405162461bcd60e51b8152600401610c1c906134e4565b6010548111156119005760405162461bcd60e51b815260206004820152602660248201527f4578636565646564206d6178696d756d20746f74616c20616d6f756e7420706560448201526572207472782160d01b6064820152608401610c1c565b6011543360009081526012602052604090205461191e9083906134cc565b111561193c5760405162461bcd60e51b8152600401610c1c90613700565b81600b548161194b9190613577565b3410156119905760405162461bcd60e51b8152602060048201526013602482015272496e73756666696369656e742066756e64732160681b6044820152606401610c1c565b600f54610100900460ff16156119b85760405162461bcd60e51b8152600401610c1c90613510565b6119c061277f565b60405162461bcd60e51b815260206004820152601360248201527226b2ba3437b2103737ba1030b63637bbb2b21760691b6044820152606401610c1c565b611a066120ef565b8051610cbb90600c906020840190612c92565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611a8d6120ef565b601680546001600160a01b039384166001600160a01b03199182161790915560178054929093169116179055565b611ae860405180608001604052806000815260200160008152602001600015158152602001606081525090565b60148281548110611afb57611afb613686565b600091825260209182902060408051608081018252600490930290910180548352600181015483850152600281015460ff1615158383015260038101805483518187028101870190945280845293949193606086019392830182828015611b8157602002820191906000526020600020905b815481526020019060010190808311611b6d575b5050505050815250509050919050565b611b996120ef565b60148281548110611bac57611bac613686565b6000918252602080832060036004909302019190910180546001810182559083529120015550565b611bdf8484846110dc565b6001600160a01b0383163b15611c1857611bfb848484846127d8565b611c18576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b600f54610100900460ff1615611c465760405162461bcd60e51b8152600401610c1c90613510565b611c52338484846121b1565b611c1884610d456110ce565b60606014805480602002602001604051908101604052809291908181526020016000905b82821015611d27576000848152602090819020604080516080810182526004860290920180548352600181015483850152600281015460ff1615158383015260038101805483518187028101870190945280845293949193606086019392830182828015611d0f57602002820191906000526020600020905b815481526020019060010190808311611cfb575b50505050508152505081526020019060010190611c82565b50505050905090565b611d386120ef565b6014548210611d595760405162461bcd60e51b8152600401610c1c906136d7565b8060148381548110611d6d57611d6d613686565b9060005260206000209060040201600101819055505050565b6060611d918261260b565b611ddd5760405162461bcd60e51b815260206004820152601960248201527f546f6b656e20494420646f206573206e6f742065786973742e000000000000006044820152606401610c1c565b600f5460ff16611e7957600e8054611df49061353d565b80601f0160208091040260200160405190810160405280929190818152602001828054611e209061353d565b8015611e6d5780601f10611e4257610100808354040283529160200191611e6d565b820191906000526020600020905b815481529060010190602001808311611e5057829003601f168201915b50505050509050919050565b611e816128c4565b611e8a836128d3565b600d604051602001611e9e9392919061374a565b6040516020818303038152906040529050919050565b611ebc6120ef565b8051825114611efe5760405162461bcd60e51b815260206004820152600e60248201526d092dcecc2d8d2c840d8cadccee8d60931b6044820152606401610c1c565b6000611f086110ce565b905060005b83518161ffff161015611c18576040518060200160405280848361ffff1681518110611f3b57611f3b613686565b6020026020010151815250601560008361ffff1685611f5a91906134cc565b611f659060016134cc565b81526020810191909152604001600020905190558351611fa490859061ffff8416908110611f9557611f95613686565b60200260200101516001612149565b80611fae8161380d565b915050611f0d565b611fbe6120ef565b600f805460ff1916911515919091179055565b611fd96120ef565b6014548210611ffa5760405162461bcd60e51b8152600401610c1c906136d7565b806014838154811061200e5761200e613686565b60009182526020909120600490910201600201805460ff19169115159190911790555050565b600f54610100900460ff16156119c05760405162461bcd60e51b8152600401610c1c90613510565b6120646120ef565b6001600160a01b0381166120c95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c1c565b6120d28161272d565b50565b6120dd6120ef565b601055565b6120ea6120ef565b600b55565b6008546001600160a01b031633146115ee5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c1c565b610cbb828260405180602001604052806000815250612965565b60006301ffc9a760e01b6001600160e01b03198316148061219457506380ac58cd60e01b6001600160e01b03198316145b80610cff5750506001600160e01b031916635b5e139f60e01b1490565b83600a546121bd6110ce565b6121c89060016134cc565b11156121e65760405162461bcd60e51b8152600401610c1c906134e4565b601154336000908152601260205260409020546122049060016134cc565b11156122225760405162461bcd60e51b8152600401610c1c90613700565b600f54610100900460ff161561224a5760405162461bcd60e51b8152600401610c1c90613510565b61225261277f565b82518251146122a35760405162461bcd60e51b815260206004820152601f60248201527f496e76616c696420737570706c6961626c65206974656d73206c656e677468006044820152606401610c1c565b60006122ae85610ec7565b9050803410156122f65760405162461bcd60e51b8152602060048201526013602482015272496e73756666696369656e742066756e64732160681b6044820152606401610c1c565b600084516001600160401b0381111561231157612311612dad565b60405190808252806020026020018201604052801561233a578160200160208202803683370190505b50905060005b815181101561237d57601454825183908390811061236057612360613686565b6020908102919091010152806123758161369c565b915050612340565b5060005b85518110156125325760005b825181101561241e578281815181106123a8576123a8613686565b60200260200101518783815181106123c2576123c2613686565b60200260200101510361240c5760405162461bcd60e51b815260206004820152601260248201527113185e595c88185b1c9958591e481d5cd95960721b6044820152606401610c1c565b806124168161369c565b91505061238d565b5085818151811061243157612431613686565b602002602001015182828151811061244b5761244b613686565b60200260200101818152505085818151811061246957612469613686565b6020026020010151600261247d9190613577565b6124889060016134cc565b61249390600261367a565b87166000036124e45760405162461bcd60e51b815260206004820152601760248201527f4d697373696e6720737570706c6961626c65206974656d0000000000000000006044820152606401610c1c565b6125208682815181106124f9576124f9613686565b602002602001015186838151811061251357612513613686565b60200260200101516129cb565b8061252a8161369c565b915050612381565b50604080516020810190915286815261256061254c6110ce565b600090815260156020526040902082519055565b61256b886001612149565b6001600160a01b03881660009081526012602052604081208054600192906125949084906134cc565b9091555050600160095550610d4a915050565b600082815260136020526040902054156125f95760405162461bcd60e51b815260206004820152601360248201527214995c5d595cdd08185b1c9958591e481cd95d606a1b6044820152606401610c1c565b60009182526013602052604090912055565b60008160011115801561261f575060005482105b8015610cff575050600090815260046020526040902054600160e01b161590565b6000818060011161269d5760005481101561269d5760008181526004602052604081205490600160e01b8216900361269b575b80600003612694575060001901600081815260046020526040902054612673565b9392505050565b505b604051636f96cda160e11b815260040160405180910390fd5b604080516080810182526000808252602082018190529181018290526060810191909152610cff6126e683612640565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6002600954036127d15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c1c565b6002600955565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061280d90339089908890889060040161382e565b6020604051808303816000875af1925050508015612848575060408051601f3d908101601f191682019092526128459181019061386b565b60015b6128a6573d808015612876576040519150601f19603f3d011682016040523d82523d6000602084013e61287b565b606091505b50805160000361289e576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6060600c8054610d609061353d565b606060006128e083612a9e565b60010190506000816001600160401b038111156128ff576128ff612dad565b6040519080825280601f01601f191660200182016040528015612929576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461293357509392505050565b61296f8383612b76565b6001600160a01b0383163b1561128f576000548281035b61299960008683806001019450866127d8565b6129b6576040516368d2bf6b60e11b815260040160405180910390fd5b818110612986578160005414610d4a57600080fd5b6000601483815481106129e0576129e0613686565b90600052602060002090600402016003018281548110612a0257612a02613686565b906000526020600020015411612a4a5760405162461bcd60e51b815260206004820152600d60248201526c139bc81a5d195b5cc81b19599d609a1b6044820152606401610c1c565b60148281548110612a5d57612a5d613686565b90600052602060002090600402016003018181548110612a7f57612a7f613686565b60009182526020822001805491612a9583613888565b91905055505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612add5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612b09576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612b2757662386f26fc10000830492506010015b6305f5e1008310612b3f576305f5e100830492506008015b6127108310612b5357612710830492506004015b60648310612b65576064830492506002015b600a8310610cff5760010192915050565b6000805490829003612b9b5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114612c4a57808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101612c12565b5081600003612c6b57604051622e076360e81b815260040160405180910390fd5b60005550505050565b50805460008255906000526020600020908101906120d29190612d50565b828054612c9e9061353d565b90600052602060002090601f016020900481019282612cc05760008555612d06565b82601f10612cd957805160ff1916838001178555612d06565b82800160010185558215612d06579182015b82811115612d06578251825591602001919060010190612ceb565b50612d12929150612d50565b5090565b828054828255906000526020600020908101928215612d065791602002820182811115612d06578251825591602001919060010190612ceb565b5b80821115612d125760008155600101612d51565b80356001600160a01b0381168114612d7c57600080fd5b919050565b60008060408385031215612d9457600080fd5b82359150612da460208401612d65565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612deb57612deb612dad565b604052919050565b60006001600160401b03831115612e0c57612e0c612dad565b612e1f601f8401601f1916602001612dc3565b9050828152838383011115612e3357600080fd5b828260208301376000602084830101529392505050565b600060208284031215612e5c57600080fd5b81356001600160401b03811115612e7257600080fd5b8201601f81018413612e8357600080fd5b6128bc84823560208401612df3565b6001600160e01b0319811681146120d257600080fd5b600060208284031215612eba57600080fd5b813561269481612e92565b60006001600160401b03821115612ede57612ede612dad565b5060051b60200190565b600082601f830112612ef957600080fd5b81356020612f0e612f0983612ec5565b612dc3565b82815260059290921b84018101918181019086841115612f2d57600080fd5b8286015b84811015612f485780358352918301918301612f31565b509695505050505050565b600080600080600060a08688031215612f6b57600080fd5b612f7486612d65565b9450602086013593506040860135925060608601356001600160401b0380821115612f9e57600080fd5b612faa89838a01612ee8565b93506080880135915080821115612fc057600080fd5b50612fcd88828901612ee8565b9150509295509295909350565b60005b83811015612ff5578181015183820152602001612fdd565b83811115611c185750506000910152565b6000815180845261301e816020860160208601612fda565b601f01601f19169290920160200192915050565b6020815260006126946020830184613006565b60006020828403121561305757600080fd5b5035919050565b6000806040838503121561307157600080fd5b61307a83612d65565b946020939093013593505050565b6000806040838503121561309b57600080fd5b50508035926020909101359150565b80358015158114612d7c57600080fd5b6000602082840312156130cc57600080fd5b612694826130aa565b6000806000606084860312156130ea57600080fd5b6130f384612d65565b925061310160208501612d65565b9150604084013590509250925092565b60006020828403121561312357600080fd5b61269482612d65565b600081518084526020808501945080840160005b8381101561315c57815187529582019590820190600101613140565b509495945050505050565b602081526000612694602083018461312c565b60008060006060848603121561318f57600080fd5b505081359360208301359350604090920135919050565b6000806000606084860312156131bb57600080fd5b83359250602084013591506131d2604085016130aa565b90509250925092565b600080604083850312156131ee57600080fd5b6131f783612d65565b9150612da4602084016130aa565b6000806040838503121561321857600080fd5b61322183612d65565b9150612da460208401612d65565b805182526020810151602083015260408101511515604083015260006060820151608060608501526128bc608085018261312c565b602081526000612694602083018461322f565b6000806000806080858703121561328d57600080fd5b61329685612d65565b93506132a460208601612d65565b92506040850135915060608501356001600160401b038111156132c657600080fd5b8501601f810187136132d757600080fd5b6132e687823560208401612df3565b91505092959194509250565b6000806000806080858703121561330857600080fd5b843593506020850135925060408501356001600160401b038082111561332d57600080fd5b61333988838901612ee8565b9350606087013591508082111561334f57600080fd5b506132e687828801612ee8565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156133b157603f1988860301845261339f85835161322f565b94509285019290850190600101613383565b5092979650505050505050565b600080604083850312156133d157600080fd5b82356001600160401b03808211156133e857600080fd5b818501915085601f8301126133fc57600080fd5b8135602061340c612f0983612ec5565b82815260059290921b8401810191818101908984111561342b57600080fd5b948201945b838610156134505761344186612d65565b82529482019490820190613430565b9650508601359250508082111561346657600080fd5b5061347385828601612ee8565b9150509250929050565b6000806040838503121561349057600080fd5b82359150612da4602084016130aa565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156134df576134df6134b6565b500190565b6020808252601290820152714d617820737570706c79206578636565642160701b604082015260600190565b60208082526013908201527221b7b73a3930b1ba1034b9903830bab9b2b21760691b604082015260600190565b600181811c9082168061355157607f821691505b60208210810361357157634e487b7160e01b600052602260045260246000fd5b50919050565b6000816000190483118215151615613591576135916134b6565b500290565b600181815b808511156135d15781600019048211156135b7576135b76134b6565b808516156135c457918102915b93841c939080029061359b565b509250929050565b6000826135e857506001610cff565b816135f557506000610cff565b816001811461360b576002811461361557613631565b6001915050610cff565b60ff841115613626576136266134b6565b50506001821b610cff565b5060208310610133831016604e8410600b8410161715613654575081810a610cff565b61365e8383613596565b8060001904821115613672576136726134b6565b029392505050565b600061269483836135d9565b634e487b7160e01b600052603260045260246000fd5b6000600182016136ae576136ae6134b6565b5060010190565b6000826136d257634e487b7160e01b600052601260045260246000fd5b500490565b6020808252600f908201526e125b9d985b1a59081b185e595c9259608a1b604082015260600190565b6020808252602a908201527f4578636565646564206d6178696d756d20746f74616c20616d6f756e742070656040820152697220616464726573732160b01b606082015260800190565b60008451602061375d8285838a01612fda565b8551918401916137708184848a01612fda565b8554920191600090600181811c908083168061378d57607f831692505b85831081036137aa57634e487b7160e01b85526022600452602485fd5b8080156137be57600181146137cf576137fc565b60ff198516885283880195506137fc565b60008b81526020902060005b858110156137f45781548a8201529084019088016137db565b505083880195505b50939b9a5050505050505050505050565b600061ffff808316818103613824576138246134b6565b6001019392505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061386190830184613006565b9695505050505050565b60006020828403121561387d57600080fd5b815161269481612e92565b600081613897576138976134b6565b50600019019056fea26469706673582212203cd07ec6168e2d837c072865e414b99163b2f6c213137389a5f39c1ed5f082e664736f6c634300080e0033
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.