Feature Tip: Add private address tag to any address under My Name Tag !
ERC-721
Overview
Max Total Supply
96 BLTZ
Holders
51
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 BLTZLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
This contract contains unverified libraries: __CACHE_BREAKER__
Contract Name:
Blitoadz
Compiler Version
v0.8.12+commit.f00d7308
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "solidity-bytes-utils/contracts/BytesLib.sol"; import "../interfaces/IBlitmap.sol"; contract Blitmap is IBlitmap { bytes _tokenData; bytes _creators; string[100] _names; constructor(bytes memory tokenData, bytes memory creators) { _tokenData = tokenData; _creators = creators; } function setNames(string[100] memory names) public { _names = names; } function tokenDataOf(uint256 tokenId) public view returns (bytes memory) { return BytesLib.slice(_tokenData, tokenId * 12, 12); } function tokenCreatorOf(uint256 tokenId) public view returns (address) { return BytesLib.toAddress(_creators, tokenId * 20); } function tokenNameOf(uint256 tokenId) public view returns (string memory) { return _names[tokenId]; } }
// SPDX-License-Identifier: Unlicense /* * @title Solidity Bytes Arrays Utils * @author Gonçalo Sá <[email protected]> * * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity. * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage. */ pragma solidity >=0.8.0 <0.9.0; library BytesLib { function concat( bytes memory _preBytes, bytes memory _postBytes ) internal pure returns (bytes memory) { bytes memory tempBytes; assembly { // Get a location of some free memory and store it in tempBytes as // Solidity does for memory variables. tempBytes := mload(0x40) // Store the length of the first bytes array at the beginning of // the memory for tempBytes. let length := mload(_preBytes) mstore(tempBytes, length) // Maintain a memory counter for the current write location in the // temp bytes array by adding the 32 bytes for the array length to // the starting location. let mc := add(tempBytes, 0x20) // Stop copying when the memory counter reaches the length of the // first bytes array. let end := add(mc, length) for { // Initialize a copy counter to the start of the _preBytes data, // 32 bytes into its memory. let cc := add(_preBytes, 0x20) } lt(mc, end) { // Increase both counters by 32 bytes each iteration. mc := add(mc, 0x20) cc := add(cc, 0x20) } { // Write the _preBytes data into the tempBytes memory 32 bytes // at a time. mstore(mc, mload(cc)) } // Add the length of _postBytes to the current length of tempBytes // and store it as the new length in the first 32 bytes of the // tempBytes memory. length := mload(_postBytes) mstore(tempBytes, add(length, mload(tempBytes))) // Move the memory counter back from a multiple of 0x20 to the // actual end of the _preBytes data. mc := end // Stop copying when the memory counter reaches the new combined // length of the arrays. end := add(mc, length) for { let cc := add(_postBytes, 0x20) } lt(mc, end) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { mstore(mc, mload(cc)) } // Update the free-memory pointer by padding our last write location // to 32 bytes: add 31 bytes to the end of tempBytes to move to the // next 32 byte block, then round down to the nearest multiple of // 32. If the sum of the length of the two arrays is zero then add // one before rounding down to leave a blank 32 bytes (the length block with 0). mstore(0x40, and( add(add(end, iszero(add(length, mload(_preBytes)))), 31), not(31) // Round down to the nearest 32 bytes. )) } return tempBytes; } function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal { assembly { // Read the first 32 bytes of _preBytes storage, which is the length // of the array. (We don't need to use the offset into the slot // because arrays use the entire slot.) let fslot := sload(_preBytes.slot) // Arrays of 31 bytes or less have an even value in their slot, // while longer arrays have an odd value. The actual length is // the slot divided by two for odd values, and the lowest order // byte divided by two for even values. // If the slot is even, bitwise and the slot with 255 and divide by // two to get the length. If the slot is odd, bitwise and the slot // with -1 and divide by two. let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2) let mlength := mload(_postBytes) let newlength := add(slength, mlength) // slength can contain both the length and contents of the array // if length < 32 bytes so let's prepare for that // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage switch add(lt(slength, 32), lt(newlength, 32)) case 2 { // Since the new array still fits in the slot, we just need to // update the contents of the slot. // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length sstore( _preBytes.slot, // all the modifications to the slot are inside this // next block add( // we can just add to the slot contents because the // bytes we want to change are the LSBs fslot, add( mul( div( // load the bytes from memory mload(add(_postBytes, 0x20)), // zero all bytes to the right exp(0x100, sub(32, mlength)) ), // and now shift left the number of bytes to // leave space for the length in the slot exp(0x100, sub(32, newlength)) ), // increase length by the double of the memory // bytes length mul(mlength, 2) ) ) ) } case 1 { // The stored value fits in the slot, but the combined value // will exceed it. // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) let sc := add(keccak256(0x0, 0x20), div(slength, 32)) // save new length sstore(_preBytes.slot, add(mul(newlength, 2), 1)) // The contents of the _postBytes array start 32 bytes into // the structure. Our first read should obtain the `submod` // bytes that can fit into the unused space in the last word // of the stored array. To get this, we read 32 bytes starting // from `submod`, so the data we read overlaps with the array // contents by `submod` bytes. Masking the lowest-order // `submod` bytes allows us to add that value directly to the // stored value. let submod := sub(32, slength) let mc := add(_postBytes, submod) let end := add(_postBytes, mlength) let mask := sub(exp(0x100, submod), 1) sstore( sc, add( and( fslot, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00 ), and(mload(mc), mask) ) ) for { mc := add(mc, 0x20) sc := add(sc, 1) } lt(mc, end) { sc := add(sc, 1) mc := add(mc, 0x20) } { sstore(sc, mload(mc)) } mask := exp(0x100, sub(mc, end)) sstore(sc, mul(div(mload(mc), mask), mask)) } default { // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) // Start copying to the last used word of the stored array. let sc := add(keccak256(0x0, 0x20), div(slength, 32)) // save new length sstore(_preBytes.slot, add(mul(newlength, 2), 1)) // Copy over the first `submod` bytes of the new data as in // case 1 above. let slengthmod := mod(slength, 32) let mlengthmod := mod(mlength, 32) let submod := sub(32, slengthmod) let mc := add(_postBytes, submod) let end := add(_postBytes, mlength) let mask := sub(exp(0x100, submod), 1) sstore(sc, add(sload(sc), and(mload(mc), mask))) for { sc := add(sc, 1) mc := add(mc, 0x20) } lt(mc, end) { sc := add(sc, 1) mc := add(mc, 0x20) } { sstore(sc, mload(mc)) } mask := exp(0x100, sub(mc, end)) sstore(sc, mul(div(mload(mc), mask), mask)) } } } function slice( bytes memory _bytes, uint256 _start, uint256 _length ) internal pure returns (bytes memory) { require(_length + 31 >= _length, "slice_overflow"); require(_bytes.length >= _start + _length, "slice_outOfBounds"); bytes memory tempBytes; assembly { switch iszero(_length) case 0 { // Get a location of some free memory and store it in tempBytes as // Solidity does for memory variables. tempBytes := mload(0x40) // The first word of the slice result is potentially a partial // word read from the original array. To read it, we calculate // the length of that partial word and start copying that many // bytes into the array. The first word we copy will start with // data we don't care about, but the last `lengthmod` bytes will // land at the beginning of the contents of the new array. When // we're done copying, we overwrite the full first word with // the actual length of the slice. let lengthmod := and(_length, 31) // The multiplication in the next line is necessary // because when slicing multiples of 32 bytes (lengthmod == 0) // the following copy loop was copying the origin's length // and then ending prematurely not copying everything it should. let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod))) let end := add(mc, _length) for { // The multiplication in the next line has the same exact purpose // as the one above. let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start) } lt(mc, end) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { mstore(mc, mload(cc)) } mstore(tempBytes, _length) //update free-memory pointer //allocating the array padded to 32 bytes like the compiler does now mstore(0x40, and(add(mc, 31), not(31))) } //if we want a zero-length slice let's just return a zero-length array default { tempBytes := mload(0x40) //zero out the 32 bytes slice we are about to return //we need to do it because Solidity does not garbage collect mstore(tempBytes, 0) mstore(0x40, add(tempBytes, 0x20)) } } return tempBytes; } function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) { require(_bytes.length >= _start + 20, "toAddress_outOfBounds"); address tempAddress; assembly { tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000) } return tempAddress; } function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) { require(_bytes.length >= _start + 1 , "toUint8_outOfBounds"); uint8 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x1), _start)) } return tempUint; } function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) { require(_bytes.length >= _start + 2, "toUint16_outOfBounds"); uint16 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x2), _start)) } return tempUint; } function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) { require(_bytes.length >= _start + 4, "toUint32_outOfBounds"); uint32 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x4), _start)) } return tempUint; } function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) { require(_bytes.length >= _start + 8, "toUint64_outOfBounds"); uint64 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x8), _start)) } return tempUint; } function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) { require(_bytes.length >= _start + 12, "toUint96_outOfBounds"); uint96 tempUint; assembly { tempUint := mload(add(add(_bytes, 0xc), _start)) } return tempUint; } function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) { require(_bytes.length >= _start + 16, "toUint128_outOfBounds"); uint128 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x10), _start)) } return tempUint; } function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) { require(_bytes.length >= _start + 32, "toUint256_outOfBounds"); uint256 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x20), _start)) } return tempUint; } function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) { require(_bytes.length >= _start + 32, "toBytes32_outOfBounds"); bytes32 tempBytes32; assembly { tempBytes32 := mload(add(add(_bytes, 0x20), _start)) } return tempBytes32; } function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) { bool success = true; assembly { let length := mload(_preBytes) // if lengths don't match the arrays are not equal switch eq(length, mload(_postBytes)) case 1 { // cb is a circuit breaker in the for loop since there's // no said feature for inline assembly loops // cb = 1 - don't breaker // cb = 0 - break let cb := 1 let mc := add(_preBytes, 0x20) let end := add(mc, length) for { let cc := add(_postBytes, 0x20) // the next line is the loop condition: // while(uint256(mc < end) + cb == 2) } eq(add(lt(mc, end), cb), 2) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { // if any of these checks fails then arrays are not equal if iszero(eq(mload(mc), mload(cc))) { // unsuccess: success := 0 cb := 0 } } } default { // unsuccess: success := 0 } } return success; } function equalStorage( bytes storage _preBytes, bytes memory _postBytes ) internal view returns (bool) { bool success = true; assembly { // we know _preBytes_offset is 0 let fslot := sload(_preBytes.slot) // Decode the length of the stored array like in concatStorage(). let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2) let mlength := mload(_postBytes) // if lengths don't match the arrays are not equal switch eq(slength, mlength) case 1 { // slength can contain both the length and contents of the array // if length < 32 bytes so let's prepare for that // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage if iszero(iszero(slength)) { switch lt(slength, 32) case 1 { // blank the last byte which is the length fslot := mul(div(fslot, 0x100), 0x100) if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) { // unsuccess: success := 0 } } default { // cb is a circuit breaker in the for loop since there's // no said feature for inline assembly loops // cb = 1 - don't breaker // cb = 0 - break let cb := 1 // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) let sc := keccak256(0x0, 0x20) let mc := add(_postBytes, 0x20) let end := add(mc, mlength) // the next line is the loop condition: // while(uint256(mc < end) + cb == 2) for {} eq(add(lt(mc, end), cb), 2) { sc := add(sc, 1) mc := add(mc, 0x20) } { if iszero(eq(sload(sc), mload(mc))) { // unsuccess: success := 0 cb := 0 } } } } } default { // unsuccess: success := 0 } } return success; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; interface IBlitmap { function tokenDataOf(uint256 tokenId) external view returns (bytes memory); function tokenCreatorOf(uint256 tokenId) external view returns (address); function tokenNameOf(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "@0xsequence/sstore2/contracts/SSTORE2.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "solidity-bytes-utils/contracts/BytesLib.sol"; import "../interfaces/IBlitoadzRenderer.sol"; import "../interfaces/IBlitmap.sol"; import {Integers} from "../lib/Integers.sol"; /* @title Blitoadz Renderer @author Clement Walter @dev Encode each one of the 56 toadz in a single byte with a leading 57 uint16 for indexes. Color palettes is dropped because blitmap colors are used instead. */ contract BlitoadzRenderer is Ownable, ReentrancyGuard, IBlitoadzRenderer { using Strings for uint256; using Integers for uint8; // We have a total of 4 * 6 = 24 bits = 3 bytes for coordinates + 1 byte for the color // Hence each rect is 4 bytes uint8 public constant BITS_PER_FILL_INDEX = 2; string public constant RECT_TAG_START = "%3crect%20x=%27"; string public constant Y_TAG = "%27%20y=%27"; string public constant WH_FILL_TAG = "%27%20width=%271%27%20height=%271%27%20fill=%27%23"; string public constant RECT_TAG_END = "%27/%3e"; string public constant SVG_TAG_START = "%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2036%2036%27%20width=%27360px%27%20height=%27360px%27%3e"; string public constant SVG_TAG_END = "%3cstyle%3erect{shape-rendering:crispEdges}%3c/style%3e%3c/svg%3e"; address public toadz; // 57 uint16 leading indexes followed by the actual 56 toadz images address public toadzNames; // 57 uint16 leading indexes followed by the actual 56 toadz names IBlitmap blitmap; //////////////////////////////////////////////////////////////////////////////// //////////////////////////// Rendering mechanics ///////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// @dev Indexes and images are concatenated and stored in a single 'bytes' with SSTORE2 to save gas. constructor(address _blitmap) { blitmap = IBlitmap(_blitmap); } function setToadz(bytes calldata _toadz) external onlyOwner { toadz = SSTORE2.write(_toadz); } function setToadzNames(bytes calldata _toadzNames) external onlyOwner { toadzNames = SSTORE2.write(_toadzNames); } function getToadzBytes(uint256 _index) public view returns (bytes memory) { uint16 start = BytesLib.toUint16( SSTORE2.read(toadz, 2 * _index, 2 * _index + 2), 0 ); uint16 end = BytesLib.toUint16( SSTORE2.read(toadz, 2 * _index + 2, 2 * _index + 4), 0 ); return SSTORE2.read(toadz, start + 57 * 2, end + 57 * 2); } function getToadzName(uint256 _index) public view returns (string memory) { uint16 start = BytesLib.toUint16( SSTORE2.read(toadzNames, 2 * _index, 2 * _index + 2), 0 ); uint16 end = BytesLib.toUint16( SSTORE2.read(toadzNames, 2 * _index + 2, 2 * _index + 4), 0 ); return string(SSTORE2.read(toadzNames, start + 57 * 2, end + 57 * 2)); } /// @dev 3 bytes per color because svg does not handle alpha. function getFill(bytes memory palette, uint256 _index) public pure returns (string memory) { return string.concat( uint8(palette[3 * _index]).toString(16, 2), uint8(palette[3 * _index + 1]).toString(16, 2), uint8(palette[3 * _index + 2]).toString(16, 2) ); } function decode1Pixel( uint256 index, bytes1 _byte, string[4] memory palette ) internal pure returns (string memory) { return string.concat( RECT_TAG_START, (index % 36).toString(), Y_TAG, (index / 36).toString(), WH_FILL_TAG, palette[uint8(_byte)], RECT_TAG_END ); } /// @dev 1 byte is 4 color indexes, so 4 rect function decode4Pixels( uint256 startIndex, bytes1 _byte, string[4] memory palette ) internal pure returns (string memory) { return string.concat( decode1Pixel(startIndex, _byte >> 6, palette), decode1Pixel(startIndex + 1, (_byte & 0x3f) >> 4, palette), decode1Pixel(startIndex + 2, (_byte & 0x0f) >> 2, palette), decode1Pixel(startIndex + 3, _byte & 0x03, palette) ); } function decode16Pixels( uint256 startIndex, bytes memory _bytes, string[4] memory palette ) internal pure returns (string memory) { return string.concat( decode4Pixels(startIndex + 0, _bytes[0], palette), decode4Pixels(startIndex + 4, _bytes[1], palette), decode4Pixels(startIndex + 8, _bytes[2], palette), decode4Pixels(startIndex + 12, _bytes[3], palette) ); } function decode128Pixels( uint256 startIndex, bytes memory _bytes, string[4] memory palette ) internal pure returns (string memory) { return string.concat( decode16Pixels( startIndex + 0, BytesLib.slice(_bytes, 0, 4), palette ), decode16Pixels( startIndex + 16, BytesLib.slice(_bytes, 4, 4), palette ), decode16Pixels( startIndex + 32, BytesLib.slice(_bytes, 8, 4), palette ), decode16Pixels( startIndex + 48, BytesLib.slice(_bytes, 12, 4), palette ), decode16Pixels( startIndex + 64, BytesLib.slice(_bytes, 16, 4), palette ), decode16Pixels( startIndex + 80, BytesLib.slice(_bytes, 20, 4), palette ), decode16Pixels( startIndex + 96, BytesLib.slice(_bytes, 24, 4), palette ), decode16Pixels( startIndex + 112, BytesLib.slice(_bytes, 28, 4), palette ) ); } function decode1296Pixels(bytes memory _bytes, string[4] memory palette) internal pure returns (string memory) { return string.concat( decode128Pixels( 0 * 128, BytesLib.slice(_bytes, 0 * 32, 32), palette ), decode128Pixels( 1 * 128, BytesLib.slice(_bytes, 1 * 32, 32), palette ), decode128Pixels( 2 * 128, BytesLib.slice(_bytes, 2 * 32, 32), palette ), decode128Pixels( 3 * 128, BytesLib.slice(_bytes, 3 * 32, 32), palette ), decode128Pixels( 4 * 128, BytesLib.slice(_bytes, 4 * 32, 32), palette ), decode128Pixels( 5 * 128, BytesLib.slice(_bytes, 5 * 32, 32), palette ), decode128Pixels( 6 * 128, BytesLib.slice(_bytes, 6 * 32, 32), palette ), decode128Pixels( 7 * 128, BytesLib.slice(_bytes, 7 * 32, 32), palette ), decode128Pixels( 8 * 128, BytesLib.slice(_bytes, 8 * 32, 32), palette ), decode128Pixels( 9 * 128, BytesLib.slice(_bytes, 9 * 32, 32), palette ), decode16Pixels( 10 * 128, BytesLib.slice(_bytes, 320, 4), palette ) ); } //////////////////////////////////////////////////////////////////////////////// ///////////////////////////////// Blitoadz /////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// @dev Decode the rect and returns it as a plain string to be used in the svg rect attribute. function getBlitoadz( uint256 toadzId, uint256 blitmapId, uint8 paletteOrder ) public view returns (string memory) { bytes memory toadzBytes = getToadzBytes(toadzId); bytes memory palette = BytesLib.slice( blitmap.tokenDataOf(blitmapId), 0, 12 ); string[4] memory paletteHex = [ getFill(palette, paletteOrder >> 6), getFill(palette, (paletteOrder >> 4) & 0x3), getFill(palette, (paletteOrder >> 2) & 0x3), getFill(palette, paletteOrder & 0x3) ]; return string.concat( SVG_TAG_START, decode1296Pixels(toadzBytes, paletteHex), SVG_TAG_END ); } function getImageURI( uint256 toadzId, uint256 blitmapId, uint8 paletteOrder ) public view returns (string memory) { return string.concat( "data:image/svg+xml,", getBlitoadz(toadzId, blitmapId, paletteOrder) ); } function tokenURI( uint256 toadzId, uint256 blitmapId, uint8 paletteOrder ) public view returns (string memory) { return string.concat( "data:application/json,", '{"image_data": "', getImageURI(toadzId, blitmapId, paletteOrder), '"', ',"description": "Blitoadz are a blitmap and CrypToadz cross-breed, paving the way toward a new blitzverse. Oh - and they\'re fully on-chain."', ',"name": "', getToadzName(toadzId), " ", blitmap.tokenNameOf(blitmapId), '"}' ); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./utils/Bytecode.sol"; /** @title A key-value storage with auto-generated keys for storing chunks of data with a lower write & read cost. @author Agustin Aguilar <[email protected]> Readme: https://github.com/0xsequence/sstore2#readme */ library SSTORE2 { error WriteError(); /** @notice Stores `_data` and returns `pointer` as key for later retrieval @dev The pointer is a contract address with `_data` as code @param _data to be written @return pointer Pointer to the written `_data` */ function write(bytes memory _data) internal returns (address pointer) { // Append 00 to _data so contract can't be called // Build init code bytes memory code = Bytecode.creationCodeFor( abi.encodePacked( hex'00', _data ) ); // Deploy contract using create assembly { pointer := create(0, add(code, 32), mload(code)) } // Address MUST be non-zero if (pointer == address(0)) revert WriteError(); } /** @notice Reads the contents of the `_pointer` code as data, skips the first byte @dev The function is intended for reading pointers generated by `write` @param _pointer to be read @return data read from `_pointer` contract */ function read(address _pointer) internal view returns (bytes memory) { return Bytecode.codeAt(_pointer, 1, type(uint256).max); } /** @notice Reads the contents of the `_pointer` code as data, skips the first byte @dev The function is intended for reading pointers generated by `write` @param _pointer to be read @param _start number of bytes to skip @return data read from `_pointer` contract */ function read(address _pointer, uint256 _start) internal view returns (bytes memory) { return Bytecode.codeAt(_pointer, _start + 1, type(uint256).max); } /** @notice Reads the contents of the `_pointer` code as data, skips the first byte @dev The function is intended for reading pointers generated by `write` @param _pointer to be read @param _start number of bytes to skip @param _end index before which to end extraction @return data read from `_pointer` contract */ function read(address _pointer, uint256 _start, uint256 _end) internal view returns (bytes memory) { return Bytecode.codeAt(_pointer, _start + 1, _end + 1); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; interface IBlitoadzRenderer { function tokenURI( uint256 toadzId, uint256 blitmapId, uint8 paletteOrder ) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * Integers Library updated from https://github.com/willitscale/solidity-util * * In summary this is a simple library of integer functions which allow a simple * conversion to and from strings * * @author Clement Walter <[email protected]> */ library Integers { /** * To String * * Converts an unsigned integer to the string equivalent value, returned as bytes * Equivalent to javascript's toString(base) * * @param _number The unsigned integer to be converted to a string * @param _base The base to convert the number to * @param _padding The target length of the string; result will be padded with 0 to reach this length while padding * of 0 means no padding * @return bytes The resulting ASCII string value */ function toString( uint256 _number, uint8 _base, uint8 _padding ) public pure returns (string memory) { uint256 count = 0; uint256 b = _number; while (b != 0) { count++; b /= _base; } if (_number == 0) { count++; } bytes memory res; if (_padding == 0) { res = new bytes(count); } else { res = new bytes(_padding); } for (uint256 i = 0; i < count; ++i) { b = _number % _base; if (b < 10) { res[res.length - i - 1] = bytes1(uint8(b + 48)); // 0-9 } else { res[res.length - i - 1] = bytes1(uint8((b % 10) + 65)); // A-F } _number /= _base; } for (uint256 i = count; i < _padding; ++i) { res[res.length - i - 1] = hex"30"; // 0 } return string(res); } function toString(uint256 _number) public pure returns (string memory) { return toString(_number, 10, 0); } function toString(uint256 _number, uint8 _base) public pure returns (string memory) { return toString(_number, _base, 0); } /** * Load 16 * * Converts two bytes to a 16 bit unsigned integer * * @param _leadingBytes the first byte of the unsigned integer in [256, 65536] * @param _endingBytes the second byte of the unsigned integer in [0, 255] * @return uint16 The resulting integer value */ function load16(bytes1 _leadingBytes, bytes1 _endingBytes) public pure returns (uint16) { return (uint16(uint8(_leadingBytes)) << 8) + uint16(uint8(_endingBytes)); } /** * Load 12 * * Converts three bytes into two uint12 integers * * @return (uint16, uint16) The two uint16 values up to 2^12 each */ function load12x2( bytes1 first, bytes1 second, bytes1 third ) public pure returns (uint16, uint16) { return ( (uint16(uint8(first)) << 4) + (uint16(uint8(second)) >> 4), (uint16(uint8(second & hex"0f")) << 8) + uint16(uint8(third)) ); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library Bytecode { error InvalidCodeAtRange(uint256 _size, uint256 _start, uint256 _end); /** @notice Generate a creation code that results on a contract with `_code` as bytecode @param _code The returning value of the resulting `creationCode` @return creationCode (constructor) for new contract */ function creationCodeFor(bytes memory _code) internal pure returns (bytes memory) { /* 0x00 0x63 0x63XXXXXX PUSH4 _code.length size 0x01 0x80 0x80 DUP1 size size 0x02 0x60 0x600e PUSH1 14 14 size size 0x03 0x60 0x6000 PUSH1 00 0 14 size size 0x04 0x39 0x39 CODECOPY size 0x05 0x60 0x6000 PUSH1 00 0 size 0x06 0xf3 0xf3 RETURN <CODE> */ return abi.encodePacked( hex"63", uint32(_code.length), hex"80_60_0E_60_00_39_60_00_F3", _code ); } /** @notice Returns the size of the code on a given address @param _addr Address that may or may not contain code @return size of the code on the given `_addr` */ function codeSize(address _addr) internal view returns (uint256 size) { assembly { size := extcodesize(_addr) } } /** @notice Returns the code of a given address @dev It will fail if `_end < _start` @param _addr Address that may or may not contain code @param _start number of bytes of code to skip on read @param _end index before which to end extraction @return oCode read from `_addr` deployed bytecode Forked from: https://gist.github.com/KardanovIR/fe98661df9338c842b4a30306d507fbd */ function codeAt(address _addr, uint256 _start, uint256 _end) internal view returns (bytes memory oCode) { uint256 csize = codeSize(_addr); if (csize == 0) return bytes(""); if (_start > csize) return bytes(""); if (_end < _start) revert InvalidCodeAtRange(csize, _start, _end); unchecked { uint256 reqSize = _end - _start; uint256 maxSize = csize - _start; uint256 size = maxSize < reqSize ? maxSize : reqSize; assembly { // allocate output byte array - this could also be done without assembly // by using o_code = new bytes(size) oCode := mload(0x40) // new "memory end" including padding mstore(0x40, add(oCode, and(add(add(size, 0x20), 0x1f), not(0x1f)))) // store length in memory mstore(oCode, size) // actually retrieve the code, this needs assembly extcodecopy(_addr, add(oCode, 0x20), _start, size) } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "erc721a/contracts/ERC721A.sol"; import "../interfaces/IBlitoadzRenderer.sol"; import "../interfaces/IBlitmap.sol"; contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } error PublicSaleOpen(); error PublicSaleNotOpen(); error BlitoadzExists(); error ToadzIndexOutOfBounds(); error BlitmapIndexOutOfBounds(); error NothingToWithdraw(); error WithdrawalFailed(); error ToadzAndBlitmapLengthMismatch(); error IncorrectPrice(); error AllocationExceeded(); error BlitoadzDoesNotExist(); contract Blitoadz is ERC721A, Ownable, ReentrancyGuard { // Constants uint256 public constant MINT_PUBLIC_PRICE = 0.056 ether; uint8 public constant TOADZ_COUNT = 56; uint8 public constant BLITMAP_COUNT = 100; uint16 public constant BLITOADZ_COUNT = 5_600; IBlitmap public blitmap; // Blitoadz states variables bool[BLITOADZ_COUNT] public blitoadzExist; uint8[] public toadzIds; uint8[] public blitmapIds; uint8[] public palettes; // Blitoadz funds split uint256 public blitmapCreatorShares; mapping(address => Founder) public founders; mapping(address => uint16) creatorAvailableAmount; uint256 receivedAmount; struct Founder { uint128 withdrawnAmount; uint16 shares; uint8 remainingAllocation; } // Events event PublicSaleOpened(uint256 timestamp); event RendererChanged(address newRenderer); event BlitmapCreatorWithdrawn(address account, uint256 amount); event FounderWithdrawn(address account, uint256 amount); //////////////////////////////////////////////////////////////////////// ////////////////////////// Schedule //////////////////////////////////// //////////////////////////////////////////////////////////////////////// uint256 public publicSaleStartTimestamp; function isPublicSaleOpen() public view returns (bool) { return block.timestamp > publicSaleStartTimestamp && publicSaleStartTimestamp != 0; } modifier whenPublicSaleOpen() { if (!isPublicSaleOpen()) revert PublicSaleNotOpen(); _; } modifier whenPublicSaleClosed() { if (isPublicSaleOpen()) revert PublicSaleNotOpen(); _; } function openPublicSale() external onlyOwner whenPublicSaleClosed { publicSaleStartTimestamp = block.timestamp; emit PublicSaleOpened(publicSaleStartTimestamp); } //////////////////////////////////////////////////////////////////////// ////////////////////////// Token /////////////////////////////////////// //////////////////////////////////////////////////////////////////////// address public renderingContractAddress; IBlitoadzRenderer renderer; function setRenderingContractAddress(address _renderingContractAddress) public onlyOwner { renderingContractAddress = _renderingContractAddress; renderer = IBlitoadzRenderer(renderingContractAddress); emit RendererChanged(renderingContractAddress); } constructor( string memory name_, string memory symbol_, address _rendererAddress, address[] memory _founders, Founder[] memory _foundersData, uint256 _blitmapCreatorShares, address _blitmap ) ERC721A(name_, symbol_) { setRenderingContractAddress(_rendererAddress); for (uint256 i = 0; i < _founders.length; i++) { founders[_founders[i]] = _foundersData[i]; } blitmapCreatorShares = _blitmapCreatorShares; blitmap = IBlitmap(_blitmap); } /// @notice Free mint for addresses with an allocation. Lengths should match; at a given index the combination /// toadzId, blitmapId and paletteOrder will be used to define the given blitoadz /// @param _toadzIds the list of toadzIds to use, 0 based indexes. On etherscan, this could be e.g. 12,53,1 /// @param _blitmapIds the list of blitmapIds to use, 0 based indexes. On etherscan, this could be e.g. 99,23,87 /// @param _paletteOrders the order of the mapping for the blitmap color palette. This uint8 is parsed as 4 uint2 /// and there are consequently only 24 relevant values, any permutation of 0, 1, 2, 3 /// @param isBlitoadzPayable should this blitoadz be counted for founders and creator claims function _mint( address to, uint256[] calldata _toadzIds, uint256[] calldata _blitmapIds, uint256[] calldata _paletteOrders, bool isBlitoadzPayable ) internal { for (uint256 i = 0; i < _toadzIds.length; i++) { uint256 toadzId = _toadzIds[i]; uint256 blitmapId = _blitmapIds[i]; if (blitoadzExist[toadzId * BLITMAP_COUNT + blitmapId]) revert BlitoadzExists(); if (toadzId > TOADZ_COUNT - 1) revert ToadzIndexOutOfBounds(); if (blitmapId > BLITMAP_COUNT - 1) revert BlitmapIndexOutOfBounds(); toadzIds.push(uint8(toadzId % type(uint8).max)); blitmapIds.push(uint8(blitmapId % type(uint8).max)); palettes.push(uint8(_paletteOrders[i] % type(uint8).max)); blitoadzExist[toadzId * BLITMAP_COUNT + blitmapId] = true; if (isBlitoadzPayable) creatorAvailableAmount[blitmap.tokenCreatorOf(blitmapId)]++; } _safeMint(to, _toadzIds.length); } /// @notice Free mint for addresses with an allocation. Lengths should match; at a given index the combination /// toadzId, blitmapId and paletteOrder will be used to define the given blitoadz /// @param _toadzIds the list of toadzIds to use, 0 based indexes. On etherscan, this could be e.g. 12,53,1 /// @param _blitmapIds the list of blitmapIds to use, 0 based indexes. On etherscan, this could be e.g. 99,23,87 /// @param _paletteOrders the order of the mapping for the blitmap color palette. This uint8 is parsed as 4 uint2 /// and there are consequently only 24 relevant values, any permutation of 0, 1, 2, 3 function mintPublicSale( uint256[] calldata _toadzIds, uint256[] calldata _blitmapIds, uint256[] calldata _paletteOrders ) external payable whenPublicSaleOpen nonReentrant { if (_toadzIds.length != _blitmapIds.length) revert ToadzAndBlitmapLengthMismatch(); if (msg.value != MINT_PUBLIC_PRICE * _toadzIds.length) revert IncorrectPrice(); _mint(_msgSender(), _toadzIds, _blitmapIds, _paletteOrders, true); receivedAmount += MINT_PUBLIC_PRICE * _toadzIds.length; } /// @notice Free mint for addresses with an allocation. Lengths should match; at a given index the combination /// toadzId, blitmapId and paletteOrder will be used to define the given blitoadz /// @param _toadzIds the list of toadzIds to use, 0 based indexes. On etherscan, this could be e.g. 12,53,1 /// @param _blitmapIds the list of blitmapIds to use, 0 based indexes. On etherscan, this could be e.g. 99,23,87 /// @param _paletteOrders the order of the mapping for the blitmap color palette. This uint8 is parsed as 4 uint2 /// and there are consequently only 24 relevant values, any permutation of 0, 1, 2, 3 function mintAllocation( uint256[] calldata _toadzIds, uint256[] calldata _blitmapIds, uint256[] calldata _paletteOrders ) external nonReentrant { if (_toadzIds.length != _blitmapIds.length) revert ToadzAndBlitmapLengthMismatch(); if (founders[_msgSender()].remainingAllocation < _toadzIds.length) revert AllocationExceeded(); founders[_msgSender()].remainingAllocation -= uint8( _toadzIds.length % type(uint8).max ); _mint(_msgSender(), _toadzIds, _blitmapIds, _paletteOrders, false); } /// @notice Withdraw available funds for blitmap creator function withdrawBlitmapCreator() external nonReentrant returns (bool) { if (creatorAvailableAmount[_msgSender()] == 0) revert NothingToWithdraw(); uint256 value = (MINT_PUBLIC_PRICE * creatorAvailableAmount[_msgSender()] * blitmapCreatorShares) / BLITOADZ_COUNT; (bool success, ) = _msgSender().call{value: value}(""); if (!success) revert WithdrawalFailed(); emit BlitmapCreatorWithdrawn(_msgSender(), value); creatorAvailableAmount[_msgSender()] = 0; return success; } /// @notice Withdraw available funds for blitoadz and toadz creators function withdrawFounder() external nonReentrant returns (bool) { uint256 value = (receivedAmount * founders[_msgSender()].shares) / BLITOADZ_COUNT - founders[_msgSender()].withdrawnAmount; if (value == 0) revert NothingToWithdraw(); founders[_msgSender()].withdrawnAmount += uint128( value % type(uint128).max ); (bool success, ) = _msgSender().call{value: value}(""); if (!success) revert WithdrawalFailed(); emit FounderWithdrawn(_msgSender(), value); return success; } /// @notice Retrieve a tokenURI from the combination toadzId, blitmapId function tokenURI(uint8 toadzId, uint8 blitmapId) external view returns (string memory) { for (uint256 i = 0; i < toadzIds.length; i++) { if (toadzIds[i] == toadzId && blitmapIds[i] == blitmapId) { return tokenURI(i); } } revert BlitoadzDoesNotExist(); } function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { if (!_exists(_tokenId)) revert URIQueryForNonexistentToken(); if (renderingContractAddress == address(0)) { return ""; } return renderer.tokenURI( toadzIds[_tokenId], blitmapIds[_tokenId], palettes[_tokenId] ); } function exists(uint256 _tokenId) external view returns (bool) { return _exists(_tokenId); } receive() external payable {} }
// SPDX-License-Identifier: MIT // Creator: Chiru Labs pragma solidity ^0.8.4; import '@openzeppelin/contracts/token/ERC721/IERC721.sol'; import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol'; import '@openzeppelin/contracts/utils/Address.sol'; import '@openzeppelin/contracts/utils/Context.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import '@openzeppelin/contracts/utils/introspection/ERC165.sol'; error ApprovalCallerNotOwnerNorApproved(); error ApprovalQueryForNonexistentToken(); error ApproveToCaller(); error ApprovalToCurrentOwner(); error BalanceQueryForZeroAddress(); error MintedQueryForZeroAddress(); error BurnedQueryForZeroAddress(); error MintToZeroAddress(); error MintZeroQuantity(); error OwnerIndexOutOfBounds(); error OwnerQueryForNonexistentToken(); error TokenIndexOutOfBounds(); error TransferCallerNotOwnerNorApproved(); error TransferFromIncorrectOwner(); error TransferToNonERC721ReceiverImplementer(); error TransferToZeroAddress(); error URIQueryForNonexistentToken(); /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..). * * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * * Assumes that the maximum token id cannot exceed 2**128 - 1 (max value of uint128). */ contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; // Compiler will pack this into a single 256bit word. struct TokenOwnership { // The address of the owner. address addr; // Keeps track of the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; } // Compiler will pack this into a single 256bit word. struct AddressData { // Realistically, 2**64-1 is more than enough. uint64 balance; // Keeps track of mint count with minimal overhead for tokenomics. uint64 numberMinted; // Keeps track of burn count with minimal overhead for tokenomics. uint64 numberBurned; } // Compiler will pack the following // _currentIndex and _burnCounter into a single 256bit word. // The tokenId of the next token to be minted. uint128 internal _currentIndex; // The number of tokens burned. uint128 internal _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details. mapping(uint256 => TokenOwnership) internal _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // 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; constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than _currentIndex times unchecked { return _currentIndex - _burnCounter; } } /** * @dev See {IERC721Enumerable-tokenByIndex}. * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first. * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case. */ function tokenByIndex(uint256 index) public view override returns (uint256) { uint256 numMintedSoFar = _currentIndex; uint256 tokenIdsIdx; // Counter overflow is impossible as the loop breaks when // uint256 i is equal to another uint256 numMintedSoFar. unchecked { for (uint256 i; i < numMintedSoFar; i++) { TokenOwnership memory ownership = _ownerships[i]; if (!ownership.burned) { if (tokenIdsIdx == index) { return i; } tokenIdsIdx++; } } } revert TokenIndexOutOfBounds(); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first. * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) { if (index >= balanceOf(owner)) revert OwnerIndexOutOfBounds(); uint256 numMintedSoFar = _currentIndex; uint256 tokenIdsIdx; address currOwnershipAddr; // Counter overflow is impossible as the loop breaks when // uint256 i is equal to another uint256 numMintedSoFar. unchecked { for (uint256 i; i < numMintedSoFar; i++) { TokenOwnership memory ownership = _ownerships[i]; if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { if (tokenIdsIdx == index) { return i; } tokenIdsIdx++; } } } // Execution should never reach this point. revert(); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return uint256(_addressData[owner].balance); } function _numberMinted(address owner) internal view returns (uint256) { if (owner == address(0)) revert MintedQueryForZeroAddress(); return uint256(_addressData[owner].numberMinted); } function _numberBurned(address owner) internal view returns (uint256) { if (owner == address(0)) revert BurnedQueryForZeroAddress(); return uint256(_addressData[owner].numberBurned); } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { uint256 curr = tokenId; unchecked { if (curr < _currentIndex) { TokenOwnership memory ownership = _ownerships[curr]; if (!ownership.burned) { if (ownership.addr != address(0)) { return ownership; } // Invariant: // There will always be an ownership that has an address and is not burned // before an ownership that does not have an address and is not burned. // Hence, curr will not underflow. while (true) { curr--; ownership = _ownerships[curr]; if (ownership.addr != address(0)) { return ownership; } } } } } revert OwnerQueryForNonexistentToken(); } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { return ownershipOf(tokenId).addr; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ''; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public override { address owner = ERC721A.ownerOf(tokenId); if (to == owner) revert ApprovalToCurrentOwner(); if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) { revert ApprovalCallerNotOwnerNorApproved(); } _approve(to, tokenId, owner); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public override { if (operator == _msgSender()) revert ApproveToCaller(); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { _transfer(from, to, tokenId); if (!_checkOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), */ function _exists(uint256 tokenId) internal view returns (bool) { return tokenId < _currentIndex && !_ownerships[tokenId].burned; } function _safeMint(address to, uint256 quantity) internal { _safeMint(to, quantity, ''); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { _mint(to, quantity, _data, true); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _mint( address to, uint256 quantity, bytes memory _data, bool safe ) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 3.4e38 (2**128) - 1 // updatedIndex overflows if _currentIndex + quantity > 3.4e38 (2**128) - 1 unchecked { _addressData[to].balance += uint64(quantity); _addressData[to].numberMinted += uint64(quantity); _ownerships[startTokenId].addr = to; _ownerships[startTokenId].startTimestamp = uint64(block.timestamp); uint256 updatedIndex = startTokenId; for (uint256 i; i < quantity; i++) { emit Transfer(address(0), to, updatedIndex); if (safe && !_checkOnERC721Received(address(0), to, updatedIndex, _data)) { revert TransferToNonERC721ReceiverImplementer(); } updatedIndex++; } _currentIndex = uint128(updatedIndex); } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) private { TokenOwnership memory prevOwnership = ownershipOf(tokenId); bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr || isApprovedForAll(prevOwnership.addr, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); if (prevOwnership.addr != from) revert TransferFromIncorrectOwner(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, prevOwnership.addr); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**128. unchecked { _addressData[from].balance -= 1; _addressData[to].balance += 1; _ownerships[tokenId].addr = to; _ownerships[tokenId].startTimestamp = uint64(block.timestamp); // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; if (_ownerships[nextTokenId].addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId < _currentIndex) { _ownerships[nextTokenId].addr = prevOwnership.addr; _ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @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 { TokenOwnership memory prevOwnership = ownershipOf(tokenId); _beforeTokenTransfers(prevOwnership.addr, address(0), tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, prevOwnership.addr); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**128. unchecked { _addressData[prevOwnership.addr].balance -= 1; _addressData[prevOwnership.addr].numberBurned += 1; // Keep track of who burned the token, and the timestamp of burning. _ownerships[tokenId].addr = prevOwnership.addr; _ownerships[tokenId].startTimestamp = uint64(block.timestamp); _ownerships[tokenId].burned = true; // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; if (_ownerships[nextTokenId].addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId < _currentIndex) { _ownerships[nextTokenId].addr = prevOwnership.addr; _ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(prevOwnership.addr, address(0), tokenId); _afterTokenTransfers(prevOwnership.addr, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve( address to, uint256 tokenId, address owner ) private { _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, 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(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * And also called before burning one token. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes * minting. * And also called after one token has been burned. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "optimizer": { "enabled": true, "runs": 2000, "details": { "yul": true, "yulDetails": { "stackAllocation": true, "optimizerSteps": "dhfoDgvulfnTUtnIf" } } }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": { "": { "__CACHE_BREAKER__": "0x00000000d41867734bbee4c6863d9255b2b06ac1" } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"address","name":"_rendererAddress","type":"address"},{"internalType":"address[]","name":"_founders","type":"address[]"},{"components":[{"internalType":"uint128","name":"withdrawnAmount","type":"uint128"},{"internalType":"uint16","name":"shares","type":"uint16"},{"internalType":"uint8","name":"remainingAllocation","type":"uint8"}],"internalType":"struct Blitoadz.Founder[]","name":"_foundersData","type":"tuple[]"},{"internalType":"uint256","name":"_blitmapCreatorShares","type":"uint256"},{"internalType":"address","name":"_blitmap","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AllocationExceeded","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"BlitmapIndexOutOfBounds","type":"error"},{"inputs":[],"name":"BlitoadzDoesNotExist","type":"error"},{"inputs":[],"name":"BlitoadzExists","type":"error"},{"inputs":[],"name":"IncorrectPrice","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NothingToWithdraw","type":"error"},{"inputs":[],"name":"OwnerIndexOutOfBounds","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"PublicSaleNotOpen","type":"error"},{"inputs":[],"name":"ToadzAndBlitmapLengthMismatch","type":"error"},{"inputs":[],"name":"ToadzIndexOutOfBounds","type":"error"},{"inputs":[],"name":"TokenIndexOutOfBounds","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"WithdrawalFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BlitmapCreatorWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FounderWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"PublicSaleOpened","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newRenderer","type":"address"}],"name":"RendererChanged","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":"BLITMAP_COUNT","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLITOADZ_COUNT","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_PUBLIC_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOADZ_COUNT","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"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":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blitmap","outputs":[{"internalType":"contract IBlitmap","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blitmapCreatorShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"blitmapIds","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"blitoadzExist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"founders","outputs":[{"internalType":"uint128","name":"withdrawnAmount","type":"uint128"},{"internalType":"uint16","name":"shares","type":"uint16"},{"internalType":"uint8","name":"remainingAllocation","type":"uint8"}],"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"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPublicSaleOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_toadzIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_blitmapIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_paletteOrders","type":"uint256[]"}],"name":"mintAllocation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_toadzIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_blitmapIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_paletteOrders","type":"uint256[]"}],"name":"mintPublicSale","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openPublicSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"palettes","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSaleStartTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renderingContractAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_renderingContractAddress","type":"address"}],"name":"setRenderingContractAddress","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":"","type":"uint256"}],"name":"toadzIds","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"toadzId","type":"uint8"},{"internalType":"uint8","name":"blitmapId","type":"uint8"}],"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":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawBlitmapCreator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawFounder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040523480156200001157600080fd5b506040516200378538038062003785833981016040819052620000349162000696565b8651879087906200004d90600190602085019062000282565b5080516200006390600290602084019062000282565b505050620000806200007a6200019160201b60201c565b62000195565b60016008556200009085620001e7565b60005b84518110156200015f57838181518110620000b257620000b2620007ba565b602002602001015160bd6000878481518110620000d357620000d3620007ba565b6020908102919091018101516001600160a01b031682528181019290925260409081016000208351815493850151949092015160ff16600160901b0260ff60901b1961ffff909516600160801b026001600160901b03199094166001600160801b03909316929092179290921792909216919091179055806200015681620007e6565b91505062000093565b5060bc91909155600980546001600160a01b0319166001600160a01b0390921691909117905550620008a79350505050565b3390565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6007546001600160a01b031633146200021d5760405162461bcd60e51b8152600401620002149062000804565b60405180910390fd5b60c180546001600160a01b0383166001600160a01b0319918216811790925560c28054909116821790556040517fa00632ff71f043bcebbaa26952d3fd31a42e459b0dc8b686a91eb77725ee668091620002779162000850565b60405180910390a150565b828054620002909062000876565b90600052602060002090601f016020900481019282620002b45760008555620002ff565b82601f10620002cf57805160ff1916838001178555620002ff565b82800160010185558215620002ff579182015b82811115620002ff578251825591602001919060010190620002e2565b506200030d92915062000311565b5090565b5b808211156200030d576000815560010162000312565b634e487b7160e01b600052604160045260246000fd5b601f19601f83011681016001600160401b038111828210171562000366576200036662000328565b6040525050565b60006200037960405190565b90506200038782826200033e565b919050565b60006001600160401b03821115620003a857620003a862000328565b601f19601f83011660200192915050565b60005b83811015620003d6578181015183820152602001620003bc565b83811115620003e6576000848401525b50505050565b600062000403620003fd846200038c565b6200036d565b905082815260208101848484011115620004205762000420600080fd5b6200042d848285620003b9565b509392505050565b600082601f8301126200044b576200044b600080fd5b81516200045d848260208601620003ec565b949350505050565b60006001600160a01b0382165b92915050565b620004838162000465565b81146200048f57600080fd5b50565b8051620004728162000478565b60006001600160401b03821115620004bb57620004bb62000328565b5060209081020190565b6000620004d6620003fd846200049f565b83815290506020808201908402830185811115620004f757620004f7600080fd5b835b818110156200051d576200050e878262000492565b835260209283019201620004f9565b5050509392505050565b600082601f8301126200053d576200053d600080fd5b81516200045d848260208601620004c5565b6001600160801b03811662000483565b805162000472816200054f565b61ffff811662000483565b805162000472816200056c565b60ff811662000483565b8051620004728162000584565b600060608284031215620005b257620005b2600080fd5b620005be60606200036d565b90506000620005ce84846200055f565b908201526020620005e28484830162000577565b908201526040620005f6848483016200058e565b9082015292915050565b600062000611620003fd846200049f565b83815290506020810160608402830185811115620006325762000632600080fd5b835b818110156200051d576200064987826200059b565b835260209092019160600162000634565b600082601f830112620006705762000670600080fd5b81516200045d84826020860162000600565b8062000483565b8051620004728162000682565b600080600080600080600060e0888a031215620006b657620006b6600080fd5b87516001600160401b03811115620006d157620006d1600080fd5b620006df8a828b0162000435565b60208a015190985090506001600160401b03811115620007025762000702600080fd5b620007108a828b0162000435565b9650506040620007238a828b0162000492565b60608a015190965090506001600160401b03811115620007465762000746600080fd5b620007548a828b0162000527565b60808a015190955090506001600160401b03811115620007775762000777600080fd5b620007858a828b016200065a565b93505060a0620007988a828b0162000689565b92505060c0620007ab8a828b0162000492565b91505092959891949750929550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415620007fd57620007fd620007d0565b5060010190565b60208082528181019081527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408301526060820162000472565b6200084a8162000465565b82525050565b602081016200047282846200083f565b634e487b7160e01b600052602260045260246000fd5b6002810460018216806200088b57607f821691505b60208210811415620008a157620008a162000860565b50919050565b612ece80620008b76000396000f3fe6080604052600436106102ca5760003560e01c806395d89b4111610179578063c0c9c735116100d6578063de6746a51161008a578063f140a90011610064578063f140a90014610812578063f2fde38b14610825578063f95ed2f51461084557600080fd5b8063de6746a514610730578063e632751a146107a9578063e985e9c5146107c957600080fd5b8063d7822c99116100bb578063d7822c99146106da578063dcf7eefe146106f0578063dd6c6cef1461071057600080fd5b8063c0c9c735146106a5578063c87b56dd146106ba57600080fd5b8063af0097251161012d578063b6cfb24211610112578063b6cfb24214610638578063b88d4fde14610665578063c074f4121461068557600080fd5b8063af00972514610603578063b585209b1461062357600080fd5b80639c51792a1161015e5780639c51792a146105b2578063a22cb465146105cd578063ac156e9b146105ed57600080fd5b806395d89b411461058857806399c0731b1461059d57600080fd5b80633189a5341161022757806353557e25116101db57806370a08231116101c057806370a0823114610535578063715018a6146105555780638da5cb5b1461056a57600080fd5b806353557e25146104f25780636352211e1461051557600080fd5b80634bd3f52f1161020c5780634bd3f52f1461049d5780634f558e79146104b25780634f6ccce7146104d257600080fd5b80633189a5341461045057806342842e0e1461047d57600080fd5b806318160ddd1161027e5780631a6949e3116102635780631a6949e3146103fb57806323b872dd146104105780632f745c591461043057600080fd5b806318160ddd1461039d578063191694f8146103e657600080fd5b8063081812fc116102af578063081812fc1461032e578063095ea7b31461035b57806312b40a9f1461037d57600080fd5b806301ffc9a7146102d657806306fdde031461030c57600080fd5b366102d157005b600080fd5b3480156102e257600080fd5b506102f66102f13660046124f3565b610865565b604051610303919061251e565b60405180910390f35b34801561031857600080fd5b50610321610936565b604051610303919061258a565b34801561033a57600080fd5b5061034e6103493660046125b3565b6109c8565b60405161030391906125ee565b34801561036757600080fd5b5061037b610376366004612610565b610a25565b005b34801561038957600080fd5b5061037b61039836600461264d565b610ae5565b3480156103a957600080fd5b506103d96000546001600160801b0370010000000000000000000000000000000082048116918116919091031690565b6040516103039190612674565b3480156103f257600080fd5b506102f6610b88565b34801561040757600080fd5b506102f6610d3c565b34801561041c57600080fd5b5061037b61042b366004612682565b610d55565b34801561043c57600080fd5b506103d961044b366004612610565b610d60565b34801561045c57600080fd5b5061047061046b3660046125b3565b610e76565b60405161030391906126db565b34801561048957600080fd5b5061037b610498366004612682565b610eaa565b3480156104a957600080fd5b506102f6610ec5565b3480156104be57600080fd5b506102f66104cd3660046125b3565b6110b4565b3480156104de57600080fd5b506103d96104ed3660046125b3565b6110bf565b3480156104fe57600080fd5b506105086115e081565b60405161030391906126f3565b34801561052157600080fd5b5061034e6105303660046125b3565b611183565b34801561054157600080fd5b506103d961055036600461264d565b611195565b34801561056157600080fd5b5061037b6111fd565b34801561057657600080fd5b506007546001600160a01b031661034e565b34801561059457600080fd5b50610321611233565b3480156105a957600080fd5b50610470606481565b3480156105be57600080fd5b506103d966c6f3b40b6c000081565b3480156105d957600080fd5b5061037b6105e8366004612714565b611242565b3480156105f957600080fd5b506103d960bc5481565b34801561060f57600080fd5b506102f661061e3660046125b3565b611312565b34801561062f57600080fd5b5061037b61133d565b34801561064457600080fd5b50600954610658906001600160a01b031681565b6040516103039190612789565b34801561067157600080fd5b5061037b610680366004612892565b6113e4565b34801561069157600080fd5b5060c15461034e906001600160a01b031681565b3480156106b157600080fd5b50610470603881565b3480156106c657600080fd5b506103216106d53660046125b3565b61141e565b3480156106e657600080fd5b506103d960c05481565b3480156106fc57600080fd5b5061047061070b3660046125b3565b611596565b34801561071c57600080fd5b5061037b61072b366004612963565b6115a6565b34801561073c57600080fd5b5061079a61074b36600461264d565b60bd602052600090815260409020546001600160801b03811690700100000000000000000000000000000000810461ffff16907201000000000000000000000000000000000000900460ff1683565b60405161030393929190612a1f565b3480156107b557600080fd5b506103216107c4366004612a5b565b6116e8565b3480156107d557600080fd5b506102f66107e4366004612a8e565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b61037b610820366004612963565b6117ca565b34801561083157600080fd5b5061037b61084036600461264d565b6118f7565b34801561085157600080fd5b506104706108603660046125b3565b611953565b60006001600160e01b031982167f80ac58cd0000000000000000000000000000000000000000000000000000000014806108c857506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806108fc57506001600160e01b031982167f780e9d6300000000000000000000000000000000000000000000000000000000145b8061093057507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b60606001805461094590612ad7565b80601f016020809104026020016040519081016040528092919081815260200182805461097190612ad7565b80156109be5780601f10610993576101008083540402835291602001916109be565b820191906000526020600020905b8154815290600101906020018083116109a157829003601f168201915b5050505050905090565b60006109d382611963565b610a09576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152600560205260409020546001600160a01b031690565b6000610a3082611183565b9050806001600160a01b0316836001600160a01b03161415610a7e576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614801590610a9e5750610a9c81336107e4565b155b15610ad5576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ae0838383611997565b505050565b6007546001600160a01b03163314610b185760405162461bcd60e51b8152600401610b0f90612b36565b60405180910390fd5b60c180546001600160a01b03831673ffffffffffffffffffffffffffffffffffffffff19918216811790925560c28054909116821790556040517fa00632ff71f043bcebbaa26952d3fd31a42e459b0dc8b686a91eb77725ee668091610b7d916125ee565b60405180910390a150565b600060026008541415610bad5760405162461bcd60e51b8152600401610b0f90612b78565b600260085533600090815260be602052604090205461ffff16610bfc576040517fd0d04f6000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60bc5433600090815260be602052604081205490916115e091610c2a9061ffff1666c6f3b40b6c0000612b9e565b610c349190612b9e565b610c3e9190612bd3565b604051909150600090339083908381818185875af1925050503d8060008114610c83576040519150601f19603f3d011682016040523d82523d6000602084013e610c88565b606091505b5050905080610cc3576040517f27fcd9d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f481f0c31fede089900c9fd5b1bd26054cf3d6e31a09d068df5b323a0265211e53383604051610cf4929190612be7565b60405180910390a133600090815260be6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000169055600160085592915050565b600060c05442118015610d50575060c05415155b905090565b610ae0838383611a00565b6000610d6b83611195565b8210610da3576040517f0ddac30e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080546001600160801b03169080805b83811015610e7057600081815260036020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff161580159282019290925290610e1c5750610e68565b80516001600160a01b031615610e3157805192505b876001600160a01b0316836001600160a01b03161415610e665786841415610e5f5750935061093092505050565b6001909301925b505b600101610db4565b50600080fd5b60b98181548110610e8657600080fd5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b610ae0838383604051806020016040528060008152506113e4565b600060026008541415610eea5760405162461bcd60e51b8152600401610b0f90612b78565b600260085533600090815260bd602052604081205460bf546001600160801b038216916115e091610f3391700100000000000000000000000000000000900461ffff1690612b9e565b610f3d9190612bd3565b610f479190612c02565b905080610f80576040517fd0d04f6000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f916001600160801b0382612c1d565b33600090815260bd602052604081208054909190610fb99084906001600160801b0316612c31565b92506101000a8154816001600160801b0302191690836001600160801b031602179055506000610fe63390565b6001600160a01b03168260405160006040518083038185875af1925050503d8060008114611030576040519150601f19603f3d011682016040523d82523d6000602084013e611035565b606091505b5050905080611070576040517f27fcd9d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f47521fa5fb7651fe9fbc44eddef019766bd46d393ffcd1c5e1338cce9bd35cf933836040516110a1929190612be7565b60405180910390a1915050600160085590565b600061093082611963565b600080546001600160801b031681805b8281101561115057600081815260036020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff1615159181018290529061114757858314156111405750949350505050565b6001909201915b506001016110cf565b506040517fa723001c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061118e82611c6b565b5192915050565b60006001600160a01b0382166111d7576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b031660009081526004602052604090205467ffffffffffffffff1690565b6007546001600160a01b031633146112275760405162461bcd60e51b8152600401610b0f90612b36565b6112316000611da8565b565b60606002805461094590612ad7565b6001600160a01b038216331415611285576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526006602090815260408083206001600160a01b03871680855292529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151517905590519091907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319061130690859061251e565b60405180910390a35050565b600a816115e0811061132357600080fd5b60209182820401919006915054906101000a900460ff1681565b6007546001600160a01b031633146113675760405162461bcd60e51b8152600401610b0f90612b36565b61136f610d3c565b156113a6576040517f63a2de0f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b4260c08190556040517fe1edf9fc3dd1a3a3cb6d462dc065c574fb31cc577afdfba34c247d258db7f0b5916113da91612674565b60405180910390a1565b6113ef848484611a00565b6113fb84848484611e07565b611418576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b606061142982611963565b61145f576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60c1546001600160a01b031661148357505060408051602081019091526000815290565b60c25460b980546001600160a01b039092169163bd1798f69190859081106114ad576114ad612c69565b90600052602060002090602091828204019190069054906101000a900460ff1660ba85815481106114e0576114e0612c69565b90600052602060002090602091828204019190069054906101000a900460ff1660bb868154811061151357611513612c69565b90600052602060002090602091828204019190069054906101000a900460ff166040518463ffffffff1660e01b815260040161155193929190612c97565b600060405180830381865afa15801561156e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109309190810190612d0a565b60bb8181548110610e8657600080fd5b600260085414156115c95760405162461bcd60e51b8152600401610b0f90612b78565b6002600855848314611607576040517f9c38699e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260bd60205260409020547201000000000000000000000000000000000000900460ff16851115611669576040517f74a5d1f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61167460ff86612c1d565b33600090815260bd6020526040902080546012906116ac9084907201000000000000000000000000000000000000900460ff16612d45565b92506101000a81548160ff021916908360ff1602179055506116db6116ce3390565b8787878787876000611f39565b5050600160085550505050565b606060005b60b954811015611797578360ff1660b9828154811061170e5761170e612c69565b60009182526020918290209181049091015460ff601f9092166101000a90041614801561176f57508260ff1660ba828154811061174d5761174d612c69565b60009182526020918290209181049091015460ff601f9092166101000a900416145b156117855761177d8161141e565b915050610930565b8061178f81612d52565b9150506116ed565b506040517ff09c6c1300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117d2610d3c565b611808576040517f63a2de0f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600854141561182b5760405162461bcd60e51b8152600401610b0f90612b78565b6002600855848314611869576040517f9c38699e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61187a8566c6f3b40b6c0000612b9e565b34146118b2576040517f99b5cb1d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118c3338787878787876001611f39565b6118d48566c6f3b40b6c0000612b9e565b60bf60008282546118e59190612d6d565b90915550506001600855505050505050565b6007546001600160a01b031633146119215760405162461bcd60e51b8152600401610b0f90612b36565b6001600160a01b0381166119475760405162461bcd60e51b8152600401610b0f90612d80565b61195081611da8565b50565b60ba8181548110610e8657600080fd5b600080546001600160801b031682108015610930575050600090815260036020526040902054600160e01b900460ff161590565b600082815260056020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000611a0b82611c6b565b80519091506000906001600160a01b0316336001600160a01b03161480611a3957508151611a3990336107e4565b80611a54575033611a49846109c8565b6001600160a01b0316145b905080611a8d576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b846001600160a01b031682600001516001600160a01b031614611adc576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038416611b1c576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611b2c6000848460000151611997565b6001600160a01b038581166000908152600460209081526040808320805467ffffffffffffffff1980821667ffffffffffffffff92831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600390945282852080546001600160e01b031916909417600160a01b429092169190910217909255908601808352912054909116611c21576000546001600160801b0316811015611c21578251600082815260036020908152604090912080549186015167ffffffffffffffff16600160a01b026001600160e01b03199092166001600160a01b03909316929092171790555b5082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b60408051606081018252600080825260208201819052918101829052905482906001600160801b0316811015611d7657600081815260036020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff16151591810182905290611d745780516001600160a01b031615611d0a579392505050565b5060001901600081815260036020908152604091829020825160608101845290546001600160a01b038116808352600160a01b820467ffffffffffffffff1693830193909352600160e01b900460ff1615159281019290925215611d6f579392505050565b611d0a565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600780546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006001600160a01b0384163b15611f2d576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a0290611e64903390899088908890600401612de1565b6020604051808303816000875af1925050508015611e9f575060408051601f3d908101601f19168201909252611e9c91810190612e30565b60015b611efa573d808015611ecd576040519150601f19603f3d011682016040523d82523d6000602084013e611ed2565b606091505b508051611ef2576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b0319167f150b7a0200000000000000000000000000000000000000000000000000000000149050611f31565b5060015b949350505050565b60005b868110156122aa576000888883818110611f5857611f58612c69565b9050602002013590506000878784818110611f7557611f75612c69565b60200291909101359150600a905081611f8f606485612b9e565b611f999190612d6d565b6115e08110611faa57611faa612c69565b602081049091015460ff601f9092166101000a90041615611ff7576040517f81d9ae2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61200360016038612d45565b60ff1682111561203f576040517fd9c0f1d300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61204b60016064612d45565b60ff16811115612087576040517f1f81f00900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60b961209460ff84612c1d565b815460018101835560009283526020928390209281049092018054601f9093166101000a60ff818102199094169284160291909117905560ba906120d89083612c1d565b815460018101835560009283526020928390209281049092018054601f9093166101000a60ff818102199094169284160291909117905560bb9087878681811061212457612124612c69565b905060200201356121359190612c1d565b8154600181810184556000938452602093849020938204909301805460ff938416601f9093166101000a9283029390920219909116919091179055600a8261217e606486612b9e565b6121889190612d6d565b6115e0811061219957612199612c69565b602091828204019190066101000a81548160ff0219169083151502179055508315612295576009546040517f06daaebd00000000000000000000000000000000000000000000000000000000815260be916000916001600160a01b03909116906306daaebd9061220d908690600401612674565b602060405180830381865afa15801561222a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061224e9190612e5c565b6001600160a01b0316815260208101919091526040016000908120805461ffff169161227983612e7d565b91906101000a81548161ffff021916908361ffff160217905550505b505080806122a290612d52565b915050611f3c565b506122b588876122bf565b5050505050505050565b6122d98282604051806020016040528060008152506122dd565b5050565b610ae083838360016000546001600160801b03166001600160a01b038516612331576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83612368576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516600081815260046020908152604080832080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000811667ffffffffffffffff8083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c018116909202179091558584526003909252822080546001600160e01b031916909317600160a01b42909216919091021790915581905b858110156124935760405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a483801561246957506124676000888488611e07565b155b15612487576040516368d2bf6b60e11b815260040160405180910390fd5b60019182019101612412565b50600080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166001600160801b0392909216919091179055611c64565b6001600160e01b031981165b811461195057600080fd5b8035610930816124d1565b60006020828403121561250857612508600080fd5b6000611f3184846124e8565b8015155b82525050565b602081016109308284612514565b60005b8381101561254757818101518382015260200161252f565b838111156114185750506000910152565b6000612562825190565b80845260208401935061257981856020860161252c565b601f01601f19169290920192915050565b6020808252810161259b8184612558565b9392505050565b806124dd565b8035610930816125a2565b6000602082840312156125c8576125c8600080fd5b6000611f3184846125a8565b60006001600160a01b038216610930565b612518816125d4565b6020810161093082846125e5565b6124dd816125d4565b8035610930816125fc565b6000806040838503121561262657612626600080fd5b60006126328585612605565b9250506020612643858286016125a8565b9150509250929050565b60006020828403121561266257612662600080fd5b6000611f318484612605565b80612518565b60208101610930828461266e565b60008060006060848603121561269a5761269a600080fd5b60006126a68686612605565b93505060206126b786828701612605565b92505060406126c8868287016125a8565b9150509250925092565b60ff8116612518565b6020810161093082846126d2565b61ffff8116612518565b6020810161093082846126e9565b8015156124dd565b803561093081612701565b6000806040838503121561272a5761272a600080fd5b60006127368585612605565b925050602061264385828601612709565b60006109306001600160a01b03831661275e565b90565b6001600160a01b031690565b600061093082612747565b60006109308261276a565b61251881612775565b602081016109308284612780565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff821117156127d3576127d3612797565b6040525050565b60006127e560405190565b90506127f182826127ad565b919050565b600067ffffffffffffffff82111561281057612810612797565b601f19601f83011660200192915050565b82818337506000910152565b600061284061283b846127f6565b6127da565b90508281526020810184848401111561285b5761285b600080fd5b612866848285612821565b509392505050565b600082601f83011261288257612882600080fd5b8135611f3184826020860161282d565b600080600080608085870312156128ab576128ab600080fd5b60006128b78787612605565b94505060206128c887828801612605565b93505060406128d9878288016125a8565b925050606085013567ffffffffffffffff8111156128f9576128f9600080fd5b6129058782880161286e565b91505092959194509250565b60008083601f84011261292657612926600080fd5b50813567ffffffffffffffff81111561294157612941600080fd5b60208301915083602082028301111561295c5761295c600080fd5b9250929050565b6000806000806000806060878903121561297f5761297f600080fd5b863567ffffffffffffffff81111561299957612999600080fd5b6129a589828a01612911565b9650965050602087013567ffffffffffffffff8111156129c7576129c7600080fd5b6129d389828a01612911565b9450945050604087013567ffffffffffffffff8111156129f5576129f5600080fd5b612a0189828a01612911565b92509250509295509295509295565b6001600160801b038116612518565b60608101612a2d8286612a10565b612a3a60208301856126e9565b611f3160408301846126d2565b60ff81166124dd565b803561093081612a47565b60008060408385031215612a7157612a71600080fd5b6000612a7d8585612a50565b925050602061264385828601612a50565b60008060408385031215612aa457612aa4600080fd5b6000612ab08585612605565b925050602061264385828601612605565b634e487b7160e01b600052602260045260246000fd5b600281046001821680612aeb57607f821691505b60208210811415612afe57612afe612ac1565b50919050565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657291019081525b60200190565b6020808252810161093081612b04565b601f8152602081017f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081529050612b30565b6020808252810161093081612b46565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615612bb857612bb8612b88565b500290565b634e487b7160e01b600052601260045260246000fd5b600082612be257612be2612bbd565b500490565b60408101612bf582856125e5565b61259b602083018461266e565b815b9150600082821015612c1857612c18612b88565b500390565b600082612c2c57612c2c612bbd565b500690565b6001600160801b03811690506001600160801b03821691506000826001600160801b0303821115612c6457612c64612b88565b500190565b634e487b7160e01b600052603260045260246000fd5b600061093061275b60ff841681565b61251881612c7f565b60608101612ca58286612c8e565b612a3a6020830185612c8e565b6000612cc061283b846127f6565b905082815260208101848484011115612cdb57612cdb600080fd5b61286684828561252c565b600082601f830112612cfa57612cfa600080fd5b8151611f31848260208601612cb2565b600060208284031215612d1f57612d1f600080fd5b815167ffffffffffffffff811115612d3957612d39600080fd5b611f3184828501612ce6565b60ff908116908216612c04565b6000600019821415612d6657612d66612b88565b5060010190565b60008219821115612c6457612c64612b88565b6020808252810161093081602681527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160208201527f6464726573730000000000000000000000000000000000000000000000000000604082015260600190565b60808101612def82876125e5565b612dfc60208301866125e5565b612e09604083018561266e565b8181036060830152612e1b8184612558565b9695505050505050565b8051610930816124d1565b600060208284031215612e4557612e45600080fd5b6000611f318484612e25565b8051610930816125fc565b600060208284031215612e7157612e71600080fd5b6000611f318484612e51565b61ffff81169050600061ffff821415612d6657612d66612b8856fea2646970667358221220bf6d5c803e1a8352b13048e507cbeccc384bcf7ccc082cae87b0d59b34546a3664736f6c634300080c003300000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000009c6b3486eefba5f0a27442238123cc5dfbfd5b2c000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000003b80000000000000000000000008d04a8c79ceb0889bdd12acdf3fa9d207ed3ff630000000000000000000000000000000000000000000000000000000000000008426c69746f61647a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004424c545a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000d246882e05d7ddb2c8476607312279f592789cd60000000000000000000000000c3c184c2c5fc99aed927ce3513141eb3ce684fa000000000000000000000000cadb5aba304867fd2658f11c2ee41ed3a83f13d5000000000000000000000000fc7c18a7f0d53a924d6af07814c47eef0fb4f7d70000000000000000000000004298e663517593284ad4fe199b21815bd48a9969000000000000000000000000f296178d553c8ec21a2fbd2c5dda8ca9ac905a00000000000000000000000000d42bd96b117dd6bd63280620ea981bf967a7ad2b000000000000000000000000d19bf5f0b785c6f1f6228c72a8a31c9f383a49c4000000000000000000000000b7b78c45036d5a089ff85d39a0e0836037d1dc520000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006900000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005780000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002740000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002740000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001380000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
Deployed Bytecode
0x6080604052600436106102ca5760003560e01c806395d89b4111610179578063c0c9c735116100d6578063de6746a51161008a578063f140a90011610064578063f140a90014610812578063f2fde38b14610825578063f95ed2f51461084557600080fd5b8063de6746a514610730578063e632751a146107a9578063e985e9c5146107c957600080fd5b8063d7822c99116100bb578063d7822c99146106da578063dcf7eefe146106f0578063dd6c6cef1461071057600080fd5b8063c0c9c735146106a5578063c87b56dd146106ba57600080fd5b8063af0097251161012d578063b6cfb24211610112578063b6cfb24214610638578063b88d4fde14610665578063c074f4121461068557600080fd5b8063af00972514610603578063b585209b1461062357600080fd5b80639c51792a1161015e5780639c51792a146105b2578063a22cb465146105cd578063ac156e9b146105ed57600080fd5b806395d89b411461058857806399c0731b1461059d57600080fd5b80633189a5341161022757806353557e25116101db57806370a08231116101c057806370a0823114610535578063715018a6146105555780638da5cb5b1461056a57600080fd5b806353557e25146104f25780636352211e1461051557600080fd5b80634bd3f52f1161020c5780634bd3f52f1461049d5780634f558e79146104b25780634f6ccce7146104d257600080fd5b80633189a5341461045057806342842e0e1461047d57600080fd5b806318160ddd1161027e5780631a6949e3116102635780631a6949e3146103fb57806323b872dd146104105780632f745c591461043057600080fd5b806318160ddd1461039d578063191694f8146103e657600080fd5b8063081812fc116102af578063081812fc1461032e578063095ea7b31461035b57806312b40a9f1461037d57600080fd5b806301ffc9a7146102d657806306fdde031461030c57600080fd5b366102d157005b600080fd5b3480156102e257600080fd5b506102f66102f13660046124f3565b610865565b604051610303919061251e565b60405180910390f35b34801561031857600080fd5b50610321610936565b604051610303919061258a565b34801561033a57600080fd5b5061034e6103493660046125b3565b6109c8565b60405161030391906125ee565b34801561036757600080fd5b5061037b610376366004612610565b610a25565b005b34801561038957600080fd5b5061037b61039836600461264d565b610ae5565b3480156103a957600080fd5b506103d96000546001600160801b0370010000000000000000000000000000000082048116918116919091031690565b6040516103039190612674565b3480156103f257600080fd5b506102f6610b88565b34801561040757600080fd5b506102f6610d3c565b34801561041c57600080fd5b5061037b61042b366004612682565b610d55565b34801561043c57600080fd5b506103d961044b366004612610565b610d60565b34801561045c57600080fd5b5061047061046b3660046125b3565b610e76565b60405161030391906126db565b34801561048957600080fd5b5061037b610498366004612682565b610eaa565b3480156104a957600080fd5b506102f6610ec5565b3480156104be57600080fd5b506102f66104cd3660046125b3565b6110b4565b3480156104de57600080fd5b506103d96104ed3660046125b3565b6110bf565b3480156104fe57600080fd5b506105086115e081565b60405161030391906126f3565b34801561052157600080fd5b5061034e6105303660046125b3565b611183565b34801561054157600080fd5b506103d961055036600461264d565b611195565b34801561056157600080fd5b5061037b6111fd565b34801561057657600080fd5b506007546001600160a01b031661034e565b34801561059457600080fd5b50610321611233565b3480156105a957600080fd5b50610470606481565b3480156105be57600080fd5b506103d966c6f3b40b6c000081565b3480156105d957600080fd5b5061037b6105e8366004612714565b611242565b3480156105f957600080fd5b506103d960bc5481565b34801561060f57600080fd5b506102f661061e3660046125b3565b611312565b34801561062f57600080fd5b5061037b61133d565b34801561064457600080fd5b50600954610658906001600160a01b031681565b6040516103039190612789565b34801561067157600080fd5b5061037b610680366004612892565b6113e4565b34801561069157600080fd5b5060c15461034e906001600160a01b031681565b3480156106b157600080fd5b50610470603881565b3480156106c657600080fd5b506103216106d53660046125b3565b61141e565b3480156106e657600080fd5b506103d960c05481565b3480156106fc57600080fd5b5061047061070b3660046125b3565b611596565b34801561071c57600080fd5b5061037b61072b366004612963565b6115a6565b34801561073c57600080fd5b5061079a61074b36600461264d565b60bd602052600090815260409020546001600160801b03811690700100000000000000000000000000000000810461ffff16907201000000000000000000000000000000000000900460ff1683565b60405161030393929190612a1f565b3480156107b557600080fd5b506103216107c4366004612a5b565b6116e8565b3480156107d557600080fd5b506102f66107e4366004612a8e565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b61037b610820366004612963565b6117ca565b34801561083157600080fd5b5061037b61084036600461264d565b6118f7565b34801561085157600080fd5b506104706108603660046125b3565b611953565b60006001600160e01b031982167f80ac58cd0000000000000000000000000000000000000000000000000000000014806108c857506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806108fc57506001600160e01b031982167f780e9d6300000000000000000000000000000000000000000000000000000000145b8061093057507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b60606001805461094590612ad7565b80601f016020809104026020016040519081016040528092919081815260200182805461097190612ad7565b80156109be5780601f10610993576101008083540402835291602001916109be565b820191906000526020600020905b8154815290600101906020018083116109a157829003601f168201915b5050505050905090565b60006109d382611963565b610a09576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152600560205260409020546001600160a01b031690565b6000610a3082611183565b9050806001600160a01b0316836001600160a01b03161415610a7e576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614801590610a9e5750610a9c81336107e4565b155b15610ad5576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ae0838383611997565b505050565b6007546001600160a01b03163314610b185760405162461bcd60e51b8152600401610b0f90612b36565b60405180910390fd5b60c180546001600160a01b03831673ffffffffffffffffffffffffffffffffffffffff19918216811790925560c28054909116821790556040517fa00632ff71f043bcebbaa26952d3fd31a42e459b0dc8b686a91eb77725ee668091610b7d916125ee565b60405180910390a150565b600060026008541415610bad5760405162461bcd60e51b8152600401610b0f90612b78565b600260085533600090815260be602052604090205461ffff16610bfc576040517fd0d04f6000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60bc5433600090815260be602052604081205490916115e091610c2a9061ffff1666c6f3b40b6c0000612b9e565b610c349190612b9e565b610c3e9190612bd3565b604051909150600090339083908381818185875af1925050503d8060008114610c83576040519150601f19603f3d011682016040523d82523d6000602084013e610c88565b606091505b5050905080610cc3576040517f27fcd9d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f481f0c31fede089900c9fd5b1bd26054cf3d6e31a09d068df5b323a0265211e53383604051610cf4929190612be7565b60405180910390a133600090815260be6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000169055600160085592915050565b600060c05442118015610d50575060c05415155b905090565b610ae0838383611a00565b6000610d6b83611195565b8210610da3576040517f0ddac30e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080546001600160801b03169080805b83811015610e7057600081815260036020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff161580159282019290925290610e1c5750610e68565b80516001600160a01b031615610e3157805192505b876001600160a01b0316836001600160a01b03161415610e665786841415610e5f5750935061093092505050565b6001909301925b505b600101610db4565b50600080fd5b60b98181548110610e8657600080fd5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b610ae0838383604051806020016040528060008152506113e4565b600060026008541415610eea5760405162461bcd60e51b8152600401610b0f90612b78565b600260085533600090815260bd602052604081205460bf546001600160801b038216916115e091610f3391700100000000000000000000000000000000900461ffff1690612b9e565b610f3d9190612bd3565b610f479190612c02565b905080610f80576040517fd0d04f6000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f916001600160801b0382612c1d565b33600090815260bd602052604081208054909190610fb99084906001600160801b0316612c31565b92506101000a8154816001600160801b0302191690836001600160801b031602179055506000610fe63390565b6001600160a01b03168260405160006040518083038185875af1925050503d8060008114611030576040519150601f19603f3d011682016040523d82523d6000602084013e611035565b606091505b5050905080611070576040517f27fcd9d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f47521fa5fb7651fe9fbc44eddef019766bd46d393ffcd1c5e1338cce9bd35cf933836040516110a1929190612be7565b60405180910390a1915050600160085590565b600061093082611963565b600080546001600160801b031681805b8281101561115057600081815260036020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff1615159181018290529061114757858314156111405750949350505050565b6001909201915b506001016110cf565b506040517fa723001c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061118e82611c6b565b5192915050565b60006001600160a01b0382166111d7576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b031660009081526004602052604090205467ffffffffffffffff1690565b6007546001600160a01b031633146112275760405162461bcd60e51b8152600401610b0f90612b36565b6112316000611da8565b565b60606002805461094590612ad7565b6001600160a01b038216331415611285576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526006602090815260408083206001600160a01b03871680855292529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151517905590519091907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319061130690859061251e565b60405180910390a35050565b600a816115e0811061132357600080fd5b60209182820401919006915054906101000a900460ff1681565b6007546001600160a01b031633146113675760405162461bcd60e51b8152600401610b0f90612b36565b61136f610d3c565b156113a6576040517f63a2de0f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b4260c08190556040517fe1edf9fc3dd1a3a3cb6d462dc065c574fb31cc577afdfba34c247d258db7f0b5916113da91612674565b60405180910390a1565b6113ef848484611a00565b6113fb84848484611e07565b611418576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b606061142982611963565b61145f576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60c1546001600160a01b031661148357505060408051602081019091526000815290565b60c25460b980546001600160a01b039092169163bd1798f69190859081106114ad576114ad612c69565b90600052602060002090602091828204019190069054906101000a900460ff1660ba85815481106114e0576114e0612c69565b90600052602060002090602091828204019190069054906101000a900460ff1660bb868154811061151357611513612c69565b90600052602060002090602091828204019190069054906101000a900460ff166040518463ffffffff1660e01b815260040161155193929190612c97565b600060405180830381865afa15801561156e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109309190810190612d0a565b60bb8181548110610e8657600080fd5b600260085414156115c95760405162461bcd60e51b8152600401610b0f90612b78565b6002600855848314611607576040517f9c38699e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260bd60205260409020547201000000000000000000000000000000000000900460ff16851115611669576040517f74a5d1f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61167460ff86612c1d565b33600090815260bd6020526040902080546012906116ac9084907201000000000000000000000000000000000000900460ff16612d45565b92506101000a81548160ff021916908360ff1602179055506116db6116ce3390565b8787878787876000611f39565b5050600160085550505050565b606060005b60b954811015611797578360ff1660b9828154811061170e5761170e612c69565b60009182526020918290209181049091015460ff601f9092166101000a90041614801561176f57508260ff1660ba828154811061174d5761174d612c69565b60009182526020918290209181049091015460ff601f9092166101000a900416145b156117855761177d8161141e565b915050610930565b8061178f81612d52565b9150506116ed565b506040517ff09c6c1300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117d2610d3c565b611808576040517f63a2de0f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600854141561182b5760405162461bcd60e51b8152600401610b0f90612b78565b6002600855848314611869576040517f9c38699e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61187a8566c6f3b40b6c0000612b9e565b34146118b2576040517f99b5cb1d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118c3338787878787876001611f39565b6118d48566c6f3b40b6c0000612b9e565b60bf60008282546118e59190612d6d565b90915550506001600855505050505050565b6007546001600160a01b031633146119215760405162461bcd60e51b8152600401610b0f90612b36565b6001600160a01b0381166119475760405162461bcd60e51b8152600401610b0f90612d80565b61195081611da8565b50565b60ba8181548110610e8657600080fd5b600080546001600160801b031682108015610930575050600090815260036020526040902054600160e01b900460ff161590565b600082815260056020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000611a0b82611c6b565b80519091506000906001600160a01b0316336001600160a01b03161480611a3957508151611a3990336107e4565b80611a54575033611a49846109c8565b6001600160a01b0316145b905080611a8d576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b846001600160a01b031682600001516001600160a01b031614611adc576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038416611b1c576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611b2c6000848460000151611997565b6001600160a01b038581166000908152600460209081526040808320805467ffffffffffffffff1980821667ffffffffffffffff92831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600390945282852080546001600160e01b031916909417600160a01b429092169190910217909255908601808352912054909116611c21576000546001600160801b0316811015611c21578251600082815260036020908152604090912080549186015167ffffffffffffffff16600160a01b026001600160e01b03199092166001600160a01b03909316929092171790555b5082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b60408051606081018252600080825260208201819052918101829052905482906001600160801b0316811015611d7657600081815260036020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff16151591810182905290611d745780516001600160a01b031615611d0a579392505050565b5060001901600081815260036020908152604091829020825160608101845290546001600160a01b038116808352600160a01b820467ffffffffffffffff1693830193909352600160e01b900460ff1615159281019290925215611d6f579392505050565b611d0a565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600780546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006001600160a01b0384163b15611f2d576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a0290611e64903390899088908890600401612de1565b6020604051808303816000875af1925050508015611e9f575060408051601f3d908101601f19168201909252611e9c91810190612e30565b60015b611efa573d808015611ecd576040519150601f19603f3d011682016040523d82523d6000602084013e611ed2565b606091505b508051611ef2576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b0319167f150b7a0200000000000000000000000000000000000000000000000000000000149050611f31565b5060015b949350505050565b60005b868110156122aa576000888883818110611f5857611f58612c69565b9050602002013590506000878784818110611f7557611f75612c69565b60200291909101359150600a905081611f8f606485612b9e565b611f999190612d6d565b6115e08110611faa57611faa612c69565b602081049091015460ff601f9092166101000a90041615611ff7576040517f81d9ae2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61200360016038612d45565b60ff1682111561203f576040517fd9c0f1d300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61204b60016064612d45565b60ff16811115612087576040517f1f81f00900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60b961209460ff84612c1d565b815460018101835560009283526020928390209281049092018054601f9093166101000a60ff818102199094169284160291909117905560ba906120d89083612c1d565b815460018101835560009283526020928390209281049092018054601f9093166101000a60ff818102199094169284160291909117905560bb9087878681811061212457612124612c69565b905060200201356121359190612c1d565b8154600181810184556000938452602093849020938204909301805460ff938416601f9093166101000a9283029390920219909116919091179055600a8261217e606486612b9e565b6121889190612d6d565b6115e0811061219957612199612c69565b602091828204019190066101000a81548160ff0219169083151502179055508315612295576009546040517f06daaebd00000000000000000000000000000000000000000000000000000000815260be916000916001600160a01b03909116906306daaebd9061220d908690600401612674565b602060405180830381865afa15801561222a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061224e9190612e5c565b6001600160a01b0316815260208101919091526040016000908120805461ffff169161227983612e7d565b91906101000a81548161ffff021916908361ffff160217905550505b505080806122a290612d52565b915050611f3c565b506122b588876122bf565b5050505050505050565b6122d98282604051806020016040528060008152506122dd565b5050565b610ae083838360016000546001600160801b03166001600160a01b038516612331576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83612368576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516600081815260046020908152604080832080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000811667ffffffffffffffff8083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c018116909202179091558584526003909252822080546001600160e01b031916909317600160a01b42909216919091021790915581905b858110156124935760405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a483801561246957506124676000888488611e07565b155b15612487576040516368d2bf6b60e11b815260040160405180910390fd5b60019182019101612412565b50600080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166001600160801b0392909216919091179055611c64565b6001600160e01b031981165b811461195057600080fd5b8035610930816124d1565b60006020828403121561250857612508600080fd5b6000611f3184846124e8565b8015155b82525050565b602081016109308284612514565b60005b8381101561254757818101518382015260200161252f565b838111156114185750506000910152565b6000612562825190565b80845260208401935061257981856020860161252c565b601f01601f19169290920192915050565b6020808252810161259b8184612558565b9392505050565b806124dd565b8035610930816125a2565b6000602082840312156125c8576125c8600080fd5b6000611f3184846125a8565b60006001600160a01b038216610930565b612518816125d4565b6020810161093082846125e5565b6124dd816125d4565b8035610930816125fc565b6000806040838503121561262657612626600080fd5b60006126328585612605565b9250506020612643858286016125a8565b9150509250929050565b60006020828403121561266257612662600080fd5b6000611f318484612605565b80612518565b60208101610930828461266e565b60008060006060848603121561269a5761269a600080fd5b60006126a68686612605565b93505060206126b786828701612605565b92505060406126c8868287016125a8565b9150509250925092565b60ff8116612518565b6020810161093082846126d2565b61ffff8116612518565b6020810161093082846126e9565b8015156124dd565b803561093081612701565b6000806040838503121561272a5761272a600080fd5b60006127368585612605565b925050602061264385828601612709565b60006109306001600160a01b03831661275e565b90565b6001600160a01b031690565b600061093082612747565b60006109308261276a565b61251881612775565b602081016109308284612780565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff821117156127d3576127d3612797565b6040525050565b60006127e560405190565b90506127f182826127ad565b919050565b600067ffffffffffffffff82111561281057612810612797565b601f19601f83011660200192915050565b82818337506000910152565b600061284061283b846127f6565b6127da565b90508281526020810184848401111561285b5761285b600080fd5b612866848285612821565b509392505050565b600082601f83011261288257612882600080fd5b8135611f3184826020860161282d565b600080600080608085870312156128ab576128ab600080fd5b60006128b78787612605565b94505060206128c887828801612605565b93505060406128d9878288016125a8565b925050606085013567ffffffffffffffff8111156128f9576128f9600080fd5b6129058782880161286e565b91505092959194509250565b60008083601f84011261292657612926600080fd5b50813567ffffffffffffffff81111561294157612941600080fd5b60208301915083602082028301111561295c5761295c600080fd5b9250929050565b6000806000806000806060878903121561297f5761297f600080fd5b863567ffffffffffffffff81111561299957612999600080fd5b6129a589828a01612911565b9650965050602087013567ffffffffffffffff8111156129c7576129c7600080fd5b6129d389828a01612911565b9450945050604087013567ffffffffffffffff8111156129f5576129f5600080fd5b612a0189828a01612911565b92509250509295509295509295565b6001600160801b038116612518565b60608101612a2d8286612a10565b612a3a60208301856126e9565b611f3160408301846126d2565b60ff81166124dd565b803561093081612a47565b60008060408385031215612a7157612a71600080fd5b6000612a7d8585612a50565b925050602061264385828601612a50565b60008060408385031215612aa457612aa4600080fd5b6000612ab08585612605565b925050602061264385828601612605565b634e487b7160e01b600052602260045260246000fd5b600281046001821680612aeb57607f821691505b60208210811415612afe57612afe612ac1565b50919050565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657291019081525b60200190565b6020808252810161093081612b04565b601f8152602081017f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081529050612b30565b6020808252810161093081612b46565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615612bb857612bb8612b88565b500290565b634e487b7160e01b600052601260045260246000fd5b600082612be257612be2612bbd565b500490565b60408101612bf582856125e5565b61259b602083018461266e565b815b9150600082821015612c1857612c18612b88565b500390565b600082612c2c57612c2c612bbd565b500690565b6001600160801b03811690506001600160801b03821691506000826001600160801b0303821115612c6457612c64612b88565b500190565b634e487b7160e01b600052603260045260246000fd5b600061093061275b60ff841681565b61251881612c7f565b60608101612ca58286612c8e565b612a3a6020830185612c8e565b6000612cc061283b846127f6565b905082815260208101848484011115612cdb57612cdb600080fd5b61286684828561252c565b600082601f830112612cfa57612cfa600080fd5b8151611f31848260208601612cb2565b600060208284031215612d1f57612d1f600080fd5b815167ffffffffffffffff811115612d3957612d39600080fd5b611f3184828501612ce6565b60ff908116908216612c04565b6000600019821415612d6657612d66612b88565b5060010190565b60008219821115612c6457612c64612b88565b6020808252810161093081602681527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160208201527f6464726573730000000000000000000000000000000000000000000000000000604082015260600190565b60808101612def82876125e5565b612dfc60208301866125e5565b612e09604083018561266e565b8181036060830152612e1b8184612558565b9695505050505050565b8051610930816124d1565b600060208284031215612e4557612e45600080fd5b6000611f318484612e25565b8051610930816125fc565b600060208284031215612e7157612e71600080fd5b6000611f318484612e51565b61ffff81169050600061ffff821415612d6657612d66612b8856fea2646970667358221220bf6d5c803e1a8352b13048e507cbeccc384bcf7ccc082cae87b0d59b34546a3664736f6c634300080c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000009c6b3486eefba5f0a27442238123cc5dfbfd5b2c000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000003b80000000000000000000000008d04a8c79ceb0889bdd12acdf3fa9d207ed3ff630000000000000000000000000000000000000000000000000000000000000008426c69746f61647a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004424c545a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000d246882e05d7ddb2c8476607312279f592789cd60000000000000000000000000c3c184c2c5fc99aed927ce3513141eb3ce684fa000000000000000000000000cadb5aba304867fd2658f11c2ee41ed3a83f13d5000000000000000000000000fc7c18a7f0d53a924d6af07814c47eef0fb4f7d70000000000000000000000004298e663517593284ad4fe199b21815bd48a9969000000000000000000000000f296178d553c8ec21a2fbd2c5dda8ca9ac905a00000000000000000000000000d42bd96b117dd6bd63280620ea981bf967a7ad2b000000000000000000000000d19bf5f0b785c6f1f6228c72a8a31c9f383a49c4000000000000000000000000b7b78c45036d5a089ff85d39a0e0836037d1dc520000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006900000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005780000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002740000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002740000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001380000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
-----Decoded View---------------
Arg [0] : name_ (string): Blitoadz
Arg [1] : symbol_ (string): BLTZ
Arg [2] : _rendererAddress (address): 0x9C6B3486EeFBA5F0a27442238123CC5dFBfD5B2C
Arg [3] : _founders (address[]): 0xD246882E05D7DdB2C8476607312279f592789Cd6,0x0C3c184C2c5Fc99aED927cE3513141eb3Ce684FA,0xCADb5Aba304867FD2658f11c2EE41ed3A83f13D5,0xFc7c18A7F0d53A924D6aF07814c47eEf0Fb4F7d7,0x4298e663517593284Ad4FE199b21815BD48a9969,0xF296178d553C8Ec21A2fBD2c5dDa8CA9ac905A00,0xd42bd96B117dd6BD63280620EA981BF967A7aD2B,0xD19BF5F0B785c6f1F6228C72A8A31C9f383a49c4,0xb7b78C45036D5a089Ff85d39a0e0836037D1Dc52
Arg [4] : _foundersData (tuple[]): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
Arg [5] : _blitmapCreatorShares (uint256): 952
Arg [6] : _blitmap (address): 0x8d04a8c79cEB0889Bdd12acdF3Fa9D207eD3Ff63
-----Encoded View---------------
49 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [2] : 0000000000000000000000009c6b3486eefba5f0a27442238123cc5dfbfd5b2c
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [4] : 00000000000000000000000000000000000000000000000000000000000002a0
Arg [5] : 00000000000000000000000000000000000000000000000000000000000003b8
Arg [6] : 0000000000000000000000008d04a8c79ceb0889bdd12acdf3fa9d207ed3ff63
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [8] : 426c69746f61647a000000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [10] : 424c545a00000000000000000000000000000000000000000000000000000000
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000009
Arg [12] : 000000000000000000000000d246882e05d7ddb2c8476607312279f592789cd6
Arg [13] : 0000000000000000000000000c3c184c2c5fc99aed927ce3513141eb3ce684fa
Arg [14] : 000000000000000000000000cadb5aba304867fd2658f11c2ee41ed3a83f13d5
Arg [15] : 000000000000000000000000fc7c18a7f0d53a924d6af07814c47eef0fb4f7d7
Arg [16] : 0000000000000000000000004298e663517593284ad4fe199b21815bd48a9969
Arg [17] : 000000000000000000000000f296178d553c8ec21a2fbd2c5dda8ca9ac905a00
Arg [18] : 000000000000000000000000d42bd96b117dd6bd63280620ea981bf967a7ad2b
Arg [19] : 000000000000000000000000d19bf5f0b785c6f1f6228c72a8a31c9f383a49c4
Arg [20] : 000000000000000000000000b7b78c45036d5a089ff85d39a0e0836037d1dc52
Arg [21] : 0000000000000000000000000000000000000000000000000000000000000009
Arg [22] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [23] : 0000000000000000000000000000000000000000000000000000000000000690
Arg [24] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [25] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [26] : 0000000000000000000000000000000000000000000000000000000000000578
Arg [27] : 0000000000000000000000000000000000000000000000000000000000000009
Arg [28] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [29] : 0000000000000000000000000000000000000000000000000000000000000274
Arg [30] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [31] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [32] : 0000000000000000000000000000000000000000000000000000000000000274
Arg [33] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [34] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [35] : 0000000000000000000000000000000000000000000000000000000000000138
Arg [36] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [37] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [38] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [39] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [40] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [41] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [42] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [43] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [44] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [45] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [46] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [47] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [48] : 0000000000000000000000000000000000000000000000000000000000000001
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.