ERC-721
Overview
Max Total Supply
1,111 DINO
Holders
123
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
10 DINOLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
OnchainDinos
Compiler Version
v0.8.19+commit.7dd6d404
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity >=0.8.17 .0; import { ERC721A } from "@erc721a/ERC721A.sol"; import { NFTEventsAndErrors } from "./NFTEventsAndErrors.sol"; import { Utils } from "./utils/Utils.sol"; import { Constants } from "./utils/Constants.sol"; import { LibString } from "./utils/LibString.sol"; import { LibPRNG } from "./LibPRNG.sol"; import { SVG } from "./utils/SVG.sol"; /// @title onchain dinos /// @notice onchain dinos is an onchain generative dino NFT inspired by tiny dinos. rawr. contract OnchainDinos is ERC721A, NFTEventsAndErrors, Constants { using LibString for uint256; using LibString for uint8; using LibPRNG for LibPRNG.PRNG; address private immutable _deployer; bytes32[MAX_DINOS + 1] internal _tokenToSeed; uint8[39] internal colors = [ 3, 3, 3, 3, 3, 3, 3, 3, 5, 2, 2, 2, 2, 2, 1, 2, 1, 2, 5, 2, 2, 2, 2, 2, 2, 4, 4, 2, 5, 2, 2, 4, 2, 2, 2, 4, 4, 2, 2 ]; uint8[39] internal x = [ 6, 10, 7, 8, 6, 7, 8, 9, 5, 6, 7, 8, 9, 6, 7, 8, 9, 10, 5, 6, 7, 8, 9, 10, 6, 7, 8, 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, 6, 8 ]; uint8[39] internal y = [ 3, 4, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11 ]; constructor() ERC721A("onchain dinos", "DINO") { _deployer = msg.sender; } /// @notice Mint tokens. /// @param amount amount of tokens to mint function mint(uint8 amount) external payable { // Checks unchecked { if (amount * PRICE != msg.value) { // Check payment by sender is correct revert IncorrectPayment(); } uint256 nextTokenId = _nextTokenId(); if (MAX_DINOS + 1 < nextTokenId + amount) { // Check max supply not exceeded revert MaxSupplyReached(); } // Effects for (uint256 i = nextTokenId; i < nextTokenId + amount;) { _tokenToSeed[i] = keccak256(abi.encodePacked(block.prevrandao, i)); ++i; } } _mint(msg.sender, amount); } function _startTokenId() internal pure override returns (uint256) { return 1; } /// @notice Withdraw all ETH from the contract. function withdraw() external { (bool success,) = _deployer.call{ value: address(this).balance }(""); require(success); } function getColors(uint256 tokenId) public view returns (string memory dinoColor, string memory prevDinoColor, string memory backgroundColor) { LibPRNG.PRNG memory dinoPrng; dinoPrng.seed(_tokenToSeed[tokenId]); uint256 dinoHue = dinoPrng.uniform(360); dinoColor = Utils.hslaString(dinoHue, 25 + dinoPrng.uniform(70), 65 + dinoPrng.uniform(15)); if (tokenId > 1) { LibPRNG.PRNG memory prevDinoPrng; prevDinoPrng.seed(_tokenToSeed[tokenId - 1]); prevDinoColor = Utils.hslaString( prevDinoPrng.uniform(360), 25 + prevDinoPrng.uniform(70), 65 + prevDinoPrng.uniform(15) ); } else { prevDinoColor = "#FFF"; } backgroundColor = Utils.hslaString((dinoHue + 180) % 360, 60, 80); } function art(uint256 tokenId) public view returns (string memory) { (string memory bodyColor, string memory hatColor, string memory backgroundColor) = getColors(tokenId); string memory dino = ""; unchecked { for (uint8 i; i < x.length; ++i) { string memory color = colors[i] == 1 ? "#FFF" : colors[i] == 2 ? bodyColor : colors[i] == 3 ? hatColor : colors[i] == 4 ? "#DBDBDB" : colors[i] == 5 ? "#EDEDED" : ""; dino = string.concat( dino, SVG.rect( string.concat( SVG.prop("fill", color), SVG.prop("x", x[i].toString()), SVG.prop("y", y[i].toString()), i == 0 ? SVG.prop("id", "a") : i == 1 ? SVG.prop("id", "b") : "" ) ) ); } } return string.concat( '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" shape-rendering="crispEdges" viewBox="0 0 16 16" style="background-color: ', backgroundColor, '">', dino, "</svg>" ); } /// @notice Get token uri for token. /// @param tokenId token id /// @return tokenURI function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) { revert URIQueryForNonexistentToken(); } string memory artSvg = art(tokenId); return Utils.formatTokenURI( tokenId, Utils.svgToURI(artSvg), string.concat( "data:text/html;base64,", Utils.encodeBase64( bytes( string.concat( '<html style="overflow:hidden"><body style="margin:0">', artSvg, '<script>document.body.addEventListener("click",()=>{let t,e;"6"===document.getElementById("a").getAttribute("x")?(t="9",e="5"):(t="6",e="10"),document.getElementById("a").setAttribute("x",t),document.getElementById("b").setAttribute("x",e)});</script></body></html>' ) ) ) ), string.concat("[", Utils.getTrait("metadata", "onchain", true), Utils.getTrait("dino", "rawr", false), "]") ); } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import "./IERC721A.sol"; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364). struct TokenApprovalRef { address value; } // ============================================================= // CONSTANTS // ============================================================= // Mask of an entry in packed address data. uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant _BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant _BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant _BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant _BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant _BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant _BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with {_mintERC2309}. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} // is required to cause an overflow, which is unrealistic. uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // STORAGE // ============================================================= // The next token ID to be minted. uint256 private _currentIndex; // The number of tokens burned. uint256 private _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. // See {_packedOwnershipOf} implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` mapping(uint256 => uint256) private _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) private _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => TokenApprovalRef) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // ============================================================= // CONSTRUCTOR // ============================================================= constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID. * To change the starting token ID, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 1; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view virtual returns (uint256) { return _currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() public view virtual override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than `_currentIndex - _startTokenId()` times. unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { return _currentIndex - _startTokenId(); } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return _burnCounter; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(_packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal virtual { uint256 packed = _packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); _packedAddressData[owner] = packed; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes // of the XOR of all function selectors in the interface. // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) return interfaceId == 0x01ffc9a7 // ERC165 interface ID for ERC165. || interfaceId == 0x80ac58cd // ERC165 interface ID for ERC721. || interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256) public view virtual override returns (string memory) { return ""; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr) { if (curr < _currentIndex) { uint256 packed = _packedOwnerships[curr]; // If not burned. if (packed & _BITMASK_BURNED == 0) { // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `curr` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. while (packed == 0) { packed = _packedOwnerships[--curr]; } return packed; } } } } revert OwnerQueryForNonexistentToken(); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) public payable virtual override { address owner = ownerOf(tokenId); if (_msgSenderERC721A() != owner) { if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId].value; } /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) public virtual override { _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex // If within bounds, && _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned. } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`. assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approvedAddressSlot) } } // ============================================================= // TRANSFER OPERATIONS // ============================================================= /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) public payable virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) { if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); } if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // We can directly increment and decrement the balances. --_packedAddressData[from]; // Updates: `balance -= 1`. ++_packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData(to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom(address from, address to, uint256 tokenId) public payable virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public payable virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) { if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } } /** * @dev Hook that is called before a set of serially-ordered token IDs * are about to be transferred. This includes minting. * And also called before burning one token. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers(address from, address to, uint256 startTokenId, uint256 quantity) internal virtual { } /** * @dev Hook that is called after a set of serially-ordered token IDs * have been transferred. This includes minting. * And also called after one token has been burned. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers(address from, address to, uint256 startTokenId, uint256 quantity) internal virtual { } /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns whether the call correctly returned the expected magic value. */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns ( bytes4 retval ) { return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData(to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)); uint256 toMasked; uint256 end = startTokenId + quantity; // Use assembly to loop and emit the `Transfer` event for gas savings. // The duplicated `log4` removes an extra check and reduces stack juggling. // The assembly, OnchainDinos with the surrounding Solidity code, have been // delicately arranged to nudge the compiler into producing optimized opcodes. assembly { // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. toMasked := and(to, _BITMASK_ADDRESS) // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. startTokenId // `tokenId`. ) // The `iszero(eq(,))` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. // The compiler will optimize the `iszero` away for performance. for { let tokenId := add(startTokenId, 1) } iszero(eq(tokenId, end)) { tokenId := add(tokenId, 1) } { // Emit the `Transfer` event. Similar to above. log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId) } } if (toMasked == 0) revert MintToZeroAddress(); _currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData(to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); _currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint(address to, uint256 quantity, bytes memory _data) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = _currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (index < end); // Reentrancy protection. if (_currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ""); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) { if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); } } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = _packedOwnerships[index]; if (packed == 0) revert OwnershipNotInitializedForExtraData(); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); _packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _extraData(address from, address to, uint24 previousExtraData) internal view virtual returns (uint24) { } /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData(address from, address to, uint256 prevOwnershipPacked) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString(uint256 value) internal pure virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. let m := add(mload(0x40), 0xa0) // Update the free memory pointer to allocate. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 { } { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.17 .0; interface NFTEventsAndErrors { error MaxSupplyReached(); error IncorrectPayment(); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.17 .0; import { LibPRNG } from "./LibPRNG.sol"; import { LibString } from "./LibString.sol"; library Utils { using LibPRNG for LibPRNG.PRNG; using LibString for uint256; string internal constant _BASE64_TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; function svgToURI(string memory _source) internal pure returns (string memory) { return string.concat("data:image/svg+xml;base64,", encodeBase64(bytes(_source))); } function formatTokenURI( uint256 _tokenId, string memory _imageURI, string memory _animationURI, string memory _properties ) internal pure returns (string memory) { return string.concat( "data:application/json;base64,", encodeBase64( bytes( string.concat( '{"name":"onchain dino #', _tokenId.toString(), '","description":"onchain dinos are generative onchain dinos inspired by tiny dinos. the hat each onchain dino is wearing was made by the previous onchain dino.","attributes":', _properties, ',"image":"', _imageURI, '","animation_url":"', _animationURI, '"}' ) ) ) ); } function getTrait( string memory traitType, string memory value, bool includeTrailingComma ) internal pure returns (string memory) { return string.concat('{"trait_type":"', traitType, '","value":"', value, '"}', includeTrailingComma ? "," : ""); } // Encode some bytes in base64 // https://gist.github.com/mbvissers/8ba9ac1eca9ed0ef6973bd49b3c999ba function encodeBase64(bytes memory data) internal pure returns (string memory) { if (data.length == 0) return ""; // load the table into memory string memory table = _BASE64_TABLE; unchecked { // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((data.length + 2) / 3); // add some extra buffer at the end required for the writing string memory result = new string(encodedLen + 32); assembly { // set the actual output length mstore(result, encodedLen) // prepare the lookup table let tablePtr := add(table, 1) // input ptr let dataPtr := data let endPtr := add(dataPtr, mload(data)) // result ptr, jump over length let resultPtr := add(result, 32) // run over the input, 3 bytes at a time for { } lt(dataPtr, endPtr) { } { dataPtr := add(dataPtr, 3) // read 3 bytes let input := mload(dataPtr) // write 4 characters mstore(resultPtr, shl(248, mload(add(tablePtr, and(shr(18, input), 0x3F))))) resultPtr := add(resultPtr, 1) mstore(resultPtr, shl(248, mload(add(tablePtr, and(shr(12, input), 0x3F))))) resultPtr := add(resultPtr, 1) mstore(resultPtr, shl(248, mload(add(tablePtr, and(shr(6, input), 0x3F))))) resultPtr := add(resultPtr, 1) mstore(resultPtr, shl(248, mload(add(tablePtr, and(input, 0x3F))))) resultPtr := add(resultPtr, 1) } // padding with '=' switch mod(mload(data), 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } } return result; } } function hslaString(uint256 hue, uint256 saturation, uint256 lightness) internal pure returns (string memory) { return string.concat("hsla(", hue.toString(), ",", saturation.toString(), "%,", lightness.toString(), "%,100%)"); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.17 .0; contract Constants { uint256 public constant PRICE = 0.005 ether; uint256 internal constant MAX_DINOS = 1111; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Library for converting numbers into strings and other string operations. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibString.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/LibString.sol) library LibString { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The `length` of the output is too small to contain all the hex digits. error HexLengthInsufficient(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CONSTANTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The constant returned when the `search` is not found in the string. uint256 internal constant NOT_FOUND = type(uint256).max; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* DECIMAL OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the base 10 decimal representation of `value`. function toString(uint256 value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. str := add(mload(0x40), 0x80) // Update the free memory pointer to allocate. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str let w := not(0) // Tsk. // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let temp := value } 1 { } { str := add(str, w) // `sub(str, 1)`. // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } /// @dev Returns the base 10 decimal representation of `value`. function toString(int256 value) internal pure returns (string memory str) { if (value >= 0) { return toString(uint256(value)); } unchecked { str = toString(uint256(-value)); } /// @solidity memory-safe-assembly assembly { // We still have some spare memory space on the left, // as we have allocated 3 words (96 bytes) for up to 78 digits. let length := mload(str) // Load the string length. mstore(str, 0x2d) // Store the '-' character. str := sub(str, 1) // Move back the string pointer by a byte. mstore(str, add(length, 1)) // Update the string length. } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* HEXADECIMAL OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the hexadecimal representation of `value`, /// left-padded to an input length of `length` bytes. /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte, /// giving a total length of `length * 2 + 2` bytes. /// Reverts if `length` is too small for the output to contain all the digits. function toHexString(uint256 value, uint256 length) internal pure returns (string memory str) { str = toHexStringNoPrefix(value, length); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`, /// left-padded to an input length of `length` bytes. /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte, /// giving a total length of `length * 2` bytes. /// Reverts if `length` is too small for the output to contain all the digits. function toHexStringNoPrefix(uint256 value, uint256 length) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { // We need 0x20 bytes for the trailing zeros padding, `length * 2` bytes // for the digits, 0x02 bytes for the prefix, and 0x20 bytes for the length. // We add 0x20 to the total and round down to a multiple of 0x20. // (0x20 + 0x20 + 0x02 + 0x20) = 0x62. str := add(mload(0x40), and(add(shl(1, length), 0x42), not(0x1f))) // Allocate the memory. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end to calculate the length later. let end := str // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let start := sub(str, add(length, length)) let w := not(1) // Tsk. let temp := value // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { } 1 { } { str := add(str, w) // `sub(str, 2)`. mstore8(add(str, 1), mload(and(temp, 15))) mstore8(str, mload(and(shr(4, temp), 15))) temp := shr(8, temp) if iszero(xor(str, start)) { break } } if temp { // Store the function selector of `HexLengthInsufficient()`. mstore(0x00, 0x2194895a) // Revert with (offset, size). revert(0x1c, 0x04) } // Compute the string's length. let strLength := sub(end, str) // Move the pointer and write the length. str := sub(str, 0x20) mstore(str, strLength) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte. /// As address are 20 bytes long, the output will left-padded to have /// a length of `20 * 2 + 2` bytes. function toHexString(uint256 value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is encoded using 2 hexadecimal digits per byte. /// As address are 20 bytes long, the output will left-padded to have /// a length of `20 * 2` bytes. function toHexStringNoPrefix(uint256 value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length, // 0x02 bytes for the prefix, and 0x40 bytes for the digits. // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x40) is 0xa0. str := add(mload(0x40), 0x80) // Allocate the memory. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end to calculate the length later. let end := str // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let w := not(1) // Tsk. // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let temp := value } 1 { } { str := add(str, w) // `sub(str, 2)`. mstore8(add(str, 1), mload(and(temp, 15))) mstore8(str, mload(and(shr(4, temp), 15))) temp := shr(8, temp) if iszero(temp) { break } } // Compute the string's length. let strLength := sub(end, str) // Move the pointer and write the length. str := sub(str, 0x20) mstore(str, strLength) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x", encoded using 2 hexadecimal digits per byte, /// and the alphabets are capitalized conditionally according to /// https://eips.ethereum.org/EIPS/eip-55 function toHexStringChecksumed(address value) internal pure returns (string memory str) { str = toHexString(value); /// @solidity memory-safe-assembly assembly { let mask := shl(6, div(not(0), 255)) // `0b010000000100000000 ...` let o := add(str, 0x22) let hashed := and(keccak256(o, 40), mul(34, mask)) // `0b10001000 ... ` let t := shl(240, 136) // `0b10001000 << 240` for { let i := 0 } 1 { } { mstore(add(i, i), mul(t, byte(i, hashed))) i := add(i, 1) if eq(i, 20) { break } } mstore(o, xor(mload(o), shr(1, and(mload(0x00), and(mload(o), mask))))) o := add(o, 0x20) mstore(o, xor(mload(o), shr(1, and(mload(0x20), and(mload(o), mask))))) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte. function toHexString(address value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is encoded using 2 hexadecimal digits per byte. function toHexStringNoPrefix(address value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { str := mload(0x40) // Allocate the memory. // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length, // 0x02 bytes for the prefix, and 0x28 bytes for the digits. // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x28) is 0x80. mstore(0x40, add(str, 0x80)) // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) str := add(str, 2) mstore(str, 40) let o := add(str, 0x20) mstore(add(o, 40), 0) value := shl(96, value) // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let i := 0 } 1 { } { let p := add(o, add(i, i)) let temp := byte(i, value) mstore8(add(p, 1), mload(and(temp, 15))) mstore8(p, mload(shr(4, temp))) i := add(i, 1) if eq(i, 20) { break } } } } /// @dev Returns the hex encoded string from the raw bytes. /// The output is encoded using 2 hexadecimal digits per byte. function toHexString(bytes memory raw) internal pure returns (string memory str) { str = toHexStringNoPrefix(raw); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hex encoded string from the raw bytes. /// The output is encoded using 2 hexadecimal digits per byte. function toHexStringNoPrefix(bytes memory raw) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { let length := mload(raw) str := add(mload(0x40), 2) // Skip 2 bytes for the optional prefix. mstore(str, add(length, length)) // Store the length of the output. // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let o := add(str, 0x20) let end := add(raw, length) for { } iszero(eq(raw, end)) { } { raw := add(raw, 1) mstore8(add(o, 1), mload(and(mload(raw), 15))) mstore8(o, mload(and(shr(4, mload(raw)), 15))) o := add(o, 2) } mstore(o, 0) // Zeroize the slot after the string. mstore(0x40, and(add(o, 31), not(31))) // Allocate the memory. } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* RUNE STRING OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the number of UTF characters in the string. function runeCount(string memory s) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { if mload(s) { mstore(0x00, div(not(0), 255)) mstore(0x20, 0x0202020202020202020202020202020202020202020202020303030304040506) let o := add(s, 0x20) let end := add(o, mload(s)) for { result := 1 } 1 { result := add(result, 1) } { o := add(o, byte(0, mload(shr(250, mload(o))))) if iszero(lt(o, end)) { break } } } } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* BYTE STRING OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ // For performance and bytecode compactness, all indices of the following operations // are byte (ASCII) offsets, not UTF character offsets. /// @dev Returns `subject` all occurrences of `search` replaced with `replacement`. function replace( string memory subject, string memory search, string memory replacement ) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) let searchLength := mload(search) let replacementLength := mload(replacement) subject := add(subject, 0x20) search := add(search, 0x20) replacement := add(replacement, 0x20) result := add(mload(0x40), 0x20) let subjectEnd := add(subject, subjectLength) if iszero(gt(searchLength, subjectLength)) { let subjectSearchEnd := add(sub(subjectEnd, searchLength), 1) let h := 0 if iszero(lt(searchLength, 32)) { h := keccak256(search, searchLength) } let m := shl(3, sub(32, and(searchLength, 31))) let s := mload(search) for { } 1 { } { let t := mload(subject) // Whether the first `searchLength % 32` bytes of // `subject` and `search` matches. if iszero(shr(m, xor(t, s))) { if h { if iszero(eq(keccak256(subject, searchLength), h)) { mstore(result, t) result := add(result, 1) subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } continue } } // Copy the `replacement` one word at a time. for { let o := 0 } 1 { } { mstore(add(result, o), mload(add(replacement, o))) o := add(o, 0x20) if iszero(lt(o, replacementLength)) { break } } result := add(result, replacementLength) subject := add(subject, searchLength) if searchLength { if iszero(lt(subject, subjectSearchEnd)) { break } continue } } mstore(result, t) result := add(result, 1) subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } } } let resultRemainder := result result := add(mload(0x40), 0x20) let k := add(sub(resultRemainder, result), sub(subjectEnd, subject)) // Copy the rest of the string one word at a time. for { } lt(subject, subjectEnd) { } { mstore(resultRemainder, mload(subject)) resultRemainder := add(resultRemainder, 0x20) subject := add(subject, 0x20) } result := sub(result, 0x20) // Zeroize the slot after the string. let last := add(add(result, 0x20), k) mstore(last, 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, and(add(last, 31), not(31))) // Store the length of the result. mstore(result, k) } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from left to right, starting from `from`. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function indexOf(string memory subject, string memory search, uint256 from) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { for { let subjectLength := mload(subject) } 1 { } { if iszero(mload(search)) { if iszero(gt(from, subjectLength)) { result := from break } result := subjectLength break } let searchLength := mload(search) let subjectStart := add(subject, 0x20) result := not(0) // Initialize to `NOT_FOUND`. subject := add(subjectStart, from) let end := add(sub(add(subjectStart, subjectLength), searchLength), 1) let m := shl(3, sub(32, and(searchLength, 31))) let s := mload(add(search, 0x20)) if iszero(and(lt(subject, end), lt(from, subjectLength))) { break } if iszero(lt(searchLength, 32)) { for { let h := keccak256(add(search, 0x20), searchLength) } 1 { } { if iszero(shr(m, xor(mload(subject), s))) { if eq(keccak256(subject, searchLength), h) { result := sub(subject, subjectStart) break } } subject := add(subject, 1) if iszero(lt(subject, end)) { break } } break } for { } 1 { } { if iszero(shr(m, xor(mload(subject), s))) { result := sub(subject, subjectStart) break } subject := add(subject, 1) if iszero(lt(subject, end)) { break } } break } } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from left to right. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function indexOf(string memory subject, string memory search) internal pure returns (uint256 result) { result = indexOf(subject, search, 0); } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from right to left, starting from `from`. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function lastIndexOf( string memory subject, string memory search, uint256 from ) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { for { } 1 { } { result := not(0) // Initialize to `NOT_FOUND`. let searchLength := mload(search) if gt(searchLength, mload(subject)) { break } let w := result let fromMax := sub(mload(subject), searchLength) if iszero(gt(fromMax, from)) { from := fromMax } let end := add(add(subject, 0x20), w) subject := add(add(subject, 0x20), from) if iszero(gt(subject, end)) { break } // As this function is not too often used, // we shall simply use keccak256 for smaller bytecode size. for { let h := keccak256(add(search, 0x20), searchLength) } 1 { } { if eq(keccak256(subject, searchLength), h) { result := sub(subject, add(end, 1)) break } subject := add(subject, w) // `sub(subject, 1)`. if iszero(gt(subject, end)) { break } } break } } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from right to left. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function lastIndexOf(string memory subject, string memory search) internal pure returns (uint256 result) { result = lastIndexOf(subject, search, uint256(int256(-1))); } /// @dev Returns whether `subject` starts with `search`. function startsWith(string memory subject, string memory search) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { let searchLength := mload(search) // Just using keccak256 directly is actually cheaper. // forgefmt: disable-next-item result := and( iszero(gt(searchLength, mload(subject))), eq(keccak256(add(subject, 0x20), searchLength), keccak256(add(search, 0x20), searchLength)) ) } } /// @dev Returns whether `subject` ends with `search`. function endsWith(string memory subject, string memory search) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { let searchLength := mload(search) let subjectLength := mload(subject) // Whether `search` is not longer than `subject`. let withinRange := iszero(gt(searchLength, subjectLength)) // Just using keccak256 directly is actually cheaper. // forgefmt: disable-next-item result := and( withinRange, eq( keccak256( // `subject + 0x20 + max(subjectLength - searchLength, 0)`. add(add(subject, 0x20), mul(withinRange, sub(subjectLength, searchLength))), searchLength ), keccak256(add(search, 0x20), searchLength) ) ) } } /// @dev Returns `subject` repeated `times`. function repeat(string memory subject, uint256 times) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) if iszero(or(iszero(times), iszero(subjectLength))) { subject := add(subject, 0x20) result := mload(0x40) let output := add(result, 0x20) for { } 1 { } { // Copy the `subject` one word at a time. for { let o := 0 } 1 { } { mstore(add(output, o), mload(add(subject, o))) o := add(o, 0x20) if iszero(lt(o, subjectLength)) { break } } output := add(output, subjectLength) times := sub(times, 1) if iszero(times) { break } } // Zeroize the slot after the string. mstore(output, 0) // Store the length. let resultLength := sub(output, add(result, 0x20)) mstore(result, resultLength) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, add(result, and(add(resultLength, 63), not(31)))) } } } /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive). /// `start` and `end` are byte offsets. function slice(string memory subject, uint256 start, uint256 end) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) if iszero(gt(subjectLength, end)) { end := subjectLength } if iszero(gt(subjectLength, start)) { start := subjectLength } if lt(start, end) { result := mload(0x40) let resultLength := sub(end, start) mstore(result, resultLength) subject := add(subject, start) let w := not(31) // Copy the `subject` one word at a time, backwards. for { let o := and(add(resultLength, 31), w) } 1 { } { mstore(add(result, o), mload(add(subject, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } // Zeroize the slot after the string. mstore(add(add(result, 0x20), resultLength), 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, add(result, and(add(resultLength, 63), w))) } } } /// @dev Returns a copy of `subject` sliced from `start` to the end of the string. /// `start` is a byte offset. function slice(string memory subject, uint256 start) internal pure returns (string memory result) { result = slice(subject, start, uint256(int256(-1))); } /// @dev Returns all the indices of `search` in `subject`. /// The indices are byte offsets. function indicesOf(string memory subject, string memory search) internal pure returns (uint256[] memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) let searchLength := mload(search) if iszero(gt(searchLength, subjectLength)) { subject := add(subject, 0x20) search := add(search, 0x20) result := add(mload(0x40), 0x20) let subjectStart := subject let subjectSearchEnd := add(sub(add(subject, subjectLength), searchLength), 1) let h := 0 if iszero(lt(searchLength, 32)) { h := keccak256(search, searchLength) } let m := shl(3, sub(32, and(searchLength, 31))) let s := mload(search) for { } 1 { } { let t := mload(subject) // Whether the first `searchLength % 32` bytes of // `subject` and `search` matches. if iszero(shr(m, xor(t, s))) { if h { if iszero(eq(keccak256(subject, searchLength), h)) { subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } continue } } // Append to `result`. mstore(result, sub(subject, subjectStart)) result := add(result, 0x20) // Advance `subject` by `searchLength`. subject := add(subject, searchLength) if searchLength { if iszero(lt(subject, subjectSearchEnd)) { break } continue } } subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } } let resultEnd := result // Assign `result` to the free memory pointer. result := mload(0x40) // Store the length of `result`. mstore(result, shr(5, sub(resultEnd, add(result, 0x20)))) // Allocate memory for result. // We allocate one more word, so this array can be recycled for {split}. mstore(0x40, add(resultEnd, 0x20)) } } } /// @dev Returns a arrays of strings based on the `delimiter` inside of the `subject` string. function split(string memory subject, string memory delimiter) internal pure returns (string[] memory result) { uint256[] memory indices = indicesOf(subject, delimiter); /// @solidity memory-safe-assembly assembly { let w := not(31) let indexPtr := add(indices, 0x20) let indicesEnd := add(indexPtr, shl(5, add(mload(indices), 1))) mstore(add(indicesEnd, w), mload(subject)) mstore(indices, add(mload(indices), 1)) let prevIndex := 0 for { } 1 { } { let index := mload(indexPtr) mstore(indexPtr, 0x60) if iszero(eq(index, prevIndex)) { let element := mload(0x40) let elementLength := sub(index, prevIndex) mstore(element, elementLength) // Copy the `subject` one word at a time, backwards. for { let o := and(add(elementLength, 31), w) } 1 { } { mstore(add(element, o), mload(add(add(subject, prevIndex), o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } // Zeroize the slot after the string. mstore(add(add(element, 0x20), elementLength), 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, add(element, and(add(elementLength, 63), w))) // Store the `element` into the array. mstore(indexPtr, element) } prevIndex := add(index, mload(delimiter)) indexPtr := add(indexPtr, 0x20) if iszero(lt(indexPtr, indicesEnd)) { break } } result := indices if iszero(mload(delimiter)) { result := add(indices, 0x20) mstore(result, sub(mload(indices), 2)) } } } /// @dev Returns a concatenated string of `a` and `b`. /// Cheaper than `string.concat()` and does not de-align the free memory pointer. function concat(string memory a, string memory b) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let w := not(31) result := mload(0x40) let aLength := mload(a) // Copy `a` one word at a time, backwards. for { let o := and(add(mload(a), 32), w) } 1 { } { mstore(add(result, o), mload(add(a, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } let bLength := mload(b) let output := add(result, mload(a)) // Copy `b` one word at a time, backwards. for { let o := and(add(bLength, 32), w) } 1 { } { mstore(add(output, o), mload(add(b, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } let totalLength := add(aLength, bLength) let last := add(add(result, 0x20), totalLength) // Zeroize the slot after the string. mstore(last, 0) // Stores the length. mstore(result, totalLength) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, and(add(last, 31), w)) } } /// @dev Returns a copy of the string in either lowercase or UPPERCASE. function toCase(string memory subject, bool toUpper) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let length := mload(subject) if length { result := add(mload(0x40), 0x20) subject := add(subject, 1) let flags := shl(add(70, shl(5, toUpper)), 67108863) let w := not(0) for { let o := length } 1 { } { o := add(o, w) let b := and(0xff, mload(add(subject, o))) mstore8(add(result, o), xor(b, and(shr(b, flags), 0x20))) if iszero(o) { break } } // Restore the result. result := mload(0x40) // Stores the string length. mstore(result, length) // Zeroize the slot after the string. let last := add(add(result, 0x20), length) mstore(last, 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, and(add(last, 31), not(31))) } } } /// @dev Returns a lowercased copy of the string. function lower(string memory subject) internal pure returns (string memory result) { result = toCase(subject, false); } /// @dev Returns an UPPERCASED copy of the string. function upper(string memory subject) internal pure returns (string memory result) { result = toCase(subject, true); } /// @dev Escapes the string to be used within HTML tags. function escapeHTML(string memory s) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { for { let end := add(s, mload(s)) result := add(mload(0x40), 0x20) // Store the bytes of the packed offsets and strides into the scratch space. // `packed = (stride << 5) | offset`. Max offset is 20. Max stride is 6. mstore(0x1f, 0x900094) mstore(0x08, 0xc0000000a6ab) // Store ""&'<>" into the scratch space. mstore(0x00, shl(64, 0x2671756f743b26616d703b262333393b266c743b2667743b)) } iszero(eq(s, end)) { } { s := add(s, 1) let c := and(mload(s), 0xff) // Not in `["\"","'","&","<",">"]`. if iszero(and(shl(c, 1), 0x500000c400000000)) { mstore8(result, c) result := add(result, 1) continue } let t := shr(248, mload(c)) mstore(result, mload(and(t, 31))) result := add(result, shr(5, t)) } let last := result // Zeroize the slot after the string. mstore(last, 0) // Restore the result to the start of the free memory. result := mload(0x40) // Store the length of the result. mstore(result, sub(last, add(result, 0x20))) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, and(add(last, 31), not(31))) } } /// @dev Escapes the string to be used within double-quotes in a JSON. function escapeJSON(string memory s) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { for { let end := add(s, mload(s)) result := add(mload(0x40), 0x20) // Store "\\u0000" in scratch space. // Store "0123456789abcdef" in scratch space. // Also, store `{0x08:"b", 0x09:"t", 0x0a:"n", 0x0c:"f", 0x0d:"r"}`. // into the scratch space. mstore(0x15, 0x5c75303030303031323334353637383961626364656662746e006672) // Bitmask for detecting `["\"","\\"]`. let e := or(shl(0x22, 1), shl(0x5c, 1)) } iszero(eq(s, end)) { } { s := add(s, 1) let c := and(mload(s), 0xff) if iszero(lt(c, 0x20)) { if iszero(and(shl(c, 1), e)) { // Not in `["\"","\\"]`. mstore8(result, c) result := add(result, 1) continue } mstore8(result, 0x5c) // "\\". mstore8(add(result, 1), c) result := add(result, 2) continue } if iszero(and(shl(c, 1), 0x3700)) { // Not in `["\b","\t","\n","\f","\d"]`. mstore8(0x1d, mload(shr(4, c))) // Hex value. mstore8(0x1e, mload(and(c, 15))) // Hex value. mstore(result, mload(0x19)) // "\\u00XX". result := add(result, 6) continue } mstore8(result, 0x5c) // "\\". mstore8(add(result, 1), mload(add(c, 8))) result := add(result, 2) } let last := result // Zeroize the slot after the string. mstore(last, 0) // Restore the result to the start of the free memory. result := mload(0x40) // Store the length of the result. mstore(result, sub(last, add(result, 0x20))) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, and(add(last, 31), not(31))) } } /// @dev Returns whether `a` equals `b`. function eq(string memory a, string memory b) internal pure returns (bool result) { assembly { result := eq(keccak256(add(a, 0x20), mload(a)), keccak256(add(b, 0x20), mload(b))) } } /// @dev Packs a single string with its length into a single word. /// Returns `bytes32(0)` if the length is zero or greater than 31. function packOne(string memory a) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { // We don't need to zero right pad the string, // since this is our own custom non-standard packing scheme. result := mul( // Load the length and the bytes. mload(add(a, 0x1f)), // `length != 0 && length < 32`. Abuses underflow. // Assumes that the length is valid and within the block gas limit. lt(sub(mload(a), 1), 0x1f) ) } } /// @dev Unpacks a string packed using {packOne}. /// Returns the empty string if `packed` is `bytes32(0)`. /// If `packed` is not an output of {packOne}, the output behaviour is undefined. function unpackOne(bytes32 packed) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { // Grab the free memory pointer. result := mload(0x40) // Allocate 2 words (1 for the length, 1 for the bytes). mstore(0x40, add(result, 0x40)) // Zeroize the length slot. mstore(result, 0) // Store the length and bytes. mstore(add(result, 0x1f), packed) // Right pad with zeroes. mstore(add(add(result, 0x20), mload(result)), 0) } } /// @dev Packs two strings with their lengths into a single word. /// Returns `bytes32(0)` if combined length is zero or greater than 30. function packTwo(string memory a, string memory b) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { let aLength := mload(a) // We don't need to zero right pad the strings, // since this is our own custom non-standard packing scheme. result := mul( // Load the length and the bytes of `a` and `b`. or(shl(shl(3, sub(0x1f, aLength)), mload(add(a, aLength))), mload(sub(add(b, 0x1e), aLength))), // `totalLength != 0 && totalLength < 31`. Abuses underflow. // Assumes that the lengths are valid and within the block gas limit. lt(sub(add(aLength, mload(b)), 1), 0x1e) ) } } /// @dev Unpacks strings packed using {packTwo}. /// Returns the empty strings if `packed` is `bytes32(0)`. /// If `packed` is not an output of {packTwo}, the output behaviour is undefined. function unpackTwo(bytes32 packed) internal pure returns (string memory resultA, string memory resultB) { /// @solidity memory-safe-assembly assembly { // Grab the free memory pointer. resultA := mload(0x40) resultB := add(resultA, 0x40) // Allocate 2 words for each string (1 for the length, 1 for the byte). Total 4 words. mstore(0x40, add(resultB, 0x40)) // Zeroize the length slots. mstore(resultA, 0) mstore(resultB, 0) // Store the lengths and bytes. mstore(add(resultA, 0x1f), packed) mstore(add(resultB, 0x1f), mload(add(add(resultA, 0x20), mload(resultA)))) // Right pad with zeroes. mstore(add(add(resultA, 0x20), mload(resultA)), 0) mstore(add(add(resultB, 0x20), mload(resultB)), 0) } } /// @dev Directly returns `a` without copying. function directReturn(string memory a) internal pure { assembly { // Assumes that the string does not start from the scratch space. let retStart := sub(a, 0x20) let retSize := add(mload(a), 0x40) // Right pad with zeroes. Just in case the string is produced // by a method that doesn't zero right pad. mstore(add(retStart, retSize), 0) // Store the return offset. mstore(retStart, 0x20) // End the transaction, returning the string. return(retStart, retSize) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Library for generating psuedorandom numbers. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibPRNG.sol) library LibPRNG { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* STRUCTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev A psuedorandom number state in memory. struct PRNG { uint256 state; } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Seeds the `prng` with `state`. function seed(PRNG memory prng, bytes32 state) internal pure { /// @solidity memory-safe-assembly assembly { mstore(prng, state) } } /// @dev Returns a psuedorandom uint256, uniformly distributed /// between 0 (inclusive) and `upper` (exclusive). /// If your modulus is big, this method is recommended /// for uniform sampling to avoid modulo bias. /// For uniform sampling across all uint256 values, /// or for small enough moduli such that the bias is neligible, /// use {next} instead. function uniform( PRNG memory prng, uint256 upper ) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { // prettier-ignore for {} 1 {} { result := keccak256(prng, 0x20) mstore(prng, result) // prettier-ignore if iszero(lt(result, mod(sub(0, upper), upper))) { break } } result := mod(result, upper) } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.17 .0; library SVG { /* MAIN ELEMENTS */ function line(string memory _props) internal pure returns (string memory) { return string.concat("<line ", _props, "/>"); } function rect(string memory _props) internal pure returns (string memory) { return string.concat('<rect height="1" width="1" ', _props, "/>"); } /* COMMON */ // an SVG attribute function prop(string memory _key, string memory _val) internal pure returns (string memory) { return string.concat(_key, "=", '"', _val, '" '); } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721A { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the * ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitializedForExtraData(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables * (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, * checking first that contract recipients are aware of the ERC721 protocol * to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move * this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external payable; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Transfers `tokenId` from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} * whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external payable; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) external view returns (bool); // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Library for generating psuedorandom numbers. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibPRNG.sol) library LibPRNG { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* STRUCTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev A psuedorandom number state in memory. struct PRNG { uint256 state; } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Seeds the `prng` with `state`. function seed(PRNG memory prng, bytes32 state) internal pure { /// @solidity memory-safe-assembly assembly { mstore(prng, state) } } /// @dev Returns a psuedorandom uint256, uniformly distributed /// between 0 (inclusive) and `upper` (exclusive). /// If your modulus is big, this method is recommended /// for uniform sampling to avoid modulo bias. /// For uniform sampling across all uint256 values, /// or for small enough moduli such that the bias is neligible, /// use {next} instead. function uniform(PRNG memory prng, uint256 upper) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { // prettier-ignore for {} 1 {} { result := keccak256(prng, 0x20) mstore(prng, result) // prettier-ignore if iszero(lt(result, mod(sub(0, upper), upper))) { break } } result := mod(result, upper) } } }
{ "remappings": [ "@prb/test/=lib/prb-test/src/", "forge-std/=lib/forge-std/src/", "src/=src/", "@erc721a/=lib/ERC721A/contracts/", "@openzeppelin/=lib/openzeppelin-contracts/", "@solady/=lib/solady/src/", "operator-filter-registry/=lib/operator-filter-registry/", "ERC721A/=lib/ERC721A/contracts/", "ds-test/=lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/operator-filter-registry/lib/openzeppelin-contracts/lib/erc4626-tests/", "openzeppelin-contracts-upgradeable/=lib/operator-filter-registry/lib/openzeppelin-contracts-upgradeable/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "prb-math/=lib/prb-math/src/", "prb-test/=lib/prb-test/src/", "solady/=lib/solady/src/", "solidity-trigonometry/=lib/solidity-trigonometry/src/", "solmate/=lib/solady/lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 20 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "none", "appendCBOR": false }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "evmVersion": "paris", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"IncorrectPayment","type":"error"},{"inputs":[],"name":"MaxSupplyReached","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"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":"PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"art","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getColors","outputs":[{"internalType":"string","name":"dinoColor","type":"string"},{"internalType":"string","name":"prevDinoColor","type":"string"},{"internalType":"string","name":"backgroundColor","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"amount","type":"uint8"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
610580604052600360a081815260c082905260e08290526101008290526101208290526101408290526101608290526101809190915260056101a081905260026101c08190526101e081905261020081905261022081905261024081905260016102608190526102808290526102a0526102c08190526102e08290526103008190526103208190526103408190526103608190526103808190526103a081905260046103c08190526103e0819052610400829052610420929092526104408190526104608181526104808390526104a08290526104c08290526104e082905261050083905261052092909252610540819052610560526200010291602762000425565b50604080516104e0810182526006808252600a6020830181905260079383018490526008606084018190526080840183905260a0840185905260c08401819052600960e085018190526005610100860181905261012086018590526101408601879052610160860183905261018086018290526101a086018590526101c086018790526101e08601839052610200860182905261022086018490526102408601819052610260860185905261028086018790526102a086018390526102c086018290526102e0860193909352610300850184905261032085018690526103408501829052600461036086015261038085018390526103a085018490526103c085018690526103e08501829052610400850152610420840191909152610440830182905261046083019390935261048082018390526104a08201526104c0810191909152620002569061046290602762000425565b50604080516104e081018252600380825260046020830181905292820181905260608201526080810182905260a0810182905260c0810182905260e08101919091526005610100820181905261012082018190526101408201819052610160820181905261018082015260066101a082018190526101c082018190526101e08201819052610200820181905261022082015260076102408201819052610260820181905261028082018190526102a082018190526102c082018190526102e08201526008610300820181905261032082018190526103408201526009610360820181905261038082018190526103a082018190526103c082018190526103e08201819052610400820152600a610420820181905261044082018190526104608201819052610480820152600b6104a082018190526104c0820152620003a19061046490602762000425565b50348015620003af57600080fd5b506040518060400160405280600d81526020016c6f6e636861696e2064696e6f7360981b8152506040518060400160405280600481526020016344494e4f60e01b81525081600290816200040491906200057b565b5060036200041382826200057b565b50600160005550503360805262000647565b600283019183908215620004ad5791602002820160005b838211156200047c57835183826101000a81548160ff021916908360ff16021790555092602001926001016020816000010492830192600103026200043c565b8015620004ab5782816101000a81549060ff02191690556001016020816000010492830192600103026200047c565b505b50620004bb929150620004bf565b5090565b5b80821115620004bb5760008155600101620004c0565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200050157607f821691505b6020821081036200052257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200057657600081815260208120601f850160051c81016020861015620005515750805b601f850160051c820191505b8181101562000572578281556001016200055d565b5050505b505050565b81516001600160401b03811115620005975762000597620004d6565b620005af81620005a88454620004ec565b8462000528565b602080601f831160018114620005e75760008415620005ce5750858301515b600019600386901b1c1916600185901b17855562000572565b600085815260208120601f198616915b828110156200061857888601518255948401946001909101908401620005f7565b5085821015620006375787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6080516120fb62000663600039600061068601526120fb6000f3fe6080604052600436106100e45760003560e01c806301ffc9a7146100e957806306fdde031461011e578063081812fc14610140578063095ea7b31461017857806318160ddd1461018d57806323b872dd146101b45780633ccfd60b146101c757806342842e0e146101dc5780636352211e146101ef5780636ecd23061461020f57806370a08231146102225780638d859f3e1461024257806395d89b411461025d578063a22cb46514610272578063a85cd88914610292578063b88d4fde146102b2578063c87b56dd146102c5578063e985e9c5146102e5578063f311968214610305575b600080fd5b3480156100f557600080fd5b50610109610104366004611506565b610334565b60405190151581526020015b60405180910390f35b34801561012a57600080fd5b50610133610386565b6040516101159190611573565b34801561014c57600080fd5b5061016061015b366004611586565b610418565b6040516001600160a01b039091168152602001610115565b61018b6101863660046115bb565b61045c565b005b34801561019957600080fd5b5060015460005403600019015b604051908152602001610115565b61018b6101c23660046115e5565b6104fc565b3480156101d357600080fd5b5061018b610682565b61018b6101ea3660046115e5565b610705565b3480156101fb57600080fd5b5061016061020a366004611586565b610725565b61018b61021d366004611621565b610730565b34801561022e57600080fd5b506101a661023d366004611644565b6107ec565b34801561024e57600080fd5b506101a66611c37937e0800081565b34801561026957600080fd5b5061013361083a565b34801561027e57600080fd5b5061018b61028d36600461165f565b610849565b34801561029e57600080fd5b506101336102ad366004611586565b6108b5565b61018b6102c03660046116b1565b610c6f565b3480156102d157600080fd5b506101336102e0366004611586565b610cb9565b3480156102f157600080fd5b5061010961030036600461178c565b610df5565b34801561031157600080fd5b50610325610320366004611586565b610e23565b604051610115939291906117bf565b60006301ffc9a760e01b6001600160e01b03198316148061036557506380ac58cd60e01b6001600160e01b03198316145b806103805750635b5e139f60e01b6001600160e01b03198316145b92915050565b60606002805461039590611802565b80601f01602080910402602001604051908101604052809291908181526020018280546103c190611802565b801561040e5780601f106103e35761010080835404028352916020019161040e565b820191906000526020600020905b8154815290600101906020018083116103f157829003601f168201915b5050505050905090565b600061042382610f61565b610440576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b600061046782610725565b9050336001600160a01b038216146104a0576104838133610df5565b6104a0576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600061050782610f96565b9050836001600160a01b0316816001600160a01b03161461053a5760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054338082146001600160a01b038816909114176105875761056a8633610df5565b61058757604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0385166105ae57604051633a954ecd60e21b815260040160405180910390fd5b80156105b957600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716815220805460010190556105f685600160e11b611005565b600085815260046020526040812091909155600160e11b8416900361064b576001840160008181526004602052604081205490036106495760005481146106495760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03166000805160206120db83398151915260405160405180910390a4505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03164760405160006040518083038185875af1925050503d80600081146106ef576040519150601f19603f3d011682016040523d82523d6000602084013e6106f4565b606091505b505090508061070257600080fd5b50565b61072083838360405180602001604052806000815250610c6f565b505050565b600061038082610f96565b346611c37937e080008260ff16021461075c5760405163569e8c1160e01b815260040160405180910390fd5b60005460ff8216810161045810156107875760405163d05cb60960e01b815260040160405180910390fd5b805b8260ff1682018110156107dd57604080514460208201529081018290526060016040516020818303038152906040528051906020012060088261045881106107d3576107d361183c565b0155600101610789565b5050610702338260ff1661101a565b60006001600160a01b038216610815576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b60606003805461039590611802565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b606060008060006108c585610e23565b925092509250600060405180602001604052806000815250905060005b60278160ff161015610c415760006104608260ff16602781106109075761090761183c565b602091828204019190069054906101000a900460ff1660ff16600114610a6e576104608260ff166027811061093e5761093e61183c565b602091828204019190069054906101000a900460ff1660ff16600214610a68576104608260ff16602781106109755761097561183c565b602091828204019190069054906101000a900460ff1660ff16600314610a62576104608260ff16602781106109ac576109ac61183c565b602091828204019190069054906101000a900460ff1660ff16600414610a3d576104608260ff16602781106109e3576109e361183c565b602091828204019190069054906101000a900460ff1660ff16600514610a185760405180602001604052806000815250610a8c565b6040518060400160405280600781526020016608d1511151115160ca1b815250610a8c565b6040518060400160405280600781526020016611a2212221222160c91b815250610a8c565b84610a8c565b85610a8c565b6040518060400160405280600481526020016311a3232360e11b8152505b905082610c15610ab860405180604001604052806004815260200163199a5b1b60e21b81525084611102565b610b0f604051806040016040528060018152602001600f60fb1b815250610b0a6104628860ff1660278110610aef57610aef61183c565b602081049091015460ff601f9092166101000a90041661112e565b611102565b610b46604051806040016040528060018152602001607960f81b815250610b0a6104648960ff1660278110610aef57610aef61183c565b60ff871615610bb1578660ff16600114610b6f5760405180602001604052806000815250610bee565b610bac604051806040016040528060028152602001611a5960f21b815250604051806040016040528060018152602001603160f91b815250611102565b610bee565b610bee604051806040016040528060028152602001611a5960f21b815250604051806040016040528060018152602001606160f81b815250611102565b604051602001610c01949392919061186e565b604051602081830303815290604052611172565b604051602001610c269291906118c5565b60408051601f198184030181529190529250506001016108e2565b508181604051602001610c559291906118f4565b604051602081830303815290604052945050505050919050565b610c7a8484846104fc565b6001600160a01b0383163b15610cb357610c968484848461119b565b610cb3576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6060610cc482610f61565b610ce157604051630a14c4b560e41b815260040160405180910390fd5b6000610cec836108b5565b9050610dee83610cfb83611286565b610d2384604051602001610d0f91906119f5565b6040516020818303038152906040526112a1565b604051602001610d339190611b9e565b60408051601f19818403018152828201825260088352676d6574616461746160c01b6020848101919091528251808401909352600783526637b731b430b4b760c91b9083015291610d859160016113f3565b610dc96040518060400160405280600481526020016364696e6f60e01b815250604051806040016040528060048152602001633930bbb960e11b81525060006113f3565b604051602001610dda929190611bdc565b604051602081830303815290604052611456565b9392505050565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b6060806060610e3e6040518060200160405280600081525090565b610e5b6008866104588110610e5557610e5561183c565b01548252565b6000610e69826101686114a3565b9050610ea081610e7a8460466114a3565b610e85906019611c3f565b610e9085600f6114a3565b610e9b906041611c3f565b6114c1565b94506001861115610f1357604080516020810190915260008152610edb6008610eca60018a611c52565b6104588110610e5557610e5561183c565b610f0b610eea826101686114a3565b610ef58360466114a3565b610f00906019611c3f565b610e9084600f6114a3565b945050610f33565b6040518060400160405280600481526020016311a3232360e11b81525093505b610f57610168610f448360b4611c3f565b610f4e9190611c7b565b603c60506114c1565b9496939550505050565b600081600111158015610f75575060005482105b8015610380575050600090815260046020526040902054600160e01b161590565b60008180600111610fec57600054811015610fec5760008181526004602052604081205490600160e01b82169003610fea575b80600003610dee575060001901600081815260046020526040902054610fc9565b505b604051636f96cda160e11b815260040160405180910390fd5b4260a01b176001600160a01b03919091161790565b600080549082900361103f5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038316600090815260056020526040902080546001600160401b018402019055611076836001841460e11b611005565b6000828152600460205260408120919091556001600160a01b0384169083830190839083906000805160206120db8339815191528180a4600183015b8181146110d857808360006000805160206120db833981519152600080a46001016110b2565b50816000036110f957604051622e076360e81b815260040160405180910390fd5b60005550505050565b60608282604051602001611117929190611c9d565b604051602081830303815290604052905092915050565b60606080604051019050602081016040526000815280600019835b928101926030600a8206018453600a900480611149575050819003601f19909101908152919050565b6060816040516020016111859190611cf2565b6040516020818303038152906040529050919050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906111d0903390899088908890600401611d42565b6020604051808303816000875af192505050801561120b575060408051601f3d908101601f1916820190925261120891810190611d75565b60015b611269573d808015611239576040519150601f19603f3d011682016040523d82523d6000602084013e61123e565b606091505b508051600003611261576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6060611291826112a1565b6040516020016111859190611d92565b606081516000036112c057505060408051602081019091526000815290565b600060405180606001604052806040815260200161209b604091399050600060038451600201816112f3576112f3611c65565b0460040290506000816020016001600160401b038111156113165761131661169b565b6040519080825280601f01601f191660200182016040528015611340576020820181803683370190505b509050818152600183018586518101602084015b818310156113ae5760039283018051603f601282901c811687015160f890811b8552600c83901c8216880151811b6001860152600683901c8216880151811b60028601529116860151901b93820193909352600401611354565b6003895106600181146113c857600281146113d9576113e5565b613d3d60f01b6001198301526113e5565b603d60f81b6000198301525b509398975050505050505050565b6060838383611411576040518060200160405280600081525061142c565b604051806040016040528060018152602001600b60fa1b8152505b60405160200161143e93929190611dd4565b60405160208183030381529060405290509392505050565b606061147a6114648661112e565b838686604051602001610d0f9493929190611e5a565b60405160200161148a9190611fd0565b6040516020818303038152906040529050949350505050565b60005b60208320905080835281826000030681106114a65706919050565b60606114cc8461112e565b6114d58461112e565b6114de8461112e565b60405160200161143e93929190612015565b6001600160e01b03198116811461070257600080fd5b60006020828403121561151857600080fd5b8135610dee816114f0565b60005b8381101561153e578181015183820152602001611526565b50506000910152565b6000815180845261155f816020860160208601611523565b601f01601f19169290920160200192915050565b602081526000610dee6020830184611547565b60006020828403121561159857600080fd5b5035919050565b80356001600160a01b03811681146115b657600080fd5b919050565b600080604083850312156115ce57600080fd5b6115d78361159f565b946020939093013593505050565b6000806000606084860312156115fa57600080fd5b6116038461159f565b92506116116020850161159f565b9150604084013590509250925092565b60006020828403121561163357600080fd5b813560ff81168114610dee57600080fd5b60006020828403121561165657600080fd5b610dee8261159f565b6000806040838503121561167257600080fd5b61167b8361159f565b91506020830135801515811461169057600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156116c757600080fd5b6116d08561159f565b93506116de6020860161159f565b92506040850135915060608501356001600160401b038082111561170157600080fd5b818701915087601f83011261171557600080fd5b8135818111156117275761172761169b565b604051601f8201601f19908116603f0116810190838211818310171561174f5761174f61169b565b816040528281528a602084870101111561176857600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561179f57600080fd5b6117a88361159f565b91506117b66020840161159f565b90509250929050565b6060815260006117d26060830186611547565b82810360208401526117e48186611547565b905082810360408401526117f88185611547565b9695505050505050565b600181811c9082168061181657607f821691505b60208210810361183657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b60008151611864818560208601611523565b9290920192915050565b60008551611880818460208a01611523565b855190830190611894818360208a01611523565b85519101906118a7818360208901611523565b84519101906118ba818360208801611523565b019695505050505050565b600083516118d7818460208801611523565b8351908301906118eb818360208801611523565b01949350505050565b7f3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323081527f30302f737667222077696474683d223130302522206865696768743d2231303060208201527f25222073686170652d72656e646572696e673d2263726973704564676573222060408201527f76696577426f783d2230203020313620313622207374796c653d226261636b6760608201526c03937bab73216b1b7b637b91d1609d1b6080820152600083516119b481608d850160208801611523565b61111f60f11b608d9184019182015283516119d681608f840160208801611523565b651e17b9bb339f60d11b608f9290910191820152609501949350505050565b7f3c68746d6c207374796c653d226f766572666c6f773a68696464656e223e3c6281527437b23c9039ba3cb6329e9136b0b933b4b71d18111f60591b602082015260008251611a4b816035850160208701611523565b7f3c7363726970743e646f63756d656e742e626f64792e6164644576656e744c6960359390910192830152507f7374656e65722822636c69636b222c28293d3e7b6c657420742c653b2236223d60558201527f3d3d646f63756d656e742e676574456c656d656e744279496428226122292e6760758201527f657441747472696275746528227822293f28743d2239222c653d223522293a2860958201527f743d2236222c653d22313022292c646f63756d656e742e676574456c656d656e60b58201527f744279496428226122292e736574417474726962757465282278222c74292c6460d58201527f6f63756d656e742e676574456c656d656e744279496428226222292e7365744160f58201527f7474726962757465282278222c65297d293b3c2f7363726970743e3c2f626f64610115820152683c9f1e17b43a36b61f60b91b61013582015261013e01919050565b7519185d184e9d195e1d0bda1d1b5b0ed8985cd94d8d0b60521b815260008251611bcf816016850160208701611523565b9190910160160192915050565b605b60f81b815260008351611bf8816001850160208801611523565b835190830190611c0f816001840160208801611523565b605d60f81b60019290910191820152600201949350505050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561038057610380611c29565b8181038181111561038057610380611c29565b634e487b7160e01b600052601260045260246000fd5b600082611c9857634e487b7160e01b600052601260045260246000fd5b500690565b60008351611caf818460208801611523565b603d60f81b908301908152601160f91b60018201528351611cd7816002840160208801611523565b61011160f51b60029290910191820152600401949350505050565b7a01e3932b1ba103432b4b3b43a1e911891103bb4b23a341e9118911602d1b81528151600090611d2981601b850160208701611523565b61179f60f11b601b939091019283015250601d01919050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906117f890830184611547565b600060208284031215611d8757600080fd5b8151610dee816114f0565b7919185d184e9a5b5859d94bdcdd99cade1b5b0ed8985cd94d8d0b60321b815260008251611dc781601a850160208701611523565b91909101601a0192915050565b6e3d913a3930b4ba2fba3cb832911d1160891b81528351600090611dff81600f850160208901611523565b6a1116113b30b63ab2911d1160a91b600f918401918201528451611e2a81601a840160208901611523565b61227d60f01b601a92909101918201528351611e4d81601c840160208801611523565b01601c0195945050505050565b767b226e616d65223a226f6e636861696e2064696e6f202360481b81528451600090611e8d816017850160208a01611523565b7f222c226465736372697074696f6e223a226f6e636861696e2064696e6f7320616017918401918201527f72652067656e65726174697665206f6e636861696e2064696e6f7320696e737060378201527f697265642062792074696e792064696e6f732e2074686520686174206561636860578201527f206f6e636861696e2064696e6f2069732077656172696e6720776173206d616460778201527f65206279207468652070726576696f7573206f6e636861696e2064696e6f2e2260978201526d161130ba3a3934b13aba32b9911d60911b60b7820152611f7360c5820187611852565b69161134b6b0b3b2911d1160b11b81529050611f92600a820186611852565b7211161130b734b6b0ba34b7b72fbab936111d1160691b81529050611fba6013820185611852565b61227d60f01b8152600201979650505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161200881601d850160208701611523565b91909101601d0192915050565b640d0e6d8c2560db1b815260008451612035816005850160208901611523565b600b60fa1b6005918401918201528451612056816006840160208901611523565b61094b60f21b600692909101918201528351612079816008840160208801611523565b66252c313030252960c81b60089290910191820152600f019594505050505056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
Deployed Bytecode
0x6080604052600436106100e45760003560e01c806301ffc9a7146100e957806306fdde031461011e578063081812fc14610140578063095ea7b31461017857806318160ddd1461018d57806323b872dd146101b45780633ccfd60b146101c757806342842e0e146101dc5780636352211e146101ef5780636ecd23061461020f57806370a08231146102225780638d859f3e1461024257806395d89b411461025d578063a22cb46514610272578063a85cd88914610292578063b88d4fde146102b2578063c87b56dd146102c5578063e985e9c5146102e5578063f311968214610305575b600080fd5b3480156100f557600080fd5b50610109610104366004611506565b610334565b60405190151581526020015b60405180910390f35b34801561012a57600080fd5b50610133610386565b6040516101159190611573565b34801561014c57600080fd5b5061016061015b366004611586565b610418565b6040516001600160a01b039091168152602001610115565b61018b6101863660046115bb565b61045c565b005b34801561019957600080fd5b5060015460005403600019015b604051908152602001610115565b61018b6101c23660046115e5565b6104fc565b3480156101d357600080fd5b5061018b610682565b61018b6101ea3660046115e5565b610705565b3480156101fb57600080fd5b5061016061020a366004611586565b610725565b61018b61021d366004611621565b610730565b34801561022e57600080fd5b506101a661023d366004611644565b6107ec565b34801561024e57600080fd5b506101a66611c37937e0800081565b34801561026957600080fd5b5061013361083a565b34801561027e57600080fd5b5061018b61028d36600461165f565b610849565b34801561029e57600080fd5b506101336102ad366004611586565b6108b5565b61018b6102c03660046116b1565b610c6f565b3480156102d157600080fd5b506101336102e0366004611586565b610cb9565b3480156102f157600080fd5b5061010961030036600461178c565b610df5565b34801561031157600080fd5b50610325610320366004611586565b610e23565b604051610115939291906117bf565b60006301ffc9a760e01b6001600160e01b03198316148061036557506380ac58cd60e01b6001600160e01b03198316145b806103805750635b5e139f60e01b6001600160e01b03198316145b92915050565b60606002805461039590611802565b80601f01602080910402602001604051908101604052809291908181526020018280546103c190611802565b801561040e5780601f106103e35761010080835404028352916020019161040e565b820191906000526020600020905b8154815290600101906020018083116103f157829003601f168201915b5050505050905090565b600061042382610f61565b610440576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b600061046782610725565b9050336001600160a01b038216146104a0576104838133610df5565b6104a0576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600061050782610f96565b9050836001600160a01b0316816001600160a01b03161461053a5760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054338082146001600160a01b038816909114176105875761056a8633610df5565b61058757604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0385166105ae57604051633a954ecd60e21b815260040160405180910390fd5b80156105b957600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716815220805460010190556105f685600160e11b611005565b600085815260046020526040812091909155600160e11b8416900361064b576001840160008181526004602052604081205490036106495760005481146106495760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03166000805160206120db83398151915260405160405180910390a4505050505050565b60007f000000000000000000000000db9e0036155b3afaae1b98ac9e6e8ec43c22499d6001600160a01b03164760405160006040518083038185875af1925050503d80600081146106ef576040519150601f19603f3d011682016040523d82523d6000602084013e6106f4565b606091505b505090508061070257600080fd5b50565b61072083838360405180602001604052806000815250610c6f565b505050565b600061038082610f96565b346611c37937e080008260ff16021461075c5760405163569e8c1160e01b815260040160405180910390fd5b60005460ff8216810161045810156107875760405163d05cb60960e01b815260040160405180910390fd5b805b8260ff1682018110156107dd57604080514460208201529081018290526060016040516020818303038152906040528051906020012060088261045881106107d3576107d361183c565b0155600101610789565b5050610702338260ff1661101a565b60006001600160a01b038216610815576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b60606003805461039590611802565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b606060008060006108c585610e23565b925092509250600060405180602001604052806000815250905060005b60278160ff161015610c415760006104608260ff16602781106109075761090761183c565b602091828204019190069054906101000a900460ff1660ff16600114610a6e576104608260ff166027811061093e5761093e61183c565b602091828204019190069054906101000a900460ff1660ff16600214610a68576104608260ff16602781106109755761097561183c565b602091828204019190069054906101000a900460ff1660ff16600314610a62576104608260ff16602781106109ac576109ac61183c565b602091828204019190069054906101000a900460ff1660ff16600414610a3d576104608260ff16602781106109e3576109e361183c565b602091828204019190069054906101000a900460ff1660ff16600514610a185760405180602001604052806000815250610a8c565b6040518060400160405280600781526020016608d1511151115160ca1b815250610a8c565b6040518060400160405280600781526020016611a2212221222160c91b815250610a8c565b84610a8c565b85610a8c565b6040518060400160405280600481526020016311a3232360e11b8152505b905082610c15610ab860405180604001604052806004815260200163199a5b1b60e21b81525084611102565b610b0f604051806040016040528060018152602001600f60fb1b815250610b0a6104628860ff1660278110610aef57610aef61183c565b602081049091015460ff601f9092166101000a90041661112e565b611102565b610b46604051806040016040528060018152602001607960f81b815250610b0a6104648960ff1660278110610aef57610aef61183c565b60ff871615610bb1578660ff16600114610b6f5760405180602001604052806000815250610bee565b610bac604051806040016040528060028152602001611a5960f21b815250604051806040016040528060018152602001603160f91b815250611102565b610bee565b610bee604051806040016040528060028152602001611a5960f21b815250604051806040016040528060018152602001606160f81b815250611102565b604051602001610c01949392919061186e565b604051602081830303815290604052611172565b604051602001610c269291906118c5565b60408051601f198184030181529190529250506001016108e2565b508181604051602001610c559291906118f4565b604051602081830303815290604052945050505050919050565b610c7a8484846104fc565b6001600160a01b0383163b15610cb357610c968484848461119b565b610cb3576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6060610cc482610f61565b610ce157604051630a14c4b560e41b815260040160405180910390fd5b6000610cec836108b5565b9050610dee83610cfb83611286565b610d2384604051602001610d0f91906119f5565b6040516020818303038152906040526112a1565b604051602001610d339190611b9e565b60408051601f19818403018152828201825260088352676d6574616461746160c01b6020848101919091528251808401909352600783526637b731b430b4b760c91b9083015291610d859160016113f3565b610dc96040518060400160405280600481526020016364696e6f60e01b815250604051806040016040528060048152602001633930bbb960e11b81525060006113f3565b604051602001610dda929190611bdc565b604051602081830303815290604052611456565b9392505050565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b6060806060610e3e6040518060200160405280600081525090565b610e5b6008866104588110610e5557610e5561183c565b01548252565b6000610e69826101686114a3565b9050610ea081610e7a8460466114a3565b610e85906019611c3f565b610e9085600f6114a3565b610e9b906041611c3f565b6114c1565b94506001861115610f1357604080516020810190915260008152610edb6008610eca60018a611c52565b6104588110610e5557610e5561183c565b610f0b610eea826101686114a3565b610ef58360466114a3565b610f00906019611c3f565b610e9084600f6114a3565b945050610f33565b6040518060400160405280600481526020016311a3232360e11b81525093505b610f57610168610f448360b4611c3f565b610f4e9190611c7b565b603c60506114c1565b9496939550505050565b600081600111158015610f75575060005482105b8015610380575050600090815260046020526040902054600160e01b161590565b60008180600111610fec57600054811015610fec5760008181526004602052604081205490600160e01b82169003610fea575b80600003610dee575060001901600081815260046020526040902054610fc9565b505b604051636f96cda160e11b815260040160405180910390fd5b4260a01b176001600160a01b03919091161790565b600080549082900361103f5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038316600090815260056020526040902080546001600160401b018402019055611076836001841460e11b611005565b6000828152600460205260408120919091556001600160a01b0384169083830190839083906000805160206120db8339815191528180a4600183015b8181146110d857808360006000805160206120db833981519152600080a46001016110b2565b50816000036110f957604051622e076360e81b815260040160405180910390fd5b60005550505050565b60608282604051602001611117929190611c9d565b604051602081830303815290604052905092915050565b60606080604051019050602081016040526000815280600019835b928101926030600a8206018453600a900480611149575050819003601f19909101908152919050565b6060816040516020016111859190611cf2565b6040516020818303038152906040529050919050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906111d0903390899088908890600401611d42565b6020604051808303816000875af192505050801561120b575060408051601f3d908101601f1916820190925261120891810190611d75565b60015b611269573d808015611239576040519150601f19603f3d011682016040523d82523d6000602084013e61123e565b606091505b508051600003611261576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6060611291826112a1565b6040516020016111859190611d92565b606081516000036112c057505060408051602081019091526000815290565b600060405180606001604052806040815260200161209b604091399050600060038451600201816112f3576112f3611c65565b0460040290506000816020016001600160401b038111156113165761131661169b565b6040519080825280601f01601f191660200182016040528015611340576020820181803683370190505b509050818152600183018586518101602084015b818310156113ae5760039283018051603f601282901c811687015160f890811b8552600c83901c8216880151811b6001860152600683901c8216880151811b60028601529116860151901b93820193909352600401611354565b6003895106600181146113c857600281146113d9576113e5565b613d3d60f01b6001198301526113e5565b603d60f81b6000198301525b509398975050505050505050565b6060838383611411576040518060200160405280600081525061142c565b604051806040016040528060018152602001600b60fa1b8152505b60405160200161143e93929190611dd4565b60405160208183030381529060405290509392505050565b606061147a6114648661112e565b838686604051602001610d0f9493929190611e5a565b60405160200161148a9190611fd0565b6040516020818303038152906040529050949350505050565b60005b60208320905080835281826000030681106114a65706919050565b60606114cc8461112e565b6114d58461112e565b6114de8461112e565b60405160200161143e93929190612015565b6001600160e01b03198116811461070257600080fd5b60006020828403121561151857600080fd5b8135610dee816114f0565b60005b8381101561153e578181015183820152602001611526565b50506000910152565b6000815180845261155f816020860160208601611523565b601f01601f19169290920160200192915050565b602081526000610dee6020830184611547565b60006020828403121561159857600080fd5b5035919050565b80356001600160a01b03811681146115b657600080fd5b919050565b600080604083850312156115ce57600080fd5b6115d78361159f565b946020939093013593505050565b6000806000606084860312156115fa57600080fd5b6116038461159f565b92506116116020850161159f565b9150604084013590509250925092565b60006020828403121561163357600080fd5b813560ff81168114610dee57600080fd5b60006020828403121561165657600080fd5b610dee8261159f565b6000806040838503121561167257600080fd5b61167b8361159f565b91506020830135801515811461169057600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156116c757600080fd5b6116d08561159f565b93506116de6020860161159f565b92506040850135915060608501356001600160401b038082111561170157600080fd5b818701915087601f83011261171557600080fd5b8135818111156117275761172761169b565b604051601f8201601f19908116603f0116810190838211818310171561174f5761174f61169b565b816040528281528a602084870101111561176857600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561179f57600080fd5b6117a88361159f565b91506117b66020840161159f565b90509250929050565b6060815260006117d26060830186611547565b82810360208401526117e48186611547565b905082810360408401526117f88185611547565b9695505050505050565b600181811c9082168061181657607f821691505b60208210810361183657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b60008151611864818560208601611523565b9290920192915050565b60008551611880818460208a01611523565b855190830190611894818360208a01611523565b85519101906118a7818360208901611523565b84519101906118ba818360208801611523565b019695505050505050565b600083516118d7818460208801611523565b8351908301906118eb818360208801611523565b01949350505050565b7f3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323081527f30302f737667222077696474683d223130302522206865696768743d2231303060208201527f25222073686170652d72656e646572696e673d2263726973704564676573222060408201527f76696577426f783d2230203020313620313622207374796c653d226261636b6760608201526c03937bab73216b1b7b637b91d1609d1b6080820152600083516119b481608d850160208801611523565b61111f60f11b608d9184019182015283516119d681608f840160208801611523565b651e17b9bb339f60d11b608f9290910191820152609501949350505050565b7f3c68746d6c207374796c653d226f766572666c6f773a68696464656e223e3c6281527437b23c9039ba3cb6329e9136b0b933b4b71d18111f60591b602082015260008251611a4b816035850160208701611523565b7f3c7363726970743e646f63756d656e742e626f64792e6164644576656e744c6960359390910192830152507f7374656e65722822636c69636b222c28293d3e7b6c657420742c653b2236223d60558201527f3d3d646f63756d656e742e676574456c656d656e744279496428226122292e6760758201527f657441747472696275746528227822293f28743d2239222c653d223522293a2860958201527f743d2236222c653d22313022292c646f63756d656e742e676574456c656d656e60b58201527f744279496428226122292e736574417474726962757465282278222c74292c6460d58201527f6f63756d656e742e676574456c656d656e744279496428226222292e7365744160f58201527f7474726962757465282278222c65297d293b3c2f7363726970743e3c2f626f64610115820152683c9f1e17b43a36b61f60b91b61013582015261013e01919050565b7519185d184e9d195e1d0bda1d1b5b0ed8985cd94d8d0b60521b815260008251611bcf816016850160208701611523565b9190910160160192915050565b605b60f81b815260008351611bf8816001850160208801611523565b835190830190611c0f816001840160208801611523565b605d60f81b60019290910191820152600201949350505050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561038057610380611c29565b8181038181111561038057610380611c29565b634e487b7160e01b600052601260045260246000fd5b600082611c9857634e487b7160e01b600052601260045260246000fd5b500690565b60008351611caf818460208801611523565b603d60f81b908301908152601160f91b60018201528351611cd7816002840160208801611523565b61011160f51b60029290910191820152600401949350505050565b7a01e3932b1ba103432b4b3b43a1e911891103bb4b23a341e9118911602d1b81528151600090611d2981601b850160208701611523565b61179f60f11b601b939091019283015250601d01919050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906117f890830184611547565b600060208284031215611d8757600080fd5b8151610dee816114f0565b7919185d184e9a5b5859d94bdcdd99cade1b5b0ed8985cd94d8d0b60321b815260008251611dc781601a850160208701611523565b91909101601a0192915050565b6e3d913a3930b4ba2fba3cb832911d1160891b81528351600090611dff81600f850160208901611523565b6a1116113b30b63ab2911d1160a91b600f918401918201528451611e2a81601a840160208901611523565b61227d60f01b601a92909101918201528351611e4d81601c840160208801611523565b01601c0195945050505050565b767b226e616d65223a226f6e636861696e2064696e6f202360481b81528451600090611e8d816017850160208a01611523565b7f222c226465736372697074696f6e223a226f6e636861696e2064696e6f7320616017918401918201527f72652067656e65726174697665206f6e636861696e2064696e6f7320696e737060378201527f697265642062792074696e792064696e6f732e2074686520686174206561636860578201527f206f6e636861696e2064696e6f2069732077656172696e6720776173206d616460778201527f65206279207468652070726576696f7573206f6e636861696e2064696e6f2e2260978201526d161130ba3a3934b13aba32b9911d60911b60b7820152611f7360c5820187611852565b69161134b6b0b3b2911d1160b11b81529050611f92600a820186611852565b7211161130b734b6b0ba34b7b72fbab936111d1160691b81529050611fba6013820185611852565b61227d60f01b8152600201979650505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161200881601d850160208701611523565b91909101601d0192915050565b640d0e6d8c2560db1b815260008451612035816005850160208901611523565b600b60fa1b6005918401918201528451612056816006840160208901611523565b61094b60f21b600692909101918201528351612079816008840160208801611523565b66252c313030252960c81b60089290910191820152600f019594505050505056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
Deployed Bytecode Sourcemap
514:6280:4:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9171:618:0;;;;;;;;;;-1:-1:-1;9171:618:0;;;;;:::i;:::-;;:::i;:::-;;;565:14:10;;558:22;540:41;;528:2;513:18;9171:618:0;;;;;;;;10043:98;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;15848:214::-;;;;;;;;;;-1:-1:-1;15848:214:0;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;1719:32:10;;;1701:51;;1689:2;1674:18;15848:214:0;1555:203:10;15288:410:0;;;;;;:::i;:::-;;:::i;:::-;;5910:317;;;;;;;;;;-1:-1:-1;3163:1:4;6180:12:0;5971:7;6164:13;:28;-1:-1:-1;;6164:46:0;5910:317;;;2346:25:10;;;2334:2;2319:18;5910:317:0;2200:177:10;19395:2716:0;;;;;;:::i;:::-;;:::i;3229:140:4:-;;;;;;;;;;;;;:::i;22202:157:0:-;;;;;;:::i;:::-;;:::i;10851:150::-;;;;;;;;;;-1:-1:-1;10851:150:0;;;;;:::i;:::-;;:::i;2352:722:4:-;;;;;;:::i;:::-;;:::i;7061:230:0:-;;;;;;;;;;-1:-1:-1;7061:230:0;;;;;:::i;:::-;;:::i;87:43:5:-;;;;;;;;;;;;119:11;87:43;;10212:102:0;;;;;;;;;;;;;:::i;16389:231::-;;;;;;;;;;-1:-1:-1;16389:231:0;;;;;:::i;:::-;;:::i;4228:1331:4:-;;;;;;;;;;-1:-1:-1;4228:1331:4;;;;;:::i;:::-;;:::i;22940:444:0:-;;;;;;:::i;:::-;;:::i;5663:1129:4:-;;;;;;;;;;-1:-1:-1;5663:1129:4;;;;;:::i;:::-;;:::i;16770:162:0:-;;;;;;;;;;-1:-1:-1;16770:162:0;;;;;:::i;:::-;;:::i;3375:847:4:-;;;;;;;;;;-1:-1:-1;3375:847:4;;;;;:::i;:::-;;:::i;:::-;;;;;;;;;:::i;9171:618:0:-;9256:4;-1:-1:-1;;;;;;;;;9562:25:0;;;;:101;;-1:-1:-1;;;;;;;;;;9638:25:0;;;9562:101;:177;;;-1:-1:-1;;;;;;;;;;9714:25:0;;;9562:177;9555:184;9171:618;-1:-1:-1;;9171:618:0:o;10043:98::-;10097:13;10129:5;10122:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10043:98;:::o;15848:214::-;15924:7;15948:16;15956:7;15948;:16::i;:::-;15943:64;;15973:34;;-1:-1:-1;;;15973:34:0;;;;;;;;;;;15943:64;-1:-1:-1;16025:24:0;;;;:15;:24;;;;;:30;-1:-1:-1;;;;;16025:30:0;;15848:214::o;15288:410::-;15376:13;15392:16;15400:7;15392;:16::i;:::-;15376:32;-1:-1:-1;38730:10:0;-1:-1:-1;;;;;15423:28:0;;;15419:184;;15472:44;15489:5;38730:10;16770:162;:::i;15472:44::-;15467:126;;15543:35;;-1:-1:-1;;;15543:35:0;;;;;;;;;;;15467:126;15613:24;;;;:15;:24;;;;;;:35;;-1:-1:-1;;;;;;15613:35:0;-1:-1:-1;;;;;15613:35:0;;;;;;;;;15663:28;;15613:24;;15663:28;;;;;;;15366:332;15288:410;;:::o;19395:2716::-;19502:27;19532;19551:7;19532:18;:27::i;:::-;19502:57;;19615:4;-1:-1:-1;;;;;19574:45:0;19590:19;-1:-1:-1;;;;;19574:45:0;;19570:86;;19628:28;;-1:-1:-1;;;19628:28:0;;;;;;;;;;;19570:86;19668:27;18528:24;;;:15;:24;;;;;18752:26;;38730:10;18165:30;;;-1:-1:-1;;;;;17862:28:0;;18143:20;;;18140:56;19851:192;;19945:43;19962:4;38730:10;16770:162;:::i;19945:43::-;19940:92;;19997:35;;-1:-1:-1;;;19997:35:0;;;;;;;;;;;19940:92;-1:-1:-1;;;;;20057:16:0;;20053:52;;20082:23;;-1:-1:-1;;;20082:23:0;;;;;;;;;;;20053:52;20248:15;20245:157;;;20386:1;20365:19;20358:30;20245:157;-1:-1:-1;;;;;20774:24:0;;;;;;;:18;:24;;;;;;20772:26;;-1:-1:-1;;20772:26:0;;;20842:22;;;;;;20840:24;;-1:-1:-1;20840:24:0;;;21173:97;20842:22;-1:-1:-1;;;21173:18:0;:97::i;:::-;21128:26;;;;:17;:26;;;;;:142;;;;-1:-1:-1;;;21387:47:0;;:52;;21383:617;;21491:1;21481:11;;21459:19;21612:30;;;:17;:30;;;;;;:35;;21608:378;;21748:13;;21733:11;:28;21729:239;;21893:30;;;;:17;:30;;;;;:52;;;21729:239;21441:559;21383:617;22044:7;22040:2;-1:-1:-1;;;;;22025:27:0;22034:4;-1:-1:-1;;;;;22025:27:0;-1:-1:-1;;;;;;;;;;;22025:27:0;;;;;;;;;19492:2619;;;19395:2716;;;:::o;3229:140:4:-;3269:12;3286:9;-1:-1:-1;;;;;3286:14:4;3309:21;3286:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3268:68;;;3354:7;3346:16;;;;;;3258:111;3229:140::o;22202:157:0:-;22313:39;22330:4;22336:2;22340:7;22313:39;;;;;;;;;;;;:16;:39::i;:::-;22202:157;;;:::o;10851:150::-;10923:7;10965:27;10984:7;10965:18;:27::i;2352:722:4:-;2471:9;119:11:5;2453:6:4;:14;;;:27;2449:145;;2561:18;;-1:-1:-1;;;2561:18:4;;;;;;;;;;;2449:145;2608:19;5687:13:0;2679:20:4;;;;;2663:13;:36;2659:149;;;2775:18;;-1:-1:-1;;;2775:18:4;;;;;;;;;;;2659:149;2862:11;2845:177;2893:6;2879:20;;:11;:20;2875:1;:24;2845:177;;;2948:37;;;2965:16;2948:37;;;6408:19:10;6443:12;;;6436:28;;;6480:12;;2948:37:4;;;;;;;;;;;;2938:48;;;;;;2920:12;2933:1;2920:15;;;;;;;:::i;:::-;;:66;3004:3;;2845:177;;;;2425:607;3042:25;3048:10;3060:6;3042:25;;:5;:25::i;7061:230:0:-;7133:7;-1:-1:-1;;;;;7156:19:0;;7152:60;;7184:28;;-1:-1:-1;;;7184:28:0;;;;;;;;;;;7152:60;-1:-1:-1;;;;;;7229:25:0;;;;;:18;:25;;;;;;-1:-1:-1;;;;;7229:55:0;;7061:230::o;10212:102::-;10268:13;10300:7;10293:14;;;;;:::i;16389:231::-;38730:10;16483:39;;;;:18;:39;;;;;;;;-1:-1:-1;;;;;16483:49:0;;;;;;;;;;;;:60;;-1:-1:-1;;16483:60:0;;;;;;;;;;16558:55;;540:41:10;;;16483:49:0;;38730:10;16558:55;;513:18:10;16558:55:0;;;;;;;16389:231;;:::o;4228:1331:4:-;4279:13;4305:23;4330:22;4354:29;4387:18;4397:7;4387:9;:18::i;:::-;4304:101;;;;;;4416:18;:23;;;;;;;;;;;;;;4478:7;4473:785;4491:8;4487:1;:12;;;4473:785;;;4524:19;4546:6;4553:1;4546:9;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;:14;;4559:1;4546:14;:231;;4612:6;4619:1;4612:9;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;:14;;4625:1;4612:14;:165;;4689:6;4696:1;4689:9;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;:14;;4702:1;4689:14;:88;;4717:6;4724:1;4717:9;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;:14;;4730:1;4717:14;:60;;4746:6;4753:1;4746:9;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;:14;;4759:1;4746:14;:31;;;;;;;;;;;;;;4546:231;;4746:31;;;;;;;;;;;;;;-1:-1:-1;;;4746:31:4;;;4546:231;;4717:60;;;;;;;;;;;;;;-1:-1:-1;;;4717:60:4;;;4546:231;;4689:88;4706:8;4546:231;;4612:165;4653:9;4546:231;;;;;;;;;;;;;;;;-1:-1:-1;;;4546:231:4;;;;4524:253;;4837:4;4863:362;4940:23;;;;;;;;;;;;;;-1:-1:-1;;;4940:23:4;;;4957:5;4940:8;:23::i;:::-;4993:30;;;;;;;;;;;;;;-1:-1:-1;;;4993:30:4;;;5007:15;:1;5009;5007:4;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;:13;:15::i;:::-;4993:8;:30::i;:::-;5053;;;;;;;;;;;;;;-1:-1:-1;;;5053:30:4;;;5067:15;:1;5069;5067:4;;;;;;;;;:::i;5053:30::-;5113:6;;;;:64;;5144:1;:6;;5149:1;5144:6;:33;;;;;;;;;;;;;;5113:64;;5144:33;5153:19;;;;;;;;;;;;;;-1:-1:-1;;;5153:19:4;;;;;;;;;;;;;;;;-1:-1:-1;;;5153:19:4;;;:8;:19::i;:::-;5113:64;;;5122:19;;;;;;;;;;;;;;-1:-1:-1;;;5122:19:4;;;;;;;;;;;;;;;;-1:-1:-1;;;5122:19:4;;;:8;:19::i;:::-;4897:306;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;4863:8;:362::i;:::-;4802:441;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;4802:441:4;;;;;;;;;;-1:-1:-1;;4501:3:4;;4473:785;;;;5469:15;5516:4;5285:267;;;;;;;;;:::i;:::-;;;;;;;;;;;;;5278:274;;;;;;4228:1331;;;:::o;22940:444:0:-;23145:31;23158:4;23164:2;23168:7;23145:12;:31::i;:::-;-1:-1:-1;;;;;23190:14:0;;;:19;23186:192;;23230:56;23261:4;23267:2;23271:7;23280:5;23230:30;:56::i;:::-;23225:143;;23313:40;;-1:-1:-1;;;23313:40:0;;;;;;;;;;;23225:143;22940:444;;;;:::o;5663:1129:4:-;5736:13;5766:16;5774:7;5766;:16::i;:::-;5761:84;;5805:29;;-1:-1:-1;;;5805:29:4;;;;;;;;;;;5761:84;5855:20;5878:12;5882:7;5878:3;:12::i;:::-;5855:35;;5908:877;5942:7;5963:22;5978:6;5963:14;:22::i;:::-;6072:568;6271:6;6143:457;;;;;;;;:::i;:::-;;;;;;;;;;;;;6072:18;:568::i;:::-;5999:655;;;;;;;;:::i;:::-;;;;-1:-1:-1;;5999:655:4;;;;;;6687:43;;;;;;;;-1:-1:-1;;;5999:655:4;6687:43;;;;;;;;;;;;;;;;;;-1:-1:-1;;;6687:43:4;;;;5999:655;6687:43;;6725:4;6687:14;:43::i;:::-;6732:37;;;;;;;;;;;;;;-1:-1:-1;;;6732:37:4;;;;;;;;;;;;;;;;-1:-1:-1;;;6732:37:4;;;6763:5;6732:14;:37::i;:::-;6668:107;;;;;;;;;:::i;:::-;;;;;;;;;;;;;5908:20;:877::i;:::-;5901:884;5663:1129;-1:-1:-1;;;5663:1129:4:o;16770:162:0:-;-1:-1:-1;;;;;16890:25:0;;;16867:4;16890:25;;;:18;:25;;;;;;;;:35;;;;;;;;;;;;;;;16770:162::o;3375:847:4:-;3456:23;3481:27;3510:29;3555:28;-1:-1:-1;;;;;;;;;;;;;;3555:28:4;3593:36;3607:12;3620:7;3607:21;;;;;;;:::i;:::-;;;3593:8;1073:19:2;936:172;3593:36:4;3639:15;3657:21;:8;3674:3;3657:16;:21::i;:::-;3639:39;-1:-1:-1;3700:79:4;3639:39;3731:20;:8;3748:2;3731:16;:20::i;:::-;3726:25;;:2;:25;:::i;:::-;3758:20;:8;3775:2;3758:16;:20::i;:::-;3753:25;;:2;:25;:::i;:::-;3700:16;:79::i;:::-;3688:91;;3804:1;3794:7;:11;3790:350;;;-1:-1:-1;;;;;;;;;;;;3867:44:4;3885:12;3898:11;3908:1;3898:7;:11;:::i;:::-;3885:25;;;;;;;:::i;3867:44::-;3941:135;3975:25;:12;3996:3;3975:20;:25::i;:::-;4007:24;:12;4028:2;4007:20;:24::i;:::-;4002:29;;:2;:29;:::i;:::-;4038:24;:12;4059:2;4038:20;:24::i;3941:135::-;3925:151;;3807:280;3790:350;;;4107:22;;;;;;;;;;;;;-1:-1:-1;;;4107:22:4;;;;;3790:350;4168:47;4203:3;4186:13;:7;4196:3;4186:13;:::i;:::-;4185:21;;;;:::i;:::-;4208:2;4212;4168:16;:47::i;:::-;3375:847;;;;-1:-1:-1;;;;3375:847:4:o;17181:253:0:-;17246:4;17288:7;3163:1:4;17269:26:0;;:53;;;;;17309:13;;17299:7;:23;17269:53;:139;;;;-1:-1:-1;;17359:26:0;;;;:17;:26;;;;;;-1:-1:-1;;;17359:44:0;:49;;17181:253::o;11975:1265::-;12042:7;12076;;3163:1:4;12122:23:0;12118:1058;;12176:13;;12169:4;:20;12165:997;;;12213:14;12230:23;;;:17;:23;;;;;;;-1:-1:-1;;;12317:24:0;;:29;;12313:831;;12972:111;12979:6;12989:1;12979:11;12972:111;;-1:-1:-1;;;13049:6:0;13031:25;;;;:17;:25;;;;;;12972:111;;12313:831;12191:971;12165:997;13202:31;;-1:-1:-1;;;13202:31:0;;;;;;;;;;;13773:443;14179:11;14154:23;14150:41;14147:52;-1:-1:-1;;;;;14007:28:0;;;;14137:63;;13773:443::o;26499:2804::-;26571:20;26594:13;;;26621;;;26617:44;;26643:18;;-1:-1:-1;;;26643:18:0;;;;;;;;;;;26617:44;-1:-1:-1;;;;;27136:22:0;;;;;;:18;:22;;1511:2;27136:22;;:71;;-1:-1:-1;;;;;27162:45:0;;27136:71;;;27493:90;27136:22;-1:-1:-1;14599:15:0;;14573:24;14569:46;27493:18;:90::i;:::-;27443:31;;;;:17;:31;;;;;:140;;;;-1:-1:-1;;;;;28166:25:0;;;27642:23;;;;27461:12;;28166:25;;-1:-1:-1;;;;;;;;;;;27443:31:0;;28254:328;28882:1;28868:12;28864:20;28843:267;28906:3;28897:7;28894:16;28843:267;;29084:7;29074:8;29071:1;-1:-1:-1;;;;;;;;;;;29041:1:0;29038;29033:59;28938:1;28925:15;28843:267;;;28847:39;29141:8;29153:1;29141:13;29137:45;;29163:19;;-1:-1:-1;;;29163:19:0;;;;;;;;;;;29137:45;29197:13;:19;-1:-1:-1;22202:157:0;;;:::o;450::8:-;527:13;573:4;589;559:41;;;;;;;;;:::i;:::-;;;;;;;;;;;;;552:48;;450:157;;;;:::o;1521:1485:7:-;1577:17;1984:4;1977;1971:11;1967:22;1960:29;;2071:4;2066:3;2062:14;2056:4;2049:28;2140:1;2135:3;2128:14;2229:3;2253:1;2249:6;2452:5;2426:380;2496:11;;;;2653:2;2667;2657:13;;2649:22;2496:11;2636:36;2743:2;2733:13;;2755:43;2426:380;2755:43;-1:-1:-1;;2828:13:7;;;-1:-1:-1;;2929:14:7;;;2977:19;;;2929:14;1521:1485;-1:-1:-1;1521:1485:7:o;246:156:8:-;305:13;382:6;337:58;;;;;;;;:::i;:::-;;;;;;;;;;;;;330:65;;246:156;;;:::o;25336:717:0:-;25534:88;;-1:-1:-1;;;25534:88:0;;25510:4;;-1:-1:-1;;;;;25534:45:0;;;;;:88;;38730:10;;25601:4;;25607:7;;25616:5;;25534:88;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;-1:-1:-1;25534:88:0;;;;;;;;-1:-1:-1;;25534:88:0;;;;;;;;;;;;:::i;:::-;;;25530:517;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;25812:6;:13;25829:1;25812:18;25808:229;;25857:40;;-1:-1:-1;;;25857:40:0;;;;;;;;;;;25808:229;25997:6;25991:13;25982:6;25978:2;25974:15;25967:38;25530:517;-1:-1:-1;;;;;;25690:64:0;-1:-1:-1;;;25690:64:0;;-1:-1:-1;25336:717:0;;;;;;:::o;353:176:9:-;417:13;493:28;512:7;493:12;:28::i;:::-;449:73;;;;;;;;:::i;1952:2055::-;2016:13;2045:4;:11;2060:1;2045:16;2041:31;;-1:-1:-1;;2063:9:9;;;;;;;;;-1:-1:-1;2063:9:9;;;1952:2055::o;2041:31::-;2121:19;2143:13;;;;;;;;;;;;;;;;;2121:35;;2233:18;2279:1;2260:4;:11;2274:1;2260:15;2259:21;;;;;:::i;:::-;;2254:1;:27;2233:48;;2369:20;2403:10;2416:2;2403:15;-1:-1:-1;;;;;2392:27:9;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2392:27:9;;2369:50;;2524:10;2516:6;2509:26;2624:1;2617:5;2613:13;2688:4;2742;2736:11;2727:7;2723:25;2843:2;2835:6;2831:15;2921:808;2941:6;2932:7;2929:19;2921:808;;;2999:1;2986:15;;;3072:14;;3217:4;3205:2;3201:14;;;3197:25;;3183:40;;3177:47;3172:3;3168:57;;;3150:76;;3353:2;3349:14;;;3345:25;;3331:40;;3325:47;3316:57;;3275:1;3260:17;;3298:76;3501:1;3497:13;;;3493:24;;3479:39;;3473:46;3464:56;;3408:17;;;3446:75;3640:16;;3626:31;;3620:38;3611:48;;3555:17;;;3593:67;;;;3694:17;;2921:808;;;3807:1;3800:4;3794:11;3790:19;3831:1;3826:54;;;;3902:1;3897:52;;;;3783:166;;3826:54;-1:-1:-1;;;;;3842:17:9;;3835:43;3826:54;;3897:52;-1:-1:-1;;;;;3913:17:9;;3906:41;3783:166;-1:-1:-1;3984:6:9;;1952:2055;-1:-1:-1;;;;;;;;1952:2055:9:o;1522:315::-;1690:13;1759:9;1785:5;1798:20;:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;1798:31:9;;;;1726:104;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;1719:111;;1522:315;;;;;:::o;535:981::-;743:13;851:648;998:19;:8;:17;:19::i;:::-;1245:11;1320:9;1402:13;908:559;;;;;;;;;;;:::i;851:648::-;779:730;;;;;;;;:::i;:::-;;;;;;;;;;;;;772:737;;535:981;;;;;;:::o;1498:497:2:-;1593:14;1716:222;1772:4;1766;1756:21;1746:31;;1807:6;1801:4;1794:20;1906:5;1898;1895:1;1891:13;1887:25;1879:6;1876:37;1716:222;1866:58;1961:18;;1498:497;-1:-1:-1;1498:497:2:o;4013:239:9:-;4108:13;4163:14;:3;:12;:14::i;:::-;4184:21;:10;:19;:21::i;:::-;4213:20;:9;:18;:20::i;:::-;4140:105;;;;;;;;;;:::i;14:131:10:-;-1:-1:-1;;;;;;88:32:10;;78:43;;68:71;;135:1;132;125:12;150:245;208:6;261:2;249:9;240:7;236:23;232:32;229:52;;;277:1;274;267:12;229:52;316:9;303:23;335:30;359:5;335:30;:::i;592:250::-;677:1;687:113;701:6;698:1;695:13;687:113;;;777:11;;;771:18;758:11;;;751:39;723:2;716:10;687:113;;;-1:-1:-1;;834:1:10;816:16;;809:27;592:250::o;847:282::-;900:3;938:5;932:12;965:6;960:3;953:19;981:76;1050:6;1043:4;1038:3;1034:14;1027:4;1020:5;1016:16;981:76;:::i;:::-;1111:2;1090:15;-1:-1:-1;;1086:29:10;1077:39;;;;1118:4;1073:50;;847:282;-1:-1:-1;;847:282:10:o;1134:231::-;1283:2;1272:9;1265:21;1246:4;1303:56;1355:2;1344:9;1340:18;1332:6;1303:56;:::i;1370:180::-;1429:6;1482:2;1470:9;1461:7;1457:23;1453:32;1450:52;;;1498:1;1495;1488:12;1450:52;-1:-1:-1;1521:23:10;;1370:180;-1:-1:-1;1370:180:10:o;1763:173::-;1831:20;;-1:-1:-1;;;;;1880:31:10;;1870:42;;1860:70;;1926:1;1923;1916:12;1860:70;1763:173;;;:::o;1941:254::-;2009:6;2017;2070:2;2058:9;2049:7;2045:23;2041:32;2038:52;;;2086:1;2083;2076:12;2038:52;2109:29;2128:9;2109:29;:::i;:::-;2099:39;2185:2;2170:18;;;;2157:32;;-1:-1:-1;;;1941:254:10:o;2382:328::-;2459:6;2467;2475;2528:2;2516:9;2507:7;2503:23;2499:32;2496:52;;;2544:1;2541;2534:12;2496:52;2567:29;2586:9;2567:29;:::i;:::-;2557:39;;2615:38;2649:2;2638:9;2634:18;2615:38;:::i;:::-;2605:48;;2700:2;2689:9;2685:18;2672:32;2662:42;;2382:328;;;;;:::o;2715:269::-;2772:6;2825:2;2813:9;2804:7;2800:23;2796:32;2793:52;;;2841:1;2838;2831:12;2793:52;2880:9;2867:23;2930:4;2923:5;2919:16;2912:5;2909:27;2899:55;;2950:1;2947;2940:12;2989:186;3048:6;3101:2;3089:9;3080:7;3076:23;3072:32;3069:52;;;3117:1;3114;3107:12;3069:52;3140:29;3159:9;3140:29;:::i;3180:347::-;3245:6;3253;3306:2;3294:9;3285:7;3281:23;3277:32;3274:52;;;3322:1;3319;3312:12;3274:52;3345:29;3364:9;3345:29;:::i;:::-;3335:39;;3424:2;3413:9;3409:18;3396:32;3471:5;3464:13;3457:21;3450:5;3447:32;3437:60;;3493:1;3490;3483:12;3437:60;3516:5;3506:15;;;3180:347;;;;;:::o;3532:127::-;3593:10;3588:3;3584:20;3581:1;3574:31;3624:4;3621:1;3614:15;3648:4;3645:1;3638:15;3664:1138;3759:6;3767;3775;3783;3836:3;3824:9;3815:7;3811:23;3807:33;3804:53;;;3853:1;3850;3843:12;3804:53;3876:29;3895:9;3876:29;:::i;:::-;3866:39;;3924:38;3958:2;3947:9;3943:18;3924:38;:::i;:::-;3914:48;;4009:2;3998:9;3994:18;3981:32;3971:42;;4064:2;4053:9;4049:18;4036:32;-1:-1:-1;;;;;4128:2:10;4120:6;4117:14;4114:34;;;4144:1;4141;4134:12;4114:34;4182:6;4171:9;4167:22;4157:32;;4227:7;4220:4;4216:2;4212:13;4208:27;4198:55;;4249:1;4246;4239:12;4198:55;4285:2;4272:16;4307:2;4303;4300:10;4297:36;;;4313:18;;:::i;:::-;4388:2;4382:9;4356:2;4442:13;;-1:-1:-1;;4438:22:10;;;4462:2;4434:31;4430:40;4418:53;;;4486:18;;;4506:22;;;4483:46;4480:72;;;4532:18;;:::i;:::-;4572:10;4568:2;4561:22;4607:2;4599:6;4592:18;4647:7;4642:2;4637;4633;4629:11;4625:20;4622:33;4619:53;;;4668:1;4665;4658:12;4619:53;4724:2;4719;4715;4711:11;4706:2;4698:6;4694:15;4681:46;4769:1;4764:2;4759;4751:6;4747:15;4743:24;4736:35;4790:6;4780:16;;;;;;;3664:1138;;;;;;;:::o;4807:260::-;4875:6;4883;4936:2;4924:9;4915:7;4911:23;4907:32;4904:52;;;4952:1;4949;4942:12;4904:52;4975:29;4994:9;4975:29;:::i;:::-;4965:39;;5023:38;5057:2;5046:9;5042:18;5023:38;:::i;:::-;5013:48;;4807:260;;;;;:::o;5072:579::-;5317:2;5306:9;5299:21;5280:4;5343:56;5395:2;5384:9;5380:18;5372:6;5343:56;:::i;:::-;5447:9;5439:6;5435:22;5430:2;5419:9;5415:18;5408:50;5481:44;5518:6;5510;5481:44;:::i;:::-;5467:58;;5573:9;5565:6;5561:22;5556:2;5545:9;5541:18;5534:50;5601:44;5638:6;5630;5601:44;:::i;:::-;5593:52;5072:579;-1:-1:-1;;;;;;5072:579:10:o;5656:380::-;5735:1;5731:12;;;;5778;;;5799:61;;5853:4;5845:6;5841:17;5831:27;;5799:61;5906:2;5898:6;5895:14;5875:18;5872:38;5869:161;;5952:10;5947:3;5943:20;5940:1;5933:31;5987:4;5984:1;5977:15;6015:4;6012:1;6005:15;5869:161;;5656:380;;;:::o;6503:127::-;6564:10;6559:3;6555:20;6552:1;6545:31;6595:4;6592:1;6585:15;6619:4;6616:1;6609:15;6635:198;6677:3;6715:5;6709:12;6730:65;6788:6;6783:3;6776:4;6769:5;6765:16;6730:65;:::i;:::-;6811:16;;;;;6635:198;-1:-1:-1;;6635:198:10:o;6838:910::-;7113:3;7151:6;7145:13;7167:66;7226:6;7221:3;7214:4;7206:6;7202:17;7167:66;:::i;:::-;7296:13;;7255:16;;;;7318:70;7296:13;7255:16;7365:4;7353:17;;7318:70;:::i;:::-;7455:13;;7410:20;;;7477:70;7455:13;7410:20;7524:4;7512:17;;7477:70;:::i;:::-;7614:13;;7569:20;;;7636:70;7614:13;7569:20;7683:4;7671:17;;7636:70;:::i;:::-;7722:20;;6838:910;-1:-1:-1;;;;;;6838:910:10:o;7753:496::-;7932:3;7970:6;7964:13;7986:66;8045:6;8040:3;8033:4;8025:6;8021:17;7986:66;:::i;:::-;8115:13;;8074:16;;;;8137:70;8115:13;8074:16;8184:4;8172:17;;8137:70;:::i;:::-;8223:20;;7753:496;-1:-1:-1;;;;7753:496:10:o;8254:1325::-;8744:66;8739:3;8732:79;8841:66;8836:2;8831:3;8827:12;8820:88;8938:66;8933:2;8928:3;8924:12;8917:88;9035:66;9030:2;9025:3;9021:12;9014:88;-1:-1:-1;;;9127:3:10;9122;9118:13;9111:38;8714:3;9178:6;9172:13;9194:74;9261:6;9255:3;9250;9246:13;9241:2;9233:6;9229:15;9194:74;:::i;:::-;-1:-1:-1;;;9327:3:10;9287:16;;;9319:12;;;9312:36;9373:13;;9395:75;9373:13;9455:3;9447:12;;9442:2;9430:15;;9395:75;:::i;:::-;-1:-1:-1;;;9530:3:10;9489:17;;;;9522:12;;;9515:30;9569:3;9561:12;;8254:1325;-1:-1:-1;;;;8254:1325:10:o;9584:1485::-;9947:66;9942:3;9935:79;10052:44;10048:2;10044:53;10039:2;10034:3;10030:12;10023:75;9917:3;10127:6;10121:13;10143:73;10209:6;10204:2;10199:3;10195:12;10190:2;10182:6;10178:15;10143:73;:::i;:::-;10280:34;10275:2;10235:16;;;;10267:11;;;10260:55;-1:-1:-1;10344:66:10;10339:2;10331:11;;10324:87;10441:66;10435:3;10427:12;;10420:88;10538:66;10532:3;10524:12;;10517:88;10635:66;10629:3;10621:12;;10614:88;10732:66;10726:3;10718:12;;10711:88;10829:66;10823:3;10815:12;;10808:88;10926:66;10920:3;10912:12;;10905:88;-1:-1:-1;;;11017:3:10;11009:12;;11002:33;11059:3;11051:12;;9584:1485;-1:-1:-1;9584:1485:10:o;11074:444::-;-1:-1:-1;;;11321:3:10;11314:37;11296:3;11380:6;11374:13;11396:75;11464:6;11459:2;11454:3;11450:12;11443:4;11435:6;11431:17;11396:75;:::i;:::-;11491:16;;;;11509:2;11487:25;;11074:444;-1:-1:-1;;11074:444:10:o;11523:769::-;-1:-1:-1;;;11907:3:10;11900:16;11882:3;11945:6;11939:13;11961:74;12028:6;12024:1;12019:3;12015:11;12008:4;12000:6;11996:17;11961:74;:::i;:::-;12095:13;;12054:16;;;;12117:75;12095:13;12179:1;12171:10;;12164:4;12152:17;;12117:75;:::i;:::-;-1:-1:-1;;;12252:1:10;12211:17;;;;12244:10;;;12237:23;12284:1;12276:10;;11523:769;-1:-1:-1;;;;11523:769:10:o;12297:127::-;12358:10;12353:3;12349:20;12346:1;12339:31;12389:4;12386:1;12379:15;12413:4;12410:1;12403:15;12429:125;12494:9;;;12515:10;;;12512:36;;;12528:18;;:::i;12559:128::-;12626:9;;;12647:11;;;12644:37;;;12661:18;;:::i;12692:127::-;12753:10;12748:3;12744:20;12741:1;12734:31;12784:4;12781:1;12774:15;12808:4;12805:1;12798:15;12824:209;12856:1;12882;12872:132;;12926:10;12921:3;12917:20;12914:1;12907:31;12961:4;12958:1;12951:15;12989:4;12986:1;12979:15;12872:132;-1:-1:-1;13018:9:10;;12824:209::o;13038:916::-;13487:3;13525:6;13519:13;13541:66;13600:6;13595:3;13588:4;13580:6;13576:17;13541:66;:::i;:::-;-1:-1:-1;;;13629:16:10;;;13654:18;;;-1:-1:-1;;;13699:1:10;13688:13;;13681:35;13741:13;;13763:78;13741:13;13828:1;13817:13;;13810:4;13798:17;;13763:78;:::i;:::-;-1:-1:-1;;;13904:1:10;13860:20;;;;13896:10;;;13889:33;13946:1;13938:10;;13038:916;-1:-1:-1;;;;13038:916:10:o;13959:630::-;-1:-1:-1;;;14289:78:10;;14390:13;;14271:3;;14412:75;14390:13;14475:2;14466:12;;14459:4;14447:17;;14412:75;:::i;:::-;-1:-1:-1;;;14546:2:10;14506:16;;;;14538:11;;;14531:25;-1:-1:-1;14580:2:10;14572:11;;13959:630;-1:-1:-1;13959:630:10:o;14594:500::-;-1:-1:-1;;;;;14863:15:10;;;14845:34;;14915:15;;14910:2;14895:18;;14888:43;14962:2;14947:18;;14940:34;;;15010:3;15005:2;14990:18;;14983:31;;;14788:4;;15031:57;;15068:19;;15060:6;15031:57;:::i;15099:249::-;15168:6;15221:2;15209:9;15200:7;15196:23;15192:32;15189:52;;;15237:1;15234;15227:12;15189:52;15269:9;15263:16;15288:30;15312:5;15288:30;:::i;15353:448::-;-1:-1:-1;;;15600:3:10;15593:41;15575:3;15663:6;15657:13;15679:75;15747:6;15742:2;15737:3;15733:12;15726:4;15718:6;15714:17;15679:75;:::i;:::-;15774:16;;;;15792:2;15770:25;;15353:448;-1:-1:-1;;15353:448:10:o;15890:1165::-;-1:-1:-1;;;16407:55:10;;16485:13;;16389:3;;16507:75;16485:13;16570:2;16561:12;;16554:4;16542:17;;16507:75;:::i;:::-;-1:-1:-1;;;16641:2:10;16601:16;;;16633:11;;;16626:55;16706:13;;16728:76;16706:13;16790:2;16782:11;;16775:4;16763:17;;16728:76;:::i;:::-;-1:-1:-1;;;16864:2:10;16823:17;;;;16856:11;;;16849:35;16909:13;;16931:76;16909:13;16993:2;16985:11;;16978:4;16966:17;;16931:76;:::i;:::-;17027:17;17046:2;17023:26;;15890:1165;-1:-1:-1;;;;;15890:1165:10:o;17306:1796::-;-1:-1:-1;;;18063:70:10;;18156:13;;18045:3;;18178:75;18156:13;18241:2;18232:12;;18225:4;18213:17;;18178:75;:::i;:::-;18317:66;18312:2;18272:16;;;18304:11;;;18297:87;18413:34;18408:2;18400:11;;18393:55;18477:34;18472:2;18464:11;;18457:55;18542:34;18536:3;18528:12;;18521:56;18607:66;18601:3;18593:12;;18586:88;-1:-1:-1;;;18698:3:10;18690:12;;18683:62;18767:39;18801:3;18793:12;;18785:6;18767:39;:::i;:::-;-1:-1:-1;;;17118:45:10;;18754:52;-1:-1:-1;18873:41:10;18910:2;18903:5;18899:14;18891:6;18873:41;:::i;:::-;-1:-1:-1;;;17232:63:10;;18860:54;-1:-1:-1;18981:41:10;19018:2;19011:5;19007:14;18999:6;18981:41;:::i;:::-;-1:-1:-1;;;15856:27:10;;19094:1;19083:13;;;-1:-1:-1;;;;;;;17306:1796:10:o;19107:451::-;19359:31;19354:3;19347:44;19329:3;19420:6;19414:13;19436:75;19504:6;19499:2;19494:3;19490:12;19483:4;19475:6;19471:17;19436:75;:::i;:::-;19531:16;;;;19549:2;19527:25;;19107:451;-1:-1:-1;;19107:451:10:o;19563:1231::-;-1:-1:-1;;;20175:3:10;20168:20;20150:3;20217:6;20211:13;20233:74;20300:6;20296:1;20291:3;20287:11;20280:4;20272:6;20268:17;20233:74;:::i;:::-;-1:-1:-1;;;20366:1:10;20326:16;;;20358:10;;;20351:23;20399:13;;20421:75;20399:13;20483:1;20475:10;;20468:4;20456:17;;20421:75;:::i;:::-;-1:-1:-1;;;20556:1:10;20515:17;;;;20548:10;;;20541:24;20590:13;;20612:75;20590:13;20674:1;20666:10;;20659:4;20647:17;;20612:75;:::i;:::-;-1:-1:-1;;;20747:1:10;20706:17;;;;20739:10;;;20732:29;20785:2;20777:11;;19563:1231;-1:-1:-1;;;;;19563:1231:10:o
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.