ERC-721
Overview
Max Total Supply
480 MITG
Holders
192
Market
Volume (24H)
0.6 ETH
Min Price (24H)
$2,005.69 @ 0.600000 ETH
Max Price (24H)
$2,005.69 @ 0.600000 ETH
Other Info
Token Contract
Balance
1 MITGLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
MachineInTheGhost
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 1000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT /********************************************************************** * ┓ • • ┓ * * ┏┳┓┏┓┏┣┓┓┏┓┏┓ ┓┏┓ ╋┣┓┏┓ * * ┛┗┗┗┻┗┛┗┗┛┗┗ ┗┛┗ ┗┛┗┗ ᵈᶦᶦᵈ ᵃⁿᵈ ᵛᵉʳᵗᵘ ᶠᶦⁿᵉ ᵃʳᵗ ᵖʳᵉˢᵉⁿᵗ * * ░▒▓██████▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓██████▓▒░ ░▒▓███████▓▒░▒▓████████▓▒░ * * ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░ * * ░▒▓█▓▒▒▓███▓▒░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓██████▓▒░ ░▒▓█▓▒░ * * ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ * * ░▒▓██████▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓██████▓▒░░▒▓███████▓▒░ ░▒▓█▓▒░ * * * **********************************************************************/ pragma solidity ^0.8.20; import "erc721a/contracts/ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "solady/src/utils/SSTORE2.sol"; import "solady/src/utils/Base64.sol"; abstract contract InflateLib { function puff(bytes memory source, uint256 destlen) external pure virtual returns (bytes memory); } contract MachineInTheGhost is ERC721A, Ownable(msg.sender) { InflateLib inflateLib; struct Image { address[] pointers; uint length; string name; } Image[64] public images; struct Palette { string name; bytes1[3][] colors; } Palette[32] public palettes; struct BayerGrid { uint[16] grid; uint length; string name; } BayerGrid[16] public bayerGrids; bytes32[16] physicals; uint seed; bool locked = false; uint MAX_SUPPLY = 512; uint PHYSICALS = 16; uint RESERVED = 32; uint price = .1 ether; bytes32 ZERO_HASH = 0x00000000000000000000000000000000; uint public allowlistStartTime; uint public publicStartTime; bytes32 public root; mapping(address => uint) public minted; mapping(uint => bytes32) hashes; /* ______ ______ ______ __ __ ______ /\ ___\/\ ___\/\__ _\/\ \/\ \/\ == \ \ \___ \ \ __\\/_/\ \/\ \ \_\ \ \ _-/ \/\_____\ \_____\ \ \_\ \ \_____\ \_\ \/_____/\/_____/ \/_/ \/_____/\/_/ begin setup (aka pre-mint stuff) */ constructor(address inflate) ERC721A("machine in the ghost", "MITG") { inflateLib = InflateLib(inflate); root = 0xacd18baca68279e4a841c887392d24ed6a03564c07be64ac5b5bdd556aae9475; _mintERC2309(msg.sender, 16); seed = block.timestamp; } modifier isUnlocked() { require(!locked, 'Contract is locked and cannot be edited'); _; } function lockContract() public onlyOwner { locked = true; } function setPhysicals(bytes32[] memory _physicals) public onlyOwner isUnlocked { for (uint i = 0; i < _physicals.length; i++) { physicals[i] = _physicals[i]; } } function setPhysical(bytes32 physical, uint i) public onlyOwner isUnlocked { physicals[i] = physical; } function setImages(Image[] memory _images) public onlyOwner isUnlocked { for (uint i = 0; i < _images.length; i++) { images[i] = _images[i]; } } function setPalettes(Palette[] calldata _palettes) public onlyOwner isUnlocked { for (uint i = 0; i < _palettes.length; i++) { palettes[i] = _palettes[i]; } } function setBayerGrids(BayerGrid[] calldata grids) public onlyOwner isUnlocked { for (uint i = 0; i < grids.length; i++) { bayerGrids[i] = grids[i]; } } function _startTokenId() internal view virtual override returns (uint256) { return 1; } /* end setup */ /* __ __ ______ __ __ /\ \/\ \/\__ _\/\ \/\ \ \ \ \_\ \/_/\ \/\ \ \ \ \____ \ \_____\ \ \_\ \ \_\ \_____\ \/_____/ \/_/ \/_/\/_____/ begin util (aka everything that was barely touched) */ function _max(int[3] memory options) private pure returns (int) { int max = 0; for (uint i = 0; i < options.length; i++) { if (options[i] > max) max = options[i]; } return max; } function _min(int[3] memory options) private pure returns (int) { int min = 0xFFFFFFFFFFFFFFFF; for (uint i = 0; i < options.length; i++) { if (options[i] < min) min = options[i]; } return min; } function _loadRawImage(uint imageId) private view returns (bytes memory) { Image memory image = images[imageId]; // unroll the loop for efficiency, nothing is bigger than 50kb bytes memory data = SSTORE2.read(image.pointers[0]); if (image.pointers.length > 1) { data = abi.encodePacked(data, SSTORE2.read(image.pointers[1])); } data = inflateLib.puff(data, image.length); return data; } function _wrap(string memory imageUri, uint width, uint height) private pure returns(string memory) { string memory w = Strings.toString(width * 10); string memory h = Strings.toString(height * 10); return string(abi.encodePacked( '<svg viewBox="0 0 ', w, ' ', h, '" width="', w, '" height="', h, '" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style>image {image-rendering: optimizeSpeed;image-rendering: -moz-crisp-edges;image-rendering: -o-crisp-edges;image-rendering: -webkit-optimize-contrast;image-rendering: optimize-contrast;image-rendering: crisp-edges;image-rendering: pixelated;-ms-interpolation-mode: nearest-neighbor;}</style></defs><image width="', w, 'px" height="', h, 'px" href="data:image/bmp;base64,', imageUri, '" /></svg>' )); } function _getDouble(bytes1 first, bytes1 second) private pure returns(uint) { return (uint(uint8(first)) << 8) + uint8(second); } /* end util */ /* __ __ ______ ______ ______ _____ ______ ______ ______ /\ "-./ \/\ ___\/\__ _\/\ __ \/\ __-./\ __ \/\__ _\/\ __ \ \ \ \-./\ \ \ __\\/_/\ \/\ \ __ \ \ \/\ \ \ __ \/_/\ \/\ \ __ \ \ \_\ \ \_\ \_____\ \ \_\ \ \_\ \_\ \____-\ \_\ \_\ \ \_\ \ \_\ \_\ \/_/ \/_/\/_____/ \/_/ \/_/\/_/\/____/ \/_/\/_/ \/_/ \/_/\/_/ start metadata */ function _paletteName(bytes32 hash) private view returns(string memory) { return palettes[uint8(hash[1]) % palettes.length].name; } function _imageId(bytes32 hash) private pure returns(uint) { return uint(uint8(hash[0])) & 0x3F; } function _bayerGrid(bytes32 hash) private view returns(string memory) { uint alg = (uint8(hash[2]) % 8 > 0) ? 1 : 0; uint gridIndex = (uint8(hash[3]) & 0x0f) % bayerGrids.length; if (alg == 0) { gridIndex = gridIndex % 4; } return bayerGrids[gridIndex].name; } function _comparison(bytes32 hash) private pure returns(string memory) { uint comp = (uint8(hash[3]) >> 4) % 3; if (comp == 0) { return "RGB"; } else if (comp == 1) { return "Luma"; } else { return "Lightness"; } } function _initialPalette(bytes32 hash) private view returns(bytes1[3][] memory) { return palettes[uint8(hash[1]) % palettes.length].colors; } function _getNewHash() private view returns (bytes32) { return keccak256(abi.encodePacked(seed, _nextTokenId(), msg.sender, block.timestamp)); } function getHash(uint256 tokenId) public view returns (bytes32) { if (tokenId <= 16) return physicals[tokenId - 1]; else if (hashes[tokenId] != ZERO_HASH) return hashes[tokenId]; return keccak256(abi.encodePacked(tokenId, seed)); } function getProperties(bytes32 hash) public view returns (string memory) { string memory attributes = '"attributes": ['; string memory image = images[_imageId(hash)].name; string memory grid = _bayerGrid(hash); string memory comparison = _comparison(hash); string memory palette = _paletteName(hash); uint colorCorrect = (uint8(hash[4]) & 0x0f) % 10; if (colorCorrect > 6) { attributes = string(abi.encodePacked( attributes, '{"trait_type":"color correction","value":"true"},' )); } if (colorCorrect < 9) { // bayer grid attributes = string(abi.encodePacked( attributes, '{"trait_type":"grid","value":"', grid, '"},' )); } // image attributes = string(abi.encodePacked( attributes, '{"trait_type":"source","value":"', image, '"},' )); // palette attributes = string(abi.encodePacked( attributes, '{"trait_type":"palette","value":"', palette, '"},' )); // comparison attributes = string(abi.encodePacked( attributes, '{"trait_type":"comparison","value":"', comparison, '"}' )); return string( abi.encodePacked( attributes, ']' ) ); } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { bytes32 hash = getHash(tokenId); return string(abi.encodePacked( 'data:application/json;utf8,{"name":"', Strings.toString(tokenId), '","image":"data:image/svg+xml;base64,', Base64.encode(bytes(generate(hash))), '",', getProperties(hash), '}' )); } /* end metadata */ /* ______ ______ __ ______ ______ /\ ___\/\ __ \/\ \ /\ __ \/\ == \ \ \ \___\ \ \/\ \ \ \___\ \ \/\ \ \ __< \ \_____\ \_____\ \_____\ \_____\ \_\ \_\ \/_____/\/_____/\/_____/\/_____/\/_/ /_/ start color */ function _writeColorTable(bytes memory data, bytes1[3][] memory colorTable) private pure returns(bytes memory) { for (uint i = 0; i < colorTable.length; i++) { data[0x36 + i * 4] = colorTable[i][2]; data[0x36 + i * 4 + 1] = colorTable[i][1]; data[0x36 + i * 4 + 2] = colorTable[i][0]; } return data; } function _writeFullColorTable(bytes memory data, bytes1[3][16] memory colorTable) private pure returns(bytes memory) { for (uint i = 0; i < 16; i++) { data[0x36 + i * 4] = colorTable[i][2]; data[0x36 + i * 4 + 1] = colorTable[i][1]; data[0x36 + i * 4 + 2] = colorTable[i][0]; } return data; } function _extractColorTable(bytes memory data) private pure returns(bytes1[3][16] memory) { bytes1[3][16] memory colorTable; for (uint i = 0; i < 16; i++) { colorTable[i][2] = data[0x36 + i * 4]; colorTable[i][1] = data[0x36 + i * 4 + 1]; colorTable[i][0] = data[0x36 + i * 4 + 2]; } return colorTable; } function _diff(uint a, uint b) private pure returns(uint) { uint d; if (a > b) { d = a - b; } else { d = b - a; } return d * d; } function _diffb(bytes1 a, bytes1 b) private pure returns(uint) { return _diff(uint8(a), uint8(b)); } function _distRGB(bytes1[3] memory a, bytes1[3] memory b) private pure returns(uint) { return _diffb(a[0], b[0]) + _diffb(a[1], b[1]) + _diffb(a[2], b[2]); } function _distLightness(bytes1[3] memory a, bytes1[3] memory b) private pure returns(uint) { uint b1 = _getBrightness(a); uint b2 = _getBrightness(b); return _diff(b1, b2); } function _distLuma(bytes1[3] memory x, bytes1[3] memory y) private pure returns(uint) { uint lumadiff = _distLightness(x, y); uint r = _diffb(x[0], y[0]); uint g = _diffb(x[1], y[1]); uint b = _diffb(x[2], y[2]); return _getBrightnessInt(r, g, b) * 3 / 4 + lumadiff * lumadiff; } function _dist(bytes1[3] memory a, bytes1[3] memory b, uint alg) private pure returns (uint) { if (alg == 0) { return _distRGB(a, b); } else if (alg == 1) { return _distLuma(a, b); } else { return _distLightness(a, b); } } function _getBrightnessInt(uint r, uint g, uint b) private pure returns (uint) { uint bright = 299 * r + 587 * g + 114 * b; return bright / 1000; } function _getBrightness(bytes1[3] memory color) private pure returns(uint) { return _getBrightnessInt(uint(uint8(color[0])), uint(uint8(color[1])), uint(uint8(color[2]))); } function _getNormalizedPalette(bytes1[3][16] memory colorTable, uint len) private pure returns(bytes1[3][] memory) { uint[16] memory brightnesses; bytes1[3][] memory returnVal = new bytes1[3][](len); for (uint i = 0; i < 16; i++) { brightnesses[i] = 0; } for (uint i = 0; i < 16; i++) { uint brightness = _getBrightness(colorTable[i]); brightnesses[i] = brightness; for (uint j = 0; j < i; j++) { if (brightnesses[j] >= brightness) { if (j < 15) { brightnesses[j + 1] = brightnesses[j]; } brightnesses[j] = brightness; break; } } } for (uint i = 0; i < len; i++) { uint j = i * 15 / (len - 1); uint b = brightnesses[j]; if (i == 0 && b > 0) b--; else if (i == len - 1 && b < 255) b++; returnVal[i] = [ abi.encodePacked(b)[0], abi.encodePacked(b)[0], abi.encodePacked(b)[0] ]; } return returnVal; } /* end color */ /* _____ __ ______ __ __ ______ ______ /\ __-./\ \/\__ _\/\ \_\ \/\ ___\/\ == \ \ \ \/\ \ \ \/_/\ \/\ \ __ \ \ __\\ \ __< \ \____-\ \_\ \ \_\ \ \_\ \_\ \_____\ \_\ \_\ \/____/ \/_/ \/_/ \/_/\/_/\/_____/\/_/ /_/ start dithering */ function _getBayerColor(bytes1 color, uint i, uint gridIndex) private view returns (bytes1) { uint[16] memory grid = bayerGrids[gridIndex].grid; uint offset = 180 / (bayerGrids[gridIndex].length); uint adjustment = 90; uint modifiedColor = uint(uint8(color)) + offset * grid[i]; if (modifiedColor < adjustment) modifiedColor = adjustment; modifiedColor -= adjustment; return abi.encodePacked(uint8(modifiedColor & 0xFF))[0]; } function _getBayerReplacements(uint len, bytes1[3][16] memory colorTable, bytes1[3][] memory palette, uint gridIndex, uint distAlg) private view returns(uint8[16][16] memory) { uint8[16][16] memory replacements; for (uint i = 0; i < len; i++) { for (uint j = 0; j < 16; j++) { bytes1[3] memory tempTable; tempTable[0] = _getBayerColor(colorTable[j][0], i, gridIndex); tempTable[1] = _getBayerColor(colorTable[j][1], i, gridIndex); tempTable[2] = _getBayerColor(colorTable[j][2], i, gridIndex); uint8 replacement; uint minDist = 3 * 256 * 256 + 1; for (uint8 c = 0; c < palette.length; c++) { uint dist = _dist(tempTable, palette[c], distAlg); if (dist < minDist) { replacement = c; minDist = dist; } } replacements[i][j] = replacement; } } return replacements; } function _bayer(bytes1[3][16] memory colorTable, bytes1[3][] memory palette, bytes memory data, uint width, uint height, uint gridIndex, uint distAlg) private view { uint len = bayerGrids[gridIndex].length; uint8[16][16] memory replacements = _getBayerReplacements(len, colorTable, palette, gridIndex, distAlg); uint w = len == 4 ? 2 : 4; for (uint y = 0; y < height; y++) { for (uint x = 0; x < width / 2; x++) { uint i = 0x76 + (y * width) / 2 + x; uint8 p0 = uint8(data[i]) >> 4; uint8 p1 = uint8(data[i]) & 0x0F; uint j = w * (y % w) + (w / 2) * (x % (w / 2)); data[i] = abi.encodePacked( (replacements[j][p0] << 4) + replacements[j + 1][p1] )[0]; } } } /* end dither */ /* ______ ______ ______ ______ ______ ______ ______ /\ ___\/\ __ \/\ == \/\ == \/\ ___\/\ ___\/\__ _\ \ \ \___\ \ \/\ \ \ __<\ \ __<\ \ __\\ \ \___\/_/\ \/ \ \_____\ \_____\ \_\ \_\ \_\ \_\ \_____\ \_____\ \ \_\ \/_____/\/_____/\/_/ /_/\/_/ /_/\/_____/\/_____/ \/_/ start color correction */ function _getHSV(bytes1[3] memory color) private pure returns (int[3] memory) { int r = int(uint(uint8(color[0]))); int g = int(uint(uint8(color[1]))); int b = int(uint(uint8(color[2]))); int v = _max([r, g, b]); int c = v - _min([r, g, b]); int h = 0; if (c == 0) { h = c; } else if (v == r) { h = (256 * (g - b)) / c; } else if (v == g) { h = 512 + (256 * (b - r)) / c; } else { h = 1024 + (256 * (r - g)) / c; } // sat = c / v return [ (h < 0 ? h + 1536 : h) / 6, v != 0 ? (256 * c) / v : v, v ]; } function _getRGBComponent(int n, int[3] memory color) private pure returns(bytes1) { int h = color[0]; int s = color[1]; int v = color[2]; int k = (n * 256 + h * 6) % (6 * 256); int l = _min([k, 1024 - k, 256]); int m = l > 0 ? l : int(0); return abi.encodePacked(uint((v * (256 - (s * m) / 256)) / 256))[31]; } function _getRGB(int[3] memory color) private pure returns (bytes1[3] memory) { return [ _getRGBComponent(5, color), _getRGBComponent(3, color), _getRGBComponent(1, color) ]; } function _shift(int val, int amount) private pure returns (int) { if (amount != 0) { val += amount; if (val < 0) val = 0; else if (val > 255) val = 255; } return val; } function _norm(uint n, int v, int val, int min, int max) private pure returns (int) { if (n == 0) return v; int offset = (8 * ((v * v) / 256 - v + 64)) / int(n); if (v > 128) { val -= offset; if (val < min) val = min; } else { val += offset; if (val > max) val = max; } return val; } function _hueShift(uint maxShift, uint targetHue, int h) private pure returns (int) { if (maxShift == 0) return h; uint dist; int change; if (int(targetHue) > h) { int c1 = int(targetHue) - h; int c2 = 255 - h + int(targetHue); if (c1 > c2) { dist = uint(c2); change = -c2; } else { dist = uint(c1); change = c2; } } else { int c1 = h - int(targetHue); int c2 = 255 - int(targetHue) + h; if (c1 < c2) { dist = uint(c1); change = -c1; } else { dist = uint(c2); change = c2; } } if (dist < maxShift) h = int(targetHue); else { h += change; if (h < 0) h = 256 + h; else if (h > 255) h = h - 256; } return h; } // start at random[5] function _colorCorrect(bytes1[3][16] memory colorTable, bytes32 random) private pure { int[3][16] memory hueTable; for (uint i = 0; i < 16; i++) { hueTable[i] = _getHSV(colorTable[i]); } /* satShift --> 5 brightShift --> 6 muddle --> 7 satNorm --> 8 hueNorm --> 9 hueShift --> 10 targetHue --> 11 probably want to normalize these more */ // simply move saturation up or down, -64 to 64 --> 6 bit int satShift = int(uint(uint8(random[5]) % 128)) - 64; // ignore brightness shift, use sat shift alongside it // to increase moodiness bool muddle = uint8(random[7]) % 2 > 0; // simply move brightness up or down, -64 to 64 --> 7 bit int brightShift = muddle ? satShift / 2 : int(uint(uint8(random[6]) % 128)) - 64; // increase saturation in dark colors, decrease in bright, 0 to 15 uint satNorm = uint(uint8(random[8]) % 16); // warm colors in bright colors, cool in dark, 0 to 15 uint hueNorm = uint(uint8(random[9]) % 16); // shift towards the target hue, 2 * hueShift is the max shift. 128 is a good max // target hue from 0 to 255 uint hueShift = uint(uint8(random[10]) / 2); if (uint(uint8(random[11])) % 4 > 0) hueShift = 0; uint targetHue = uint(uint8(random[12])); for (uint i = 0; i < 16; i++) { int h = hueTable[i][0]; int s = hueTable[i][1]; int v = hueTable[i][2]; s = _shift(s, satShift); v = _shift(v, brightShift); s = _norm(satNorm, v, s, 0, 255); h = _norm(hueNorm, v, s, 35, 200); h = _hueShift(hueShift, targetHue, h); hueTable[i] = [h, s, v]; } for (uint i = 0; i < 16; i++) { colorTable[i] = _getRGB(hueTable[i]); } } /* end color correction */ /* ______ ______ __ __ ______ ______ ______ ______ ______ /\ ___\/\ ___\/\ "-.\ \/\ ___\/\ == \/\ __ \/\__ _\/\ ___\ \ \ \__ \ \ __\\ \ \-. \ \ __\\ \ __<\ \ __ \/_/\ \/\ \ __\ \ \_____\ \_____\ \_\\"\_\ \_____\ \_\ \_\ \_\ \_\ \ \_\ \ \_____\ \/_____/\/_____/\/_/ \/_/\/_____/\/_/ /_/\/_/\/_/ \/_/ \/_____/ start generator */ function render(bytes memory data, bytes1[3][] memory palette, uint8 alg, bool normalize, uint bayerIndex, uint distAlg, uint colorCorrect, bytes32 random) public view returns(string memory) { uint w = _getDouble(data[0x13], data[0x12]); uint h = _getDouble(data[0x17], data[0x16]); w = (w * 4 + 31) / 32; w = w * 8; bytes1[3][16] memory colorTable = _extractColorTable(data); if (colorCorrect < 9) { if (alg == 0) bayerIndex = bayerIndex % 4; if (normalize) { _bayer(colorTable, _getNormalizedPalette(colorTable, palette.length), data, w, h, bayerIndex, distAlg); } else { _bayer(colorTable, palette, data, w, h, bayerIndex, distAlg); } _writeColorTable(data, palette); } if (colorCorrect > 6) { // gotta re-extract the palette if (colorCorrect < 9) colorTable = _extractColorTable(data); _colorCorrect(colorTable, random); _writeFullColorTable(data, colorTable); } return _wrap(Base64.encode(data), w, h); } function generate(bytes32 hash) public view returns(string memory) { uint imageId = _imageId(hash); bytes1[3][] memory palette = _initialPalette(hash); bytes memory data = _loadRawImage(imageId); return render(data, palette, (uint8(hash[2]) % 8 > 0) ? 1 : 0, (uint8(hash[2]) << 4) % 2 == 1, (uint8(hash[3]) & 0x0f) % bayerGrids.length, (uint8(hash[3]) >> 4) % 3, (uint8(hash[4]) & 0x0f) % 10, hash); } /* end generator */ /* __ __ __ __ __ ______ /\ "-./ \/\ \/\ "-.\ \/\__ _\ \ \ \-./\ \ \ \ \ \-. \/_/\ \/ \ \_\ \ \_\ \_\ \_\\"\_\ \ \_\ \/_/ \/_/\/_/\/_/ \/_/ \/_/ start mint */ function _publicSaleActive() internal view returns (bool) { return block.timestamp >= publicStartTime && publicStartTime != 0; } function _allowlistSaleActive() internal view returns (bool) { return block.timestamp >= allowlistStartTime && allowlistStartTime != 0; } function allowlistSaleActive() public view returns (bool) { return _allowlistSaleActive() && !_publicSaleActive(); } function saleActive() public view returns (bool) { return _allowlistSaleActive() || _publicSaleActive(); } function remainingAdminSupply() public view returns (uint) { return MAX_SUPPLY - _nextTokenId() + 1; } function remainingSupply() public view returns (uint) { return remainingAdminSupply() - RESERVED; } modifier isNotSoldOut(uint count) { require(remainingSupply() >= count, 'sold out!'); _; } modifier isNotMintedOut(uint count) { require(remainingAdminSupply() >= count, 'minted out'); _; } modifier hasPaid(uint count) { require(msg.value == price * count, 'you gotta pay to play'); _; } modifier saleIsActive() { require(saleActive(), 'sale is not live'); _; } modifier publicSaleIsActive() { require(_publicSaleActive(), 'sale is allowlist only'); _; } function _mintTokenWithHash(bytes32 hash, address to) private { hashes[_nextTokenId()] = hash; _mint(to, 1); } function mint() public payable hasPaid(1) saleIsActive publicSaleIsActive isNotSoldOut(1) { _mintTokenWithHash(_getNewHash(), msg.sender); } function mintAllowlist(bytes32[] calldata proof, uint count) public payable hasPaid(count) saleIsActive isNotSoldOut(count) { require( MerkleProof.verifyCalldata( proof, root, keccak256(abi.encodePacked(msg.sender)) ), 'not on allowlist'); require(minted[msg.sender] + count <= 3, 'already minted'); minted[msg.sender] += count; for (uint i = 0; i < count; i++) { _mintTokenWithHash(_getNewHash(), msg.sender); } } function adminMint(bytes32[] calldata hashesToMint, address to, uint count) public onlyOwner isNotMintedOut(count) { for (uint i = 0; i < count; i++) { bytes32 hash = ZERO_HASH; if (hashesToMint.length > i) { hash = hashesToMint[i]; } if (hash == ZERO_HASH) { hash = _getNewHash(); } _mintTokenWithHash(hash, to); } } /* end mint */ /* ______ _____ __ __ __ __ __ /\ __ \/\ __-./\ "-./ \/\ \/\ "-.\ \ \ \ __ \ \ \/\ \ \ \-./\ \ \ \ \ \-. \ \ \_\ \_\ \____-\ \_\ \ \_\ \_\ \_\\"\_\ \/_/\/_/\/____/ \/_/ \/_/\/_/\/_/ \/_/ begin admin */ /** * @notice sets the merkle root for allowlist checking * * @param _root the new root to set */ function setRoot(bytes32 _root) external onlyOwner { root = _root; } /** * @notice immediately starts the public sale (no allowlist) */ function startPublicSale() external onlyOwner { publicStartTime = block.timestamp; allowlistStartTime = block.timestamp; } /** * @notice starts the allowlist sale (signed AL spot required) */ function startAllowlistSale() external onlyOwner { publicStartTime = 0; allowlistStartTime = block.timestamp; } /** * @notice sets the start time for public sale * * @param start the start time */ function setPublicStartTime(uint start) external onlyOwner { publicStartTime = start; } /** * @notice sets the start time for allowlist sale * * @param start the start time */ function setAllowlistStartTime(uint start) external onlyOwner { allowlistStartTime = start; } /** * @notice sets a new per-piece price * * @param _price the new price to set */ function setPrice(uint _price) external onlyOwner { price = _price; } /** * @notice withdraw to the owner */ function withdraw() external onlyOwner { (bool s,) = owner().call{value: (address(this).balance)}(""); require(s, "Withdraw failed."); } /* end admin */ }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../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. * * The initial owner is set to the address provided by the deployer. 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; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @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 { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling 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 { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _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 v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.20; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the Merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates Merkle trees that are safe * against this attack out of the box. */ library MerkleProof { /** *@dev The multiproof provided is not valid. */ error MerkleProofInvalidMultiproof(); /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} */ function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the Merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. if (leavesLen + proofLen != totalHashes + 1) { revert MerkleProofInvalidMultiproof(); } // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { if (proofPos != proofLen) { revert MerkleProofInvalidMultiproof(); } unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the Merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. if (leavesLen + proofLen != totalHashes + 1) { revert MerkleProofInvalidMultiproof(); } // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { if (proofPos != proofLen) { revert MerkleProofInvalidMultiproof(); } unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Sorts the pair (a, b) and hashes the result. */ function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } /** * @dev Implementation of keccak256(abi.encode(a, b)) that doesn't allocate or expand memory. */ function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @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 towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (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 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 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. uint256 twos = denominator & (0 - denominator); 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 (unsignedRoundsUp(rounding) && 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 * towards zero. * * 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 + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * 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 + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * 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 + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * 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 256, 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 + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./math/Math.sol"; import {SignedMath} from "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @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), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @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) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } 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); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.3.0 // 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()`. * * The `_sequentialUpTo()` function can be overriden to enable spot mints * (i.e. non-consecutive mints) for `tokenId`s greater than `_sequentialUpTo()`. * * 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; // The amount of tokens minted above `_sequentialUpTo()`. // We call these spot mints (i.e. non-sequential mints). uint256 private _spotMinted; // ============================================================= // CONSTRUCTOR // ============================================================= constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); if (_sequentialUpTo() < _startTokenId()) _revert(SequentialUpToTooSmall.selector); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID for sequential mints. * * Override this function to change the starting token ID for sequential mints. * * Note: The value returned must never change after any tokens have been minted. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the maximum token ID (inclusive) for sequential mints. * * Override this function to return a value less than 2**256 - 1, * but greater than `_startTokenId()`, to enable spot (non-sequential) mints. * * Note: The value returned must never change after any tokens have been minted. */ function _sequentialUpTo() internal view virtual returns (uint256) { return type(uint256).max; } /** * @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 result) { // Counter underflow is impossible as `_burnCounter` cannot be incremented // more than `_currentIndex + _spotMinted - _startTokenId()` times. unchecked { // With spot minting, the intermediate `result` can be temporarily negative, // and the computation must be unchecked. result = _currentIndex - _burnCounter - _startTokenId(); if (_sequentialUpTo() != type(uint256).max) result += _spotMinted; } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256 result) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { result = _currentIndex - _startTokenId(); if (_sequentialUpTo() != type(uint256).max) result += _spotMinted; } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return _burnCounter; } /** * @dev Returns the total number of tokens that are spot-minted. */ function _totalSpotMinted() internal view virtual returns (uint256) { return _spotMinted; } // ============================================================= // 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.selector); 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.selector); 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 Returns whether the ownership slot at `index` is initialized. * An uninitialized slot does not necessarily mean that the slot has no owner. */ function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) { return _packedOwnerships[index] != 0; } /** * @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); } } /** * @dev Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) { if (_startTokenId() <= tokenId) { packed = _packedOwnerships[tokenId]; if (tokenId > _sequentialUpTo()) { if (_packedOwnershipExists(packed)) return packed; _revert(OwnerQueryForNonexistentToken.selector); } // If the data at the starting slot does not exist, start the scan. if (packed == 0) { if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexistentToken.selector); // 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, `tokenId` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. for (;;) { unchecked { packed = _packedOwnerships[--tokenId]; } if (packed == 0) continue; if (packed & _BITMASK_BURNED == 0) return packed; // Otherwise, the token is burned, and we must revert. // This handles the case of batch burned tokens, where only the burned bit // of the starting slot is set, and remaining slots are left uninitialized. _revert(OwnerQueryForNonexistentToken.selector); } } // Otherwise, the data exists and we can skip the scan. // This is possible because we have already achieved the target condition. // This saves 2143 gas on transfers of initialized tokens. // If the token is not burned, return `packed`. Otherwise, revert. if (packed & _BITMASK_BURNED == 0) return packed; } _revert(OwnerQueryForNonexistentToken.selector); } /** * @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. See {ERC721A-_approve}. * * Requirements: * * - The caller must own the token or be an approved operator. */ function approve(address to, uint256 tokenId) public payable virtual override { _approve(to, tokenId, true); } /** * @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.selector); 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 result) { if (_startTokenId() <= tokenId) { if (tokenId > _sequentialUpTo()) return _packedOwnershipExists(_packedOwnerships[tokenId]); if (tokenId < _currentIndex) { uint256 packed; while ((packed = _packedOwnerships[tokenId]) == 0) --tokenId; result = packed & _BITMASK_BURNED == 0; } } } /** * @dev Returns whether `packed` represents a token that exists. */ function _packedOwnershipExists(uint256 packed) private pure returns (bool result) { assembly { // The following is equivalent to `owner != address(0) && burned == false`. // Symbolically tested. result := gt(and(packed, _BITMASK_ADDRESS), and(packed, _BITMASK_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); // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean. from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS)); if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector); (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.selector); _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; } } } } // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; assembly { // 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. from, // `from`. toMasked, // `to`. tokenId // `tokenId`. ) } if (toMasked == 0) _revert(TransferToZeroAddress.selector); _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.selector); } } /** * @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.selector); } 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.selector); _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: // - `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) ); // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; if (toMasked == 0) _revert(MintToZeroAddress.selector); uint256 end = startTokenId + quantity; uint256 tokenId = startTokenId; if (end - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector); do { assembly { // 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`. tokenId // `tokenId`. ) } // The `!=` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. } while (++tokenId != end); _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.selector); if (quantity == 0) _revert(MintZeroQuantity.selector); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector); _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) ); if (startTokenId + quantity - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector); 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.selector); } } while (index < end); // This prevents reentrancy to `_safeMint`. // It does not prevent reentrancy to `_safeMintSpot`. if (_currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } /** * @dev Mints a single token at `tokenId`. * * Note: A spot-minted `tokenId` that has been burned can be re-minted again. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` must be greater than `_sequentialUpTo()`. * - `tokenId` must not exist. * * Emits a {Transfer} event for each mint. */ function _mintSpot(address to, uint256 tokenId) internal virtual { if (tokenId <= _sequentialUpTo()) _revert(SpotMintTokenIdTooSmall.selector); uint256 prevOwnershipPacked = _packedOwnerships[tokenId]; if (_packedOwnershipExists(prevOwnershipPacked)) _revert(TokenAlreadyExists.selector); _beforeTokenTransfers(address(0), to, tokenId, 1); // Overflows are incredibly unrealistic. // The `numberMinted` for `to` is incremented by 1, and has a max limit of 2**64 - 1. // `_spotMinted` is incremented by 1, and has a max limit of 2**256 - 1. unchecked { // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `true` (as `quantity == 1`). _packedOwnerships[tokenId] = _packOwnershipData( to, _nextInitializedFlag(1) | _nextExtraData(address(0), to, prevOwnershipPacked) ); // Updates: // - `balance += 1`. // - `numberMinted += 1`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += (1 << _BITPOS_NUMBER_MINTED) | 1; // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; if (toMasked == 0) _revert(MintToZeroAddress.selector); assembly { // 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`. tokenId // `tokenId`. ) } ++_spotMinted; } _afterTokenTransfers(address(0), to, tokenId, 1); } /** * @dev Safely mints a single token at `tokenId`. * * Note: A spot-minted `tokenId` that has been burned can be re-minted again. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}. * - `tokenId` must be greater than `_sequentialUpTo()`. * - `tokenId` must not exist. * * See {_mintSpot}. * * Emits a {Transfer} event. */ function _safeMintSpot( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mintSpot(to, tokenId); unchecked { if (to.code.length != 0) { uint256 currentSpotMinted = _spotMinted; if (!_checkContractOnERC721Received(address(0), to, tokenId, _data)) { _revert(TransferToNonERC721ReceiverImplementer.selector); } // This prevents reentrancy to `_safeMintSpot`. // It does not prevent reentrancy to `_safeMint`. if (_spotMinted != currentSpotMinted) revert(); } } } /** * @dev Equivalent to `_safeMintSpot(to, tokenId, '')`. */ function _safeMintSpot(address to, uint256 tokenId) internal virtual { _safeMintSpot(to, tokenId, ''); } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Equivalent to `_approve(to, tokenId, false)`. */ function _approve(address to, uint256 tokenId) internal virtual { _approve(to, tokenId, false); } /** * @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: * * - `tokenId` must exist. * * Emits an {Approval} event. */ function _approve( address to, uint256 tokenId, bool approvalCheck ) internal virtual { address owner = ownerOf(tokenId); if (approvalCheck && _msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { _revert(ApprovalCallerNotOwnerNorApproved.selector); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } // ============================================================= // 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.selector); } _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 + _spotMinted` 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.selector); 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) } } /** * @dev For more efficient reverts. */ function _revert(bytes4 errorSelector) internal pure { assembly { mstore(0x00, errorSelector) revert(0x00, 0x04) } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.3.0 // 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(); /** * `_sequentialUpTo()` must be greater than `_startTokenId()`. */ error SequentialUpToTooSmall(); /** * The `tokenId` of a sequential mint exceeds `_sequentialUpTo()`. */ error SequentialMintExceedsLimit(); /** * Spot minting requires a `tokenId` greater than `_sequentialUpTo()`. */ error SpotMintTokenIdTooSmall(); /** * Cannot mint over a token that already exists. */ error TokenAlreadyExists(); /** * The feature is not compatible with spot mints. */ error NotCompatibleWithSpotMints(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables * (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, * checking first that contract recipients are aware of the ERC721 protocol * to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move * this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external payable; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Transfers `tokenId` from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} * whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external payable; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) external view returns (bool); // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Library to encode strings in Base64. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/Base64.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/Base64.sol) /// @author Modified from (https://github.com/Brechtpd/base64/blob/main/base64.sol) by Brecht Devos - <[email protected]>. library Base64 { /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// See: https://datatracker.ietf.org/doc/html/rfc4648 /// @param fileSafe Whether to replace '+' with '-' and '/' with '_'. /// @param noPadding Whether to strip away the padding. function encode(bytes memory data, bool fileSafe, bool noPadding) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let dataLength := mload(data) if dataLength { // Multiply by 4/3 rounded up. // The `shl(2, ...)` is equivalent to multiplying by 4. let encodedLength := shl(2, div(add(dataLength, 2), 3)) // Set `result` to point to the start of the free memory. result := mload(0x40) // Store the table into the scratch space. // Offsetted by -1 byte so that the `mload` will load the character. // We will rewrite the free memory pointer at `0x40` later with // the allocated size. // The magic constant 0x0670 will turn "-_" into "+/". mstore(0x1f, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef") mstore(0x3f, xor("ghijklmnopqrstuvwxyz0123456789-_", mul(iszero(fileSafe), 0x0670))) // Skip the first slot, which stores the length. let ptr := add(result, 0x20) let end := add(ptr, encodedLength) let dataEnd := add(add(0x20, data), dataLength) let dataEndValue := mload(dataEnd) // Cache the value at the `dataEnd` slot. mstore(dataEnd, 0x00) // Zeroize the `dataEnd` slot to clear dirty bits. // Run over the input, 3 bytes at a time. for {} 1 {} { data := add(data, 3) // Advance 3 bytes. let input := mload(data) // Write 4 bytes. Optimized for fewer stack operations. mstore8(0, mload(and(shr(18, input), 0x3F))) mstore8(1, mload(and(shr(12, input), 0x3F))) mstore8(2, mload(and(shr(6, input), 0x3F))) mstore8(3, mload(and(input, 0x3F))) mstore(ptr, mload(0x00)) ptr := add(ptr, 4) // Advance 4 bytes. if iszero(lt(ptr, end)) { break } } mstore(dataEnd, dataEndValue) // Restore the cached value at `dataEnd`. mstore(0x40, add(end, 0x20)) // Allocate the memory. // Equivalent to `o = [0, 2, 1][dataLength % 3]`. let o := div(2, mod(dataLength, 3)) // Offset `ptr` and pad with '='. We can simply write over the end. mstore(sub(ptr, o), shl(240, 0x3d3d)) // Set `o` to zero if there is padding. o := mul(iszero(iszero(noPadding)), o) mstore(sub(ptr, o), 0) // Zeroize the slot after the string. mstore(result, sub(encodedLength, o)) // Store the length. } } } /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// Equivalent to `encode(data, false, false)`. function encode(bytes memory data) internal pure returns (string memory result) { result = encode(data, false, false); } /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// Equivalent to `encode(data, fileSafe, false)`. function encode(bytes memory data, bool fileSafe) internal pure returns (string memory result) { result = encode(data, fileSafe, false); } /// @dev Decodes base64 encoded `data`. /// /// Supports: /// - RFC 4648 (both standard and file-safe mode). /// - RFC 3501 (63: ','). /// /// Does not support: /// - Line breaks. /// /// Note: For performance reasons, /// this function will NOT revert on invalid `data` inputs. /// Outputs for invalid inputs will simply be undefined behaviour. /// It is the user's responsibility to ensure that the `data` /// is a valid base64 encoded string. function decode(string memory data) internal pure returns (bytes memory result) { /// @solidity memory-safe-assembly assembly { let dataLength := mload(data) if dataLength { let decodedLength := mul(shr(2, dataLength), 3) for {} 1 {} { // If padded. if iszero(and(dataLength, 3)) { let t := xor(mload(add(data, dataLength)), 0x3d3d) // forgefmt: disable-next-item decodedLength := sub( decodedLength, add(iszero(byte(30, t)), iszero(byte(31, t))) ) break } // If non-padded. decodedLength := add(decodedLength, sub(and(dataLength, 3), 1)) break } result := mload(0x40) // Write the length of the bytes. mstore(result, decodedLength) // Skip the first slot, which stores the length. let ptr := add(result, 0x20) let end := add(ptr, decodedLength) // Load the table into the scratch space. // Constants are optimized for smaller bytecode with zero gas overhead. // `m` also doubles as the mask of the upper 6 bits. let m := 0xfc000000fc00686c7074787c8084888c9094989ca0a4a8acb0b4b8bcc0c4c8cc mstore(0x5b, m) mstore(0x3b, 0x04080c1014181c2024282c3034383c4044484c5054585c6064) mstore(0x1a, 0xf8fcf800fcd0d4d8dce0e4e8ecf0f4) for {} 1 {} { // Read 4 bytes. data := add(data, 4) let input := mload(data) // Write 3 bytes. // forgefmt: disable-next-item mstore(ptr, or( and(m, mload(byte(28, input))), shr(6, or( and(m, mload(byte(29, input))), shr(6, or( and(m, mload(byte(30, input))), shr(6, mload(byte(31, input))) )) )) )) ptr := add(ptr, 3) if iszero(lt(ptr, end)) { break } } mstore(0x40, add(end, 0x20)) // Allocate the memory. mstore(end, 0) // Zeroize the slot after the bytes. mstore(0x60, 0) // Restore the zero slot. } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Read and write to persistent storage at a fraction of the cost. /// @author Solady (https://github.com/vectorized/solmady/blob/main/src/utils/SSTORE2.sol) /// @author Saw-mon-and-Natalie (https://github.com/Saw-mon-and-Natalie) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SSTORE2.sol) /// @author Modified from 0xSequence (https://github.com/0xSequence/sstore2/blob/master/contracts/SSTORE2.sol) library SSTORE2 { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CONSTANTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev We skip the first byte as it's a STOP opcode, /// which ensures the contract can't be called. uint256 internal constant DATA_OFFSET = 1; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Unable to deploy the storage contract. error DeploymentFailed(); /// @dev The storage contract address is invalid. error InvalidPointer(); /// @dev Attempt to read outside of the storage contract's bytecode bounds. error ReadOutOfBounds(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* WRITE LOGIC */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Writes `data` into the bytecode of a storage contract and returns its address. function write(bytes memory data) internal returns (address pointer) { /// @solidity memory-safe-assembly assembly { let originalDataLength := mload(data) // Add 1 to data size since we are prefixing it with a STOP opcode. let dataSize := add(originalDataLength, DATA_OFFSET) /** * ------------------------------------------------------------------------------+ * Opcode | Mnemonic | Stack | Memory | * ------------------------------------------------------------------------------| * 61 dataSize | PUSH2 dataSize | dataSize | | * 80 | DUP1 | dataSize dataSize | | * 60 0xa | PUSH1 0xa | 0xa dataSize dataSize | | * 3D | RETURNDATASIZE | 0 0xa dataSize dataSize | | * 39 | CODECOPY | dataSize | [0..dataSize): code | * 3D | RETURNDATASIZE | 0 dataSize | [0..dataSize): code | * F3 | RETURN | | [0..dataSize): code | * 00 | STOP | | | * ------------------------------------------------------------------------------+ * @dev Prefix the bytecode with a STOP opcode to ensure it cannot be called. * Also PUSH2 is used since max contract size cap is 24,576 bytes which is less than 2 ** 16. */ mstore( // Do a out-of-gas revert if `dataSize` is more than 2 bytes. // The actual EVM limit may be smaller and may change over time. add(data, gt(dataSize, 0xffff)), // Left shift `dataSize` by 64 so that it lines up with the 0000 after PUSH2. or(0xfd61000080600a3d393df300, shl(0x40, dataSize)) ) // Deploy a new contract with the generated creation code. pointer := create(0, add(data, 0x15), add(dataSize, 0xa)) // If `pointer` is zero, revert. if iszero(pointer) { // Store the function selector of `DeploymentFailed()`. mstore(0x00, 0x30116425) // Revert with (offset, size). revert(0x1c, 0x04) } // Restore original length of the variable size `data`. mstore(data, originalDataLength) } } /// @dev Writes `data` into the bytecode of a storage contract with `salt` /// and returns its deterministic address. function writeDeterministic(bytes memory data, bytes32 salt) internal returns (address pointer) { /// @solidity memory-safe-assembly assembly { let originalDataLength := mload(data) let dataSize := add(originalDataLength, DATA_OFFSET) mstore( // Do a out-of-gas revert if `dataSize` is more than 2 bytes. // The actual EVM limit may be smaller and may change over time. add(data, gt(dataSize, 0xffff)), // Left shift `dataSize` by 64 so that it lines up with the 0000 after PUSH2. or(0xfd61000080600a3d393df300, shl(0x40, dataSize)) ) // Deploy a new contract with the generated creation code. pointer := create2(0, add(data, 0x15), add(dataSize, 0xa), salt) // If `pointer` is zero, revert. if iszero(pointer) { // Store the function selector of `DeploymentFailed()`. mstore(0x00, 0x30116425) // Revert with (offset, size). revert(0x1c, 0x04) } // Restore original length of the variable size `data`. mstore(data, originalDataLength) } } /// @dev Returns the initialization code hash of the storage contract for `data`. /// Used for mining vanity addresses with create2crunch. function initCodeHash(bytes memory data) internal pure returns (bytes32 hash) { /// @solidity memory-safe-assembly assembly { let originalDataLength := mload(data) let dataSize := add(originalDataLength, DATA_OFFSET) // Do a out-of-gas revert if `dataSize` is more than 2 bytes. // The actual EVM limit may be smaller and may change over time. returndatacopy(returndatasize(), returndatasize(), shr(16, dataSize)) mstore(data, or(0x61000080600a3d393df300, shl(0x40, dataSize))) hash := keccak256(add(data, 0x15), add(dataSize, 0xa)) // Restore original length of the variable size `data`. mstore(data, originalDataLength) } } /// @dev Returns the address of the storage contract for `data` /// deployed with `salt` by `deployer`. /// Note: The returned result has dirty upper 96 bits. Please clean if used in assembly. function predictDeterministicAddress(bytes memory data, bytes32 salt, address deployer) internal pure returns (address predicted) { bytes32 hash = initCodeHash(data); /// @solidity memory-safe-assembly assembly { // Compute and store the bytecode hash. mstore8(0x00, 0xff) // Write the prefix. mstore(0x35, hash) mstore(0x01, shl(96, deployer)) mstore(0x15, salt) predicted := keccak256(0x00, 0x55) // Restore the part of the free memory pointer that has been overwritten. mstore(0x35, 0) } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* READ LOGIC */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns all the `data` from the bytecode of the storage contract at `pointer`. function read(address pointer) internal view returns (bytes memory data) { /// @solidity memory-safe-assembly assembly { let pointerCodesize := extcodesize(pointer) if iszero(pointerCodesize) { // Store the function selector of `InvalidPointer()`. mstore(0x00, 0x11052bb4) // Revert with (offset, size). revert(0x1c, 0x04) } // Offset all indices by 1 to skip the STOP opcode. let size := sub(pointerCodesize, DATA_OFFSET) // Get the pointer to the free memory and allocate // enough 32-byte words for the data and the length of the data, // then copy the code to the allocated memory. // Masking with 0xffe0 will suffice, since contract size is less than 16 bits. data := mload(0x40) mstore(0x40, add(data, and(add(size, 0x3f), 0xffe0))) mstore(data, size) mstore(add(add(data, 0x20), size), 0) // Zeroize the last slot. extcodecopy(pointer, add(data, 0x20), DATA_OFFSET, size) } } /// @dev Returns the `data` from the bytecode of the storage contract at `pointer`, /// from the byte at `start`, to the end of the data stored. function read(address pointer, uint256 start) internal view returns (bytes memory data) { /// @solidity memory-safe-assembly assembly { let pointerCodesize := extcodesize(pointer) if iszero(pointerCodesize) { // Store the function selector of `InvalidPointer()`. mstore(0x00, 0x11052bb4) // Revert with (offset, size). revert(0x1c, 0x04) } // If `!(pointer.code.size > start)`, reverts. // This also handles the case where `start + DATA_OFFSET` overflows. if iszero(gt(pointerCodesize, start)) { // Store the function selector of `ReadOutOfBounds()`. mstore(0x00, 0x84eb0dd1) // Revert with (offset, size). revert(0x1c, 0x04) } let size := sub(pointerCodesize, add(start, DATA_OFFSET)) // Get the pointer to the free memory and allocate // enough 32-byte words for the data and the length of the data, // then copy the code to the allocated memory. // Masking with 0xffe0 will suffice, since contract size is less than 16 bits. data := mload(0x40) mstore(0x40, add(data, and(add(size, 0x3f), 0xffe0))) mstore(data, size) mstore(add(add(data, 0x20), size), 0) // Zeroize the last slot. extcodecopy(pointer, add(data, 0x20), add(start, DATA_OFFSET), size) } } /// @dev Returns the `data` from the bytecode of the storage contract at `pointer`, /// from the byte at `start`, to the byte at `end` (exclusive) of the data stored. function read(address pointer, uint256 start, uint256 end) internal view returns (bytes memory data) { /// @solidity memory-safe-assembly assembly { let pointerCodesize := extcodesize(pointer) if iszero(pointerCodesize) { // Store the function selector of `InvalidPointer()`. mstore(0x00, 0x11052bb4) // Revert with (offset, size). revert(0x1c, 0x04) } // If `!(pointer.code.size > end) || (start > end)`, revert. // This also handles the cases where // `end + DATA_OFFSET` or `start + DATA_OFFSET` overflows. if iszero( and( gt(pointerCodesize, end), // Within bounds. iszero(gt(start, end)) // Valid range. ) ) { // Store the function selector of `ReadOutOfBounds()`. mstore(0x00, 0x84eb0dd1) // Revert with (offset, size). revert(0x1c, 0x04) } let size := sub(end, start) // Get the pointer to the free memory and allocate // enough 32-byte words for the data and the length of the data, // then copy the code to the allocated memory. // Masking with 0xffe0 will suffice, since contract size is less than 16 bits. data := mload(0x40) mstore(0x40, add(data, and(add(size, 0x3f), 0xffe0))) mstore(data, size) mstore(add(add(data, 0x20), size), 0) // Zeroize the last slot. extcodecopy(pointer, add(data, 0x20), add(start, DATA_OFFSET), size) } } }
{ "optimizer": { "enabled": true, "runs": 1000 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"inflate","type":"address"}],"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":"NotCompatibleWithSpotMints","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"SequentialMintExceedsLimit","type":"error"},{"inputs":[],"name":"SequentialUpToTooSmall","type":"error"},{"inputs":[],"name":"SpotMintTokenIdTooSmall","type":"error"},{"inputs":[],"name":"TokenAlreadyExists","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":[{"internalType":"bytes32[]","name":"hashesToMint","type":"bytes32[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"count","type":"uint256"}],"name":"adminMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"allowlistSaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"bayerGrids","outputs":[{"internalType":"uint256","name":"length","type":"uint256"},{"internalType":"string","name":"name","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"hash","type":"bytes32"}],"name":"generate","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"uint256","name":"tokenId","type":"uint256"}],"name":"getHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"hash","type":"bytes32"}],"name":"getProperties","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"images","outputs":[{"internalType":"uint256","name":"length","type":"uint256"},{"internalType":"string","name":"name","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"uint256","name":"count","type":"uint256"}],"name":"mintAllowlist","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"palettes","outputs":[{"internalType":"string","name":"name","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"remainingAdminSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"remainingSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bytes1[3][]","name":"palette","type":"bytes1[3][]"},{"internalType":"uint8","name":"alg","type":"uint8"},{"internalType":"bool","name":"normalize","type":"bool"},{"internalType":"uint256","name":"bayerIndex","type":"uint256"},{"internalType":"uint256","name":"distAlg","type":"uint256"},{"internalType":"uint256","name":"colorCorrect","type":"uint256"},{"internalType":"bytes32","name":"random","type":"bytes32"}],"name":"render","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"root","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":[],"name":"saleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"start","type":"uint256"}],"name":"setAllowlistStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256[16]","name":"grid","type":"uint256[16]"},{"internalType":"uint256","name":"length","type":"uint256"},{"internalType":"string","name":"name","type":"string"}],"internalType":"struct MachineInTheGhost.BayerGrid[]","name":"grids","type":"tuple[]"}],"name":"setBayerGrids","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address[]","name":"pointers","type":"address[]"},{"internalType":"uint256","name":"length","type":"uint256"},{"internalType":"string","name":"name","type":"string"}],"internalType":"struct MachineInTheGhost.Image[]","name":"_images","type":"tuple[]"}],"name":"setImages","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"bytes1[3][]","name":"colors","type":"bytes1[3][]"}],"internalType":"struct MachineInTheGhost.Palette[]","name":"_palettes","type":"tuple[]"}],"name":"setPalettes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"physical","type":"bytes32"},{"internalType":"uint256","name":"i","type":"uint256"}],"name":"setPhysical","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_physicals","type":"bytes32[]"}],"name":"setPhysicals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"start","type":"uint256"}],"name":"setPublicStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_root","type":"bytes32"}],"name":"setRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startAllowlistSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startPublicSale","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":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"result","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":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405261023c805460ff1916905561020061023d55601061023e55602061023f5567016345785d8a0000610240556000610241553480156200004257600080fd5b5060405162006170380380620061708339810160408190526200006591620002b5565b336040518060400160405280601481526020017f6d616368696e6520696e207468652067686f7374000000000000000000000000815250604051806040016040528060048152602001634d49544760e01b8152508160029081620000ca91906200038b565b506003620000d982826200038b565b50600160005550506001600160a01b0381166200011057604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200011b816200017f565b50600a80546001600160a01b0319166001600160a01b0383161790557facd18baca68279e4a841c887392d24ed6a03564c07be64ac5b5bdd556aae94756102445562000169336010620001d1565b504261023b5562000457565b8060005260046000fd5b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000546001600160a01b038316620001f457620001f4622e076360e81b62000175565b816000036200020f576200020f63b562e8dd60e01b62000175565b6113888211156200022c576200022c633db1f9af60e01b62000175565b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600482528083206001871460e11b4260a01b17851790555160001985870101815284917fdeaa91b6123d068f5821d0fb0678463d1a8a6079fe8af5de3ce5e896dcf9133d910160405180910390a40160005550565b505050565b600060208284031215620002c857600080fd5b81516001600160a01b0381168114620002e057600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200031257607f821691505b6020821081036200033357634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002b057600081815260208120601f850160051c81016020861015620003625750805b601f850160051c820191505b8181101562000383578281556001016200036e565b505050505050565b81516001600160401b03811115620003a757620003a7620002e7565b620003bf81620003b88454620002fd565b8462000339565b602080601f831160018114620003f75760008415620003de5750858301515b600019600386901b1c1916600185901b17855562000383565b600085815260208120601f198616915b82811015620004285788860151825594840194600190910190840162000407565b5085821015620004475787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b615d0980620004676000396000f3fe6080604052600436106103135760003560e01c806370a082311161019a578063c87b56dd116100e1578063e985e9c51161008a578063f2fde38b11610064578063f2fde38b1461086e578063f3dc5a891461088e578063f6d82599146108a357600080fd5b8063e985e9c5146107ee578063ebf0c71714610837578063ef59d8a41461084e57600080fd5b8063db68d5c4116100bb578063db68d5c414610799578063db8cc8fa146107ae578063dcf7eefe146107ce57600080fd5b8063c87b56dd14610744578063da0239a614610764578063dab5f3401461077957600080fd5b806391b7f5ed11610143578063aab5c4bf1161011d578063aab5c4bf146106fc578063b88d4fde1461071c578063becadb651461072f57600080fd5b806391b7f5ed146106a757806395d89b41146106c7578063a22cb465146106dc57600080fd5b80637f5a590d116101745780637f5a590d1461063b578063848564821461065b5780638da5cb5b1461068957600080fd5b806370a08231146105f1578063715018a614610611578063753868e31461062657600080fd5b806323b872dd1161025e5780635fd1bbc4116102075780636819dca8116101e15780636819dca81461059c57806368428a1b146105bc5780636b2fafa9146105d157600080fd5b80635fd1bbc4146105455780636352211e1461055c57806363dbe57c1461057c57600080fd5b80635308f668116102385780635308f668146104ee578063594f21301461050e57806359d7bc4d1461052e57600080fd5b806323b872dd146104b35780633ccfd60b146104c657806342842e0e146104db57600080fd5b80631249c58b116102c057806318160ddd1161029a57806318160ddd146104395780631857f757146104655780631e7269c51461048557600080fd5b80631249c58b146103f157806312a6f5f4146103f957806317ca7bd81461041957600080fd5b8063081812fc116102f1578063081812fc14610391578063095ea7b3146103c95780630c1c972a146103dc57600080fd5b806301ffc9a71461031857806303b674d31461034d57806306fdde031461036f575b600080fd5b34801561032457600080fd5b50610338610333366004614567565b6108b6565b60405190151581526020015b60405180910390f35b34801561035957600080fd5b5061036d610368366004614584565b610953565b005b34801561037b57600080fd5b50610384610961565b60405161034491906145ed565b34801561039d57600080fd5b506103b16103ac366004614584565b6109f3565b6040516001600160a01b039091168152602001610344565b61036d6103d7366004614617565b610a47565b3480156103e857600080fd5b5061036d610a57565b61036d610a6c565b34801561040557600080fd5b50610384610414366004614584565b610bce565b34801561042557600080fd5b5061036d610434366004614641565b610c8d565b34801561044557600080fd5b50610457600154600054036000190190565b604051908152602001610344565b34801561047157600080fd5b5061036d6104803660046146af565b610d14565b34801561049157600080fd5b506104576104a03660046146f1565b6102456020526000908152604090205481565b61036d6104c136600461470c565b610deb565b3480156104d257600080fd5b5061036d610fd5565b61036d6104e936600461470c565b611094565b3480156104fa57600080fd5b5061036d6105093660046146af565b6110af565b34801561051a57600080fd5b5061036d61052936600461485a565b611180565b34801561053a57600080fd5b506104576102425481565b34801561055157600080fd5b506104576102435481565b34801561056857600080fd5b506103b1610577366004614584565b61127b565b34801561058857600080fd5b5061036d6105973660046149c7565b611286565b3480156105a857600080fd5b506103846105b7366004614a5a565b611353565b3480156105c857600080fd5b506103386114cf565b3480156105dd57600080fd5b506104576105ec366004614584565b6114ec565b3480156105fd57600080fd5b5061045761060c3660046146f1565b611584565b34801561061d57600080fd5b5061036d6115e3565b34801561063257600080fd5b5061036d6115f7565b34801561064757600080fd5b50610384610656366004614584565b61160f565b34801561066757600080fd5b5061067b610676366004614584565b611825565b604051610344929190614bae565b34801561069557600080fd5b506009546001600160a01b03166103b1565b3480156106b357600080fd5b5061036d6106c2366004614584565b6118d7565b3480156106d357600080fd5b506103846118e5565b3480156106e857600080fd5b5061036d6106f7366004614bc7565b6118f4565b34801561070857600080fd5b5061067b610717366004614584565b611960565b61036d61072a366004614bfa565b611990565b34801561073b57600080fd5b5061036d6119d1565b34801561075057600080fd5b5061038461075f366004614584565b6119e6565b34801561077057600080fd5b50610457611a41565b34801561078557600080fd5b5061036d610794366004614584565b611a59565b3480156107a557600080fd5b50610338611a67565b3480156107ba57600080fd5b5061036d6107c9366004614584565b611a86565b3480156107da57600080fd5b506103846107e9366004614584565b611a94565b3480156107fa57600080fd5b50610338610809366004614c62565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b34801561084357600080fd5b506104576102445481565b34801561085a57600080fd5b5061036d610869366004614c8c565b611b3b565b34801561087a57600080fd5b5061036d6108893660046146f1565b611bf5565b34801561089a57600080fd5b50610457611c49565b61036d6108b1366004614d12565b611c66565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316148061091957507f80ac58cd000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b8061094d57507f5b5e139f000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b61095b611ea9565b61024255565b60606002805461097090614d5e565b80601f016020809104026020016040519081016040528092919081815260200182805461099c90614d5e565b80156109e95780601f106109be576101008083540402835291602001916109e9565b820191906000526020600020905b8154815290600101906020018083116109cc57829003601f168201915b5050505050905090565b60006109fe82611eef565b610a2b57610a2b7fcf4700e400000000000000000000000000000000000000000000000000000000611f3d565b506000908152600660205260409020546001600160a01b031690565b610a5382826001611f47565b5050565b610a5f611ea9565b4261024381905561024255565b60018061024054610a7d9190614da8565b3414610ad05760405162461bcd60e51b815260206004820152601560248201527f796f7520676f7474612070617920746f20706c6179000000000000000000000060448201526064015b60405180910390fd5b610ad86114cf565b610b245760405162461bcd60e51b815260206004820152601060248201527f73616c65206973206e6f74206c697665000000000000000000000000000000006044820152606401610ac7565b610b2c61202d565b610b785760405162461bcd60e51b815260206004820152601660248201527f73616c6520697320616c6c6f776c697374206f6e6c79000000000000000000006044820152606401610ac7565b600180610b83611a41565b1015610bbd5760405162461bcd60e51b8152602060048201526009602482015268736f6c64206f75742160b81b6044820152606401610ac7565b610a53610bc8612047565b336120a2565b6060600082811a603f1690506000610be5846120cd565b90506000610bf283612198565b9050610c8481836000610c0a600860028b901a614deb565b60ff1611610c19576000610c1c565b60015b610c2c60028a811a60041b614deb565b60ff1660011460108a600360208110610c4757610c47614dbf565b610c569291600f911a16614e0d565b610c6660038c811a60041c614deb565b60ff16610c7b600a60048e901a600f16614deb565b60ff168c611353565b95945050505050565b610c95611ea9565b61023c5460ff1615610cf95760405162461bcd60e51b815260206004820152602760248201527f436f6e7472616374206973206c6f636b656420616e642063616e6e6f742062656044820152660819591a5d195960ca1b6064820152608401610ac7565b8161022b8260108110610d0e57610d0e614dbf565b01555050565b610d1c611ea9565b61023c5460ff1615610d805760405162461bcd60e51b815260206004820152602760248201527f436f6e7472616374206973206c6f636b656420616e642063616e6e6f742062656044820152660819591a5d195960ca1b6064820152608401610ac7565b60005b81811015610de657828282818110610d9d57610d9d614dbf565b9050602002810190610daf9190614e21565b61010b8260108110610dc357610dc3614dbf565b60120201610dd18282614ede565b50819050610dde81614fde565b915050610d83565b505050565b6000610df6826123d1565b6001600160a01b039485169490915081168414610e3657610e367fa114810000000000000000000000000000000000000000000000000000000000611f3d565b60008281526006602052604090208054338082146001600160a01b03881690911417610eb0576001600160a01b038616600090815260076020908152604080832033845290915290205460ff16610eb057610eb07f59c896be00000000000000000000000000000000000000000000000000000000611f3d565b8015610ebb57600082555b6001600160a01b03808716600090815260056020526040808220805460001901905591871681522080546001019055610f1485610ef9888287612472565b600160e11b174260a01b176001600160a01b03919091161790565b600085815260046020526040812091909155600160e11b84169003610f6957600184016000818152600460205260408120549003610f67576000548114610f675760008181526004602052604090208490555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a480600003610fcc57610fcc7fea553b3400000000000000000000000000000000000000000000000000000000611f3d565b50505050505050565b610fdd611ea9565b6000610ff16009546001600160a01b031690565b6001600160a01b03164760405160006040518083038185875af1925050503d806000811461103b576040519150601f19603f3d011682016040523d82523d6000602084013e611040565b606091505b50509050806110915760405162461bcd60e51b815260206004820152601060248201527f5769746864726177206661696c65642e000000000000000000000000000000006044820152606401610ac7565b50565b610de683838360405180602001604052806000815250611990565b6110b7611ea9565b61023c5460ff161561111b5760405162461bcd60e51b815260206004820152602760248201527f436f6e7472616374206973206c6f636b656420616e642063616e6e6f742062656044820152660819591a5d195960ca1b6064820152608401610ac7565b60005b81811015610de65782828281811061113857611138614dbf565b905060200281019061114a9190614ff7565b60cb826020811061115d5761115d614dbf565b6002020161116b8282615130565b5081905061117881614fde565b91505061111e565b611188611ea9565b61023c5460ff16156111ec5760405162461bcd60e51b815260206004820152602760248201527f436f6e7472616374206973206c6f636b656420616e642063616e6e6f742062656044820152660819591a5d195960ca1b6064820152608401610ac7565b60005b8151811015610a535781818151811061120a5761120a614dbf565b6020026020010151600b826040811061122557611225614dbf565b600302016000820151816000019080519060200190611245929190614403565b506020820151600182015560408201516002820190611264908261520d565b50905050808061127390614fde565b9150506111ef565b600061094d826123d1565b61128e611ea9565b8080611298611c49565b10156112e65760405162461bcd60e51b815260206004820152600a60248201527f6d696e746564206f7574000000000000000000000000000000000000000000006044820152606401610ac7565b60005b8281101561134b5761024154818611156113195786868381811061130f5761130f614dbf565b9050602002013590505b61024154810361132e5761132b612047565b90505b61133881866120a2565b508061134381614fde565b9150506112e9565b505050505050565b6060600061139f8a60138151811061136d5761136d614dbf565b602001015160f81c60f81b8b60128151811061138b5761138b614dbf565b01602001516001600160f81b03191661247c565b905060006113d78b6017815181106113b9576113b9614dbf565b602001015160f81c60f81b8c60168151811061138b5761138b614dbf565b905060206113e6836004614da8565b6113f190601f6152cd565b6113fb91906152e0565b9150611408826008614da8565b915060006114158c612494565b90506009861015611478578960ff1660000361143957611436600489614e0d565b97505b881561145d576114588161144e838e516125fe565b8e86868d8d612936565b61146c565b61146c818c8e86868d8d612936565b6114768c8c612b93565b505b60068611156114ac576009861015611496576114938c612494565b90505b6114a08186612d1e565b6114aa8c82612f9c565b505b6114bf6114b88d6130dd565b84846130eb565b9c9b505050505050505050505050565b60006114d961314d565b806114e757506114e761202d565b905090565b60006010821161151c5761022b6115046001846152f4565b6010811061151457611514614dbf565b015492915050565b61024154600083815261024660205260409020541461154957506000908152610246602052604090205490565b61023b54604051611567918491602001918252602082015260400190565b604051602081830303815290604052805190602001209050919050565b60006001600160a01b0382166115bd576115bd7f8f4eb60400000000000000000000000000000000000000000000000000000000611f3d565b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b6115eb611ea9565b6115f56000613167565b565b6115ff611ea9565b61023c805460ff19166001179055565b60408051808201909152600f81527f2261747472696275746573223a205b000000000000000000000000000000000060208201526060906000600b84821a603f166040811061166057611660614dbf565b60030201600201805461167290614d5e565b80601f016020809104026020016040519081016040528092919081815260200182805461169e90614d5e565b80156116eb5780601f106116c0576101008083540402835291602001916116eb565b820191906000526020600020905b8154815290600101906020018083116116ce57829003601f168201915b5050505050905060006116fd856131c6565b9050600061170a866132ca565b90506000611717876133aa565b9050600061172d600a60048a901a600f16614deb565b60ff169050600681111561175e578560405160200161174c9190615323565b60405160208183030381529060405295505b600981101561178c57858460405160200161177a92919061538a565b60405160208183030381529060405295505b858560405160200161179f9291906153f2565b604051602081830303815290604052955085826040516020016117c392919061545b565b604051602081830303815290604052955085836040516020016117e79291906154ea565b604051602081830303815290604052955085604051602001611809919061557a565b6040516020818303038152906040529650505050505050919050565b600b816040811061183557600080fd5b6003020160009150905080600101549080600201805461185490614d5e565b80601f016020809104026020016040519081016040528092919081815260200182805461188090614d5e565b80156118cd5780601f106118a2576101008083540402835291602001916118cd565b820191906000526020600020905b8154815290600101906020018083116118b057829003601f168201915b5050505050905082565b6118df611ea9565b61024055565b60606003805461097090614d5e565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61010b816010811061197157600080fd5b6012020160009150905080601001549080601101805461185490614d5e565b61199b848484610deb565b6001600160a01b0383163b156119cb576119b784848484613461565b6119cb576119cb6368d2bf6b60e11b611f3d565b50505050565b6119d9611ea9565b6000610243554261024255565b606060006119f3836114ec565b90506119fe83613543565b611a0f611a0a83610bce565b6130dd565b611a188361160f565b604051602001611a2a939291906155bb565b604051602081830303815290604052915050919050565b600061023f54611a4f611c49565b6114e791906152f4565b611a61611ea9565b61024455565b6000611a7161314d565b80156114e75750611a8061202d565b15905090565b611a8e611ea9565b61024355565b60cb8160208110611aa457600080fd5b6002020180549091508190611ab890614d5e565b80601f0160208091040260200160405190810160405280929190818152602001828054611ae490614d5e565b8015611b315780601f10611b0657610100808354040283529160200191611b31565b820191906000526020600020905b815481529060010190602001808311611b1457829003601f168201915b5050505050905081565b611b43611ea9565b61023c5460ff1615611ba75760405162461bcd60e51b815260206004820152602760248201527f436f6e7472616374206973206c6f636b656420616e642063616e6e6f742062656044820152660819591a5d195960ca1b6064820152608401610ac7565b60005b8151811015610a5357818181518110611bc557611bc5614dbf565b602002602001015161022b8260108110611be157611be1614dbf565b015580611bed81614fde565b915050611baa565b611bfd611ea9565b6001600160a01b038116611c40576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610ac7565b61109181613167565b6000805461023d54611c5b91906152f4565b6114e79060016152cd565b808061024054611c769190614da8565b3414611cc45760405162461bcd60e51b815260206004820152601560248201527f796f7520676f7474612070617920746f20706c617900000000000000000000006044820152606401610ac7565b611ccc6114cf565b611d185760405162461bcd60e51b815260206004820152601060248201527f73616c65206973206e6f74206c697665000000000000000000000000000000006044820152606401610ac7565b8180611d22611a41565b1015611d5c5760405162461bcd60e51b8152602060048201526009602482015268736f6c64206f75742160b81b6044820152606401610ac7565b610244546040516bffffffffffffffffffffffff193360601b166020820152611da2918791879190603401604051602081830303815290604052805190602001206135e4565b611dee5760405162461bcd60e51b815260206004820152601060248201527f6e6f74206f6e20616c6c6f776c697374000000000000000000000000000000006044820152606401610ac7565b3360009081526102456020526040902054600390611e0d9085906152cd565b1115611e5b5760405162461bcd60e51b815260206004820152600e60248201527f616c7265616479206d696e7465640000000000000000000000000000000000006044820152606401610ac7565b336000908152610245602052604081208054859290611e7b9084906152cd565b90915550600090505b8381101561134b57611e97610bc8612047565b80611ea181614fde565b915050611e84565b6009546001600160a01b031633146115f5576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610ac7565b600081600111611f3857600054821015611f385760005b5060008281526004602052604081205490819003611f2e57611f27836156d8565b9250611f06565b600160e01b161590505b919050565b8060005260046000fd5b6000611f528361127b565b9050818015611f6a5750336001600160a01b03821614155b15611fc3576001600160a01b038116600090815260076020908152604080832033845290915290205460ff16611fc357611fc37fcfb3b94200000000000000000000000000000000000000000000000000000000611f3d565b600083815260066020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0388811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b60006102435442101580156114e757505061024354151590565b600061023b5461205660005490565b60408051602081019390935282015233606090811b6bffffffffffffffffffffffff19169082015242607482015260940160405160208183030381529060405280519060200120905090565b8161024660006120b160005490565b8152602081019190915260400160002055610a538160016135fc565b606060cb6120e06020600185901a614e0d565b602081106120f0576120f0614dbf565b60020201600101805480602002602001604051908101604052809291908181526020016000905b8282101561218d576000848152602081206040805160608101918290529291850191600391908390855b825461010083900a900460f81b6001600160f81b031916815260206001928301818104948501949093039092029101808411612141579050505050505081526020019060010190612117565b505050509050919050565b60606000600b83604081106121af576121af614dbf565b600302016040518060600160405290816000820180548060200260200160405190810160405280929190818152602001828054801561221757602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116121f9575b505050505081526020016001820154815260200160028201805461223a90614d5e565b80601f016020809104026020016040519081016040528092919081815260200182805461226690614d5e565b80156122b35780601f10612288576101008083540402835291602001916122b3565b820191906000526020600020905b81548152906001019060200180831161229657829003601f168201915b505050505081525050905060006122e782600001516000815181106122da576122da614dbf565b602002602001015161370f565b905060018260000151511115612335578061231283600001516001815181106122da576122da614dbf565b6040516020016123239291906156ef565b60405160208183030381529060405290505b600a5460208301516040517f265b7f7e0000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163265b7f7e916123849185919060040161571e565b600060405180830381865afa1580156123a1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526123c99190810190615740565b949350505050565b60008160011161246257506000818152600460205260409020548060000361244f57600054821061240c5761240c636f96cda160e11b611f3d565b5b5060001901600081815260046020526040902054801561240d57600160e01b811660000361243a57919050565b61244a636f96cda160e11b611f3d565b61240d565b600160e01b811660000361246257919050565b611f38636f96cda160e11b611f3d565b60005b9392505050565b600061247560f883901c61ff0060f086901c166152cd565b61249c614475565b6124a4614475565b60005b60108110156125f757836124bc826004614da8565b6124c79060366152cd565b815181106124d7576124d7614dbf565b01602001516001600160f81b0319168282601081106124f8576124f8614dbf565b60200201516001600160f81b0319919091166040909101528361251c826004614da8565b6125279060366152cd565b6125329060016152cd565b8151811061254257612542614dbf565b01602001516001600160f81b03191682826010811061256357612563614dbf565b602002015160016001600160f81b031990921660209290920201528361258a826004614da8565b6125959060366152cd565b6125a09060026152cd565b815181106125b0576125b0614dbf565b01602001516001600160f81b0319168282601081106125d1576125d1614dbf565b60200201516001600160f81b0319919091169052806125ef81614fde565b9150506124a7565b5092915050565b60606126086144a3565b60008367ffffffffffffffff81111561262357612623614748565b60405190808252806020026020018201604052801561265c57816020015b6126496144c2565b8152602001906001900390816126415790505b50905060005b601081101561269657600083826010811061267f5761267f614dbf565b60200201528061268e81614fde565b915050612662565b5060005b601081101561278c5760006126c48783601081106126ba576126ba614dbf565b6020020151613759565b9050808483601081106126d9576126d9614dbf565b602002015260005b8281101561277757818582601081106126fc576126fc614dbf565b60200201511061276557600f8110156127485784816010811061272157612721614dbf565b6020020151856127328360016152cd565b6010811061274257612742614dbf565b60200201525b8185826010811061275b5761275b614dbf565b6020020152612777565b8061276f81614fde565b9150506126e1565b5050808061278490614fde565b91505061269a565b5060005b8481101561292d5760006127a56001876152f4565b6127b083600f614da8565b6127ba91906152e0565b905060008482601081106127d0576127d0614dbf565b60200201519050821580156127e55750600081115b156127fc57806127f4816156d8565b915050612828565b6128076001886152f4565b83148015612815575060ff81105b15612828578061282481614fde565b9150505b6040805160608101909152608081018290528060a0810160405160208183030381529060405260008151811061286057612860614dbf565b602091018101516001600160f81b0319168252604080518083018690529290910191016040516020818303038152906040526000815181106128a4576128a4614dbf565b602091018101516001600160f81b0319168252604080518083018690529290910191016040516020818303038152906040526000815181106128e8576128e8614dbf565b01602001516001600160f81b0319169052845185908590811061290d5761290d614dbf565b60200260200101819052505050808061292590614fde565b915050612790565b50949350505050565b600061010b836010811061294c5761294c614dbf565b601202016010015490506000612965828a8a878761377c565b905060008260041461297857600461297b565b60025b60ff16905060005b86811015612b865760005b61299960028a6152e0565b811015612b735760008160026129af8c86614da8565b6129b991906152e0565b6129c49060766152cd565b6129ce91906152cd565b9050600060048c83815181106129e6576129e6614dbf565b602001015160f81c60f81b60f81c60ff16901c905060008c8381518110612a0f57612a0f614dbf565b60209101015160f81c600f1690506000612a2a6002886152e0565b612a349086614e0d565b612a3f6002896152e0565b612a499190614da8565b612a538888614e0d565b612a5d9089614da8565b612a6791906152cd565b905087612a758260016152cd565b60108110612a8557612a85614dbf565b60200201518260ff1660108110612a9e57612a9e614dbf565b60200201516004898360108110612ab757612ab7614dbf565b60200201518560ff1660108110612ad057612ad0614dbf565b602002015160ff16901b612ae491906157ae565b604051602001612b07919060f89190911b6001600160f81b031916815260010190565b604051602081830303815290604052600081518110612b2857612b28614dbf565b602001015160f81c60f81b8e8581518110612b4557612b45614dbf565b60200101906001600160f81b031916908160001a905350505050508080612b6b90614fde565b91505061298e565b5080612b7e81614fde565b915050612983565b5050505050505050505050565b606060005b8251811015612d1657828181518110612bb357612bb3614dbf565b6020026020010151600260038110612bcd57612bcd614dbf565b602002015184612bde836004614da8565b612be99060366152cd565b81518110612bf957612bf9614dbf565b60200101906001600160f81b031916908160001a905350828181518110612c2257612c22614dbf565b6020026020010151600160038110612c3c57612c3c614dbf565b602002015184612c4d836004614da8565b612c589060366152cd565b612c639060016152cd565b81518110612c7357612c73614dbf565b60200101906001600160f81b031916908160001a905350828181518110612c9c57612c9c614dbf565b6020026020010151600060038110612cb657612cb6614dbf565b602002015184612cc7836004614da8565b612cd29060366152cd565b612cdd9060026152cd565b81518110612ced57612ced614dbf565b60200101906001600160f81b031916908160001a90535080612d0e81614fde565b915050612b98565b509192915050565b612d266144e0565b60005b6010811015612d7a57612d51848260108110612d4757612d47614dbf565b602002015161390d565b828260108110612d6357612d63614dbf565b602002015280612d7281614fde565b915050612d29565b5060006040612d8e6080600586901a614deb565b60ff16612d9b91906157c7565b9050600080612daf6002600787901a614deb565b60ff16119050600081612ddf576040612dcd6080600688901a614deb565b60ff16612dda91906157c7565b612dea565b612dea6002846157e7565b90506000612dfd6010600888901a614deb565b60ff1690506000612e136010600989901a614deb565b60ff1690506000612e296002600a8a901a615815565b60ff1690506000612e3f6004600b8b901a614e0d565b1115612e49575060005b600c88901a60005b6010811015612f47576000898260108110612e6e57612e6e614dbf565b602002015151905060008a8360108110612e8a57612e8a614dbf565b602002015160016020020151905060008b8460108110612eac57612eac614dbf565b6020020151604001519050612ec1828c613a99565b9150612ecd818a613a99565b9050612ede888284600060ff613ad4565b9150612eef878284602360c8613ad4565b9250612efc868685613b75565b92506040518060600160405280848152602001838152602001828152508c8560108110612f2b57612f2b614dbf565b602002015250829150612f3f905081614fde565b915050612e51565b5060005b6010811015612b8657612f73898260108110612f6957612f69614dbf565b6020020151613c8a565b8b8260108110612f8557612f85614dbf565b602002015280612f9481614fde565b915050612f4b565b606060005b6010811015612d1657828160108110612fbc57612fbc614dbf565b60200201516040015184612fd1836004614da8565b612fdc9060366152cd565b81518110612fec57612fec614dbf565b60200101906001600160f81b031916908160001a90535082816010811061301557613015614dbf565b6020020151600160200201518461302d836004614da8565b6130389060366152cd565b6130439060016152cd565b8151811061305357613053614dbf565b60200101906001600160f81b031916908160001a90535082816010811061307c5761307c614dbf565b6020020151518461308e836004614da8565b6130999060366152cd565b6130a49060026152cd565b815181106130b4576130b4614dbf565b60200101906001600160f81b031916908160001a905350806130d581614fde565b915050612fa1565b606061094d82600080613cee565b606060006131026130fd85600a614da8565b613543565b905060006131146130fd85600a614da8565b90508181838385858b6040516020016131339796959493929190615837565b604051602081830303815290604052925050509392505050565b60006102425442101580156114e757505061024254151590565b600980546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606000806131da6008600286901a614deb565b60ff16116131e95760006131ec565b60015b60ff16905060006132056010600386901a600f16614e0d565b90508160000361321d5761321a600482614e0d565b90505b61010b816010811061323157613231614dbf565b60120201601101805461324390614d5e565b80601f016020809104026020016040519081016040528092919081815260200182805461326f90614d5e565b80156132bc5780601f10613291576101008083540402835291602001916132bc565b820191906000526020600020905b81548152906001019060200180831161329f57829003601f168201915b505050505092505050919050565b606060006132de600384811a60041c614deb565b60ff1690508060000361332657505060408051808201909152600381527f52474200000000000000000000000000000000000000000000000000000000006020820152919050565b8060010361336957505060408051808201909152600481527f4c756d61000000000000000000000000000000000000000000000000000000006020820152919050565b505060408051808201909152600981527f4c696768746e65737300000000000000000000000000000000000000000000006020820152919050565b50919050565b606060cb6133bd6020600185901a614e0d565b602081106133cd576133cd614dbf565b6002020180546133dc90614d5e565b80601f016020809104026020016040519081016040528092919081815260200182805461340890614d5e565b80156134555780601f1061342a57610100808354040283529160200191613455565b820191906000526020600020905b81548152906001019060200180831161343857829003601f168201915b50505050509050919050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290613496903390899088908890600401615bd3565b6020604051808303816000875af19250505080156134d1575060408051601f3d908101601f191682019092526134ce91810190615c0f565b60015b613526573d8080156134ff576040519150601f19603f3d011682016040523d82523d6000602084013e613504565b606091505b50805160000361351e5761351e6368d2bf6b60e11b611f3d565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6060600061355083613dfe565b600101905060008167ffffffffffffffff81111561357057613570614748565b6040519080825280601f01601f19166020018201604052801561359a576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846135a4575b509392505050565b6000826135f2868685613ee0565b1495945050505050565b6000805490829003613631576136317fb562e8dd00000000000000000000000000000000000000000000000000000000611f3d565b61365f836136426000866000612472565b6001851460e11b174260a01b176001600160a01b03919091161790565b6000828152600460209081526040808320939093556001600160a01b038616808352600590915291812080546801000000000000000186020190558190036136ca576136ca7f2e07630000000000000000000000000000000000000000000000000000000000611f3d565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a48181600101915081036136cf575060005550505050565b6060813b80613726576311052bb46000526004601cfd5b600181039050604051915061ffe0603f820116820160405280825260008160208401015280600160208401853c50919050565b80516020820151604083015160009261094d9260f891821c9290821c911c613f23565b61378461450e565b61378c61450e565b60005b878110156139025760005b60108110156138ef576137ab6144c2565b6137d48983601081106137c0576137c0614dbf565b602002015160005b60200201518489613f6b565b6001600160f81b03191681526138018983601081106137f5576137f5614dbf565b602002015160016137c8565b6001600160f81b031916602082015261383189836010811061382557613825614dbf565b602002015160026137c8565b6001600160f81b0319166040820152600062030001815b8a518160ff1610156138a157600061387d858d8460ff168151811061386f5761386f614dbf565b60200260200101518c61408a565b90508281101561388e578193508092505b508061389981615c2c565b915050613848565b50818686601081106138b5576138b5614dbf565b602002015185601081106138cb576138cb614dbf565b60ff9092166020929092020152508291506138e7905081614fde565b91505061379a565b50806138fa81614fde565b91505061378f565b509695505050505050565b6139156144c2565b8151602080840151604080860151815160608101835260f895861c80825293861c948101859052941c9084018190529092600090613952906140c1565b90506000613979604051806060016040528087815260200186815260200185815250614119565b61398390836157c7565b9050600081600003613996575080613a29565b8583036139c557816139a885876157c7565b6139b490610100615c4b565b6139be91906157e7565b9050613a29565b8483036139f957816139d787866157c7565b6139e390610100615c4b565b6139ed91906157e7565b6139be90610200615c7b565b81613a0486886157c7565b613a1090610100615c4b565b613a1a91906157e7565b613a2690610400615c7b565b90505b6040518060600160405280600660008412613a445783613a50565b613a5084610600615c7b565b613a5a91906157e7565b815260200184600003613a6d5784613a84565b84613a7a85610100615c4b565b613a8491906157e7565b81526020019390935250909695505050505050565b60008115613acd57613aab8284615c7b565b92506000831215613abf5760009250613acd565b60ff831315613acd5760ff92505b5090919050565b600085600003613ae5575083610c84565b60008686610100613af68280615c4b565b613b0091906157e7565b613b0a91906157c7565b613b15906040615c7b565b613b20906008615c4b565b613b2a91906157e7565b90506080861315613b5257613b3f81866157c7565b945083851215613b4d578394505b613b6a565b613b5c8186615c7b565b945082851315613b6a578294505b509295945050505050565b600083600003613b86575080612475565b60008083851315613be2576000613b9d85876157c7565b9050600086613bad8760ff6157c7565b613bb79190615c7b565b905080821315613bd457925082613bcd81615ca3565b9250613bdb565b8193508092505b5050613c30565b6000613bee86866157c7565b9050600085613bfe8860ff6157c7565b613c089190615c7b565b905080821215613c265781935081613c1f90615ca3565b9250613c2d565b8093508092505b50505b85821015613c4057849350613c80565b613c4a8185615c7b565b93506000841215613c6857613c6184610100615c7b565b9350613c80565b60ff841315613c8057613c7d610100856157c7565b93505b5091949350505050565b613c926144c2565b6040518060600160405280613ca8600585614179565b6001600160f81b0319168152602001613cc2600385614179565b6001600160f81b0319168152602001613cdc600185614179565b6001600160f81b031916905292915050565b6060835180156135dc576003600282010460021b60405192507f4142434445464748494a4b4c4d4e4f505152535455565758595a616263646566601f526106708515027f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392d5f18603f52602083018181018388602001018051600082525b60038a0199508951603f8160121c1651600053603f81600c1c1651600153603f8160061c1651600253603f811651600353506000518452600484019350828410613d6a5790526020016040527f3d3d00000000000000000000000000000000000000000000000000000000000060038406600204808303919091526000861515909102918290035290038252509392505050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310613e47577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310613e73576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613e9157662386f26fc10000830492506010015b6305f5e1008310613ea9576305f5e100830492506008015b6127108310613ebd57612710830492506004015b60648310613ecf576064830492506002015b600a831061094d5760010192915050565b600081815b8481101561292d57613f0f82878784818110613f0357613f03614dbf565b9050602002013561428d565b915080613f1b81614fde565b915050613ee5565b600080613f31836072614da8565b613f3d8561024b614da8565b613f498761012b614da8565b613f5391906152cd565b613f5d91906152cd565b9050610c846103e8826152e0565b60008061010b8360108110613f8257613f82614dbf565b60408051610200810191829052926012929092029091019060109082845b815481526020019060010190808311613fa05750505050509050600061010b8460108110613fd057613fd0614dbf565b601202016010015460b4613fe491906152e0565b9050605a6000838760108110613ffc57613ffc614dbf565b602002015161400b9084614da8565b6140199060f88a901c6152cd565b9050818110156140265750805b61403082826152f4565b6040516001600160f81b031960f883901b16602082015290915060210160405160208183030381529060405260008151811061406e5761406e614dbf565b01602001516001600160f81b0319169450505050509392505050565b6000816000036140a55761409e84846142bc565b9050612475565b816001036140b75761409e8484614310565b61409e848461439c565b600080805b60038110156125f757818482600381106140e2576140e2614dbf565b60200201511315614107578381600381106140ff576140ff614dbf565b602002015191505b8061411181614fde565b9150506140c6565b600067ffffffffffffffff815b60038110156125f7578184826003811061414257614142614dbf565b602002015112156141675783816003811061415f5761415f614dbf565b602002015191505b8061417181614fde565b915050614126565b805160208201516040830151600092919083610600614199856006615c4b565b6141a589610100615c4b565b6141af9190615c7b565b6141b99190615cbf565b905060006141ef6040518060600160405280848152602001846104006141df91906157c7565b8152602001610100815250614119565b90506000808213614201576000614203565b815b9050610100806142138388615c4b565b61421d91906157e7565b614229906101006157c7565b6142339086615c4b565b61423d91906157e7565b60405160200161424f91815260200190565b604051602081830303815290604052601f8151811061427057614270614dbf565b01602001516001600160f81b031916965050505050505092915050565b60008183106142a9576000828152602084905260409020612475565b6000838152602083905260409020612475565b60006142d783600260200201518360025b60200201516143c1565b60208401516142e8908460016142cd565b6142fc8560005b60200201518560006142cd565b61430691906152cd565b61247591906152cd565b60008061431d848461439c565b9050600061432b85826142ef565b9050600061434286600160200201518660016142cd565b9050600061435987600260200201518760026142cd565b90506143658480614da8565b6004614372858585613f23565b61437d906003614da8565b61438791906152e0565b61439191906152cd565b979650505050505050565b6000806143a884613759565b905060006143b584613759565b9050610c8482826143d0565b600061247560f884811c9084901c5b600080828411156143ec576143e583856152f4565b90506143f9565b6143f684846152f4565b90505b6123c98180614da8565b828054828255906000526020600020908101928215614465579160200282015b82811115614465578251825473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909116178255602090920191600190910190614423565b5061447192915061453c565b5090565b6040518061020001604052806010905b61448d6144c2565b8152602001906001900390816144855790505090565b6040518061020001604052806010906020820280368337509192915050565b60405180606001604052806003906020820280368337509192915050565b6040518061020001604052806010905b6144f86144c2565b8152602001906001900390816144f05790505090565b6040518061020001604052806010905b6145266144a3565b81526020019060019003908161451e5790505090565b5b80821115614471576000815560010161453d565b6001600160e01b03198116811461109157600080fd5b60006020828403121561457957600080fd5b813561247581614551565b60006020828403121561459657600080fd5b5035919050565b60005b838110156145b85781810151838201526020016145a0565b50506000910152565b600081518084526145d981602086016020860161459d565b601f01601f19169290920160200192915050565b60208152600061247560208301846145c1565b80356001600160a01b0381168114611f3857600080fd5b6000806040838503121561462a57600080fd5b61463383614600565b946020939093013593505050565b6000806040838503121561465457600080fd5b50508035926020909101359150565b60008083601f84011261467557600080fd5b50813567ffffffffffffffff81111561468d57600080fd5b6020830191508360208260051b85010111156146a857600080fd5b9250929050565b600080602083850312156146c257600080fd5b823567ffffffffffffffff8111156146d957600080fd5b6146e585828601614663565b90969095509350505050565b60006020828403121561470357600080fd5b61247582614600565b60008060006060848603121561472157600080fd5b61472a84614600565b925061473860208501614600565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff8111828210171561478157614781614748565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156147b0576147b0614748565b604052919050565b600067ffffffffffffffff8211156147d2576147d2614748565b5060051b60200190565b600067ffffffffffffffff8211156147f6576147f6614748565b50601f01601f191660200190565b600082601f83011261481557600080fd5b8135614828614823826147dc565b614787565b81815284602083860101111561483d57600080fd5b816020850160208301376000918101602001919091529392505050565b6000602080838503121561486d57600080fd5b823567ffffffffffffffff8082111561488557600080fd5b818501915085601f83011261489957600080fd5b81356148a7614823826147b8565b81815260059190911b830184019084810190888311156148c657600080fd5b8585015b838110156149ba578035858111156148e157600080fd5b86016060818c03601f190112156148f757600080fd5b6148ff61475e565b888201358781111561491057600080fd5b8201603f81018d1361492157600080fd5b89810135614931614823826147b8565b81815260059190911b8201604001908b8101908f83111561495157600080fd5b6040840193505b828410156149785761496984614600565b8252928c0192908c0190614958565b845250505060408201358982015260608201358781111561499857600080fd5b6149a68d8b83860101614804565b6040830152508452509186019186016148ca565b5098975050505050505050565b600080600080606085870312156149dd57600080fd5b843567ffffffffffffffff8111156149f457600080fd5b614a0087828801614663565b9095509350614a13905060208601614600565b9396929550929360400135925050565b6001600160f81b03198116811461109157600080fd5b803560ff81168114611f3857600080fd5b80358015158114611f3857600080fd5b600080600080600080600080610100898b031215614a7757600080fd5b67ffffffffffffffff808a351115614a8e57600080fd5b614a9b8b8b358c01614804565b985060208a013581811115614aaf57600080fd5b8a019050601f81018b13614ac257600080fd5b8035614ad0614823826147b8565b8082825260208201915060206060840285010192508d831115614af257600080fd5b6020840193505b82841015614b66578d601f850112614b1057600080fd5b614b1861475e565b808f606087011115614b2957600080fd5b855b60608701811015614b5057614b408135614a23565b8035835260209283019201614b2b565b5083525060609390930192602090910190614af9565b9950614b789250505060408a01614a39565b9550614b8660608a01614a4a565b979a969950949760808101359660a0820135965060c0820135955060e0909101359350915050565b8281526040602082015260006123c960408301846145c1565b60008060408385031215614bda57600080fd5b614be383614600565b9150614bf160208401614a4a565b90509250929050565b60008060008060808587031215614c1057600080fd5b614c1985614600565b9350614c2760208601614600565b925060408501359150606085013567ffffffffffffffff811115614c4a57600080fd5b614c5687828801614804565b91505092959194509250565b60008060408385031215614c7557600080fd5b614c7e83614600565b9150614bf160208401614600565b60006020808385031215614c9f57600080fd5b823567ffffffffffffffff811115614cb657600080fd5b8301601f81018513614cc757600080fd5b8035614cd5614823826147b8565b81815260059190911b82018301908381019087831115614cf457600080fd5b928401925b8284101561439157833582529284019290840190614cf9565b600080600060408486031215614d2757600080fd5b833567ffffffffffffffff811115614d3e57600080fd5b614d4a86828701614663565b909790965060209590950135949350505050565b600181811c90821680614d7257607f821691505b6020821081036133a457634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761094d5761094d614d92565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600060ff831680614dfe57614dfe614dd5565b8060ff84160691505092915050565b600082614e1c57614e1c614dd5565b500690565b6000823561023e19833603018112614e3857600080fd5b9190910192915050565b5b81811015610a535760008155600101614e43565b6000808335601e19843603018112614e6e57600080fd5b83018035915067ffffffffffffffff821115614e8957600080fd5b6020019150368190038213156146a857600080fd5b601f821115610de657806000526020600020601f840160051c81016020851015614ec55750805b614ed7601f850160051c830182614e42565b5050505050565b8160005b6010811015614eff57813583820155602090910190600101614ee2565b5050610200820135601082015560118101614f1e610220840184614e57565b67ffffffffffffffff811115614f3657614f36614748565b614f4a81614f448554614d5e565b85614e9e565b6000601f821160018114614f7e5760008315614f665750838201355b600019600385901b1c1916600184901b178555610fcc565b600085815260209020601f19841690835b82811015614faf5786850135825560209485019460019092019101614f8f565b5084821015614fcc5760001960f88660031b161c19848701351681555b50505050600190811b01909155505050565b600060018201614ff057614ff0614d92565b5060010190565b60008235603e19833603018112614e3857600080fd5b6000808335601e1984360301811261502457600080fd5b83018035915067ffffffffffffffff82111561503f57600080fd5b60200191506060810236038213156146a857600080fd5b816000805b600380821061506a575061509d565b833561507581614a23565b82821b91508060f81c821b60ff831b198516179350505060208301925060018101905061505b565b509091555050565b680100000000000000008311156150be576150be614748565b8054838255808410156150fe576000828152602090208481019082015b808210156150fb576150f06001830183614e42565b6001820191506150db565b50505b5060008181526020812083915b8581101561134b5761511d8383615056565b606092909201916001918201910161510b565b61513a8283614e57565b67ffffffffffffffff81111561515257615152614748565b61516081614f448554614d5e565b6000601f821160018114615194576000831561517c5750838201355b600019600385901b1c1916600184901b1785556151ee565b600085815260209020601f19841690835b828110156151c557868501358255602094850194600190920191016151a5565b50848210156151e25760001960f88660031b161c19848701351681555b505060018360011b0185555b505050506151ff602083018361500d565b6119cb8183600186016150a5565b815167ffffffffffffffff81111561522757615227614748565b61523b816152358454614d5e565b84614e9e565b602080601f83116001811461527057600084156152585750858301515b600019600386901b1c1916600185901b17855561134b565b600085815260208120601f198616915b8281101561529f57888601518255948401946001909101908401615280565b50858210156152bd5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b8082018082111561094d5761094d614d92565b6000826152ef576152ef614dd5565b500490565b8181038181111561094d5761094d614d92565b6000815161531981856020860161459d565b9290920192915050565b6000825161533581846020870161459d565b7f7b2274726169745f74797065223a22636f6c6f7220636f7272656374696f6e229201918252507f2c2276616c7565223a2274727565227d2c0000000000000000000000000000006020820152603101919050565b6000835161539c81846020880161459d565b7f7b2274726169745f74797065223a2267726964222c2276616c7565223a22000090830190815283516153d681601e84016020880161459d565b62089f4b60ea1b601e9290910191820152602101949350505050565b6000835161540481846020880161459d565b80830190507f7b2274726169745f74797065223a22736f75726365222c2276616c7565223a228152835161543f81602084016020880161459d565b62089f4b60ea1b60209290910191820152602301949350505050565b6000835161546d81846020880161459d565b80830190507f7b2274726169745f74797065223a2270616c65747465222c2276616c7565223a81527f2200000000000000000000000000000000000000000000000000000000000000602082015283516154ce81602184016020880161459d565b62089f4b60ea1b60219290910191820152602401949350505050565b600083516154fc81846020880161459d565b80830190507f7b2274726169745f74797065223a22636f6d70617269736f6e222c2276616c7581526332911d1160e11b6020820152835161554481602484016020880161459d565b7f227d00000000000000000000000000000000000000000000000000000000000060249290910191820152602601949350505050565b6000825161558c81846020870161459d565b7f5d00000000000000000000000000000000000000000000000000000000000000920191825250600101919050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b757466382c7b226e616d81526332911d1160e11b60208201526000845161560081602485016020890161459d565b7f222c22696d616765223a22646174613a696d6167652f7376672b786d6c3b62616024918401918201527f736536342c0000000000000000000000000000000000000000000000000000006044820152845161566381604984016020890161459d565b7f222c0000000000000000000000000000000000000000000000000000000000006049929091019182015283516156a181604b84016020880161459d565b7f7d00000000000000000000000000000000000000000000000000000000000000604b9290910191820152604c0195945050505050565b6000816156e7576156e7614d92565b506000190190565b6000835161570181846020880161459d565b83519083019061571581836020880161459d565b01949350505050565b60408152600061573160408301856145c1565b90508260208301529392505050565b60006020828403121561575257600080fd5b815167ffffffffffffffff81111561576957600080fd5b8201601f8101841361577a57600080fd5b8051615788614823826147dc565b81815285602083850101111561579d57600080fd5b610c8482602083016020860161459d565b60ff818116838216019081111561094d5761094d614d92565b81810360008312801583831316838312821617156125f7576125f7614d92565b6000826157f6576157f6614dd5565b600160ff1b82146000198414161561581057615810614d92565b500590565b600060ff83168061582857615828614dd5565b8060ff84160491505092915050565b7f3c7376672076696577426f783d2230203020000000000000000000000000000081526000885161586f816012850160208d0161459d565b7f200000000000000000000000000000000000000000000000000000000000000060129184019182015288516158ac816013840160208d0161459d565b7f222077696474683d2200000000000000000000000000000000000000000000006013929091019182015287516158ea81601c840160208c0161459d565b7f22206865696768743d2200000000000000000000000000000000000000000000601c92909101918201528651615928816026840160208b0161459d565b7f2220786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f602692909101918201527f7376672220786d6c6e733a786c696e6b3d22687474703a2f2f7777772e77332e60468201527f6f72672f313939392f786c696e6b223e3c646566733e3c7374796c653e696d6160668201527f6765207b696d6167652d72656e646572696e673a206f7074696d697a6553706560868201527f65643b696d6167652d72656e646572696e673a202d6d6f7a2d63726973702d6560a68201527f646765733b696d6167652d72656e646572696e673a202d6f2d63726973702d6560c68201527f646765733b696d6167652d72656e646572696e673a202d7765626b69742d6f7060e68201527f74696d697a652d636f6e74726173743b696d6167652d72656e646572696e673a6101068201527f206f7074696d697a652d636f6e74726173743b696d6167652d72656e646572696101268201527f6e673a2063726973702d65646765733b696d6167652d72656e646572696e673a6101468201527f20706978656c617465643b2d6d732d696e746572706f6c6174696f6e2d6d6f646101668201527f653a206e6561726573742d6e65696768626f723b7d3c2f7374796c653e3c2f646101868201527f6566733e3c696d6167652077696474683d2200000000000000000000000000006101a6820152615bc5615b9c615b96615b6d615b67615b3e6101b887018c615307565b7f707822206865696768743d2200000000000000000000000000000000000000008152600c0190565b89615307565b7f70782220687265663d22646174613a696d6167652f626d703b6261736536342c815260200190565b86615307565b7f22202f3e3c2f7376673e000000000000000000000000000000000000000000008152600a0190565b9a9950505050505050505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152615c0560808301846145c1565b9695505050505050565b600060208284031215615c2157600080fd5b815161247581614551565b600060ff821660ff8103615c4257615c42614d92565b60010192915050565b80820260008212600160ff1b84141615615c6757615c67614d92565b818105831482151761094d5761094d614d92565b8082018281126000831280158216821582161715615c9b57615c9b614d92565b505092915050565b6000600160ff1b8203615cb857615cb8614d92565b5060000390565b600082615cce57615cce614dd5565b50079056fea26469706673582212202b6cb9120f3225df8e17a5b8c32a4fd39c05da63c78224042d31730e5255db1764736f6c6343000814003300000000000000000000000072ff4bfc711800644fb21cf08b2e0d10958b9de7
Deployed Bytecode
0x6080604052600436106103135760003560e01c806370a082311161019a578063c87b56dd116100e1578063e985e9c51161008a578063f2fde38b11610064578063f2fde38b1461086e578063f3dc5a891461088e578063f6d82599146108a357600080fd5b8063e985e9c5146107ee578063ebf0c71714610837578063ef59d8a41461084e57600080fd5b8063db68d5c4116100bb578063db68d5c414610799578063db8cc8fa146107ae578063dcf7eefe146107ce57600080fd5b8063c87b56dd14610744578063da0239a614610764578063dab5f3401461077957600080fd5b806391b7f5ed11610143578063aab5c4bf1161011d578063aab5c4bf146106fc578063b88d4fde1461071c578063becadb651461072f57600080fd5b806391b7f5ed146106a757806395d89b41146106c7578063a22cb465146106dc57600080fd5b80637f5a590d116101745780637f5a590d1461063b578063848564821461065b5780638da5cb5b1461068957600080fd5b806370a08231146105f1578063715018a614610611578063753868e31461062657600080fd5b806323b872dd1161025e5780635fd1bbc4116102075780636819dca8116101e15780636819dca81461059c57806368428a1b146105bc5780636b2fafa9146105d157600080fd5b80635fd1bbc4146105455780636352211e1461055c57806363dbe57c1461057c57600080fd5b80635308f668116102385780635308f668146104ee578063594f21301461050e57806359d7bc4d1461052e57600080fd5b806323b872dd146104b35780633ccfd60b146104c657806342842e0e146104db57600080fd5b80631249c58b116102c057806318160ddd1161029a57806318160ddd146104395780631857f757146104655780631e7269c51461048557600080fd5b80631249c58b146103f157806312a6f5f4146103f957806317ca7bd81461041957600080fd5b8063081812fc116102f1578063081812fc14610391578063095ea7b3146103c95780630c1c972a146103dc57600080fd5b806301ffc9a71461031857806303b674d31461034d57806306fdde031461036f575b600080fd5b34801561032457600080fd5b50610338610333366004614567565b6108b6565b60405190151581526020015b60405180910390f35b34801561035957600080fd5b5061036d610368366004614584565b610953565b005b34801561037b57600080fd5b50610384610961565b60405161034491906145ed565b34801561039d57600080fd5b506103b16103ac366004614584565b6109f3565b6040516001600160a01b039091168152602001610344565b61036d6103d7366004614617565b610a47565b3480156103e857600080fd5b5061036d610a57565b61036d610a6c565b34801561040557600080fd5b50610384610414366004614584565b610bce565b34801561042557600080fd5b5061036d610434366004614641565b610c8d565b34801561044557600080fd5b50610457600154600054036000190190565b604051908152602001610344565b34801561047157600080fd5b5061036d6104803660046146af565b610d14565b34801561049157600080fd5b506104576104a03660046146f1565b6102456020526000908152604090205481565b61036d6104c136600461470c565b610deb565b3480156104d257600080fd5b5061036d610fd5565b61036d6104e936600461470c565b611094565b3480156104fa57600080fd5b5061036d6105093660046146af565b6110af565b34801561051a57600080fd5b5061036d61052936600461485a565b611180565b34801561053a57600080fd5b506104576102425481565b34801561055157600080fd5b506104576102435481565b34801561056857600080fd5b506103b1610577366004614584565b61127b565b34801561058857600080fd5b5061036d6105973660046149c7565b611286565b3480156105a857600080fd5b506103846105b7366004614a5a565b611353565b3480156105c857600080fd5b506103386114cf565b3480156105dd57600080fd5b506104576105ec366004614584565b6114ec565b3480156105fd57600080fd5b5061045761060c3660046146f1565b611584565b34801561061d57600080fd5b5061036d6115e3565b34801561063257600080fd5b5061036d6115f7565b34801561064757600080fd5b50610384610656366004614584565b61160f565b34801561066757600080fd5b5061067b610676366004614584565b611825565b604051610344929190614bae565b34801561069557600080fd5b506009546001600160a01b03166103b1565b3480156106b357600080fd5b5061036d6106c2366004614584565b6118d7565b3480156106d357600080fd5b506103846118e5565b3480156106e857600080fd5b5061036d6106f7366004614bc7565b6118f4565b34801561070857600080fd5b5061067b610717366004614584565b611960565b61036d61072a366004614bfa565b611990565b34801561073b57600080fd5b5061036d6119d1565b34801561075057600080fd5b5061038461075f366004614584565b6119e6565b34801561077057600080fd5b50610457611a41565b34801561078557600080fd5b5061036d610794366004614584565b611a59565b3480156107a557600080fd5b50610338611a67565b3480156107ba57600080fd5b5061036d6107c9366004614584565b611a86565b3480156107da57600080fd5b506103846107e9366004614584565b611a94565b3480156107fa57600080fd5b50610338610809366004614c62565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b34801561084357600080fd5b506104576102445481565b34801561085a57600080fd5b5061036d610869366004614c8c565b611b3b565b34801561087a57600080fd5b5061036d6108893660046146f1565b611bf5565b34801561089a57600080fd5b50610457611c49565b61036d6108b1366004614d12565b611c66565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316148061091957507f80ac58cd000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b8061094d57507f5b5e139f000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b61095b611ea9565b61024255565b60606002805461097090614d5e565b80601f016020809104026020016040519081016040528092919081815260200182805461099c90614d5e565b80156109e95780601f106109be576101008083540402835291602001916109e9565b820191906000526020600020905b8154815290600101906020018083116109cc57829003601f168201915b5050505050905090565b60006109fe82611eef565b610a2b57610a2b7fcf4700e400000000000000000000000000000000000000000000000000000000611f3d565b506000908152600660205260409020546001600160a01b031690565b610a5382826001611f47565b5050565b610a5f611ea9565b4261024381905561024255565b60018061024054610a7d9190614da8565b3414610ad05760405162461bcd60e51b815260206004820152601560248201527f796f7520676f7474612070617920746f20706c6179000000000000000000000060448201526064015b60405180910390fd5b610ad86114cf565b610b245760405162461bcd60e51b815260206004820152601060248201527f73616c65206973206e6f74206c697665000000000000000000000000000000006044820152606401610ac7565b610b2c61202d565b610b785760405162461bcd60e51b815260206004820152601660248201527f73616c6520697320616c6c6f776c697374206f6e6c79000000000000000000006044820152606401610ac7565b600180610b83611a41565b1015610bbd5760405162461bcd60e51b8152602060048201526009602482015268736f6c64206f75742160b81b6044820152606401610ac7565b610a53610bc8612047565b336120a2565b6060600082811a603f1690506000610be5846120cd565b90506000610bf283612198565b9050610c8481836000610c0a600860028b901a614deb565b60ff1611610c19576000610c1c565b60015b610c2c60028a811a60041b614deb565b60ff1660011460108a600360208110610c4757610c47614dbf565b610c569291600f911a16614e0d565b610c6660038c811a60041c614deb565b60ff16610c7b600a60048e901a600f16614deb565b60ff168c611353565b95945050505050565b610c95611ea9565b61023c5460ff1615610cf95760405162461bcd60e51b815260206004820152602760248201527f436f6e7472616374206973206c6f636b656420616e642063616e6e6f742062656044820152660819591a5d195960ca1b6064820152608401610ac7565b8161022b8260108110610d0e57610d0e614dbf565b01555050565b610d1c611ea9565b61023c5460ff1615610d805760405162461bcd60e51b815260206004820152602760248201527f436f6e7472616374206973206c6f636b656420616e642063616e6e6f742062656044820152660819591a5d195960ca1b6064820152608401610ac7565b60005b81811015610de657828282818110610d9d57610d9d614dbf565b9050602002810190610daf9190614e21565b61010b8260108110610dc357610dc3614dbf565b60120201610dd18282614ede565b50819050610dde81614fde565b915050610d83565b505050565b6000610df6826123d1565b6001600160a01b039485169490915081168414610e3657610e367fa114810000000000000000000000000000000000000000000000000000000000611f3d565b60008281526006602052604090208054338082146001600160a01b03881690911417610eb0576001600160a01b038616600090815260076020908152604080832033845290915290205460ff16610eb057610eb07f59c896be00000000000000000000000000000000000000000000000000000000611f3d565b8015610ebb57600082555b6001600160a01b03808716600090815260056020526040808220805460001901905591871681522080546001019055610f1485610ef9888287612472565b600160e11b174260a01b176001600160a01b03919091161790565b600085815260046020526040812091909155600160e11b84169003610f6957600184016000818152600460205260408120549003610f67576000548114610f675760008181526004602052604090208490555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a480600003610fcc57610fcc7fea553b3400000000000000000000000000000000000000000000000000000000611f3d565b50505050505050565b610fdd611ea9565b6000610ff16009546001600160a01b031690565b6001600160a01b03164760405160006040518083038185875af1925050503d806000811461103b576040519150601f19603f3d011682016040523d82523d6000602084013e611040565b606091505b50509050806110915760405162461bcd60e51b815260206004820152601060248201527f5769746864726177206661696c65642e000000000000000000000000000000006044820152606401610ac7565b50565b610de683838360405180602001604052806000815250611990565b6110b7611ea9565b61023c5460ff161561111b5760405162461bcd60e51b815260206004820152602760248201527f436f6e7472616374206973206c6f636b656420616e642063616e6e6f742062656044820152660819591a5d195960ca1b6064820152608401610ac7565b60005b81811015610de65782828281811061113857611138614dbf565b905060200281019061114a9190614ff7565b60cb826020811061115d5761115d614dbf565b6002020161116b8282615130565b5081905061117881614fde565b91505061111e565b611188611ea9565b61023c5460ff16156111ec5760405162461bcd60e51b815260206004820152602760248201527f436f6e7472616374206973206c6f636b656420616e642063616e6e6f742062656044820152660819591a5d195960ca1b6064820152608401610ac7565b60005b8151811015610a535781818151811061120a5761120a614dbf565b6020026020010151600b826040811061122557611225614dbf565b600302016000820151816000019080519060200190611245929190614403565b506020820151600182015560408201516002820190611264908261520d565b50905050808061127390614fde565b9150506111ef565b600061094d826123d1565b61128e611ea9565b8080611298611c49565b10156112e65760405162461bcd60e51b815260206004820152600a60248201527f6d696e746564206f7574000000000000000000000000000000000000000000006044820152606401610ac7565b60005b8281101561134b5761024154818611156113195786868381811061130f5761130f614dbf565b9050602002013590505b61024154810361132e5761132b612047565b90505b61133881866120a2565b508061134381614fde565b9150506112e9565b505050505050565b6060600061139f8a60138151811061136d5761136d614dbf565b602001015160f81c60f81b8b60128151811061138b5761138b614dbf565b01602001516001600160f81b03191661247c565b905060006113d78b6017815181106113b9576113b9614dbf565b602001015160f81c60f81b8c60168151811061138b5761138b614dbf565b905060206113e6836004614da8565b6113f190601f6152cd565b6113fb91906152e0565b9150611408826008614da8565b915060006114158c612494565b90506009861015611478578960ff1660000361143957611436600489614e0d565b97505b881561145d576114588161144e838e516125fe565b8e86868d8d612936565b61146c565b61146c818c8e86868d8d612936565b6114768c8c612b93565b505b60068611156114ac576009861015611496576114938c612494565b90505b6114a08186612d1e565b6114aa8c82612f9c565b505b6114bf6114b88d6130dd565b84846130eb565b9c9b505050505050505050505050565b60006114d961314d565b806114e757506114e761202d565b905090565b60006010821161151c5761022b6115046001846152f4565b6010811061151457611514614dbf565b015492915050565b61024154600083815261024660205260409020541461154957506000908152610246602052604090205490565b61023b54604051611567918491602001918252602082015260400190565b604051602081830303815290604052805190602001209050919050565b60006001600160a01b0382166115bd576115bd7f8f4eb60400000000000000000000000000000000000000000000000000000000611f3d565b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b6115eb611ea9565b6115f56000613167565b565b6115ff611ea9565b61023c805460ff19166001179055565b60408051808201909152600f81527f2261747472696275746573223a205b000000000000000000000000000000000060208201526060906000600b84821a603f166040811061166057611660614dbf565b60030201600201805461167290614d5e565b80601f016020809104026020016040519081016040528092919081815260200182805461169e90614d5e565b80156116eb5780601f106116c0576101008083540402835291602001916116eb565b820191906000526020600020905b8154815290600101906020018083116116ce57829003601f168201915b5050505050905060006116fd856131c6565b9050600061170a866132ca565b90506000611717876133aa565b9050600061172d600a60048a901a600f16614deb565b60ff169050600681111561175e578560405160200161174c9190615323565b60405160208183030381529060405295505b600981101561178c57858460405160200161177a92919061538a565b60405160208183030381529060405295505b858560405160200161179f9291906153f2565b604051602081830303815290604052955085826040516020016117c392919061545b565b604051602081830303815290604052955085836040516020016117e79291906154ea565b604051602081830303815290604052955085604051602001611809919061557a565b6040516020818303038152906040529650505050505050919050565b600b816040811061183557600080fd5b6003020160009150905080600101549080600201805461185490614d5e565b80601f016020809104026020016040519081016040528092919081815260200182805461188090614d5e565b80156118cd5780601f106118a2576101008083540402835291602001916118cd565b820191906000526020600020905b8154815290600101906020018083116118b057829003601f168201915b5050505050905082565b6118df611ea9565b61024055565b60606003805461097090614d5e565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61010b816010811061197157600080fd5b6012020160009150905080601001549080601101805461185490614d5e565b61199b848484610deb565b6001600160a01b0383163b156119cb576119b784848484613461565b6119cb576119cb6368d2bf6b60e11b611f3d565b50505050565b6119d9611ea9565b6000610243554261024255565b606060006119f3836114ec565b90506119fe83613543565b611a0f611a0a83610bce565b6130dd565b611a188361160f565b604051602001611a2a939291906155bb565b604051602081830303815290604052915050919050565b600061023f54611a4f611c49565b6114e791906152f4565b611a61611ea9565b61024455565b6000611a7161314d565b80156114e75750611a8061202d565b15905090565b611a8e611ea9565b61024355565b60cb8160208110611aa457600080fd5b6002020180549091508190611ab890614d5e565b80601f0160208091040260200160405190810160405280929190818152602001828054611ae490614d5e565b8015611b315780601f10611b0657610100808354040283529160200191611b31565b820191906000526020600020905b815481529060010190602001808311611b1457829003601f168201915b5050505050905081565b611b43611ea9565b61023c5460ff1615611ba75760405162461bcd60e51b815260206004820152602760248201527f436f6e7472616374206973206c6f636b656420616e642063616e6e6f742062656044820152660819591a5d195960ca1b6064820152608401610ac7565b60005b8151811015610a5357818181518110611bc557611bc5614dbf565b602002602001015161022b8260108110611be157611be1614dbf565b015580611bed81614fde565b915050611baa565b611bfd611ea9565b6001600160a01b038116611c40576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610ac7565b61109181613167565b6000805461023d54611c5b91906152f4565b6114e79060016152cd565b808061024054611c769190614da8565b3414611cc45760405162461bcd60e51b815260206004820152601560248201527f796f7520676f7474612070617920746f20706c617900000000000000000000006044820152606401610ac7565b611ccc6114cf565b611d185760405162461bcd60e51b815260206004820152601060248201527f73616c65206973206e6f74206c697665000000000000000000000000000000006044820152606401610ac7565b8180611d22611a41565b1015611d5c5760405162461bcd60e51b8152602060048201526009602482015268736f6c64206f75742160b81b6044820152606401610ac7565b610244546040516bffffffffffffffffffffffff193360601b166020820152611da2918791879190603401604051602081830303815290604052805190602001206135e4565b611dee5760405162461bcd60e51b815260206004820152601060248201527f6e6f74206f6e20616c6c6f776c697374000000000000000000000000000000006044820152606401610ac7565b3360009081526102456020526040902054600390611e0d9085906152cd565b1115611e5b5760405162461bcd60e51b815260206004820152600e60248201527f616c7265616479206d696e7465640000000000000000000000000000000000006044820152606401610ac7565b336000908152610245602052604081208054859290611e7b9084906152cd565b90915550600090505b8381101561134b57611e97610bc8612047565b80611ea181614fde565b915050611e84565b6009546001600160a01b031633146115f5576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610ac7565b600081600111611f3857600054821015611f385760005b5060008281526004602052604081205490819003611f2e57611f27836156d8565b9250611f06565b600160e01b161590505b919050565b8060005260046000fd5b6000611f528361127b565b9050818015611f6a5750336001600160a01b03821614155b15611fc3576001600160a01b038116600090815260076020908152604080832033845290915290205460ff16611fc357611fc37fcfb3b94200000000000000000000000000000000000000000000000000000000611f3d565b600083815260066020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0388811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b60006102435442101580156114e757505061024354151590565b600061023b5461205660005490565b60408051602081019390935282015233606090811b6bffffffffffffffffffffffff19169082015242607482015260940160405160208183030381529060405280519060200120905090565b8161024660006120b160005490565b8152602081019190915260400160002055610a538160016135fc565b606060cb6120e06020600185901a614e0d565b602081106120f0576120f0614dbf565b60020201600101805480602002602001604051908101604052809291908181526020016000905b8282101561218d576000848152602081206040805160608101918290529291850191600391908390855b825461010083900a900460f81b6001600160f81b031916815260206001928301818104948501949093039092029101808411612141579050505050505081526020019060010190612117565b505050509050919050565b60606000600b83604081106121af576121af614dbf565b600302016040518060600160405290816000820180548060200260200160405190810160405280929190818152602001828054801561221757602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116121f9575b505050505081526020016001820154815260200160028201805461223a90614d5e565b80601f016020809104026020016040519081016040528092919081815260200182805461226690614d5e565b80156122b35780601f10612288576101008083540402835291602001916122b3565b820191906000526020600020905b81548152906001019060200180831161229657829003601f168201915b505050505081525050905060006122e782600001516000815181106122da576122da614dbf565b602002602001015161370f565b905060018260000151511115612335578061231283600001516001815181106122da576122da614dbf565b6040516020016123239291906156ef565b60405160208183030381529060405290505b600a5460208301516040517f265b7f7e0000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163265b7f7e916123849185919060040161571e565b600060405180830381865afa1580156123a1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526123c99190810190615740565b949350505050565b60008160011161246257506000818152600460205260409020548060000361244f57600054821061240c5761240c636f96cda160e11b611f3d565b5b5060001901600081815260046020526040902054801561240d57600160e01b811660000361243a57919050565b61244a636f96cda160e11b611f3d565b61240d565b600160e01b811660000361246257919050565b611f38636f96cda160e11b611f3d565b60005b9392505050565b600061247560f883901c61ff0060f086901c166152cd565b61249c614475565b6124a4614475565b60005b60108110156125f757836124bc826004614da8565b6124c79060366152cd565b815181106124d7576124d7614dbf565b01602001516001600160f81b0319168282601081106124f8576124f8614dbf565b60200201516001600160f81b0319919091166040909101528361251c826004614da8565b6125279060366152cd565b6125329060016152cd565b8151811061254257612542614dbf565b01602001516001600160f81b03191682826010811061256357612563614dbf565b602002015160016001600160f81b031990921660209290920201528361258a826004614da8565b6125959060366152cd565b6125a09060026152cd565b815181106125b0576125b0614dbf565b01602001516001600160f81b0319168282601081106125d1576125d1614dbf565b60200201516001600160f81b0319919091169052806125ef81614fde565b9150506124a7565b5092915050565b60606126086144a3565b60008367ffffffffffffffff81111561262357612623614748565b60405190808252806020026020018201604052801561265c57816020015b6126496144c2565b8152602001906001900390816126415790505b50905060005b601081101561269657600083826010811061267f5761267f614dbf565b60200201528061268e81614fde565b915050612662565b5060005b601081101561278c5760006126c48783601081106126ba576126ba614dbf565b6020020151613759565b9050808483601081106126d9576126d9614dbf565b602002015260005b8281101561277757818582601081106126fc576126fc614dbf565b60200201511061276557600f8110156127485784816010811061272157612721614dbf565b6020020151856127328360016152cd565b6010811061274257612742614dbf565b60200201525b8185826010811061275b5761275b614dbf565b6020020152612777565b8061276f81614fde565b9150506126e1565b5050808061278490614fde565b91505061269a565b5060005b8481101561292d5760006127a56001876152f4565b6127b083600f614da8565b6127ba91906152e0565b905060008482601081106127d0576127d0614dbf565b60200201519050821580156127e55750600081115b156127fc57806127f4816156d8565b915050612828565b6128076001886152f4565b83148015612815575060ff81105b15612828578061282481614fde565b9150505b6040805160608101909152608081018290528060a0810160405160208183030381529060405260008151811061286057612860614dbf565b602091018101516001600160f81b0319168252604080518083018690529290910191016040516020818303038152906040526000815181106128a4576128a4614dbf565b602091018101516001600160f81b0319168252604080518083018690529290910191016040516020818303038152906040526000815181106128e8576128e8614dbf565b01602001516001600160f81b0319169052845185908590811061290d5761290d614dbf565b60200260200101819052505050808061292590614fde565b915050612790565b50949350505050565b600061010b836010811061294c5761294c614dbf565b601202016010015490506000612965828a8a878761377c565b905060008260041461297857600461297b565b60025b60ff16905060005b86811015612b865760005b61299960028a6152e0565b811015612b735760008160026129af8c86614da8565b6129b991906152e0565b6129c49060766152cd565b6129ce91906152cd565b9050600060048c83815181106129e6576129e6614dbf565b602001015160f81c60f81b60f81c60ff16901c905060008c8381518110612a0f57612a0f614dbf565b60209101015160f81c600f1690506000612a2a6002886152e0565b612a349086614e0d565b612a3f6002896152e0565b612a499190614da8565b612a538888614e0d565b612a5d9089614da8565b612a6791906152cd565b905087612a758260016152cd565b60108110612a8557612a85614dbf565b60200201518260ff1660108110612a9e57612a9e614dbf565b60200201516004898360108110612ab757612ab7614dbf565b60200201518560ff1660108110612ad057612ad0614dbf565b602002015160ff16901b612ae491906157ae565b604051602001612b07919060f89190911b6001600160f81b031916815260010190565b604051602081830303815290604052600081518110612b2857612b28614dbf565b602001015160f81c60f81b8e8581518110612b4557612b45614dbf565b60200101906001600160f81b031916908160001a905350505050508080612b6b90614fde565b91505061298e565b5080612b7e81614fde565b915050612983565b5050505050505050505050565b606060005b8251811015612d1657828181518110612bb357612bb3614dbf565b6020026020010151600260038110612bcd57612bcd614dbf565b602002015184612bde836004614da8565b612be99060366152cd565b81518110612bf957612bf9614dbf565b60200101906001600160f81b031916908160001a905350828181518110612c2257612c22614dbf565b6020026020010151600160038110612c3c57612c3c614dbf565b602002015184612c4d836004614da8565b612c589060366152cd565b612c639060016152cd565b81518110612c7357612c73614dbf565b60200101906001600160f81b031916908160001a905350828181518110612c9c57612c9c614dbf565b6020026020010151600060038110612cb657612cb6614dbf565b602002015184612cc7836004614da8565b612cd29060366152cd565b612cdd9060026152cd565b81518110612ced57612ced614dbf565b60200101906001600160f81b031916908160001a90535080612d0e81614fde565b915050612b98565b509192915050565b612d266144e0565b60005b6010811015612d7a57612d51848260108110612d4757612d47614dbf565b602002015161390d565b828260108110612d6357612d63614dbf565b602002015280612d7281614fde565b915050612d29565b5060006040612d8e6080600586901a614deb565b60ff16612d9b91906157c7565b9050600080612daf6002600787901a614deb565b60ff16119050600081612ddf576040612dcd6080600688901a614deb565b60ff16612dda91906157c7565b612dea565b612dea6002846157e7565b90506000612dfd6010600888901a614deb565b60ff1690506000612e136010600989901a614deb565b60ff1690506000612e296002600a8a901a615815565b60ff1690506000612e3f6004600b8b901a614e0d565b1115612e49575060005b600c88901a60005b6010811015612f47576000898260108110612e6e57612e6e614dbf565b602002015151905060008a8360108110612e8a57612e8a614dbf565b602002015160016020020151905060008b8460108110612eac57612eac614dbf565b6020020151604001519050612ec1828c613a99565b9150612ecd818a613a99565b9050612ede888284600060ff613ad4565b9150612eef878284602360c8613ad4565b9250612efc868685613b75565b92506040518060600160405280848152602001838152602001828152508c8560108110612f2b57612f2b614dbf565b602002015250829150612f3f905081614fde565b915050612e51565b5060005b6010811015612b8657612f73898260108110612f6957612f69614dbf565b6020020151613c8a565b8b8260108110612f8557612f85614dbf565b602002015280612f9481614fde565b915050612f4b565b606060005b6010811015612d1657828160108110612fbc57612fbc614dbf565b60200201516040015184612fd1836004614da8565b612fdc9060366152cd565b81518110612fec57612fec614dbf565b60200101906001600160f81b031916908160001a90535082816010811061301557613015614dbf565b6020020151600160200201518461302d836004614da8565b6130389060366152cd565b6130439060016152cd565b8151811061305357613053614dbf565b60200101906001600160f81b031916908160001a90535082816010811061307c5761307c614dbf565b6020020151518461308e836004614da8565b6130999060366152cd565b6130a49060026152cd565b815181106130b4576130b4614dbf565b60200101906001600160f81b031916908160001a905350806130d581614fde565b915050612fa1565b606061094d82600080613cee565b606060006131026130fd85600a614da8565b613543565b905060006131146130fd85600a614da8565b90508181838385858b6040516020016131339796959493929190615837565b604051602081830303815290604052925050509392505050565b60006102425442101580156114e757505061024254151590565b600980546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606000806131da6008600286901a614deb565b60ff16116131e95760006131ec565b60015b60ff16905060006132056010600386901a600f16614e0d565b90508160000361321d5761321a600482614e0d565b90505b61010b816010811061323157613231614dbf565b60120201601101805461324390614d5e565b80601f016020809104026020016040519081016040528092919081815260200182805461326f90614d5e565b80156132bc5780601f10613291576101008083540402835291602001916132bc565b820191906000526020600020905b81548152906001019060200180831161329f57829003601f168201915b505050505092505050919050565b606060006132de600384811a60041c614deb565b60ff1690508060000361332657505060408051808201909152600381527f52474200000000000000000000000000000000000000000000000000000000006020820152919050565b8060010361336957505060408051808201909152600481527f4c756d61000000000000000000000000000000000000000000000000000000006020820152919050565b505060408051808201909152600981527f4c696768746e65737300000000000000000000000000000000000000000000006020820152919050565b50919050565b606060cb6133bd6020600185901a614e0d565b602081106133cd576133cd614dbf565b6002020180546133dc90614d5e565b80601f016020809104026020016040519081016040528092919081815260200182805461340890614d5e565b80156134555780601f1061342a57610100808354040283529160200191613455565b820191906000526020600020905b81548152906001019060200180831161343857829003601f168201915b50505050509050919050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290613496903390899088908890600401615bd3565b6020604051808303816000875af19250505080156134d1575060408051601f3d908101601f191682019092526134ce91810190615c0f565b60015b613526573d8080156134ff576040519150601f19603f3d011682016040523d82523d6000602084013e613504565b606091505b50805160000361351e5761351e6368d2bf6b60e11b611f3d565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6060600061355083613dfe565b600101905060008167ffffffffffffffff81111561357057613570614748565b6040519080825280601f01601f19166020018201604052801561359a576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846135a4575b509392505050565b6000826135f2868685613ee0565b1495945050505050565b6000805490829003613631576136317fb562e8dd00000000000000000000000000000000000000000000000000000000611f3d565b61365f836136426000866000612472565b6001851460e11b174260a01b176001600160a01b03919091161790565b6000828152600460209081526040808320939093556001600160a01b038616808352600590915291812080546801000000000000000186020190558190036136ca576136ca7f2e07630000000000000000000000000000000000000000000000000000000000611f3d565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a48181600101915081036136cf575060005550505050565b6060813b80613726576311052bb46000526004601cfd5b600181039050604051915061ffe0603f820116820160405280825260008160208401015280600160208401853c50919050565b80516020820151604083015160009261094d9260f891821c9290821c911c613f23565b61378461450e565b61378c61450e565b60005b878110156139025760005b60108110156138ef576137ab6144c2565b6137d48983601081106137c0576137c0614dbf565b602002015160005b60200201518489613f6b565b6001600160f81b03191681526138018983601081106137f5576137f5614dbf565b602002015160016137c8565b6001600160f81b031916602082015261383189836010811061382557613825614dbf565b602002015160026137c8565b6001600160f81b0319166040820152600062030001815b8a518160ff1610156138a157600061387d858d8460ff168151811061386f5761386f614dbf565b60200260200101518c61408a565b90508281101561388e578193508092505b508061389981615c2c565b915050613848565b50818686601081106138b5576138b5614dbf565b602002015185601081106138cb576138cb614dbf565b60ff9092166020929092020152508291506138e7905081614fde565b91505061379a565b50806138fa81614fde565b91505061378f565b509695505050505050565b6139156144c2565b8151602080840151604080860151815160608101835260f895861c80825293861c948101859052941c9084018190529092600090613952906140c1565b90506000613979604051806060016040528087815260200186815260200185815250614119565b61398390836157c7565b9050600081600003613996575080613a29565b8583036139c557816139a885876157c7565b6139b490610100615c4b565b6139be91906157e7565b9050613a29565b8483036139f957816139d787866157c7565b6139e390610100615c4b565b6139ed91906157e7565b6139be90610200615c7b565b81613a0486886157c7565b613a1090610100615c4b565b613a1a91906157e7565b613a2690610400615c7b565b90505b6040518060600160405280600660008412613a445783613a50565b613a5084610600615c7b565b613a5a91906157e7565b815260200184600003613a6d5784613a84565b84613a7a85610100615c4b565b613a8491906157e7565b81526020019390935250909695505050505050565b60008115613acd57613aab8284615c7b565b92506000831215613abf5760009250613acd565b60ff831315613acd5760ff92505b5090919050565b600085600003613ae5575083610c84565b60008686610100613af68280615c4b565b613b0091906157e7565b613b0a91906157c7565b613b15906040615c7b565b613b20906008615c4b565b613b2a91906157e7565b90506080861315613b5257613b3f81866157c7565b945083851215613b4d578394505b613b6a565b613b5c8186615c7b565b945082851315613b6a578294505b509295945050505050565b600083600003613b86575080612475565b60008083851315613be2576000613b9d85876157c7565b9050600086613bad8760ff6157c7565b613bb79190615c7b565b905080821315613bd457925082613bcd81615ca3565b9250613bdb565b8193508092505b5050613c30565b6000613bee86866157c7565b9050600085613bfe8860ff6157c7565b613c089190615c7b565b905080821215613c265781935081613c1f90615ca3565b9250613c2d565b8093508092505b50505b85821015613c4057849350613c80565b613c4a8185615c7b565b93506000841215613c6857613c6184610100615c7b565b9350613c80565b60ff841315613c8057613c7d610100856157c7565b93505b5091949350505050565b613c926144c2565b6040518060600160405280613ca8600585614179565b6001600160f81b0319168152602001613cc2600385614179565b6001600160f81b0319168152602001613cdc600185614179565b6001600160f81b031916905292915050565b6060835180156135dc576003600282010460021b60405192507f4142434445464748494a4b4c4d4e4f505152535455565758595a616263646566601f526106708515027f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392d5f18603f52602083018181018388602001018051600082525b60038a0199508951603f8160121c1651600053603f81600c1c1651600153603f8160061c1651600253603f811651600353506000518452600484019350828410613d6a5790526020016040527f3d3d00000000000000000000000000000000000000000000000000000000000060038406600204808303919091526000861515909102918290035290038252509392505050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310613e47577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310613e73576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613e9157662386f26fc10000830492506010015b6305f5e1008310613ea9576305f5e100830492506008015b6127108310613ebd57612710830492506004015b60648310613ecf576064830492506002015b600a831061094d5760010192915050565b600081815b8481101561292d57613f0f82878784818110613f0357613f03614dbf565b9050602002013561428d565b915080613f1b81614fde565b915050613ee5565b600080613f31836072614da8565b613f3d8561024b614da8565b613f498761012b614da8565b613f5391906152cd565b613f5d91906152cd565b9050610c846103e8826152e0565b60008061010b8360108110613f8257613f82614dbf565b60408051610200810191829052926012929092029091019060109082845b815481526020019060010190808311613fa05750505050509050600061010b8460108110613fd057613fd0614dbf565b601202016010015460b4613fe491906152e0565b9050605a6000838760108110613ffc57613ffc614dbf565b602002015161400b9084614da8565b6140199060f88a901c6152cd565b9050818110156140265750805b61403082826152f4565b6040516001600160f81b031960f883901b16602082015290915060210160405160208183030381529060405260008151811061406e5761406e614dbf565b01602001516001600160f81b0319169450505050509392505050565b6000816000036140a55761409e84846142bc565b9050612475565b816001036140b75761409e8484614310565b61409e848461439c565b600080805b60038110156125f757818482600381106140e2576140e2614dbf565b60200201511315614107578381600381106140ff576140ff614dbf565b602002015191505b8061411181614fde565b9150506140c6565b600067ffffffffffffffff815b60038110156125f7578184826003811061414257614142614dbf565b602002015112156141675783816003811061415f5761415f614dbf565b602002015191505b8061417181614fde565b915050614126565b805160208201516040830151600092919083610600614199856006615c4b565b6141a589610100615c4b565b6141af9190615c7b565b6141b99190615cbf565b905060006141ef6040518060600160405280848152602001846104006141df91906157c7565b8152602001610100815250614119565b90506000808213614201576000614203565b815b9050610100806142138388615c4b565b61421d91906157e7565b614229906101006157c7565b6142339086615c4b565b61423d91906157e7565b60405160200161424f91815260200190565b604051602081830303815290604052601f8151811061427057614270614dbf565b01602001516001600160f81b031916965050505050505092915050565b60008183106142a9576000828152602084905260409020612475565b6000838152602083905260409020612475565b60006142d783600260200201518360025b60200201516143c1565b60208401516142e8908460016142cd565b6142fc8560005b60200201518560006142cd565b61430691906152cd565b61247591906152cd565b60008061431d848461439c565b9050600061432b85826142ef565b9050600061434286600160200201518660016142cd565b9050600061435987600260200201518760026142cd565b90506143658480614da8565b6004614372858585613f23565b61437d906003614da8565b61438791906152e0565b61439191906152cd565b979650505050505050565b6000806143a884613759565b905060006143b584613759565b9050610c8482826143d0565b600061247560f884811c9084901c5b600080828411156143ec576143e583856152f4565b90506143f9565b6143f684846152f4565b90505b6123c98180614da8565b828054828255906000526020600020908101928215614465579160200282015b82811115614465578251825473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909116178255602090920191600190910190614423565b5061447192915061453c565b5090565b6040518061020001604052806010905b61448d6144c2565b8152602001906001900390816144855790505090565b6040518061020001604052806010906020820280368337509192915050565b60405180606001604052806003906020820280368337509192915050565b6040518061020001604052806010905b6144f86144c2565b8152602001906001900390816144f05790505090565b6040518061020001604052806010905b6145266144a3565b81526020019060019003908161451e5790505090565b5b80821115614471576000815560010161453d565b6001600160e01b03198116811461109157600080fd5b60006020828403121561457957600080fd5b813561247581614551565b60006020828403121561459657600080fd5b5035919050565b60005b838110156145b85781810151838201526020016145a0565b50506000910152565b600081518084526145d981602086016020860161459d565b601f01601f19169290920160200192915050565b60208152600061247560208301846145c1565b80356001600160a01b0381168114611f3857600080fd5b6000806040838503121561462a57600080fd5b61463383614600565b946020939093013593505050565b6000806040838503121561465457600080fd5b50508035926020909101359150565b60008083601f84011261467557600080fd5b50813567ffffffffffffffff81111561468d57600080fd5b6020830191508360208260051b85010111156146a857600080fd5b9250929050565b600080602083850312156146c257600080fd5b823567ffffffffffffffff8111156146d957600080fd5b6146e585828601614663565b90969095509350505050565b60006020828403121561470357600080fd5b61247582614600565b60008060006060848603121561472157600080fd5b61472a84614600565b925061473860208501614600565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff8111828210171561478157614781614748565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156147b0576147b0614748565b604052919050565b600067ffffffffffffffff8211156147d2576147d2614748565b5060051b60200190565b600067ffffffffffffffff8211156147f6576147f6614748565b50601f01601f191660200190565b600082601f83011261481557600080fd5b8135614828614823826147dc565b614787565b81815284602083860101111561483d57600080fd5b816020850160208301376000918101602001919091529392505050565b6000602080838503121561486d57600080fd5b823567ffffffffffffffff8082111561488557600080fd5b818501915085601f83011261489957600080fd5b81356148a7614823826147b8565b81815260059190911b830184019084810190888311156148c657600080fd5b8585015b838110156149ba578035858111156148e157600080fd5b86016060818c03601f190112156148f757600080fd5b6148ff61475e565b888201358781111561491057600080fd5b8201603f81018d1361492157600080fd5b89810135614931614823826147b8565b81815260059190911b8201604001908b8101908f83111561495157600080fd5b6040840193505b828410156149785761496984614600565b8252928c0192908c0190614958565b845250505060408201358982015260608201358781111561499857600080fd5b6149a68d8b83860101614804565b6040830152508452509186019186016148ca565b5098975050505050505050565b600080600080606085870312156149dd57600080fd5b843567ffffffffffffffff8111156149f457600080fd5b614a0087828801614663565b9095509350614a13905060208601614600565b9396929550929360400135925050565b6001600160f81b03198116811461109157600080fd5b803560ff81168114611f3857600080fd5b80358015158114611f3857600080fd5b600080600080600080600080610100898b031215614a7757600080fd5b67ffffffffffffffff808a351115614a8e57600080fd5b614a9b8b8b358c01614804565b985060208a013581811115614aaf57600080fd5b8a019050601f81018b13614ac257600080fd5b8035614ad0614823826147b8565b8082825260208201915060206060840285010192508d831115614af257600080fd5b6020840193505b82841015614b66578d601f850112614b1057600080fd5b614b1861475e565b808f606087011115614b2957600080fd5b855b60608701811015614b5057614b408135614a23565b8035835260209283019201614b2b565b5083525060609390930192602090910190614af9565b9950614b789250505060408a01614a39565b9550614b8660608a01614a4a565b979a969950949760808101359660a0820135965060c0820135955060e0909101359350915050565b8281526040602082015260006123c960408301846145c1565b60008060408385031215614bda57600080fd5b614be383614600565b9150614bf160208401614a4a565b90509250929050565b60008060008060808587031215614c1057600080fd5b614c1985614600565b9350614c2760208601614600565b925060408501359150606085013567ffffffffffffffff811115614c4a57600080fd5b614c5687828801614804565b91505092959194509250565b60008060408385031215614c7557600080fd5b614c7e83614600565b9150614bf160208401614600565b60006020808385031215614c9f57600080fd5b823567ffffffffffffffff811115614cb657600080fd5b8301601f81018513614cc757600080fd5b8035614cd5614823826147b8565b81815260059190911b82018301908381019087831115614cf457600080fd5b928401925b8284101561439157833582529284019290840190614cf9565b600080600060408486031215614d2757600080fd5b833567ffffffffffffffff811115614d3e57600080fd5b614d4a86828701614663565b909790965060209590950135949350505050565b600181811c90821680614d7257607f821691505b6020821081036133a457634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761094d5761094d614d92565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600060ff831680614dfe57614dfe614dd5565b8060ff84160691505092915050565b600082614e1c57614e1c614dd5565b500690565b6000823561023e19833603018112614e3857600080fd5b9190910192915050565b5b81811015610a535760008155600101614e43565b6000808335601e19843603018112614e6e57600080fd5b83018035915067ffffffffffffffff821115614e8957600080fd5b6020019150368190038213156146a857600080fd5b601f821115610de657806000526020600020601f840160051c81016020851015614ec55750805b614ed7601f850160051c830182614e42565b5050505050565b8160005b6010811015614eff57813583820155602090910190600101614ee2565b5050610200820135601082015560118101614f1e610220840184614e57565b67ffffffffffffffff811115614f3657614f36614748565b614f4a81614f448554614d5e565b85614e9e565b6000601f821160018114614f7e5760008315614f665750838201355b600019600385901b1c1916600184901b178555610fcc565b600085815260209020601f19841690835b82811015614faf5786850135825560209485019460019092019101614f8f565b5084821015614fcc5760001960f88660031b161c19848701351681555b50505050600190811b01909155505050565b600060018201614ff057614ff0614d92565b5060010190565b60008235603e19833603018112614e3857600080fd5b6000808335601e1984360301811261502457600080fd5b83018035915067ffffffffffffffff82111561503f57600080fd5b60200191506060810236038213156146a857600080fd5b816000805b600380821061506a575061509d565b833561507581614a23565b82821b91508060f81c821b60ff831b198516179350505060208301925060018101905061505b565b509091555050565b680100000000000000008311156150be576150be614748565b8054838255808410156150fe576000828152602090208481019082015b808210156150fb576150f06001830183614e42565b6001820191506150db565b50505b5060008181526020812083915b8581101561134b5761511d8383615056565b606092909201916001918201910161510b565b61513a8283614e57565b67ffffffffffffffff81111561515257615152614748565b61516081614f448554614d5e565b6000601f821160018114615194576000831561517c5750838201355b600019600385901b1c1916600184901b1785556151ee565b600085815260209020601f19841690835b828110156151c557868501358255602094850194600190920191016151a5565b50848210156151e25760001960f88660031b161c19848701351681555b505060018360011b0185555b505050506151ff602083018361500d565b6119cb8183600186016150a5565b815167ffffffffffffffff81111561522757615227614748565b61523b816152358454614d5e565b84614e9e565b602080601f83116001811461527057600084156152585750858301515b600019600386901b1c1916600185901b17855561134b565b600085815260208120601f198616915b8281101561529f57888601518255948401946001909101908401615280565b50858210156152bd5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b8082018082111561094d5761094d614d92565b6000826152ef576152ef614dd5565b500490565b8181038181111561094d5761094d614d92565b6000815161531981856020860161459d565b9290920192915050565b6000825161533581846020870161459d565b7f7b2274726169745f74797065223a22636f6c6f7220636f7272656374696f6e229201918252507f2c2276616c7565223a2274727565227d2c0000000000000000000000000000006020820152603101919050565b6000835161539c81846020880161459d565b7f7b2274726169745f74797065223a2267726964222c2276616c7565223a22000090830190815283516153d681601e84016020880161459d565b62089f4b60ea1b601e9290910191820152602101949350505050565b6000835161540481846020880161459d565b80830190507f7b2274726169745f74797065223a22736f75726365222c2276616c7565223a228152835161543f81602084016020880161459d565b62089f4b60ea1b60209290910191820152602301949350505050565b6000835161546d81846020880161459d565b80830190507f7b2274726169745f74797065223a2270616c65747465222c2276616c7565223a81527f2200000000000000000000000000000000000000000000000000000000000000602082015283516154ce81602184016020880161459d565b62089f4b60ea1b60219290910191820152602401949350505050565b600083516154fc81846020880161459d565b80830190507f7b2274726169745f74797065223a22636f6d70617269736f6e222c2276616c7581526332911d1160e11b6020820152835161554481602484016020880161459d565b7f227d00000000000000000000000000000000000000000000000000000000000060249290910191820152602601949350505050565b6000825161558c81846020870161459d565b7f5d00000000000000000000000000000000000000000000000000000000000000920191825250600101919050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b757466382c7b226e616d81526332911d1160e11b60208201526000845161560081602485016020890161459d565b7f222c22696d616765223a22646174613a696d6167652f7376672b786d6c3b62616024918401918201527f736536342c0000000000000000000000000000000000000000000000000000006044820152845161566381604984016020890161459d565b7f222c0000000000000000000000000000000000000000000000000000000000006049929091019182015283516156a181604b84016020880161459d565b7f7d00000000000000000000000000000000000000000000000000000000000000604b9290910191820152604c0195945050505050565b6000816156e7576156e7614d92565b506000190190565b6000835161570181846020880161459d565b83519083019061571581836020880161459d565b01949350505050565b60408152600061573160408301856145c1565b90508260208301529392505050565b60006020828403121561575257600080fd5b815167ffffffffffffffff81111561576957600080fd5b8201601f8101841361577a57600080fd5b8051615788614823826147dc565b81815285602083850101111561579d57600080fd5b610c8482602083016020860161459d565b60ff818116838216019081111561094d5761094d614d92565b81810360008312801583831316838312821617156125f7576125f7614d92565b6000826157f6576157f6614dd5565b600160ff1b82146000198414161561581057615810614d92565b500590565b600060ff83168061582857615828614dd5565b8060ff84160491505092915050565b7f3c7376672076696577426f783d2230203020000000000000000000000000000081526000885161586f816012850160208d0161459d565b7f200000000000000000000000000000000000000000000000000000000000000060129184019182015288516158ac816013840160208d0161459d565b7f222077696474683d2200000000000000000000000000000000000000000000006013929091019182015287516158ea81601c840160208c0161459d565b7f22206865696768743d2200000000000000000000000000000000000000000000601c92909101918201528651615928816026840160208b0161459d565b7f2220786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f602692909101918201527f7376672220786d6c6e733a786c696e6b3d22687474703a2f2f7777772e77332e60468201527f6f72672f313939392f786c696e6b223e3c646566733e3c7374796c653e696d6160668201527f6765207b696d6167652d72656e646572696e673a206f7074696d697a6553706560868201527f65643b696d6167652d72656e646572696e673a202d6d6f7a2d63726973702d6560a68201527f646765733b696d6167652d72656e646572696e673a202d6f2d63726973702d6560c68201527f646765733b696d6167652d72656e646572696e673a202d7765626b69742d6f7060e68201527f74696d697a652d636f6e74726173743b696d6167652d72656e646572696e673a6101068201527f206f7074696d697a652d636f6e74726173743b696d6167652d72656e646572696101268201527f6e673a2063726973702d65646765733b696d6167652d72656e646572696e673a6101468201527f20706978656c617465643b2d6d732d696e746572706f6c6174696f6e2d6d6f646101668201527f653a206e6561726573742d6e65696768626f723b7d3c2f7374796c653e3c2f646101868201527f6566733e3c696d6167652077696474683d2200000000000000000000000000006101a6820152615bc5615b9c615b96615b6d615b67615b3e6101b887018c615307565b7f707822206865696768743d2200000000000000000000000000000000000000008152600c0190565b89615307565b7f70782220687265663d22646174613a696d6167652f626d703b6261736536342c815260200190565b86615307565b7f22202f3e3c2f7376673e000000000000000000000000000000000000000000008152600a0190565b9a9950505050505050505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152615c0560808301846145c1565b9695505050505050565b600060208284031215615c2157600080fd5b815161247581614551565b600060ff821660ff8103615c4257615c42614d92565b60010192915050565b80820260008212600160ff1b84141615615c6757615c67614d92565b818105831482151761094d5761094d614d92565b8082018281126000831280158216821582161715615c9b57615c9b614d92565b505092915050565b6000600160ff1b8203615cb857615cb8614d92565b5060000390565b600082615cce57615cce614dd5565b50079056fea26469706673582212202b6cb9120f3225df8e17a5b8c32a4fd39c05da63c78224042d31730e5255db1764736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000072ff4bfc711800644fb21cf08b2e0d10958b9de7
-----Decoded View---------------
Arg [0] : inflate (address): 0x72Ff4BFc711800644fb21CF08b2E0D10958B9De7
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000072ff4bfc711800644fb21cf08b2e0d10958b9de7
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.