ERC-721
NFT
Overview
Max Total Supply
8,300 FLIP
Holders
2,844
Market
Volume (24H)
0.0001 ETH
Min Price (24H)
$0.11 @ 0.000033 ETH
Max Price (24H)
$0.11 @ 0.000033 ETH
Other Info
Token Contract
Balance
4 FLIPLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
This contract contains unverified libraries: BlitmapAnalysis
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
Flipmap
Compiler Version
v0.8.0+commit.c7dfd78e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "../../blitmaps/contracts/Blitmap.sol"; contract Flipmap is ERC721, ReentrancyGuard { uint256 public _tokenId = 1700; struct SVGCursor { uint8 x; uint8 y; string color1; string color2; string color3; string color4; } struct Colors { uint[4] r; uint[4] g; uint[4] b; } struct VariantParents { uint256 tokenIdA; uint256 tokenIdB; } mapping(uint256 => VariantParents) private _tokenParentIndex; mapping(bytes32 => bool) private _tokenPairs; mapping(address => uint256) private _creators; address sara = 0x00796e910Bd0228ddF4cd79e3f353871a61C351C; address lambo = 0xafBDEc0ba91FDFf03A91CbdF07392e6D72d43712; address dev = 0xE424E566BFc3f7aDDFfb17862637DD61e2da3bE2; Blitmap blitmap; address private _owner; modifier onlyOwner() { require(msg.sender == _owner); _; } constructor(address _blitAddress) ERC721("Flipmap", "FLIP") { _owner = msg.sender; blitmap = Blitmap(_blitAddress); } function transferOwner(address _newOwner) public onlyOwner { _owner = _newOwner; } function totalSupply() public view returns (uint256) { return _tokenId - 1700; } function savePairs(uint256[][] memory pairHashes) public onlyOwner { for(uint256 i=0; i<pairHashes.length; i++) { bytes32 pairHash = keccak256(abi.encodePacked(pairHashes[i][0], '-', pairHashes[i][1])); _tokenPairs[pairHash] = true; } } function mintVariant(uint256 tokenIdA, uint256 tokenIdB) public nonReentrant payable { require(msg.value == 0.03 ether); require(tokenIdA != tokenIdB, "b:08"); require(blitmap.tokenIsOriginal(tokenIdA) && blitmap.tokenIsOriginal(tokenIdB), "b:10"); // a given pair can only be minted once bytes32 pairHash = keccak256(abi.encodePacked(tokenIdA, '-', tokenIdB)); require(_tokenPairs[pairHash] == false, "b:11"); uint256 variantTokenId = _tokenId; _tokenId++; VariantParents memory parents; parents.tokenIdA = tokenIdA; parents.tokenIdB = tokenIdB; address creatorA = blitmap.tokenCreatorOf(tokenIdA); address creatorB = blitmap.tokenCreatorOf(tokenIdB); _tokenParentIndex[variantTokenId] = parents; _tokenPairs[pairHash] = true; _safeMint(msg.sender, variantTokenId); _creators[creatorA] += .0065625 ether; _creators[creatorB] += .0009375 ether; _creators[sara] += .0075 ether; _creators[lambo] += .0075 ether; _creators[dev] += .0075 ether; } function availableBalanceForCreator(address creatorAddress) public view returns (uint256) { return _creators[creatorAddress]; } function withdrawAvailableBalance() public nonReentrant { uint256 withdrawAmount = _creators[msg.sender]; _creators[msg.sender] = 0; payable(msg.sender).transfer(withdrawAmount); } function getByOwner(address owner) view public returns(uint256[] memory result) { result = new uint256[](balanceOf(owner)); uint256 resultIndex = 0; for (uint256 t = 0; t < _tokenId; t++) { if (_exists(t) && ownerOf(t) == owner) { result[resultIndex] = t; resultIndex++; } } } function pairIsTaken(uint256 tokenIdA, uint256 tokenIdB) public view returns (bool) { bytes32 pairHash = keccak256(abi.encodePacked(tokenIdA, '-', tokenIdB)); return _tokenPairs[pairHash]; } function currentTokenId() public view returns (uint256) { return _tokenId; } function tokenIsOriginal(uint256 tokenId) public view returns (bool) { if(tokenId < 1700) { return blitmap.tokenIsOriginal(tokenId); } return false; } function tokenDataOf(uint256 tokenId) public view returns (bytes memory) { if (tokenId < 1700) { return blitmap.tokenDataOf(tokenId); } bytes memory tokenParentData; if(_exists(tokenId)) { tokenParentData = blitmap.tokenDataOf(_tokenParentIndex[tokenId].tokenIdA); bytes memory tokenPaletteData = blitmap.tokenDataOf(_tokenParentIndex[tokenId].tokenIdB); for (uint8 i = 0; i < 12; ++i) { // overwrite palette data with parent B's palette data tokenParentData[i] = tokenPaletteData[i]; } } return tokenParentData; } function tokenParentsOf(uint256 tokenId) public view returns (uint256, uint256) { require(!tokenIsOriginal(tokenId)); return (_tokenParentIndex[tokenId].tokenIdA, _tokenParentIndex[tokenId].tokenIdB); } function uintToHexDigit(uint8 d) internal pure returns (bytes1) { if (0 <= d && d <= 9) { return bytes1(uint8(bytes1('0')) + d); } else if (10 <= uint8(d) && uint8(d) <= 15) { return bytes1(uint8(bytes1('a')) + d - 10); } revert(); } function uintToHexString(uint a) internal pure returns (string memory) { uint count = 0; uint b = a; while (b != 0) { count++; b /= 16; } bytes memory res = new bytes(count); for (uint i=0; i<count; ++i) { b = a % 16; res[count - i - 1] = uintToHexDigit(uint8(b)); a /= 16; } string memory str = string(res); if (bytes(str).length == 0) { return "00"; } else if (bytes(str).length == 1) { return string(abi.encodePacked("0", str)); } return str; } function byteToUint(bytes1 b) internal pure returns (uint) { return uint(uint8(b)); } function byteToHexString(bytes1 b) internal pure returns (string memory) { return uintToHexString(byteToUint(b)); } function bitTest(bytes1 aByte, uint8 index) internal pure returns (bool) { return uint8(aByte) >> index & 1 == 1; } function colorIndex(bytes1 aByte, uint8 index1, uint8 index2) internal pure returns (uint) { if (bitTest(aByte, index2) && bitTest(aByte, index1)) { return 3; } else if (bitTest(aByte, index2) && !bitTest(aByte, index1)) { return 2; } else if (!bitTest(aByte, index2) && bitTest(aByte, index1)) { return 1; } return 0; } function pixel4(string[32] memory lookup, SVGCursor memory pos) internal pure returns (string memory) { return string(abi.encodePacked( '<rect fill="', pos.color1, '" x="', lookup[pos.x], '" y="', lookup[pos.y], '" width="1.5" height="1.5" />', '<rect fill="', pos.color2, '" x="', lookup[pos.x + 1], '" y="', lookup[pos.y], '" width="1.5" height="1.5" />', string(abi.encodePacked( '<rect fill="', pos.color3, '" x="', lookup[pos.x + 2], '" y="', lookup[pos.y], '" width="1.5" height="1.5" />', '<rect fill="', pos.color4, '" x="', lookup[pos.x + 3], '" y="', lookup[pos.y], '" width="1.5" height="1.5" />' )) )); } function parentSvgDataOf(uint256 tokenIdA, uint256 tokenIdB) public view returns (string memory) { bytes memory tokenParentData = blitmap.tokenDataOf(tokenIdA); bytes memory tokenPaletteData = blitmap.tokenDataOf(tokenIdB); for (uint8 i = 0; i < 12; ++i) { // overwrite palette data with parent B's palette data tokenParentData[i] = tokenPaletteData[i]; } return tokenSvgData(tokenParentData); } function tokenSvgDataOf(uint256 tokenId) public view returns (string memory) { bytes memory data = tokenDataOf(tokenId); return tokenSvgData(data); } function tokenSvgData(bytes memory data) public pure returns (string memory) { string memory svgString = '<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 1000 1000"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32" shape-rendering="crispEdges"><g transform="translate(32, 0) scale(-1,1)">'; string[32] memory lookup = [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" ]; SVGCursor memory pos; string[4] memory colors = [ string(abi.encodePacked("#", byteToHexString(data[0]), byteToHexString(data[1]), byteToHexString(data[2]))), string(abi.encodePacked("#", byteToHexString(data[3]), byteToHexString(data[4]), byteToHexString(data[5]))), string(abi.encodePacked("#", byteToHexString(data[6]), byteToHexString(data[7]), byteToHexString(data[8]))), string(abi.encodePacked("#", byteToHexString(data[9]), byteToHexString(data[10]), byteToHexString(data[11]))) ]; string[8] memory p; for (uint i = 12; i < 268; i += 8) { pos.color1 = colors[colorIndex(data[i], 6, 7)]; pos.color2 = colors[colorIndex(data[i], 4, 5)]; pos.color3 = colors[colorIndex(data[i], 2, 3)]; pos.color4 = colors[colorIndex(data[i], 0, 1)]; p[0] = pixel4(lookup, pos); pos.x += 4; pos.color1 = colors[colorIndex(data[i + 1], 6, 7)]; pos.color2 = colors[colorIndex(data[i + 1], 4, 5)]; pos.color3 = colors[colorIndex(data[i + 1], 2, 3)]; pos.color4 = colors[colorIndex(data[i + 1], 0, 1)]; p[1] = pixel4(lookup, pos); pos.x += 4; pos.color1 = colors[colorIndex(data[i + 2], 6, 7)]; pos.color2 = colors[colorIndex(data[i + 2], 4, 5)]; pos.color3 = colors[colorIndex(data[i + 2], 2, 3)]; pos.color4 = colors[colorIndex(data[i + 2], 0, 1)]; p[2] = pixel4(lookup, pos); pos.x += 4; pos.color1 = colors[colorIndex(data[i + 3], 6, 7)]; pos.color2 = colors[colorIndex(data[i + 3], 4, 5)]; pos.color3 = colors[colorIndex(data[i + 3], 2, 3)]; pos.color4 = colors[colorIndex(data[i + 3], 0, 1)]; p[3] = pixel4(lookup, pos); pos.x += 4; pos.color1 = colors[colorIndex(data[i + 4], 6, 7)]; pos.color2 = colors[colorIndex(data[i + 4], 4, 5)]; pos.color3 = colors[colorIndex(data[i + 4], 2, 3)]; pos.color4 = colors[colorIndex(data[i + 4], 0, 1)]; p[4] = pixel4(lookup, pos); pos.x += 4; pos.color1 = colors[colorIndex(data[i + 5], 6, 7)]; pos.color2 = colors[colorIndex(data[i + 5], 4, 5)]; pos.color3 = colors[colorIndex(data[i + 5], 2, 3)]; pos.color4 = colors[colorIndex(data[i + 5], 0, 1)]; p[5] = pixel4(lookup, pos); pos.x += 4; pos.color1 = colors[colorIndex(data[i + 6], 6, 7)]; pos.color2 = colors[colorIndex(data[i + 6], 4, 5)]; pos.color3 = colors[colorIndex(data[i + 6], 2, 3)]; pos.color4 = colors[colorIndex(data[i + 6], 0, 1)]; p[6] = pixel4(lookup, pos); pos.x += 4; pos.color1 = colors[colorIndex(data[i + 7], 6, 7)]; pos.color2 = colors[colorIndex(data[i + 7], 4, 5)]; pos.color3 = colors[colorIndex(data[i + 7], 2, 3)]; pos.color4 = colors[colorIndex(data[i + 7], 0, 1)]; p[7] = pixel4(lookup, pos); pos.x += 4; svgString = string(abi.encodePacked(svgString, p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7])); if (pos.x >= 32) { pos.x = 0; pos.y += 1; } } svgString = string(abi.encodePacked(svgString, "</g></svg></svg>")); return svgString; } function tokenRGBColorsOf(uint256 tokenId) public view returns (BlitmapAnalysis.Colors memory) { return BlitmapAnalysis.tokenRGBColorsOf(tokenDataOf(tokenId)); } function tokenSlabsOf(uint256 tokenId) public view returns (string[4] memory) { bytes memory data = tokenDataOf(tokenId); BlitmapAnalysis.Colors memory rgb = BlitmapAnalysis.tokenRGBColorsOf(data); string[4] memory chars = [unicode"◢", unicode"◣", unicode"◤", unicode"◥"]; string[4] memory slabs; slabs[0] = chars[(rgb.r[0] + rgb.g[0] + rgb.b[0]) % 4]; slabs[1] = chars[(rgb.r[1] + rgb.g[1] + rgb.b[1]) % 4]; slabs[2] = chars[(rgb.r[2] + rgb.g[2] + rgb.b[2]) % 4]; slabs[3] = chars[(rgb.r[3] + rgb.g[3] + rgb.b[3]) % 4]; return slabs; } function tokenAffinityOf(uint256 tokenId) public view returns (string[3] memory) { return BlitmapAnalysis.tokenAffinityOf(tokenDataOf(tokenId)); } function makeAttributes(uint256 tokenId) public view returns (string memory attributes) { string[5] memory traits; uint256 parentA = _tokenParentIndex[tokenId].tokenIdA; uint256 parentB = _tokenParentIndex[tokenId].tokenIdB; traits[0] = '{"trait_type":"Type","value":"Flipling"}'; traits[1] = string(abi.encodePacked('{"trait_type":"Composition","value":"', blitmap.tokenNameOf(parentA), ' (#', toString(parentA), ')"}')); traits[2] = string(abi.encodePacked('{"trait_type":"Palette","value":"', blitmap.tokenNameOf(parentB), ' (#', toString(parentB), ')"}')); string[3] memory affinity = tokenAffinityOf(tokenId); traits[3] = string(abi.encodePacked('{"trait_type":"Affinity","value":"', affinity[0])); if(bytes(affinity[1]).length > 0) { traits[3] = string(abi.encodePacked(traits[3], ', ', affinity[1])); } if(bytes(affinity[2]).length > 0) { traits[3] = string(abi.encodePacked(traits[3], ', ', affinity[2])); } traits[3] = string(abi.encodePacked(traits[3], '"}')); string[4] memory slabs = tokenSlabsOf(tokenId); traits[4] = string(abi.encodePacked('{"trait_type":"Slabs","value":"', slabs[0], ' ', slabs[1], ' ', slabs[2], ' ', slabs[3], '"}')); attributes = string(abi.encodePacked(traits[0], ',', traits[1], ',', traits[2], ',', traits[3], ',', traits[4])); } function tokenURI(uint256 tokenId) override public view returns (string memory) { uint256 parentA = _tokenParentIndex[tokenId].tokenIdA; uint256 parentB = _tokenParentIndex[tokenId].tokenIdB; string memory name = string(abi.encodePacked('#', toString(tokenId), ' - ', blitmap.tokenNameOf(parentA), ' ', blitmap.tokenNameOf(parentB))); string memory description = 'Flipmaps are the lost 8,300 Blitmaps, only flipped.'; string memory image = string(abi.encodePacked('data:image/svg+xml;base64,', Base64.encode(bytes(tokenSvgDataOf(tokenId))))); string memory json = string(abi.encodePacked('{"name": "', name, '", "description": "', description, '", "image": "', image, '", "attributes": [', makeAttributes(tokenId), ']}')); return string(abi.encodePacked('data:application/json;base64,', Base64.encode(bytes(json)))); } function toString(uint256 value) public pure returns (string memory) { if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } } library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { uint256 len = data.length; if (len == 0) return ""; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((len + 2) / 3); // Add some extra buffer at the end bytes memory result = new bytes(encodedLen + 32); bytes memory table = TABLE; assembly { let tablePtr := add(table, 1) let resultPtr := add(result, 32) for { let i := 0 } lt(i, len) { } { i := add(i, 3) let input := and(mload(add(data, i)), 0xffffff) let out := mload(add(tablePtr, and(shr(18, input), 0x3F))) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF)) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF)) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(input, 0x3F))), 0xFF)) out := shl(224, out) mstore(resultPtr, out) resultPtr := add(resultPtr, 4) } switch mod(len, 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } mstore(result, encodedLen) } return string(result); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * 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, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @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. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * 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, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: Apache-2.0 /* Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2018 James Lockhart <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.8.0; /** * Strings Library * * In summary this is a simple library of string functions which make simple * string operations less tedious in solidity. * * Please be aware these functions can be quite gas heavy so use them only when * necessary not to clog the blockchain with expensive transactions. * * @author James Lockhart <[email protected]> */ library StringUtil { function titleCase(string memory _base) internal pure returns (string[] memory) { string[] memory components = split(_base, " "); for (uint8 i = 0; i < components.length; ++i) { if (length(components[i]) == 0) { continue; } string memory firstChar = substring(components[i], 1); string memory remainingChars = _substring(components[i], int(StringUtil.length(components[i]) - 1), 1); components[i] = string(abi.encodePacked(upper(firstChar), remainingChars)); } return components; } /** * Concat (High gas cost) * * Appends two strings together and returns a new value * * @param _base When being used for a data type this is the extended object * otherwise this is the string which will be the concatenated * prefix * @param _value The value to be the concatenated suffix * @return string The resulting string from combinging the base and value */ function concat(string memory _base, string memory _value) internal pure returns (string memory) { bytes memory _baseBytes = bytes(_base); bytes memory _valueBytes = bytes(_value); assert(_valueBytes.length > 0); string memory _tmpValue = new string(_baseBytes.length + _valueBytes.length); bytes memory _newValue = bytes(_tmpValue); uint i; uint j; for (i = 0; i < _baseBytes.length; i++) { _newValue[j++] = _baseBytes[i]; } for (i = 0; i < _valueBytes.length; i++) { _newValue[j++] = _valueBytes[i]; } return string(_newValue); } /** * Index Of * * Locates and returns the position of a character within a string * * @param _base When being used for a data type this is the extended object * otherwise this is the string acting as the haystack to be * searched * @param _value The needle to search for, at present this is currently * limited to one character * @return int The position of the needle starting from 0 and returning -1 * in the case of no matches found */ function indexOf(string memory _base, string memory _value) internal pure returns (int) { return _indexOf(_base, _value, 0); } /** * Index Of * * Locates and returns the position of a character within a string starting * from a defined offset * * @param _base When being used for a data type this is the extended object * otherwise this is the string acting as the haystack to be * searched * @param _value The needle to search for, at present this is currently * limited to one character * @param _offset The starting point to start searching from which can start * from 0, but must not exceed the length of the string * @return int The position of the needle starting from 0 and returning -1 * in the case of no matches found */ function _indexOf(string memory _base, string memory _value, uint _offset) internal pure returns (int) { bytes memory _baseBytes = bytes(_base); bytes memory _valueBytes = bytes(_value); assert(_valueBytes.length == 1); for (uint i = _offset; i < _baseBytes.length; i++) { if (_baseBytes[i] == _valueBytes[0]) { return int(i); } } return -1; } /** * Length * * Returns the length of the specified string * * @param _base When being used for a data type this is the extended object * otherwise this is the string to be measured * @return uint The length of the passed string */ function length(string memory _base) internal pure returns (uint) { bytes memory _baseBytes = bytes(_base); return _baseBytes.length; } /** * Sub String * * Extracts the beginning part of a string based on the desired length * * @param _base When being used for a data type this is the extended object * otherwise this is the string that will be used for * extracting the sub string from * @param _length The length of the sub string to be extracted from the base * @return string The extracted sub string */ function substring(string memory _base, int _length) internal pure returns (string memory) { return _substring(_base, _length, 0); } /** * Sub String * * Extracts the part of a string based on the desired length and offset. The * offset and length must not exceed the lenth of the base string. * * @param _base When being used for a data type this is the extended object * otherwise this is the string that will be used for * extracting the sub string from * @param _length The length of the sub string to be extracted from the base * @param _offset The starting point to extract the sub string from * @return string The extracted sub string */ function _substring(string memory _base, int _length, int _offset) internal pure returns (string memory) { bytes memory _baseBytes = bytes(_base); assert(uint(_offset + _length) <= _baseBytes.length); string memory _tmp = new string(uint(_length)); bytes memory _tmpBytes = bytes(_tmp); uint j = 0; for (uint i = uint(_offset); i < uint(_offset + _length); i++) { _tmpBytes[j++] = _baseBytes[i]; } return string(_tmpBytes); } /** * String Split (Very high gas cost) * * Splits a string into an array of strings based off the delimiter value. * Please note this can be quite a gas expensive function due to the use of * storage so only use if really required. * * @param _base When being used for a data type this is the extended object * otherwise this is the string value to be split. * @param _value The delimiter to split the string on which must be a single * character * @return splitArr An array of values split based off the delimiter, but * do not container the delimiter. */ function split(string memory _base, string memory _value) internal pure returns (string[] memory splitArr) { bytes memory _baseBytes = bytes(_base); uint _offset = 0; uint _splitsCount = 1; while (_offset < _baseBytes.length - 1) { int _limit = _indexOf(_base, _value, _offset); if (_limit == -1) break; else { _splitsCount++; _offset = uint(_limit) + 1; } } splitArr = new string[](_splitsCount); _offset = 0; _splitsCount = 0; while (_offset < _baseBytes.length - 1) { int _limit = _indexOf(_base, _value, _offset); if (_limit == - 1) { _limit = int(_baseBytes.length); } string memory _tmp = new string(uint(_limit) - _offset); bytes memory _tmpBytes = bytes(_tmp); uint j = 0; for (uint i = _offset; i < uint(_limit); i++) { _tmpBytes[j++] = _baseBytes[i]; } _offset = uint(_limit) + 1; splitArr[_splitsCount++] = string(_tmpBytes); } return splitArr; } /** * Compare To * * Compares the characters of two strings, to ensure that they have an * identical footprint * * @param _base When being used for a data type this is the extended object * otherwise this is the string base to compare against * @param _value The string the base is being compared to * @return bool Simply notates if the two string have an equivalent */ function compareTo(string memory _base, string memory _value) internal pure returns (bool) { bytes memory _baseBytes = bytes(_base); bytes memory _valueBytes = bytes(_value); if (_baseBytes.length != _valueBytes.length) { return false; } for (uint i = 0; i < _baseBytes.length; i++) { if (_baseBytes[i] != _valueBytes[i]) { return false; } } return true; } /** * Compare To Ignore Case (High gas cost) * * Compares the characters of two strings, converting them to the same case * where applicable to alphabetic characters to distinguish if the values * match. * * @param _base When being used for a data type this is the extended object * otherwise this is the string base to compare against * @param _value The string the base is being compared to * @return bool Simply notates if the two string have an equivalent value * discarding case */ function compareToIgnoreCase(string memory _base, string memory _value) internal pure returns (bool) { bytes memory _baseBytes = bytes(_base); bytes memory _valueBytes = bytes(_value); if (_baseBytes.length != _valueBytes.length) { return false; } for (uint i = 0; i < _baseBytes.length; i++) { if (_baseBytes[i] != _valueBytes[i] && _upper(_baseBytes[i]) != _upper(_valueBytes[i])) { return false; } } return true; } /** * Upper * * Converts all the values of a string to their corresponding upper case * value. * * @param _base When being used for a data type this is the extended object * otherwise this is the string base to convert to upper case * @return string */ function upper(string memory _base) internal pure returns (string memory) { bytes memory _baseBytes = bytes(_base); for (uint i = 0; i < _baseBytes.length; i++) { _baseBytes[i] = _upper(_baseBytes[i]); } return string(_baseBytes); } /** * Lower * * Converts all the values of a string to their corresponding lower case * value. * * @param _base When being used for a data type this is the extended object * otherwise this is the string base to convert to lower case * @return string */ function lower(string memory _base) internal pure returns (string memory) { bytes memory _baseBytes = bytes(_base); for (uint i = 0; i < _baseBytes.length; i++) { _baseBytes[i] = _lower(_baseBytes[i]); } return string(_baseBytes); } /** * Upper * * Convert an alphabetic character to upper case and return the original * value when not alphabetic * * @param _b1 The byte to be converted to upper case * @return bytes1 The converted value if the passed value was alphabetic * and in a lower case otherwise returns the original value */ function _upper(bytes1 _b1) private pure returns (bytes1) { if (_b1 >= 0x61 && _b1 <= 0x7A) { return bytes1(uint8(_b1) - 32); } return _b1; } /** * Lower * * Convert an alphabetic character to lower case and return the original * value when not alphabetic * * @param _b1 The byte to be converted to lower case * @return bytes1 The converted value if the passed value was alphabetic * and in a upper case otherwise returns the original value */ function _lower(bytes1 _b1) private pure returns (bytes1) { if (_b1 >= 0x41 && _b1 <= 0x5A) { return bytes1(uint8(_b1) + 32); } return _b1; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library BlitmapAnalysis { struct Colors { uint[4] r; uint[4] g; uint[4] b; } function byteToUint(bytes1 b) internal pure returns (uint) { return uint(uint8(b)); } function tokenRGBColorsOf(bytes memory data) public pure returns (Colors memory) { Colors memory rgb; rgb.r[0] = byteToUint(data[0]); rgb.g[0] = byteToUint(data[1]); rgb.b[0] = byteToUint(data[2]); rgb.r[1] = byteToUint(data[3]); rgb.g[1] = byteToUint(data[4]); rgb.b[1] = byteToUint(data[5]); rgb.r[2] = byteToUint(data[6]); rgb.g[2] = byteToUint(data[7]); rgb.b[2] = byteToUint(data[8]); rgb.r[3] = byteToUint(data[9]); rgb.g[3] = byteToUint(data[10]); rgb.b[3] = byteToUint(data[11]); return rgb; } function tokenSlabsOf(bytes memory data) public pure returns (string[4] memory) { Colors memory rgb = tokenRGBColorsOf(data); string[4] memory chars = ["◢", "◣", "◤", "◥"]; string[4] memory slabs; slabs[0] = chars[(rgb.r[0] + rgb.g[0] + rgb.b[0]) % 4]; slabs[1] = chars[(rgb.r[1] + rgb.g[1] + rgb.b[1]) % 4]; slabs[2] = chars[(rgb.r[2] + rgb.g[2] + rgb.b[2]) % 4]; slabs[3] = chars[(rgb.r[3] + rgb.g[3] + rgb.b[3]) % 4]; return slabs; } function tokenAffinityOf(bytes memory data) public pure returns (string[3] memory) { Colors memory rgb = tokenRGBColorsOf(data); uint r = rgb.r[0] + rgb.r[1] + rgb.r[2]; uint g = rgb.g[0] + rgb.g[1] + rgb.g[2]; uint b = rgb.b[0] + rgb.b[1] + rgb.b[2]; string[3] memory essences; uint8 offset; if (r >= g && r >= b) { essences[offset] = "Fire"; ++offset; if (g > 256) { essences[offset] = "Earth"; ++offset; } if (b > 256) { essences[offset] = "Water"; ++offset; } } else if (g >= r && g >= b) { essences[offset] = "Earth"; ++offset; if (r > 256) { essences[offset] = "Fire"; ++offset; } if (b > 256) { essences[offset] = "Water"; ++offset; } } else if (b >= r && b >= g) { essences[offset] = "Water"; ++offset; if (r > 256) { essences[offset] = "Fire"; ++offset; } if (g > 256) { essences[offset] = "Earth"; ++offset; } } if (offset == 1) { essences[0] = string(abi.encodePacked(essences[0], " III")); } else if (offset == 2) { essences[0] = string(abi.encodePacked(essences[0], " II")); essences[1] = string(abi.encodePacked(essences[1], " I")); } else if (offset == 3) { essences[0] = string(abi.encodePacked(essences[0], " I")); essences[1] = string(abi.encodePacked(essences[1], " I")); essences[2] = string(abi.encodePacked(essences[2], " I")); } return essences; } }
/* ______ _ _____ _____ | ___ \ | |_ _|_ _| | |_/ / | | | | | | ___ \ | | | | | | |_/ / |_____| |_ | | \____/\_____/\___/ \_/ ___ ___ ___ ______ | \/ | / _ \ | ___ \ | . . |/ /_\ \| |_/ / | |\/| || _ || __/ | | | || | | || | \_| |_/\_| |_/\_| by dom hofmann and friends */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./blitmap-analysis.sol"; import "./string-util.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; contract Blitmap is ERC721Enumerable { struct SVGCursor { uint8 x; uint8 y; string color1; string color2; string color3; string color4; } struct VariantParents { uint256 tokenIdA; uint256 tokenIdB; } struct Creator { string name; bool isAllowed; uint256 availableBalance; uint8 remainingMints; } struct TokenMetadata { string name; address creator; uint8 remainingVariants; } struct Colors { uint[4] r; uint[4] g; uint[4] b; } address private _owner; mapping (address => Creator) private _allowedList; event AddedToAllowedList(address indexed account); event RemovedFromAllowedList(address indexed account); event Published(); event MetadataChanged(uint256 indexed tokenId, TokenMetadata indexed newMetadata); mapping(uint256 => VariantParents) private _tokenParentIndex; mapping(bytes32 => bool) private _tokenPairs; bytes[] private _tokenDataIndex; TokenMetadata[] private _tokenMetadataIndex; string private _uriPrefix; uint8 private _numOriginals; uint8 private constant _maxNumOriginals = 128; uint8 private constant _maxNumVariants = 16; bool public published; modifier onlyOwner() { require(msg.sender == _owner); _; } modifier onlyAllowed() { require(isAllowed(msg.sender)); _; } constructor() ERC721("Blitmap", "BLIT") { _owner = msg.sender; published = false; setBaseURI("https://api.blitmap.com/v1/metadata/"); addAllowed(msg.sender, "sara", 128); } function _baseURI() override internal view virtual returns (string memory) { return _uriPrefix; } function setBaseURI(string memory prefix) public onlyOwner { _uriPrefix = prefix; } function addAllowed(address _address, string memory name, uint8 allowedMints) public onlyOwner { Creator memory creator; creator.name = name; creator.isAllowed = true; creator.remainingMints = allowedMints; _allowedList[_address] = creator; emit AddedToAllowedList(_address); } function changeMetadataOf(uint256 tokenId, TokenMetadata memory newMetadata) public onlyOwner { require(published == false, "b:01"); // only allow changes prior to publishing _tokenMetadataIndex[tokenId] = newMetadata; emit MetadataChanged(tokenId, newMetadata); } function publish() public onlyOwner { published = true; emit Published(); } /* function removeAllowed(address _address) public onlyOwner { _allowedList[_address].isAllowed = false; emit RemovedFromAllowedList(_address); } */ function isAllowed(address _address) public view returns (bool) { return _allowedList[_address].isAllowed == true; } function creatorNameOf(address _address) public view returns (string memory) { return _allowedList[_address].name; } function mintOriginal(bytes memory tokenData, string memory name) public onlyAllowed { require(published == false, "b:01"); require(_numOriginals < _maxNumOriginals, "b:03"); require(tokenData.length == 268, "b:04"); // any combination of 268 bytes is technically a valid blit require(bytes(name).length > 0 && bytes(name).length < 11, "b:05"); require(_allowedList[msg.sender].remainingMints > 0, "b:06"); uint256 tokenId = totalSupply(); _tokenDataIndex.push(tokenData); TokenMetadata memory metadata; metadata.name = name; metadata.remainingVariants = _maxNumVariants; metadata.creator = msg.sender; _allowedList[msg.sender].remainingMints--; _tokenMetadataIndex.push(metadata); _numOriginals++; _safeMint(msg.sender, tokenId); } /* function remainingNumOriginals() public view returns (uint8) { return _maxNumOriginals - _numOriginals; } function remainingNumMints(address _address) public view returns (uint8) { return _allowedList[_address].remainingMints; } function allowedNumOriginals() public pure returns (uint8) { return _maxNumOriginals; } function allowedNumVariants() public pure returns (uint8) { return _maxNumVariants; } function availableBalanceForCreator(address creatorAddress) public view returns (uint256) { return _allowedList[creatorAddress].availableBalance; } function withdrawAvailableBalance() public onlyAllowed { uint256 withdrawAmount = _allowedList[msg.sender].availableBalance; _allowedList[msg.sender].availableBalance = 0; payable(msg.sender).transfer(withdrawAmount); } */ function mintVariant(uint256 tokenIdA, uint256 tokenIdB) public payable { require(msg.value == 0.1 ether); require(published == true, "b:02"); require(_exists(tokenIdA) && _exists(tokenIdB), "b:07"); require(tokenIdA != tokenIdB, "b:08"); require(tokenRemainingVariantsOf(tokenIdA) > 0, "b:09"); require(tokenIsOriginal(tokenIdA) && tokenIsOriginal(tokenIdB), "b:10"); // a given pair can only be minted once bytes32 pairHash = keccak256(abi.encodePacked(tokenIdA, tokenIdB)); require(_tokenPairs[pairHash] == false, "b:11"); uint256 variantTokenId = totalSupply(); VariantParents memory parents; parents.tokenIdA = tokenIdA; parents.tokenIdB = tokenIdB; _tokenMetadataIndex[tokenIdA].remainingVariants--; // don't need to write real data here since we can assemble sibling data from parent data _tokenDataIndex.push(hex"00"); TokenMetadata memory metadata; metadata.name = ""; metadata.remainingVariants = 0; metadata.creator = msg.sender; _tokenMetadataIndex.push(metadata); _tokenParentIndex[variantTokenId] = parents; _tokenPairs[pairHash] = true; _safeMint(msg.sender, variantTokenId); _allowedList[_tokenMetadataIndex[tokenIdA].creator].availableBalance += 0.0875 ether; _allowedList[_tokenMetadataIndex[tokenIdB].creator].availableBalance += 0.0125 ether; } function tokenNameOf(uint256 tokenId) public view returns (string memory) { string memory name; if (tokenIsOriginal(tokenId)) { name = _tokenMetadataIndex[tokenId].name; } else { VariantParents memory parents = _tokenParentIndex[tokenId]; name = string(abi.encodePacked(tokenNameOf(parents.tokenIdA), " ", tokenNameOf(parents.tokenIdB))); } string[] memory components = StringUtil.titleCase(name); string memory titleCaseName; for (uint8 i = 0; i < components.length; ++i) { if (i == 0) { titleCaseName = components[i]; } else { titleCaseName = string(abi.encodePacked(titleCaseName, " ", components[i])); } } return titleCaseName; } function tokenIsOriginal(uint256 tokenId) public view returns (bool) { return (_tokenDataIndex[tokenId].length == 268); } function tokenParentsOf(uint256 tokenId) public view returns (uint256, uint256) { require(!tokenIsOriginal(tokenId)); return (_tokenParentIndex[tokenId].tokenIdA, _tokenParentIndex[tokenId].tokenIdB); } function tokenCreatorOf(uint256 tokenId) public view returns (address) { return _tokenMetadataIndex[tokenId].creator; } /* function tokenCreatorNameOf(uint256 tokenId) public view returns (string memory) { return _allowedList[tokenCreatorOf(tokenId)].name; } */ function tokenDataOf(uint256 tokenId) public view returns (bytes memory) { bytes memory data = _tokenDataIndex[tokenId]; if (tokenIsOriginal(tokenId)) { return data; } bytes memory tokenParentData = _tokenDataIndex[_tokenParentIndex[tokenId].tokenIdA]; bytes memory tokenPaletteData = _tokenDataIndex[_tokenParentIndex[tokenId].tokenIdB]; for (uint8 i = 0; i < 12; ++i) { // overwrite palette data with parent B's palette data tokenParentData[i] = tokenPaletteData[i]; } return tokenParentData; } function tokenRemainingVariantsOf(uint256 tokenId) public view returns (uint256) { if (!tokenIsOriginal(tokenId)) { return 0; } return _tokenMetadataIndex[tokenId].remainingVariants; } function uintToHexDigit(uint8 d) internal pure returns (bytes1) { if (0 <= d && d <= 9) { return bytes1(uint8(bytes1('0')) + d); } else if (10 <= uint8(d) && uint8(d) <= 15) { return bytes1(uint8(bytes1('a')) + d - 10); } revert(); } function uintToHexString(uint a) internal pure returns (string memory) { uint count = 0; uint b = a; while (b != 0) { count++; b /= 16; } bytes memory res = new bytes(count); for (uint i=0; i<count; ++i) { b = a % 16; res[count - i - 1] = uintToHexDigit(uint8(b)); a /= 16; } string memory str = string(res); if (bytes(str).length == 0) { return "00"; } else if (bytes(str).length == 1) { return string(abi.encodePacked("0", str)); } return str; } function byteToUint(bytes1 b) internal pure returns (uint) { return uint(uint8(b)); } function byteToHexString(bytes1 b) internal pure returns (string memory) { return uintToHexString(byteToUint(b)); } function bitTest(bytes1 aByte, uint8 index) internal pure returns (bool) { return uint8(aByte) >> index & 1 == 1; } function colorIndex(bytes1 aByte, uint8 index1, uint8 index2) internal pure returns (uint) { if (bitTest(aByte, index2) && bitTest(aByte, index1)) { return 3; } else if (bitTest(aByte, index2) && !bitTest(aByte, index1)) { return 2; } else if (!bitTest(aByte, index2) && bitTest(aByte, index1)) { return 1; } return 0; } function pixel4(string[32] memory lookup, SVGCursor memory pos) internal pure returns (string memory) { return string(abi.encodePacked( '<rect fill="', pos.color1, '" x="', lookup[pos.x], '" y="', lookup[pos.y], '" width="1.5" height="1.5" />', '<rect fill="', pos.color2, '" x="', lookup[pos.x + 1], '" y="', lookup[pos.y], '" width="1.5" height="1.5" />', string(abi.encodePacked( '<rect fill="', pos.color3, '" x="', lookup[pos.x + 2], '" y="', lookup[pos.y], '" width="1.5" height="1.5" />', '<rect fill="', pos.color4, '" x="', lookup[pos.x + 3], '" y="', lookup[pos.y], '" width="1.5" height="1.5" />' )) )); } function tokenSvgDataOf(uint256 tokenId) public view returns (string memory) { string memory svgString = '<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32">'; string[32] memory lookup = [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" ]; SVGCursor memory pos; bytes memory data = tokenDataOf(tokenId); string[4] memory colors = [ string(abi.encodePacked("#", byteToHexString(data[0]), byteToHexString(data[1]), byteToHexString(data[2]))), string(abi.encodePacked("#", byteToHexString(data[3]), byteToHexString(data[4]), byteToHexString(data[5]))), string(abi.encodePacked("#", byteToHexString(data[6]), byteToHexString(data[7]), byteToHexString(data[8]))), string(abi.encodePacked("#", byteToHexString(data[9]), byteToHexString(data[10]), byteToHexString(data[11]))) ]; string[8] memory p; for (uint i = 12; i < 268; i += 8) { pos.color1 = colors[colorIndex(data[i], 6, 7)]; pos.color2 = colors[colorIndex(data[i], 4, 5)]; pos.color3 = colors[colorIndex(data[i], 2, 3)]; pos.color4 = colors[colorIndex(data[i], 0, 1)]; p[0] = pixel4(lookup, pos); pos.x += 4; pos.color1 = colors[colorIndex(data[i + 1], 6, 7)]; pos.color2 = colors[colorIndex(data[i + 1], 4, 5)]; pos.color3 = colors[colorIndex(data[i + 1], 2, 3)]; pos.color4 = colors[colorIndex(data[i + 1], 0, 1)]; p[1] = pixel4(lookup, pos); pos.x += 4; pos.color1 = colors[colorIndex(data[i + 2], 6, 7)]; pos.color2 = colors[colorIndex(data[i + 2], 4, 5)]; pos.color3 = colors[colorIndex(data[i + 2], 2, 3)]; pos.color4 = colors[colorIndex(data[i + 2], 0, 1)]; p[2] = pixel4(lookup, pos); pos.x += 4; pos.color1 = colors[colorIndex(data[i + 3], 6, 7)]; pos.color2 = colors[colorIndex(data[i + 3], 4, 5)]; pos.color3 = colors[colorIndex(data[i + 3], 2, 3)]; pos.color4 = colors[colorIndex(data[i + 3], 0, 1)]; p[3] = pixel4(lookup, pos); pos.x += 4; pos.color1 = colors[colorIndex(data[i + 4], 6, 7)]; pos.color2 = colors[colorIndex(data[i + 4], 4, 5)]; pos.color3 = colors[colorIndex(data[i + 4], 2, 3)]; pos.color4 = colors[colorIndex(data[i + 4], 0, 1)]; p[4] = pixel4(lookup, pos); pos.x += 4; pos.color1 = colors[colorIndex(data[i + 5], 6, 7)]; pos.color2 = colors[colorIndex(data[i + 5], 4, 5)]; pos.color3 = colors[colorIndex(data[i + 5], 2, 3)]; pos.color4 = colors[colorIndex(data[i + 5], 0, 1)]; p[5] = pixel4(lookup, pos); pos.x += 4; pos.color1 = colors[colorIndex(data[i + 6], 6, 7)]; pos.color2 = colors[colorIndex(data[i + 6], 4, 5)]; pos.color3 = colors[colorIndex(data[i + 6], 2, 3)]; pos.color4 = colors[colorIndex(data[i + 6], 0, 1)]; p[6] = pixel4(lookup, pos); pos.x += 4; pos.color1 = colors[colorIndex(data[i + 7], 6, 7)]; pos.color2 = colors[colorIndex(data[i + 7], 4, 5)]; pos.color3 = colors[colorIndex(data[i + 7], 2, 3)]; pos.color4 = colors[colorIndex(data[i + 7], 0, 1)]; p[7] = pixel4(lookup, pos); pos.x += 4; svgString = string(abi.encodePacked(svgString, p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7])); if (pos.x >= 32) { pos.x = 0; pos.y += 1; } } svgString = string(abi.encodePacked(svgString, "</svg>")); return svgString; } function tokenRGBColorsOf(uint256 tokenId) public view returns (BlitmapAnalysis.Colors memory) { return BlitmapAnalysis.tokenRGBColorsOf(tokenDataOf(tokenId)); } function tokenSlabsOf(uint256 tokenId) public view returns (string[4] memory) { return BlitmapAnalysis.tokenSlabsOf(tokenDataOf(tokenId)); } function tokenAffinityOf(uint256 tokenId) public view returns (string[3] memory) { return BlitmapAnalysis.tokenAffinityOf(tokenDataOf(tokenId)); } } /* errors: 01: This can only be done before the project has been published. 02: This can only be done after the project has been published. 03: The maximum number of originals has been minted. 04: Blitmaps must be exactly 268 bytes. 05: Blitmaps must have a title must be between 1 and 10 characters. 06: You have reached your quota for minted originals. 07: One of the originals in this combination doesn't exist. 08: An original cannot be combined with itself. 09: This original has sold out all of its siblings. 10: Both blitmaps in this combination must be originals. 11: A sibling with this combination already exists. */
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "istanbul", "libraries": { "/Users/Shared/Code/experimental/flipmaps/blitmaps/contracts/blitmap-analysis.sol": { "BlitmapAnalysis": "0x7d2e3eba0119f38cca36a1cf4aeb9ffd38bf9210" } }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_blitAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"_tokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"creatorAddress","type":"address"}],"name":"availableBalanceForCreator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"getByOwner","outputs":[{"internalType":"uint256[]","name":"result","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"makeAttributes","outputs":[{"internalType":"string","name":"attributes","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenIdA","type":"uint256"},{"internalType":"uint256","name":"tokenIdB","type":"uint256"}],"name":"mintVariant","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"tokenIdA","type":"uint256"},{"internalType":"uint256","name":"tokenIdB","type":"uint256"}],"name":"pairIsTaken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenIdA","type":"uint256"},{"internalType":"uint256","name":"tokenIdB","type":"uint256"}],"name":"parentSvgDataOf","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[][]","name":"pairHashes","type":"uint256[][]"}],"name":"savePairs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"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":"value","type":"uint256"}],"name":"toString","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenAffinityOf","outputs":[{"internalType":"string[3]","name":"","type":"string[3]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenDataOf","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenIsOriginal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenParentsOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenRGBColorsOf","outputs":[{"components":[{"internalType":"uint256[4]","name":"r","type":"uint256[4]"},{"internalType":"uint256[4]","name":"g","type":"uint256[4]"},{"internalType":"uint256[4]","name":"b","type":"uint256[4]"}],"internalType":"struct BlitmapAnalysis.Colors","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenSlabsOf","outputs":[{"internalType":"string[4]","name":"","type":"string[4]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"tokenSvgData","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenSvgDataOf","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":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAvailableBalance","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040526106a4600755600b80546001600160a01b031990811672796e910bd0228ddf4cd79e3f353871a61c351c17909155600c8054821673afbdec0ba91fdff03a91cbdf07392e6d72d43712179055600d805490911673e424e566bfc3f7addffb17862637dd61e2da3be21790553480156200007c57600080fd5b50604051620057f5380380620057f58339810160408190526200009f91620001e2565b60408051808201825260078152660466c69706d61760cc1b6020808301918252835180850190945260048452630464c49560e41b908401528151919291620000ea916000916200013c565b508051620001009060019060208401906200013c565b5050600160065550600f8054336001600160a01b031991821617909155600e80549091166001600160a01b03929092169190911790556200024f565b8280546200014a9062000212565b90600052602060002090601f0160209004810192826200016e5760008555620001b9565b82601f106200018957805160ff1916838001178555620001b9565b82800160010185558215620001b9579182015b82811115620001b95782518255916020019190600101906200019c565b50620001c7929150620001cb565b5090565b5b80821115620001c75760008155600101620001cc565b600060208284031215620001f4578081fd5b81516001600160a01b03811681146200020b578182fd5b9392505050565b6002810460018216806200022757607f821691505b602082108114156200024957634e487b7160e01b600052602260045260246000fd5b50919050565b615596806200025f6000396000f3fe6080604052600436106101f85760003560e01c80636900a3ae1161010d578063a78d070f116100a0578063c0da9bcd1161006f578063c0da9bcd146105c1578063c87b56dd146105e1578063d3488e5014610601578063e985e9c51461062f578063fa2b71771461064f576101f8565b8063a78d070f1461054c578063b11113591461056c578063b88d4fde14610581578063bc04666b146105a1576101f8565b806395d89b41116100dc57806395d89b41146104ca57806399fae037146104df5780639f6b040b1461050c578063a22cb4651461052c576101f8565b80636900a3ae1461044a57806370a082311461046a5780638e13a1461461048a57806394cd4ca5146104aa576101f8565b806323b872dd11610190578063379c51311161015f578063379c51311461039d57806342842e0e146103ca578063459a03cd146103ea5780634fb2e45d1461040a5780636352211e1461042a576101f8565b806323b872dd1461031b578063248225141461033b57806327511ec41461035057806327be17a31461037d576101f8565b8063081812fc116101cc578063081812fc146102a4578063095ea7b3146102d157806311242aa3146102f357806318160ddd14610306576101f8565b80629a9b7b146101fd57806301ffc9a7146102285780630631b9451461025557806306fdde0314610282575b600080fd5b34801561020957600080fd5b5061021261066f565b60405161021f9190615146565b60405180910390f35b34801561023457600080fd5b50610248610243366004614111565b610675565b60405161021f9190614cba565b34801561026157600080fd5b50610275610270366004614261565b6106bd565b60405161021f9190614be8565b34801561028e57600080fd5b50610297610758565b60405161021f9190614cc5565b3480156102b057600080fd5b506102c46102bf366004614261565b6107ea565b60405161021f9190614b97565b3480156102dd57600080fd5b506102f16102ec366004613f54565b610836565b005b6102f1610301366004614279565b6108ce565b34801561031257600080fd5b50610212610d32565b34801561032757600080fd5b506102f1610336366004613e7e565b610d49565b34801561034757600080fd5b50610212610d81565b34801561035c57600080fd5b5061037061036b366004614261565b610d87565b60405161021f9190615105565b34801561038957600080fd5b50610297610398366004614149565b610e1f565b3480156103a957600080fd5b506103bd6103b8366004613e0e565b611e4f565b60405161021f9190614c76565b3480156103d657600080fd5b506102f16103e5366004613e7e565b611f3f565b3480156103f657600080fd5b50610297610405366004614261565b611f5a565b34801561041657600080fd5b506102f1610425366004613e0e565b61225d565b34801561043657600080fd5b506102c4610445366004614261565b612296565b34801561045657600080fd5b50610297610465366004614261565b6122cb565b34801561047657600080fd5b50610212610485366004613e0e565b6123ed565b34801561049657600080fd5b506102126104a5366004613e0e565b612431565b3480156104b657600080fd5b506102976104c5366004614279565b61244c565b3480156104d657600080fd5b506102976125fc565b3480156104eb57600080fd5b506104ff6104fa366004614261565b61260b565b60405161021f9190614c35565b34801561051857600080fd5b50610248610527366004614261565b6128e8565b34801561053857600080fd5b506102f1610547366004613f27565b612983565b34801561055857600080fd5b50610297610567366004614261565b612a51565b34801561057857600080fd5b506102f1612a70565b34801561058d57600080fd5b506102f161059c366004613ebe565b612ae2565b3480156105ad57600080fd5b506102486105bc366004614279565b612b21565b3480156105cd57600080fd5b506102976105dc366004614261565b612b67565b3480156105ed57600080fd5b506102976105fc366004614261565b612dc4565b34801561060d57600080fd5b5061062161061c366004614261565b612fc5565b60405161021f92919061514f565b34801561063b57600080fd5b5061024861064a366004613e46565b612ff7565b34801561065b57600080fd5b506102f161066a366004613f7f565b613025565b60075490565b60006001600160e01b031982166380ac58cd60e01b14806106a657506001600160e01b03198216635b5e139f60e01b145b806106b557506106b582613141565b90505b919050565b6106c5613be0565b737d2e3eba0119f38cca36a1cf4aeb9ffd38bf921063910bbd816106e884612b67565b6040518263ffffffff1660e01b81526004016107049190614cc5565b60006040518083038186803b15801561071c57600080fd5b505af4158015610730573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106b59190810190614061565b606060008054610767906152a6565b80601f0160208091040260200160405190810160405280929190818152602001828054610793906152a6565b80156107e05780601f106107b5576101008083540402835291602001916107e0565b820191906000526020600020905b8154815290600101906020018083116107c357829003601f168201915b5050505050905090565b60006107f58261315a565b61081a5760405162461bcd60e51b815260040161081190614f89565b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600061084182612296565b9050806001600160a01b0316836001600160a01b031614156108755760405162461bcd60e51b81526004016108119061501e565b806001600160a01b0316610887613177565b6001600160a01b031614806108a357506108a38161064a613177565b6108bf5760405162461bcd60e51b815260040161081190614e64565b6108c9838361317b565b505050565b600260065414156108f15760405162461bcd60e51b8152600401610811906150ce565b6002600655666a94d74f430000341461090957600080fd5b808214156109295760405162461bcd60e51b815260040161081190614cd8565b600e54604051639f6b040b60e01b81526001600160a01b0390911690639f6b040b90610959908590600401615146565b60206040518083038186803b15801561097157600080fd5b505afa158015610985573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a991906140f5565b8015610a305750600e54604051639f6b040b60e01b81526001600160a01b0390911690639f6b040b906109e0908490600401615146565b60206040518083038186803b1580156109f857600080fd5b505afa158015610a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3091906140f5565b610a4c5760405162461bcd60e51b81526004016108119061505f565b60008282604051602001610a61929190614b7f565b60408051601f1981840301815291815281516020928301206000818152600990935291205490915060ff1615610aa95760405162461bcd60e51b815260040161081190614dfa565b600780549081906000610abb836152e1565b9190505550610ac8613c07565b84815260208101849052600e546040516306daaebd60e01b81526000916001600160a01b0316906306daaebd90610b03908990600401615146565b60206040518083038186803b158015610b1b57600080fd5b505afa158015610b2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b539190613e2a565b600e546040516306daaebd60e01b81529192506000916001600160a01b03909116906306daaebd90610b89908990600401615146565b60206040518083038186803b158015610ba157600080fd5b505afa158015610bb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd99190613e2a565b600085815260086020908152604080832087518155828801516001918201558984526009909252909120805460ff191690911790559050610c1a33856131e9565b6001600160a01b0382166000908152600a6020526040812080546617508f1956a8009290610c499084906151d0565b90915550506001600160a01b0381166000908152600a602052604081208054660354a6ba7a18009290610c7d9084906151d0565b9091555050600b546001600160a01b03166000908152600a602052604081208054661aa535d3d0c0009290610cb39084906151d0565b9091555050600c546001600160a01b03166000908152600a602052604081208054661aa535d3d0c0009290610ce99084906151d0565b9091555050600d546001600160a01b03166000908152600a602052604081208054661aa535d3d0c0009290610d1f9084906151d0565b9091555050600160065550505050505050565b60006106a4600754610d449190615240565b905090565b610d5a610d54613177565b82613203565b610d765760405162461bcd60e51b81526004016108119061507d565b6108c9838383613280565b60075481565b610d8f613c21565b737d2e3eba0119f38cca36a1cf4aeb9ffd38bf921063a1ff2af9610db284612b67565b6040518263ffffffff1660e01b8152600401610dce9190614cc5565b6101806040518083038186803b158015610de757600080fd5b505af4158015610dfb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b591906141f2565b6060600060405180610140016040528061011781526020016153d76101179139604080516104408101825260016104008201818152600360fc1b610420840152825282518084018452818152603160f81b6020828101919091528084019190915283518085018552828152601960f91b818301528385015283518085018552828152603360f81b81830152606084015283518085018552828152600d60fa1b81830152608084015283518085018552828152603560f81b8183015260a084015283518085018552828152601b60f91b8183015260c084015283518085018552828152603760f81b8183015260e084015283518085018552828152600760fb1b8183015261010084015283518085018552918252603960f81b8282015261012083019190915282518084018452600280825261031360f41b828401526101408401919091528351808501855281815261313160f01b818401526101608401528351808501855281815261189960f11b818401526101808401528351808501855281815261313360f01b818401526101a084015283518085018552818152610c4d60f21b818401526101c08401528351808501855281815261313560f01b818401526101e08401528351808501855281815261189b60f11b818401526102008401528351808501855281815261313760f01b818401526102208401528351808501855281815261062760f31b818401526102408401528351808501855281815261313960f01b818401526102608401528351808501855281815261032360f41b818401526102808401528351808501855281815261323160f01b818401526102a08401528351808501855281815261191960f11b818401526102c08401528351808501855281815261323360f01b818401526102e084015283518085018552818152610c8d60f21b818401526103008401528351808501855281815261323560f01b818401526103208401528351808501855281815261191b60f11b818401526103408401528351808501855281815261323760f01b818401526103608401528351808501855281815261064760f31b818401526103808401528351808501855281815261323960f01b818401526103a08401528351808501855281815261033360f41b818401526103c08401528351808501909452835261333160f01b908301526103e0810191909152909150611193613c53565b600060405180608001604052806111d8886000815181106111c457634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b0319166133ad565b6111fc896001815181106111c457634e487b7160e01b600052603260045260246000fd5b6112208a6002815181106111c457634e487b7160e01b600052603260045260246000fd5b60405160200161123293929190614a31565b604051602081830303815290604052815260200161126a886003815181106111c457634e487b7160e01b600052603260045260246000fd5b61128e896004815181106111c457634e487b7160e01b600052603260045260246000fd5b6112b28a6005815181106111c457634e487b7160e01b600052603260045260246000fd5b6040516020016112c493929190614a31565b60405160208183030381529060405281526020016112fc886006815181106111c457634e487b7160e01b600052603260045260246000fd5b611320896007815181106111c457634e487b7160e01b600052603260045260246000fd5b6113448a6008815181106111c457634e487b7160e01b600052603260045260246000fd5b60405160200161135693929190614a31565b604051602081830303815290604052815260200161138e886009815181106111c457634e487b7160e01b600052603260045260246000fd5b6113b289600a815181106111c457634e487b7160e01b600052603260045260246000fd5b6113d68a600b815181106111c457634e487b7160e01b600052603260045260246000fd5b6040516020016113e893929190614a31565b6040516020818303038152906040528152509050611404613c8f565b600c5b61010c811015611e22578261144d89838151811061143557634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b031916600660076133c0565b6004811061146b57634e487b7160e01b600052603260045260246000fd5b60200201518460400181905250826114b489838151811061149c57634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b031916600460056133c0565b600481106114d257634e487b7160e01b600052603260045260246000fd5b602002015184606001819052508261151b89838151811061150357634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b031916600260036133c0565b6004811061153957634e487b7160e01b600052603260045260246000fd5b602002015184608001819052508261158289838151811061156a57634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b031916600060016133c0565b600481106115a057634e487b7160e01b600052603260045260246000fd5b602002015160a08501526115b48585613447565b8252835160049085906115c89083906151e8565b60ff16905250826115fc896115de8460016151d0565b8151811061143557634e487b7160e01b600052603260045260246000fd5b6004811061161a57634e487b7160e01b600052603260045260246000fd5b6020020151604085015282611652896116348460016151d0565b8151811061149c57634e487b7160e01b600052603260045260246000fd5b6004811061167057634e487b7160e01b600052603260045260246000fd5b60200201516060850152826116a88961168a8460016151d0565b8151811061150357634e487b7160e01b600052603260045260246000fd5b600481106116c657634e487b7160e01b600052603260045260246000fd5b60200201516080850152826116fe896116e08460016151d0565b8151811061156a57634e487b7160e01b600052603260045260246000fd5b6004811061171c57634e487b7160e01b600052603260045260246000fd5b602002015160a08501526117308585613447565b6020830152835160049085906117479083906151e8565b60ff169052508261175d896115de8460026151d0565b6004811061177b57634e487b7160e01b600052603260045260246000fd5b6020020151604085015282611795896116348460026151d0565b600481106117b357634e487b7160e01b600052603260045260246000fd5b60200201516060850152826117cd8961168a8460026151d0565b600481106117eb57634e487b7160e01b600052603260045260246000fd5b6020020151608085015282611805896116e08460026151d0565b6004811061182357634e487b7160e01b600052603260045260246000fd5b602002015160a08501526118378585613447565b60408301528351600490859061184e9083906151e8565b60ff1690525082611864896115de8460036151d0565b6004811061188257634e487b7160e01b600052603260045260246000fd5b602002015160408501528261189c896116348460036151d0565b600481106118ba57634e487b7160e01b600052603260045260246000fd5b60200201516060850152826118d48961168a8460036151d0565b600481106118f257634e487b7160e01b600052603260045260246000fd5b602002015160808501528261190c896116e08460036151d0565b6004811061192a57634e487b7160e01b600052603260045260246000fd5b602002015160a085015261193e8585613447565b6060830152835160049085906119559083906151e8565b60ff169052508261196b896115de8460046151d0565b6004811061198957634e487b7160e01b600052603260045260246000fd5b60200201516040850152826119a3896116348460046151d0565b600481106119c157634e487b7160e01b600052603260045260246000fd5b60200201516060850152826119db8961168a8460046151d0565b600481106119f957634e487b7160e01b600052603260045260246000fd5b6020020151608085015282611a13896116e08460046151d0565b60048110611a3157634e487b7160e01b600052603260045260246000fd5b602002015160a0850152611a458585613447565b608083015283516004908590611a5c9083906151e8565b60ff1690525082611a72896115de8460056151d0565b60048110611a9057634e487b7160e01b600052603260045260246000fd5b6020020151604085015282611aaa896116348460056151d0565b60048110611ac857634e487b7160e01b600052603260045260246000fd5b6020020151606085015282611ae28961168a8460056151d0565b60048110611b0057634e487b7160e01b600052603260045260246000fd5b6020020151608085015282611b1a896116e08460056151d0565b60048110611b3857634e487b7160e01b600052603260045260246000fd5b602002015160a0850152611b4c8585613447565b60a083015283516004908590611b639083906151e8565b60ff1690525082611b79896115de8460066151d0565b60048110611b9757634e487b7160e01b600052603260045260246000fd5b6020020151604085015282611bb1896116348460066151d0565b60048110611bcf57634e487b7160e01b600052603260045260246000fd5b6020020151606085015282611be98961168a8460066151d0565b60048110611c0757634e487b7160e01b600052603260045260246000fd5b6020020151608085015282611c21896116e08460066151d0565b60048110611c3f57634e487b7160e01b600052603260045260246000fd5b602002015160a0850152611c538585613447565b60c083015283516004908590611c6a9083906151e8565b60ff1690525082611c80896115de8460076151d0565b60048110611c9e57634e487b7160e01b600052603260045260246000fd5b6020020151604085015282611cb8896116348460076151d0565b60048110611cd657634e487b7160e01b600052603260045260246000fd5b6020020151606085015282611cf08961168a8460076151d0565b60048110611d0e57634e487b7160e01b600052603260045260246000fd5b6020020151608085015282611d28896116e08460076151d0565b60048110611d4657634e487b7160e01b600052603260045260246000fd5b602002015160a0850152611d5a8585613447565b60e083015283516004908590611d719083906151e8565b60ff169052508582600060200201518360016020020151846002602002015185600360200201518660046020020151876005602002015188600660200201518960076020020151604051602001611dd099989796959493929190614350565b60405160208183030381529060405295506020846000015160ff1610611e10576000845260208401805160019190611e099083906151e8565b60ff169052505b611e1b6008826151d0565b9050611407565b5084604051602001611e3491906144a7565b60408051808303601f19018152919052979650505050505050565b6060611e5a826123ed565b6001600160401b03811115611e7f57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611ea8578160200160208202803683370190505b5090506000805b600754811015611f3857611ec28161315a565b8015611ee75750836001600160a01b0316611edc82612296565b6001600160a01b0316145b15611f265780838381518110611f0d57634e487b7160e01b600052603260045260246000fd5b602090810291909101015281611f22816152e1565b9250505b80611f30816152e1565b915050611eaf565b5050919050565b6108c983838360405180602001604052806000815250612ae2565b6060611f64613caa565b60008381526008602090815260409182902080546001909101548351606081019094526028808552919390929091906153af908301398352600e546040516338c9319960e21b81526001600160a01b039091169063e324c66490611fcc908590600401615146565b60006040518083038186803b158015611fe457600080fd5b505afa158015611ff8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261202091908101906141c0565b612029836122cb565b60405160200161203a9291906146e7565b60408051601f198184030181529190528360016020020152600e546040516338c9319960e21b81526001600160a01b039091169063e324c66490612082908490600401615146565b60006040518083038186803b15801561209a57600080fd5b505afa1580156120ae573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526120d691908101906141c0565b6120df826122cb565b6040516020016120f0929190614666565b60408051808303601f19018152918152840152600061210e866106bd565b805160405191925061212291602001614616565b60408051808303601f1901815291905260608501526020810151511561217157606084015160208281015160405161215b939201614501565b60408051808303601f1901815291905260608501525b604081015151156121ad5760608401516040808301519051612197929190602001614501565b60408051808303601f1901815291905260608501525b60608401516040516121c291906020016144db565b60408051808303601f19018152919052606085015260006121e28761260b565b805160208083015160408085015160608601519151959650612208959293909201614567565b60408051808303601f190181529181526080870182905286516020808901518984015160608b015194516122429694959294919301614411565b60405160208183030381529060405295505050505050919050565b600f546001600160a01b0316331461227457600080fd5b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600260205260408120546001600160a01b0316806106b55760405162461bcd60e51b815260040161081190614f0b565b6060816122f057506040805180820190915260018152600360fc1b60208201526106b8565b8160005b811561231a5780612304816152e1565b91506123139050600a8361520d565b91506122f4565b6000816001600160401b0381111561234257634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561236c576020820181803683370190505b5090505b84156123e557612381600183615240565b915061238e600a8661531c565b6123999060306151d0565b60f81b8183815181106123bc57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506123de600a8661520d565b9450612370565b949350505050565b60006001600160a01b0382166124155760405162461bcd60e51b815260040161081190614ec1565b506001600160a01b031660009081526003602052604090205490565b6001600160a01b03166000908152600a602052604090205490565b600e5460405163c0da9bcd60e01b81526060916000916001600160a01b039091169063c0da9bcd90612482908790600401615146565b60006040518083038186803b15801561249a57600080fd5b505afa1580156124ae573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526124d6919081019061417b565b600e5460405163c0da9bcd60e01b81529192506000916001600160a01b039091169063c0da9bcd9061250c908790600401615146565b60006040518083038186803b15801561252457600080fd5b505afa158015612538573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612560919081019061417b565b905060005b600c8160ff1610156125e957818160ff168151811061259457634e487b7160e01b600052603260045260246000fd5b602001015160f81c60f81b838260ff16815181106125c257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506125e2816152fc565b9050612565565b506125f382610e1f565b95945050505050565b606060018054610767906152a6565b612613613cc4565b600061261e83612b67565b90506000737d2e3eba0119f38cca36a1cf4aeb9ffd38bf921063a1ff2af9836040518263ffffffff1660e01b81526004016126599190614cc5565b6101806040518083038186803b15801561267257600080fd5b505af4158015612686573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126aa91906141f2565b6040805160c08101825260036080820181815262714bd160e91b60a084015282528251808401845281815262e297a360e81b60208281019190915280840191909152835180850185528281526238a5e960ea1b8183015283850152835180850190945290835262e297a560e81b90830152606081019190915290915061272e613cc4565b6040830151516020840151518451518492600492909161274e91906151d0565b61275891906151d0565b612762919061531c565b6004811061278057634e487b7160e01b600052603260045260246000fd5b6020908102919091015182526040840151810151848201518201518551909201518492600492916127b191906151d0565b6127bb91906151d0565b6127c5919061531c565b600481106127e357634e487b7160e01b600052603260045260246000fd5b602090810291909101518282015260408481015101519084015183916004916002602002015186516040015161281991906151d0565b61282391906151d0565b61282d919061531c565b6004811061284b57634e487b7160e01b600052603260045260246000fd5b602002015181600260200201526040830151829060049060036020020151856020015160036004811061288e57634e487b7160e01b600052603260045260246000fd5b60200201518651606001516128a391906151d0565b6128ad91906151d0565b6128b7919061531c565b600481106128d557634e487b7160e01b600052603260045260246000fd5b6020020151606082015295945050505050565b60006106a482101561297b57600e54604051639f6b040b60e01b81526001600160a01b0390911690639f6b040b90612924908590600401615146565b60206040518083038186803b15801561293c57600080fd5b505afa158015612950573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061297491906140f5565b90506106b8565b506000919050565b61298b613177565b6001600160a01b0316826001600160a01b031614156129bc5760405162461bcd60e51b815260040161081190614dc3565b80600560006129c9613177565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155612a0d613177565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051612a459190614cba565b60405180910390a35050565b60606000612a5e83612b67565b9050612a6981610e1f565b9392505050565b60026006541415612a935760405162461bcd60e51b8152600401610811906150ce565b6002600655336000818152600a6020526040808220805490839055905190929183156108fc02918491818181858888f19350505050158015612ad9573d6000803e3d6000fd5b50506001600655565b612af3612aed613177565b83613203565b612b0f5760405162461bcd60e51b81526004016108119061507d565b612b1b84848484613627565b50505050565b6000808383604051602001612b37929190614b7f565b60408051808303601f1901815291815281516020928301206000908152600990925290205460ff16949350505050565b60606106a4821015612bf757600e5460405163c0da9bcd60e01b81526001600160a01b039091169063c0da9bcd90612ba3908590600401615146565b60006040518083038186803b158015612bbb57600080fd5b505afa158015612bcf573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612974919081019061417b565b6060612c028361315a565b156106b557600e546000848152600860205260409081902054905163c0da9bcd60e01b81526001600160a01b039092169163c0da9bcd91612c4591600401615146565b60006040518083038186803b158015612c5d57600080fd5b505afa158015612c71573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c99919081019061417b565b600e5460008581526008602052604080822060010154905163c0da9bcd60e01b815293945090926001600160a01b039092169163c0da9bcd91612cde91600401615146565b60006040518083038186803b158015612cf657600080fd5b505afa158015612d0a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612d32919081019061417b565b905060005b600c8160ff161015612dbb57818160ff1681518110612d6657634e487b7160e01b600052603260045260246000fd5b602001015160f81c60f81b838260ff1681518110612d9457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612db4816152fc565b9050612d37565b50509050919050565b60008181526008602052604081208054600190910154606092612de6856122cb565b600e546040516338c9319960e21b81526001600160a01b039091169063e324c66490612e16908790600401615146565b60006040518083038186803b158015612e2e57600080fd5b505afa158015612e42573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612e6a91908101906141c0565b600e546040516338c9319960e21b81526001600160a01b039091169063e324c66490612e9a908790600401615146565b60006040518083038186803b158015612eb257600080fd5b505afa158015612ec6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612eee91908101906141c0565b604051602001612f0093929190614a87565b60408051601f198184030181526060830190915260338083529092506000919061552e602083013990506000612f3d612f3888612a51565b61365a565b604051602001612f4d9190614b3a565b60405160208183030381529060405290506000838383612f6c8b611f5a565b604051602001612f7f949392919061495a565b6040516020818303038152906040529050612f998161365a565b604051602001612fa99190614af5565b6040516020818303038152906040529650505050505050919050565b600080612fd1836128e8565b15612fdb57600080fd5b5050600090815260086020526040902080546001909101549091565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b600f546001600160a01b0316331461303c57600080fd5b60005b815181101561313d57600082828151811061306a57634e487b7160e01b600052603260045260246000fd5b602002602001015160008151811061309257634e487b7160e01b600052603260045260246000fd5b60200260200101518383815181106130ba57634e487b7160e01b600052603260045260246000fd5b60200260200101516001815181106130e257634e487b7160e01b600052603260045260246000fd5b60200260200101516040516020016130fb929190614b7f565b60408051601f198184030181529181528151602092830120600090815260099092529020805460ff191660011790555080613135816152e1565b91505061303f565b5050565b6001600160e01b031981166301ffc9a760e01b14919050565b6000908152600260205260409020546001600160a01b0316151590565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906131b082612296565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b61313d8282604051806020016040528060008152506137cd565b600061320e8261315a565b61322a5760405162461bcd60e51b815260040161081190614e18565b600061323583612296565b9050806001600160a01b0316846001600160a01b031614806132705750836001600160a01b0316613265846107ea565b6001600160a01b0316145b806123e557506123e58185612ff7565b826001600160a01b031661329382612296565b6001600160a01b0316146132b95760405162461bcd60e51b815260040161081190614fd5565b6001600160a01b0382166132df5760405162461bcd60e51b815260040161081190614d7f565b6132ea8383836108c9565b6132f560008261317b565b6001600160a01b038316600090815260036020526040812080546001929061331e908490615240565b90915550506001600160a01b038216600090815260036020526040812080546001929061334c9084906151d0565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60606106b56133bb83613800565b613806565b60006133cc8483613975565b80156133dd57506133dd8484613975565b156133ea57506003612a69565b6133f48483613975565b801561340757506134058484613975565b155b1561341457506002612a69565b61341e8483613975565b15801561343057506134308484613975565b1561343d57506001612a69565b5060009392505050565b6060816040015183836000015160ff166020811061347557634e487b7160e01b600052603260045260246000fd5b602002015184846020015160ff16602081106134a157634e487b7160e01b600052603260045260246000fd5b60200201516060850151855187906134ba9060016151e8565b60ff16602081106134db57634e487b7160e01b600052603260045260246000fd5b602002015187876020015160ff166020811061350757634e487b7160e01b600052603260045260246000fd5b6020020151608088015188518a906135209060026151e8565b60ff166020811061354157634e487b7160e01b600052603260045260246000fd5b60200201518a8a6020015160ff166020811061356d57634e487b7160e01b600052603260045260246000fd5b602002015160a08b01518b518d906135869060036151e8565b60ff16602081106135a757634e487b7160e01b600052603260045260246000fd5b60200201518d8d6020015160ff16602081106135d357634e487b7160e01b600052603260045260246000fd5b60200201516040516020016135ed9695949392919061476c565b60408051601f198184030181529082905261361097969594939291602001614868565b604051602081830303815290604052905092915050565b613632848484613280565b61363e8484848461398a565b612b1b5760405162461bcd60e51b815260040161081190614cf6565b80516060908061367a5750506040805160208101909152600081526106b8565b600060036136898360026151d0565b613693919061520d565b61369e906004615221565b905060006136ad8260206151d0565b6001600160401b038111156136d257634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156136fc576020820181803683370190505b50905060006040518060600160405280604081526020016154ee604091399050600181016020830160005b86811015613788576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b835260049092019101613727565b5060038606600181146137a257600281146137b3576137bf565b613d3d60f01b6001198301526137bf565b603d60f81b6000198301525b505050918152949350505050565b6137d78383613aa5565b6137e4600084848461398a565b6108c95760405162461bcd60e51b815260040161081190614cf6565b60f81c90565b60606000825b8015613832578161381c816152e1565b925061382b905060108261520d565b905061380c565b6000826001600160401b0381111561385a57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015613884576020820181803683370190505b50905060005b838110156139115761389d60108761531c565b92506138a883613b84565b8260016138b58488615240565b6138bf9190615240565b815181106138dd57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506138ff60108761520d565b955061390a816152e1565b905061388a565b50805181906139405760405180604001604052806002815260200161030360f41b8152509450505050506106b8565b8051600114156125f3578060405160200161395b919061453e565b6040516020818303038152906040529450505050506106b8565b600160f883901c60ff83161c81161492915050565b600061399e846001600160a01b0316613bda565b15613a9a57836001600160a01b031663150b7a026139ba613177565b8786866040518563ffffffff1660e01b81526004016139dc9493929190614bab565b602060405180830381600087803b1580156139f657600080fd5b505af1925050508015613a26575060408051601f3d908101601f19168201909252613a239181019061412d565b60015b613a80573d808015613a54576040519150601f19603f3d011682016040523d82523d6000602084013e613a59565b606091505b508051613a785760405162461bcd60e51b815260040161081190614cf6565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506123e5565b506001949350505050565b6001600160a01b038216613acb5760405162461bcd60e51b815260040161081190614f54565b613ad48161315a565b15613af15760405162461bcd60e51b815260040161081190614d48565b613afd600083836108c9565b6001600160a01b0382166000908152600360205260408120805460019290613b269084906151d0565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600060098260ff1611613ba657613b9c8260306151e8565b60f81b90506106b8565b8160ff16600a11158015613bbe5750600f8260ff1611155b156101f857600a613bd08360616151e8565b613b9c9190615257565b3b151590565b60405180606001604052806003905b6060815260200190600190039081613bef5790505090565b604051806040016040528060008152602001600081525090565b6040518060600160405280613c34613cde565b8152602001613c41613cde565b8152602001613c4e613cde565b905290565b6040518060c00160405280600060ff168152602001600060ff168152602001606081526020016060815260200160608152602001606081525090565b60408051610100810190915260608152600760208201613bef565b6040805160a0810190915260608152600460208201613bef565b604080516080810190915260608152600360208201613bef565b60405180608001604052806004906020820280368337509192915050565b6000613d0f613d0a846151a9565b61515d565b9050828152838383011115613d2357600080fd5b612a6983602083018461527a565b600082601f830112613d41578081fd5b604051608081018181106001600160401b0382111715613d6357613d6361535c565b604052808360808101861015613d77578384fd5b835b6004811015613d98578151835260209283019290910190600101613d79565b509195945050505050565b600082601f830112613db3578081fd5b8135613dc1613d0a826151a9565b818152846020838601011115613dd5578283fd5b816020850160208301379081016020019190915292915050565b600082601f830112613dff578081fd5b612a6983835160208501613cfc565b600060208284031215613e1f578081fd5b8135612a6981615372565b600060208284031215613e3b578081fd5b8151612a6981615372565b60008060408385031215613e58578081fd5b8235613e6381615372565b91506020830135613e7381615372565b809150509250929050565b600080600060608486031215613e92578081fd5b8335613e9d81615372565b92506020840135613ead81615372565b929592945050506040919091013590565b60008060008060808587031215613ed3578182fd5b8435613ede81615372565b93506020850135613eee81615372565b92506040850135915060608501356001600160401b03811115613f0f578182fd5b613f1b87828801613da3565b91505092959194509250565b60008060408385031215613f39578182fd5b8235613f4481615372565b91506020830135613e738161538a565b60008060408385031215613f66578182fd5b8235613f7181615372565b946020939093013593505050565b60006020808385031215613f91578182fd5b82356001600160401b03811115613fa6578283fd5b8301601f81018513613fb6578283fd5b8035613fc4613d0a82615186565b81815283810190838501865b8481101561405357813586018a603f820112613fea578889fd5b878101356040613ffc613d0a83615186565b808382528b820191508285018f848e8702880101111561401a578d8efd5b8d95505b8486101561403c578035835260019590950194918c01918c0161401e565b508852505050938701935090860190600101613fd0565b509098975050505050505050565b60006020808385031215614073578182fd5b82516001600160401b0380821115614089578384fd5b818501915085601f83011261409c578384fd5b6040516060810181811083821117156140b7576140b761535c565b60405290508082855b60038110156140e8576140d68983518701613def565b845292850192908501906001016140c0565b5090979650505050505050565b600060208284031215614106578081fd5b8151612a698161538a565b600060208284031215614122578081fd5b8135612a6981615398565b60006020828403121561413e578081fd5b8151612a6981615398565b60006020828403121561415a578081fd5b81356001600160401b0381111561416f578182fd5b6123e584828501613da3565b60006020828403121561418c578081fd5b81516001600160401b038111156141a1578182fd5b8201601f810184136141b1578182fd5b6123e584825160208401613cfc565b6000602082840312156141d1578081fd5b81516001600160401b038111156141e6578182fd5b6123e584828501613def565b60006101808284031215614204578081fd5b604051606081018181106001600160401b03821117156142265761422661535c565b6040526142338484613d31565b81526142428460808501613d31565b6020820152614255846101008501613d31565b60408201529392505050565b600060208284031215614272578081fd5b5035919050565b6000806040838503121561428b578182fd5b50508035926020909101359150565b8060005b6004811015612b1b57815184526020938401939091019060010161429e565b600081518084526142d581602086016020860161527a565b601f01601f19169290920160200192915050565b600081516142fb81856020860161527a565b9290920192915050565b6411103c9e9160d91b815260050190565b7f222077696474683d22312e3522206865696768743d22312e3522202f3e0000008152601d0190565b6411103c1e9160d91b815260050190565b60008a51614362818460208f0161527a565b8a516143748183860160208f0161527a565b8a519184010190614389818360208e0161527a565b895161439b8183850160208e0161527a565b89519290910101906143b1818360208c0161527a565b87516143c38183850160208c0161527a565b87519290910101906143d9818360208a0161527a565b85516143eb8183850160208a0161527a565b855192909101019061440181836020880161527a565b019b9a5050505050505050505050565b60008651614423818460208b0161527a565b8083019050600b60fa1b8082528751614443816001850160208c0161527a565b600192019182018190528651614460816002850160208b0161527a565b60029201918201819052855161447d816003850160208a0161527a565b6003920191820152835161449881600484016020880161527a565b01600401979650505050505050565b600082516144b981846020870161527a565b6f1e17b39f1e17b9bb339f1e17b9bb339f60811b920191825250601001919050565b600082516144ed81846020870161527a565b61227d60f01b920191825250600201919050565b6000835161451381846020880161527a565b61016160f51b908301908152835161453281600284016020880161527a565b01600201949350505050565b6000600360fc1b8252825161455a81600185016020870161527a565b9190910160010192915050565b60007f7b2274726169745f74797065223a22536c616273222c2276616c7565223a22008252855160206145a082601f8601838b0161527a565b8184019150600160fd1b80601f84015287516145c181848601858c0161527a565b808401935050808284015286516145de8160218601858b0161527a565b602193019283015284516145f8816022850184890161527a565b61227d60f01b60229390910192830152506024019695505050505050565b60007f7b2274726169745f74797065223a22416666696e697479222c2276616c7565228252611d1160f11b6020830152825161465981602285016020870161527a565b9190910160220192915050565b60007f7b2274726169745f74797065223a2250616c65747465222c2276616c7565223a8252601160f91b602083015283516146a881602185016020880161527a565b6220282360e81b60219184019182015283516146cb81602484016020880161527a565b6229227d60e81b60249290910191820152602701949350505050565b60007f7b2274726169745f74797065223a22436f6d706f736974696f6e222c2276616c8252643ab2911d1160d91b6020830152835161472d81602585016020880161527a565b6220282360e81b602591840191820152835161475081602884016020880161527a565b6229227d60e81b60289290910191820152602b01949350505050565b60006b1e3932b1ba103334b6361e9160a11b808352885161479481600c860160208d0161527a565b6411103c1e9160d91b600c91850191820181905289516147bb816011850160208e0161527a565b6411103c9e9160d91b6011939091019283015288516147e1816016850160208d0161527a565b8083019250507f222077696474683d22312e3522206865696768743d22312e3522202f3e00000060168301528260338301528751925061482883603f840160208b0161527a565b828201925080603f840152505061485b61485661485061484b60448501896142e9565b614305565b866142e9565b614316565b9998505050505050505050565b60006b1e3932b1ba103334b6361e9160a11b808352895161489081600c860160208e0161527a565b6411103c1e9160d91b600c9185019182015289516148b5816011840160208e0161527a565b6411103c9e9160d91b6011929091019182015288516148db816016840160208d0161527a565b8082019150507f222077696474683d22312e3522206865696768743d22312e3522202f3e00000060168201528160338201528751915061492282603f830160208b0161527a565b61494b61485061485661494561484b61493f603f8888010161433f565b8c6142e9565b896142e9565b9b9a5050505050505050505050565b693d913730b6b2911d101160b11b8152845160009061498081600a850160208a0161527a565b72111610113232b9b1b934b83a34b7b7111d101160691b600a9184019182015285516149b381601d840160208a0161527a565b6c1116101134b6b0b3b2911d101160991b601d929091019182015284516149e181602a84016020890161527a565b71222c202261747472696275746573223a205b60701b602a92909101918201528351614a1481603c84016020880161527a565b615d7d60f01b603c9290910191820152603e019695505050505050565b6000602360f81b82528451614a4d81600185016020890161527a565b845190830190614a6481600184016020890161527a565b8451910190614a7a81600184016020880161527a565b0160010195945050505050565b6000602360f81b82528451614aa381600185016020890161527a565b6201016960ed1b6001918401918201528451614ac681600484016020890161527a565b600160fd1b600492909101918201528351614ae881600584016020880161527a565b0160050195945050505050565b60007f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000082528251614b2d81601d85016020870161527a565b91909101601d0192915050565b60007f646174613a696d6167652f7376672b786d6c3b6261736536342c00000000000082528251614b7281601a85016020870161527a565b91909101601a0192915050565b918252602d60f81b6020830152602182015260410190565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614bde908301846142bd565b9695505050505050565b60208082526000906080830183820185845b6003811015614c2957601f19878503018352614c178483516142bd565b93509184019190840190600101614bfa565b50919695505050505050565b602080825260009060a0830183820185845b6004811015614c2957601f19878503018352614c648483516142bd565b93509184019190840190600101614c47565b6020808252825182820181905260009190848201906040850190845b81811015614cae57835183529284019291840191600101614c92565b50909695505050505050565b901515815260200190565b600060208252612a6960208301846142bd565b6020808252600490820152630c47460760e31b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b602080825260049082015263623a313160e01b604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b60208082526029908201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460408201526832b73a103a37b5b2b760b91b606082015260800190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b6020808252600490820152630623a31360e41b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60006101808201905061511982845161429a565b602083015161512b608084018261429a565b50604083015161513f61010084018261429a565b5092915050565b90815260200190565b918252602082015260400190565b6040518181016001600160401b038111828210171561517e5761517e61535c565b604052919050565b60006001600160401b0382111561519f5761519f61535c565b5060209081020190565b60006001600160401b038211156151c2576151c261535c565b50601f01601f191660200190565b600082198211156151e3576151e3615330565b500190565b600060ff821660ff84168060ff0382111561520557615205615330565b019392505050565b60008261521c5761521c615346565b500490565b600081600019048311821515161561523b5761523b615330565b500290565b60008282101561525257615252615330565b500390565b600060ff821660ff84168082101561527157615271615330565b90039392505050565b60005b8381101561529557818101518382015260200161527d565b83811115612b1b5750506000910152565b6002810460018216806152ba57607f821691505b602082108114156152db57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156152f5576152f5615330565b5060010190565b600060ff821660ff81141561531357615313615330565b60010192915050565b60008261532b5761532b615346565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461538757600080fd5b50565b801515811461538757600080fd5b6001600160e01b03198116811461538757600080fdfe7b2274726169745f74797065223a2254797065222c2276616c7565223a22466c69706c696e67227d3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f737667222076657273696f6e3d22312e31222076696577426f783d2230203020313030302031303030223e3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f737667222076657273696f6e3d22312e31222076696577426f783d22302030203332203332222073686170652d72656e646572696e673d2263726973704564676573223e3c67207472616e73666f726d3d227472616e736c6174652833322c203029207363616c65282d312c3129223e4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f466c69706d6170732061726520746865206c6f737420382c33303020426c69746d6170732c206f6e6c7920666c69707065642ea26469706673582212206719d74675956745c194f0ffdcfa1c8beb0d92e4d81cc877047e947c40dd653a64736f6c634300080000330000000000000000000000008d04a8c79ceb0889bdd12acdf3fa9d207ed3ff63
Deployed Bytecode
0x6080604052600436106101f85760003560e01c80636900a3ae1161010d578063a78d070f116100a0578063c0da9bcd1161006f578063c0da9bcd146105c1578063c87b56dd146105e1578063d3488e5014610601578063e985e9c51461062f578063fa2b71771461064f576101f8565b8063a78d070f1461054c578063b11113591461056c578063b88d4fde14610581578063bc04666b146105a1576101f8565b806395d89b41116100dc57806395d89b41146104ca57806399fae037146104df5780639f6b040b1461050c578063a22cb4651461052c576101f8565b80636900a3ae1461044a57806370a082311461046a5780638e13a1461461048a57806394cd4ca5146104aa576101f8565b806323b872dd11610190578063379c51311161015f578063379c51311461039d57806342842e0e146103ca578063459a03cd146103ea5780634fb2e45d1461040a5780636352211e1461042a576101f8565b806323b872dd1461031b578063248225141461033b57806327511ec41461035057806327be17a31461037d576101f8565b8063081812fc116101cc578063081812fc146102a4578063095ea7b3146102d157806311242aa3146102f357806318160ddd14610306576101f8565b80629a9b7b146101fd57806301ffc9a7146102285780630631b9451461025557806306fdde0314610282575b600080fd5b34801561020957600080fd5b5061021261066f565b60405161021f9190615146565b60405180910390f35b34801561023457600080fd5b50610248610243366004614111565b610675565b60405161021f9190614cba565b34801561026157600080fd5b50610275610270366004614261565b6106bd565b60405161021f9190614be8565b34801561028e57600080fd5b50610297610758565b60405161021f9190614cc5565b3480156102b057600080fd5b506102c46102bf366004614261565b6107ea565b60405161021f9190614b97565b3480156102dd57600080fd5b506102f16102ec366004613f54565b610836565b005b6102f1610301366004614279565b6108ce565b34801561031257600080fd5b50610212610d32565b34801561032757600080fd5b506102f1610336366004613e7e565b610d49565b34801561034757600080fd5b50610212610d81565b34801561035c57600080fd5b5061037061036b366004614261565b610d87565b60405161021f9190615105565b34801561038957600080fd5b50610297610398366004614149565b610e1f565b3480156103a957600080fd5b506103bd6103b8366004613e0e565b611e4f565b60405161021f9190614c76565b3480156103d657600080fd5b506102f16103e5366004613e7e565b611f3f565b3480156103f657600080fd5b50610297610405366004614261565b611f5a565b34801561041657600080fd5b506102f1610425366004613e0e565b61225d565b34801561043657600080fd5b506102c4610445366004614261565b612296565b34801561045657600080fd5b50610297610465366004614261565b6122cb565b34801561047657600080fd5b50610212610485366004613e0e565b6123ed565b34801561049657600080fd5b506102126104a5366004613e0e565b612431565b3480156104b657600080fd5b506102976104c5366004614279565b61244c565b3480156104d657600080fd5b506102976125fc565b3480156104eb57600080fd5b506104ff6104fa366004614261565b61260b565b60405161021f9190614c35565b34801561051857600080fd5b50610248610527366004614261565b6128e8565b34801561053857600080fd5b506102f1610547366004613f27565b612983565b34801561055857600080fd5b50610297610567366004614261565b612a51565b34801561057857600080fd5b506102f1612a70565b34801561058d57600080fd5b506102f161059c366004613ebe565b612ae2565b3480156105ad57600080fd5b506102486105bc366004614279565b612b21565b3480156105cd57600080fd5b506102976105dc366004614261565b612b67565b3480156105ed57600080fd5b506102976105fc366004614261565b612dc4565b34801561060d57600080fd5b5061062161061c366004614261565b612fc5565b60405161021f92919061514f565b34801561063b57600080fd5b5061024861064a366004613e46565b612ff7565b34801561065b57600080fd5b506102f161066a366004613f7f565b613025565b60075490565b60006001600160e01b031982166380ac58cd60e01b14806106a657506001600160e01b03198216635b5e139f60e01b145b806106b557506106b582613141565b90505b919050565b6106c5613be0565b737d2e3eba0119f38cca36a1cf4aeb9ffd38bf921063910bbd816106e884612b67565b6040518263ffffffff1660e01b81526004016107049190614cc5565b60006040518083038186803b15801561071c57600080fd5b505af4158015610730573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106b59190810190614061565b606060008054610767906152a6565b80601f0160208091040260200160405190810160405280929190818152602001828054610793906152a6565b80156107e05780601f106107b5576101008083540402835291602001916107e0565b820191906000526020600020905b8154815290600101906020018083116107c357829003601f168201915b5050505050905090565b60006107f58261315a565b61081a5760405162461bcd60e51b815260040161081190614f89565b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600061084182612296565b9050806001600160a01b0316836001600160a01b031614156108755760405162461bcd60e51b81526004016108119061501e565b806001600160a01b0316610887613177565b6001600160a01b031614806108a357506108a38161064a613177565b6108bf5760405162461bcd60e51b815260040161081190614e64565b6108c9838361317b565b505050565b600260065414156108f15760405162461bcd60e51b8152600401610811906150ce565b6002600655666a94d74f430000341461090957600080fd5b808214156109295760405162461bcd60e51b815260040161081190614cd8565b600e54604051639f6b040b60e01b81526001600160a01b0390911690639f6b040b90610959908590600401615146565b60206040518083038186803b15801561097157600080fd5b505afa158015610985573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a991906140f5565b8015610a305750600e54604051639f6b040b60e01b81526001600160a01b0390911690639f6b040b906109e0908490600401615146565b60206040518083038186803b1580156109f857600080fd5b505afa158015610a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3091906140f5565b610a4c5760405162461bcd60e51b81526004016108119061505f565b60008282604051602001610a61929190614b7f565b60408051601f1981840301815291815281516020928301206000818152600990935291205490915060ff1615610aa95760405162461bcd60e51b815260040161081190614dfa565b600780549081906000610abb836152e1565b9190505550610ac8613c07565b84815260208101849052600e546040516306daaebd60e01b81526000916001600160a01b0316906306daaebd90610b03908990600401615146565b60206040518083038186803b158015610b1b57600080fd5b505afa158015610b2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b539190613e2a565b600e546040516306daaebd60e01b81529192506000916001600160a01b03909116906306daaebd90610b89908990600401615146565b60206040518083038186803b158015610ba157600080fd5b505afa158015610bb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd99190613e2a565b600085815260086020908152604080832087518155828801516001918201558984526009909252909120805460ff191690911790559050610c1a33856131e9565b6001600160a01b0382166000908152600a6020526040812080546617508f1956a8009290610c499084906151d0565b90915550506001600160a01b0381166000908152600a602052604081208054660354a6ba7a18009290610c7d9084906151d0565b9091555050600b546001600160a01b03166000908152600a602052604081208054661aa535d3d0c0009290610cb39084906151d0565b9091555050600c546001600160a01b03166000908152600a602052604081208054661aa535d3d0c0009290610ce99084906151d0565b9091555050600d546001600160a01b03166000908152600a602052604081208054661aa535d3d0c0009290610d1f9084906151d0565b9091555050600160065550505050505050565b60006106a4600754610d449190615240565b905090565b610d5a610d54613177565b82613203565b610d765760405162461bcd60e51b81526004016108119061507d565b6108c9838383613280565b60075481565b610d8f613c21565b737d2e3eba0119f38cca36a1cf4aeb9ffd38bf921063a1ff2af9610db284612b67565b6040518263ffffffff1660e01b8152600401610dce9190614cc5565b6101806040518083038186803b158015610de757600080fd5b505af4158015610dfb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b591906141f2565b6060600060405180610140016040528061011781526020016153d76101179139604080516104408101825260016104008201818152600360fc1b610420840152825282518084018452818152603160f81b6020828101919091528084019190915283518085018552828152601960f91b818301528385015283518085018552828152603360f81b81830152606084015283518085018552828152600d60fa1b81830152608084015283518085018552828152603560f81b8183015260a084015283518085018552828152601b60f91b8183015260c084015283518085018552828152603760f81b8183015260e084015283518085018552828152600760fb1b8183015261010084015283518085018552918252603960f81b8282015261012083019190915282518084018452600280825261031360f41b828401526101408401919091528351808501855281815261313160f01b818401526101608401528351808501855281815261189960f11b818401526101808401528351808501855281815261313360f01b818401526101a084015283518085018552818152610c4d60f21b818401526101c08401528351808501855281815261313560f01b818401526101e08401528351808501855281815261189b60f11b818401526102008401528351808501855281815261313760f01b818401526102208401528351808501855281815261062760f31b818401526102408401528351808501855281815261313960f01b818401526102608401528351808501855281815261032360f41b818401526102808401528351808501855281815261323160f01b818401526102a08401528351808501855281815261191960f11b818401526102c08401528351808501855281815261323360f01b818401526102e084015283518085018552818152610c8d60f21b818401526103008401528351808501855281815261323560f01b818401526103208401528351808501855281815261191b60f11b818401526103408401528351808501855281815261323760f01b818401526103608401528351808501855281815261064760f31b818401526103808401528351808501855281815261323960f01b818401526103a08401528351808501855281815261033360f41b818401526103c08401528351808501909452835261333160f01b908301526103e0810191909152909150611193613c53565b600060405180608001604052806111d8886000815181106111c457634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b0319166133ad565b6111fc896001815181106111c457634e487b7160e01b600052603260045260246000fd5b6112208a6002815181106111c457634e487b7160e01b600052603260045260246000fd5b60405160200161123293929190614a31565b604051602081830303815290604052815260200161126a886003815181106111c457634e487b7160e01b600052603260045260246000fd5b61128e896004815181106111c457634e487b7160e01b600052603260045260246000fd5b6112b28a6005815181106111c457634e487b7160e01b600052603260045260246000fd5b6040516020016112c493929190614a31565b60405160208183030381529060405281526020016112fc886006815181106111c457634e487b7160e01b600052603260045260246000fd5b611320896007815181106111c457634e487b7160e01b600052603260045260246000fd5b6113448a6008815181106111c457634e487b7160e01b600052603260045260246000fd5b60405160200161135693929190614a31565b604051602081830303815290604052815260200161138e886009815181106111c457634e487b7160e01b600052603260045260246000fd5b6113b289600a815181106111c457634e487b7160e01b600052603260045260246000fd5b6113d68a600b815181106111c457634e487b7160e01b600052603260045260246000fd5b6040516020016113e893929190614a31565b6040516020818303038152906040528152509050611404613c8f565b600c5b61010c811015611e22578261144d89838151811061143557634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b031916600660076133c0565b6004811061146b57634e487b7160e01b600052603260045260246000fd5b60200201518460400181905250826114b489838151811061149c57634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b031916600460056133c0565b600481106114d257634e487b7160e01b600052603260045260246000fd5b602002015184606001819052508261151b89838151811061150357634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b031916600260036133c0565b6004811061153957634e487b7160e01b600052603260045260246000fd5b602002015184608001819052508261158289838151811061156a57634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b031916600060016133c0565b600481106115a057634e487b7160e01b600052603260045260246000fd5b602002015160a08501526115b48585613447565b8252835160049085906115c89083906151e8565b60ff16905250826115fc896115de8460016151d0565b8151811061143557634e487b7160e01b600052603260045260246000fd5b6004811061161a57634e487b7160e01b600052603260045260246000fd5b6020020151604085015282611652896116348460016151d0565b8151811061149c57634e487b7160e01b600052603260045260246000fd5b6004811061167057634e487b7160e01b600052603260045260246000fd5b60200201516060850152826116a88961168a8460016151d0565b8151811061150357634e487b7160e01b600052603260045260246000fd5b600481106116c657634e487b7160e01b600052603260045260246000fd5b60200201516080850152826116fe896116e08460016151d0565b8151811061156a57634e487b7160e01b600052603260045260246000fd5b6004811061171c57634e487b7160e01b600052603260045260246000fd5b602002015160a08501526117308585613447565b6020830152835160049085906117479083906151e8565b60ff169052508261175d896115de8460026151d0565b6004811061177b57634e487b7160e01b600052603260045260246000fd5b6020020151604085015282611795896116348460026151d0565b600481106117b357634e487b7160e01b600052603260045260246000fd5b60200201516060850152826117cd8961168a8460026151d0565b600481106117eb57634e487b7160e01b600052603260045260246000fd5b6020020151608085015282611805896116e08460026151d0565b6004811061182357634e487b7160e01b600052603260045260246000fd5b602002015160a08501526118378585613447565b60408301528351600490859061184e9083906151e8565b60ff1690525082611864896115de8460036151d0565b6004811061188257634e487b7160e01b600052603260045260246000fd5b602002015160408501528261189c896116348460036151d0565b600481106118ba57634e487b7160e01b600052603260045260246000fd5b60200201516060850152826118d48961168a8460036151d0565b600481106118f257634e487b7160e01b600052603260045260246000fd5b602002015160808501528261190c896116e08460036151d0565b6004811061192a57634e487b7160e01b600052603260045260246000fd5b602002015160a085015261193e8585613447565b6060830152835160049085906119559083906151e8565b60ff169052508261196b896115de8460046151d0565b6004811061198957634e487b7160e01b600052603260045260246000fd5b60200201516040850152826119a3896116348460046151d0565b600481106119c157634e487b7160e01b600052603260045260246000fd5b60200201516060850152826119db8961168a8460046151d0565b600481106119f957634e487b7160e01b600052603260045260246000fd5b6020020151608085015282611a13896116e08460046151d0565b60048110611a3157634e487b7160e01b600052603260045260246000fd5b602002015160a0850152611a458585613447565b608083015283516004908590611a5c9083906151e8565b60ff1690525082611a72896115de8460056151d0565b60048110611a9057634e487b7160e01b600052603260045260246000fd5b6020020151604085015282611aaa896116348460056151d0565b60048110611ac857634e487b7160e01b600052603260045260246000fd5b6020020151606085015282611ae28961168a8460056151d0565b60048110611b0057634e487b7160e01b600052603260045260246000fd5b6020020151608085015282611b1a896116e08460056151d0565b60048110611b3857634e487b7160e01b600052603260045260246000fd5b602002015160a0850152611b4c8585613447565b60a083015283516004908590611b639083906151e8565b60ff1690525082611b79896115de8460066151d0565b60048110611b9757634e487b7160e01b600052603260045260246000fd5b6020020151604085015282611bb1896116348460066151d0565b60048110611bcf57634e487b7160e01b600052603260045260246000fd5b6020020151606085015282611be98961168a8460066151d0565b60048110611c0757634e487b7160e01b600052603260045260246000fd5b6020020151608085015282611c21896116e08460066151d0565b60048110611c3f57634e487b7160e01b600052603260045260246000fd5b602002015160a0850152611c538585613447565b60c083015283516004908590611c6a9083906151e8565b60ff1690525082611c80896115de8460076151d0565b60048110611c9e57634e487b7160e01b600052603260045260246000fd5b6020020151604085015282611cb8896116348460076151d0565b60048110611cd657634e487b7160e01b600052603260045260246000fd5b6020020151606085015282611cf08961168a8460076151d0565b60048110611d0e57634e487b7160e01b600052603260045260246000fd5b6020020151608085015282611d28896116e08460076151d0565b60048110611d4657634e487b7160e01b600052603260045260246000fd5b602002015160a0850152611d5a8585613447565b60e083015283516004908590611d719083906151e8565b60ff169052508582600060200201518360016020020151846002602002015185600360200201518660046020020151876005602002015188600660200201518960076020020151604051602001611dd099989796959493929190614350565b60405160208183030381529060405295506020846000015160ff1610611e10576000845260208401805160019190611e099083906151e8565b60ff169052505b611e1b6008826151d0565b9050611407565b5084604051602001611e3491906144a7565b60408051808303601f19018152919052979650505050505050565b6060611e5a826123ed565b6001600160401b03811115611e7f57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611ea8578160200160208202803683370190505b5090506000805b600754811015611f3857611ec28161315a565b8015611ee75750836001600160a01b0316611edc82612296565b6001600160a01b0316145b15611f265780838381518110611f0d57634e487b7160e01b600052603260045260246000fd5b602090810291909101015281611f22816152e1565b9250505b80611f30816152e1565b915050611eaf565b5050919050565b6108c983838360405180602001604052806000815250612ae2565b6060611f64613caa565b60008381526008602090815260409182902080546001909101548351606081019094526028808552919390929091906153af908301398352600e546040516338c9319960e21b81526001600160a01b039091169063e324c66490611fcc908590600401615146565b60006040518083038186803b158015611fe457600080fd5b505afa158015611ff8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261202091908101906141c0565b612029836122cb565b60405160200161203a9291906146e7565b60408051601f198184030181529190528360016020020152600e546040516338c9319960e21b81526001600160a01b039091169063e324c66490612082908490600401615146565b60006040518083038186803b15801561209a57600080fd5b505afa1580156120ae573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526120d691908101906141c0565b6120df826122cb565b6040516020016120f0929190614666565b60408051808303601f19018152918152840152600061210e866106bd565b805160405191925061212291602001614616565b60408051808303601f1901815291905260608501526020810151511561217157606084015160208281015160405161215b939201614501565b60408051808303601f1901815291905260608501525b604081015151156121ad5760608401516040808301519051612197929190602001614501565b60408051808303601f1901815291905260608501525b60608401516040516121c291906020016144db565b60408051808303601f19018152919052606085015260006121e28761260b565b805160208083015160408085015160608601519151959650612208959293909201614567565b60408051808303601f190181529181526080870182905286516020808901518984015160608b015194516122429694959294919301614411565b60405160208183030381529060405295505050505050919050565b600f546001600160a01b0316331461227457600080fd5b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600260205260408120546001600160a01b0316806106b55760405162461bcd60e51b815260040161081190614f0b565b6060816122f057506040805180820190915260018152600360fc1b60208201526106b8565b8160005b811561231a5780612304816152e1565b91506123139050600a8361520d565b91506122f4565b6000816001600160401b0381111561234257634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561236c576020820181803683370190505b5090505b84156123e557612381600183615240565b915061238e600a8661531c565b6123999060306151d0565b60f81b8183815181106123bc57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506123de600a8661520d565b9450612370565b949350505050565b60006001600160a01b0382166124155760405162461bcd60e51b815260040161081190614ec1565b506001600160a01b031660009081526003602052604090205490565b6001600160a01b03166000908152600a602052604090205490565b600e5460405163c0da9bcd60e01b81526060916000916001600160a01b039091169063c0da9bcd90612482908790600401615146565b60006040518083038186803b15801561249a57600080fd5b505afa1580156124ae573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526124d6919081019061417b565b600e5460405163c0da9bcd60e01b81529192506000916001600160a01b039091169063c0da9bcd9061250c908790600401615146565b60006040518083038186803b15801561252457600080fd5b505afa158015612538573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612560919081019061417b565b905060005b600c8160ff1610156125e957818160ff168151811061259457634e487b7160e01b600052603260045260246000fd5b602001015160f81c60f81b838260ff16815181106125c257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506125e2816152fc565b9050612565565b506125f382610e1f565b95945050505050565b606060018054610767906152a6565b612613613cc4565b600061261e83612b67565b90506000737d2e3eba0119f38cca36a1cf4aeb9ffd38bf921063a1ff2af9836040518263ffffffff1660e01b81526004016126599190614cc5565b6101806040518083038186803b15801561267257600080fd5b505af4158015612686573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126aa91906141f2565b6040805160c08101825260036080820181815262714bd160e91b60a084015282528251808401845281815262e297a360e81b60208281019190915280840191909152835180850185528281526238a5e960ea1b8183015283850152835180850190945290835262e297a560e81b90830152606081019190915290915061272e613cc4565b6040830151516020840151518451518492600492909161274e91906151d0565b61275891906151d0565b612762919061531c565b6004811061278057634e487b7160e01b600052603260045260246000fd5b6020908102919091015182526040840151810151848201518201518551909201518492600492916127b191906151d0565b6127bb91906151d0565b6127c5919061531c565b600481106127e357634e487b7160e01b600052603260045260246000fd5b602090810291909101518282015260408481015101519084015183916004916002602002015186516040015161281991906151d0565b61282391906151d0565b61282d919061531c565b6004811061284b57634e487b7160e01b600052603260045260246000fd5b602002015181600260200201526040830151829060049060036020020151856020015160036004811061288e57634e487b7160e01b600052603260045260246000fd5b60200201518651606001516128a391906151d0565b6128ad91906151d0565b6128b7919061531c565b600481106128d557634e487b7160e01b600052603260045260246000fd5b6020020151606082015295945050505050565b60006106a482101561297b57600e54604051639f6b040b60e01b81526001600160a01b0390911690639f6b040b90612924908590600401615146565b60206040518083038186803b15801561293c57600080fd5b505afa158015612950573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061297491906140f5565b90506106b8565b506000919050565b61298b613177565b6001600160a01b0316826001600160a01b031614156129bc5760405162461bcd60e51b815260040161081190614dc3565b80600560006129c9613177565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155612a0d613177565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051612a459190614cba565b60405180910390a35050565b60606000612a5e83612b67565b9050612a6981610e1f565b9392505050565b60026006541415612a935760405162461bcd60e51b8152600401610811906150ce565b6002600655336000818152600a6020526040808220805490839055905190929183156108fc02918491818181858888f19350505050158015612ad9573d6000803e3d6000fd5b50506001600655565b612af3612aed613177565b83613203565b612b0f5760405162461bcd60e51b81526004016108119061507d565b612b1b84848484613627565b50505050565b6000808383604051602001612b37929190614b7f565b60408051808303601f1901815291815281516020928301206000908152600990925290205460ff16949350505050565b60606106a4821015612bf757600e5460405163c0da9bcd60e01b81526001600160a01b039091169063c0da9bcd90612ba3908590600401615146565b60006040518083038186803b158015612bbb57600080fd5b505afa158015612bcf573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612974919081019061417b565b6060612c028361315a565b156106b557600e546000848152600860205260409081902054905163c0da9bcd60e01b81526001600160a01b039092169163c0da9bcd91612c4591600401615146565b60006040518083038186803b158015612c5d57600080fd5b505afa158015612c71573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c99919081019061417b565b600e5460008581526008602052604080822060010154905163c0da9bcd60e01b815293945090926001600160a01b039092169163c0da9bcd91612cde91600401615146565b60006040518083038186803b158015612cf657600080fd5b505afa158015612d0a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612d32919081019061417b565b905060005b600c8160ff161015612dbb57818160ff1681518110612d6657634e487b7160e01b600052603260045260246000fd5b602001015160f81c60f81b838260ff1681518110612d9457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612db4816152fc565b9050612d37565b50509050919050565b60008181526008602052604081208054600190910154606092612de6856122cb565b600e546040516338c9319960e21b81526001600160a01b039091169063e324c66490612e16908790600401615146565b60006040518083038186803b158015612e2e57600080fd5b505afa158015612e42573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612e6a91908101906141c0565b600e546040516338c9319960e21b81526001600160a01b039091169063e324c66490612e9a908790600401615146565b60006040518083038186803b158015612eb257600080fd5b505afa158015612ec6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612eee91908101906141c0565b604051602001612f0093929190614a87565b60408051601f198184030181526060830190915260338083529092506000919061552e602083013990506000612f3d612f3888612a51565b61365a565b604051602001612f4d9190614b3a565b60405160208183030381529060405290506000838383612f6c8b611f5a565b604051602001612f7f949392919061495a565b6040516020818303038152906040529050612f998161365a565b604051602001612fa99190614af5565b6040516020818303038152906040529650505050505050919050565b600080612fd1836128e8565b15612fdb57600080fd5b5050600090815260086020526040902080546001909101549091565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b600f546001600160a01b0316331461303c57600080fd5b60005b815181101561313d57600082828151811061306a57634e487b7160e01b600052603260045260246000fd5b602002602001015160008151811061309257634e487b7160e01b600052603260045260246000fd5b60200260200101518383815181106130ba57634e487b7160e01b600052603260045260246000fd5b60200260200101516001815181106130e257634e487b7160e01b600052603260045260246000fd5b60200260200101516040516020016130fb929190614b7f565b60408051601f198184030181529181528151602092830120600090815260099092529020805460ff191660011790555080613135816152e1565b91505061303f565b5050565b6001600160e01b031981166301ffc9a760e01b14919050565b6000908152600260205260409020546001600160a01b0316151590565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906131b082612296565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b61313d8282604051806020016040528060008152506137cd565b600061320e8261315a565b61322a5760405162461bcd60e51b815260040161081190614e18565b600061323583612296565b9050806001600160a01b0316846001600160a01b031614806132705750836001600160a01b0316613265846107ea565b6001600160a01b0316145b806123e557506123e58185612ff7565b826001600160a01b031661329382612296565b6001600160a01b0316146132b95760405162461bcd60e51b815260040161081190614fd5565b6001600160a01b0382166132df5760405162461bcd60e51b815260040161081190614d7f565b6132ea8383836108c9565b6132f560008261317b565b6001600160a01b038316600090815260036020526040812080546001929061331e908490615240565b90915550506001600160a01b038216600090815260036020526040812080546001929061334c9084906151d0565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60606106b56133bb83613800565b613806565b60006133cc8483613975565b80156133dd57506133dd8484613975565b156133ea57506003612a69565b6133f48483613975565b801561340757506134058484613975565b155b1561341457506002612a69565b61341e8483613975565b15801561343057506134308484613975565b1561343d57506001612a69565b5060009392505050565b6060816040015183836000015160ff166020811061347557634e487b7160e01b600052603260045260246000fd5b602002015184846020015160ff16602081106134a157634e487b7160e01b600052603260045260246000fd5b60200201516060850151855187906134ba9060016151e8565b60ff16602081106134db57634e487b7160e01b600052603260045260246000fd5b602002015187876020015160ff166020811061350757634e487b7160e01b600052603260045260246000fd5b6020020151608088015188518a906135209060026151e8565b60ff166020811061354157634e487b7160e01b600052603260045260246000fd5b60200201518a8a6020015160ff166020811061356d57634e487b7160e01b600052603260045260246000fd5b602002015160a08b01518b518d906135869060036151e8565b60ff16602081106135a757634e487b7160e01b600052603260045260246000fd5b60200201518d8d6020015160ff16602081106135d357634e487b7160e01b600052603260045260246000fd5b60200201516040516020016135ed9695949392919061476c565b60408051601f198184030181529082905261361097969594939291602001614868565b604051602081830303815290604052905092915050565b613632848484613280565b61363e8484848461398a565b612b1b5760405162461bcd60e51b815260040161081190614cf6565b80516060908061367a5750506040805160208101909152600081526106b8565b600060036136898360026151d0565b613693919061520d565b61369e906004615221565b905060006136ad8260206151d0565b6001600160401b038111156136d257634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156136fc576020820181803683370190505b50905060006040518060600160405280604081526020016154ee604091399050600181016020830160005b86811015613788576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b835260049092019101613727565b5060038606600181146137a257600281146137b3576137bf565b613d3d60f01b6001198301526137bf565b603d60f81b6000198301525b505050918152949350505050565b6137d78383613aa5565b6137e4600084848461398a565b6108c95760405162461bcd60e51b815260040161081190614cf6565b60f81c90565b60606000825b8015613832578161381c816152e1565b925061382b905060108261520d565b905061380c565b6000826001600160401b0381111561385a57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015613884576020820181803683370190505b50905060005b838110156139115761389d60108761531c565b92506138a883613b84565b8260016138b58488615240565b6138bf9190615240565b815181106138dd57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506138ff60108761520d565b955061390a816152e1565b905061388a565b50805181906139405760405180604001604052806002815260200161030360f41b8152509450505050506106b8565b8051600114156125f3578060405160200161395b919061453e565b6040516020818303038152906040529450505050506106b8565b600160f883901c60ff83161c81161492915050565b600061399e846001600160a01b0316613bda565b15613a9a57836001600160a01b031663150b7a026139ba613177565b8786866040518563ffffffff1660e01b81526004016139dc9493929190614bab565b602060405180830381600087803b1580156139f657600080fd5b505af1925050508015613a26575060408051601f3d908101601f19168201909252613a239181019061412d565b60015b613a80573d808015613a54576040519150601f19603f3d011682016040523d82523d6000602084013e613a59565b606091505b508051613a785760405162461bcd60e51b815260040161081190614cf6565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506123e5565b506001949350505050565b6001600160a01b038216613acb5760405162461bcd60e51b815260040161081190614f54565b613ad48161315a565b15613af15760405162461bcd60e51b815260040161081190614d48565b613afd600083836108c9565b6001600160a01b0382166000908152600360205260408120805460019290613b269084906151d0565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600060098260ff1611613ba657613b9c8260306151e8565b60f81b90506106b8565b8160ff16600a11158015613bbe5750600f8260ff1611155b156101f857600a613bd08360616151e8565b613b9c9190615257565b3b151590565b60405180606001604052806003905b6060815260200190600190039081613bef5790505090565b604051806040016040528060008152602001600081525090565b6040518060600160405280613c34613cde565b8152602001613c41613cde565b8152602001613c4e613cde565b905290565b6040518060c00160405280600060ff168152602001600060ff168152602001606081526020016060815260200160608152602001606081525090565b60408051610100810190915260608152600760208201613bef565b6040805160a0810190915260608152600460208201613bef565b604080516080810190915260608152600360208201613bef565b60405180608001604052806004906020820280368337509192915050565b6000613d0f613d0a846151a9565b61515d565b9050828152838383011115613d2357600080fd5b612a6983602083018461527a565b600082601f830112613d41578081fd5b604051608081018181106001600160401b0382111715613d6357613d6361535c565b604052808360808101861015613d77578384fd5b835b6004811015613d98578151835260209283019290910190600101613d79565b509195945050505050565b600082601f830112613db3578081fd5b8135613dc1613d0a826151a9565b818152846020838601011115613dd5578283fd5b816020850160208301379081016020019190915292915050565b600082601f830112613dff578081fd5b612a6983835160208501613cfc565b600060208284031215613e1f578081fd5b8135612a6981615372565b600060208284031215613e3b578081fd5b8151612a6981615372565b60008060408385031215613e58578081fd5b8235613e6381615372565b91506020830135613e7381615372565b809150509250929050565b600080600060608486031215613e92578081fd5b8335613e9d81615372565b92506020840135613ead81615372565b929592945050506040919091013590565b60008060008060808587031215613ed3578182fd5b8435613ede81615372565b93506020850135613eee81615372565b92506040850135915060608501356001600160401b03811115613f0f578182fd5b613f1b87828801613da3565b91505092959194509250565b60008060408385031215613f39578182fd5b8235613f4481615372565b91506020830135613e738161538a565b60008060408385031215613f66578182fd5b8235613f7181615372565b946020939093013593505050565b60006020808385031215613f91578182fd5b82356001600160401b03811115613fa6578283fd5b8301601f81018513613fb6578283fd5b8035613fc4613d0a82615186565b81815283810190838501865b8481101561405357813586018a603f820112613fea578889fd5b878101356040613ffc613d0a83615186565b808382528b820191508285018f848e8702880101111561401a578d8efd5b8d95505b8486101561403c578035835260019590950194918c01918c0161401e565b508852505050938701935090860190600101613fd0565b509098975050505050505050565b60006020808385031215614073578182fd5b82516001600160401b0380821115614089578384fd5b818501915085601f83011261409c578384fd5b6040516060810181811083821117156140b7576140b761535c565b60405290508082855b60038110156140e8576140d68983518701613def565b845292850192908501906001016140c0565b5090979650505050505050565b600060208284031215614106578081fd5b8151612a698161538a565b600060208284031215614122578081fd5b8135612a6981615398565b60006020828403121561413e578081fd5b8151612a6981615398565b60006020828403121561415a578081fd5b81356001600160401b0381111561416f578182fd5b6123e584828501613da3565b60006020828403121561418c578081fd5b81516001600160401b038111156141a1578182fd5b8201601f810184136141b1578182fd5b6123e584825160208401613cfc565b6000602082840312156141d1578081fd5b81516001600160401b038111156141e6578182fd5b6123e584828501613def565b60006101808284031215614204578081fd5b604051606081018181106001600160401b03821117156142265761422661535c565b6040526142338484613d31565b81526142428460808501613d31565b6020820152614255846101008501613d31565b60408201529392505050565b600060208284031215614272578081fd5b5035919050565b6000806040838503121561428b578182fd5b50508035926020909101359150565b8060005b6004811015612b1b57815184526020938401939091019060010161429e565b600081518084526142d581602086016020860161527a565b601f01601f19169290920160200192915050565b600081516142fb81856020860161527a565b9290920192915050565b6411103c9e9160d91b815260050190565b7f222077696474683d22312e3522206865696768743d22312e3522202f3e0000008152601d0190565b6411103c1e9160d91b815260050190565b60008a51614362818460208f0161527a565b8a516143748183860160208f0161527a565b8a519184010190614389818360208e0161527a565b895161439b8183850160208e0161527a565b89519290910101906143b1818360208c0161527a565b87516143c38183850160208c0161527a565b87519290910101906143d9818360208a0161527a565b85516143eb8183850160208a0161527a565b855192909101019061440181836020880161527a565b019b9a5050505050505050505050565b60008651614423818460208b0161527a565b8083019050600b60fa1b8082528751614443816001850160208c0161527a565b600192019182018190528651614460816002850160208b0161527a565b60029201918201819052855161447d816003850160208a0161527a565b6003920191820152835161449881600484016020880161527a565b01600401979650505050505050565b600082516144b981846020870161527a565b6f1e17b39f1e17b9bb339f1e17b9bb339f60811b920191825250601001919050565b600082516144ed81846020870161527a565b61227d60f01b920191825250600201919050565b6000835161451381846020880161527a565b61016160f51b908301908152835161453281600284016020880161527a565b01600201949350505050565b6000600360fc1b8252825161455a81600185016020870161527a565b9190910160010192915050565b60007f7b2274726169745f74797065223a22536c616273222c2276616c7565223a22008252855160206145a082601f8601838b0161527a565b8184019150600160fd1b80601f84015287516145c181848601858c0161527a565b808401935050808284015286516145de8160218601858b0161527a565b602193019283015284516145f8816022850184890161527a565b61227d60f01b60229390910192830152506024019695505050505050565b60007f7b2274726169745f74797065223a22416666696e697479222c2276616c7565228252611d1160f11b6020830152825161465981602285016020870161527a565b9190910160220192915050565b60007f7b2274726169745f74797065223a2250616c65747465222c2276616c7565223a8252601160f91b602083015283516146a881602185016020880161527a565b6220282360e81b60219184019182015283516146cb81602484016020880161527a565b6229227d60e81b60249290910191820152602701949350505050565b60007f7b2274726169745f74797065223a22436f6d706f736974696f6e222c2276616c8252643ab2911d1160d91b6020830152835161472d81602585016020880161527a565b6220282360e81b602591840191820152835161475081602884016020880161527a565b6229227d60e81b60289290910191820152602b01949350505050565b60006b1e3932b1ba103334b6361e9160a11b808352885161479481600c860160208d0161527a565b6411103c1e9160d91b600c91850191820181905289516147bb816011850160208e0161527a565b6411103c9e9160d91b6011939091019283015288516147e1816016850160208d0161527a565b8083019250507f222077696474683d22312e3522206865696768743d22312e3522202f3e00000060168301528260338301528751925061482883603f840160208b0161527a565b828201925080603f840152505061485b61485661485061484b60448501896142e9565b614305565b866142e9565b614316565b9998505050505050505050565b60006b1e3932b1ba103334b6361e9160a11b808352895161489081600c860160208e0161527a565b6411103c1e9160d91b600c9185019182015289516148b5816011840160208e0161527a565b6411103c9e9160d91b6011929091019182015288516148db816016840160208d0161527a565b8082019150507f222077696474683d22312e3522206865696768743d22312e3522202f3e00000060168201528160338201528751915061492282603f830160208b0161527a565b61494b61485061485661494561484b61493f603f8888010161433f565b8c6142e9565b896142e9565b9b9a5050505050505050505050565b693d913730b6b2911d101160b11b8152845160009061498081600a850160208a0161527a565b72111610113232b9b1b934b83a34b7b7111d101160691b600a9184019182015285516149b381601d840160208a0161527a565b6c1116101134b6b0b3b2911d101160991b601d929091019182015284516149e181602a84016020890161527a565b71222c202261747472696275746573223a205b60701b602a92909101918201528351614a1481603c84016020880161527a565b615d7d60f01b603c9290910191820152603e019695505050505050565b6000602360f81b82528451614a4d81600185016020890161527a565b845190830190614a6481600184016020890161527a565b8451910190614a7a81600184016020880161527a565b0160010195945050505050565b6000602360f81b82528451614aa381600185016020890161527a565b6201016960ed1b6001918401918201528451614ac681600484016020890161527a565b600160fd1b600492909101918201528351614ae881600584016020880161527a565b0160050195945050505050565b60007f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000082528251614b2d81601d85016020870161527a565b91909101601d0192915050565b60007f646174613a696d6167652f7376672b786d6c3b6261736536342c00000000000082528251614b7281601a85016020870161527a565b91909101601a0192915050565b918252602d60f81b6020830152602182015260410190565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614bde908301846142bd565b9695505050505050565b60208082526000906080830183820185845b6003811015614c2957601f19878503018352614c178483516142bd565b93509184019190840190600101614bfa565b50919695505050505050565b602080825260009060a0830183820185845b6004811015614c2957601f19878503018352614c648483516142bd565b93509184019190840190600101614c47565b6020808252825182820181905260009190848201906040850190845b81811015614cae57835183529284019291840191600101614c92565b50909695505050505050565b901515815260200190565b600060208252612a6960208301846142bd565b6020808252600490820152630c47460760e31b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b602080825260049082015263623a313160e01b604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b60208082526029908201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460408201526832b73a103a37b5b2b760b91b606082015260800190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b6020808252600490820152630623a31360e41b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60006101808201905061511982845161429a565b602083015161512b608084018261429a565b50604083015161513f61010084018261429a565b5092915050565b90815260200190565b918252602082015260400190565b6040518181016001600160401b038111828210171561517e5761517e61535c565b604052919050565b60006001600160401b0382111561519f5761519f61535c565b5060209081020190565b60006001600160401b038211156151c2576151c261535c565b50601f01601f191660200190565b600082198211156151e3576151e3615330565b500190565b600060ff821660ff84168060ff0382111561520557615205615330565b019392505050565b60008261521c5761521c615346565b500490565b600081600019048311821515161561523b5761523b615330565b500290565b60008282101561525257615252615330565b500390565b600060ff821660ff84168082101561527157615271615330565b90039392505050565b60005b8381101561529557818101518382015260200161527d565b83811115612b1b5750506000910152565b6002810460018216806152ba57607f821691505b602082108114156152db57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156152f5576152f5615330565b5060010190565b600060ff821660ff81141561531357615313615330565b60010192915050565b60008261532b5761532b615346565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461538757600080fd5b50565b801515811461538757600080fd5b6001600160e01b03198116811461538757600080fdfe7b2274726169745f74797065223a2254797065222c2276616c7565223a22466c69706c696e67227d3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f737667222076657273696f6e3d22312e31222076696577426f783d2230203020313030302031303030223e3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f737667222076657273696f6e3d22312e31222076696577426f783d22302030203332203332222073686170652d72656e646572696e673d2263726973704564676573223e3c67207472616e73666f726d3d227472616e736c6174652833322c203029207363616c65282d312c3129223e4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f466c69706d6170732061726520746865206c6f737420382c33303020426c69746d6170732c206f6e6c7920666c69707065642ea26469706673582212206719d74675956745c194f0ffdcfa1c8beb0d92e4d81cc877047e947c40dd653a64736f6c63430008000033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000008d04a8c79ceb0889bdd12acdf3fa9d207ed3ff63
-----Decoded View---------------
Arg [0] : _blitAddress (address): 0x8d04a8c79cEB0889Bdd12acdF3Fa9D207eD3Ff63
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000008d04a8c79ceb0889bdd12acdf3fa9d207ed3ff63
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.