Overview
TokenID
71126
Total Transfers
-
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
ApeMonkeyByFredericGalvani
Compiler Version
v0.8.25+commit.b61c2a91
Contract Source Code (Solidity)
/** *Submitted for verification at apescan.io on 2024-10-28 */ /** *Submitted for verification at apescan.io on 2024-10-28 */ // SPDX-License-Identifier: MIT // File: erc721a/contracts/IERC721A.sol // ERC721A Contracts v4.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721A { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the * ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitializedForExtraData(); /** * `_sequentialUpTo()` must be greater than `_startTokenId()`. */ error SequentialUpToTooSmall(); /** * The `tokenId` of a sequential mint exceeds `_sequentialUpTo()`. */ error SequentialMintExceedsLimit(); /** * Spot minting requires a `tokenId` greater than `_sequentialUpTo()`. */ error SpotMintTokenIdTooSmall(); /** * Cannot mint over a token that already exists. */ error TokenAlreadyExists(); /** * The feature is not compatible with spot mints. */ error NotCompatibleWithSpotMints(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables * (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, * checking first that contract recipients are aware of the ERC721 protocol * to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move * this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external payable; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Transfers `tokenId` from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} * whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external payable; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) external view returns (bool); // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); } // File: erc721a/contracts/ERC721A.sol // ERC721A Contracts v4.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * The `_sequentialUpTo()` function can be overriden to enable spot mints * (i.e. non-consecutive mints) for `tokenId`s greater than `_sequentialUpTo()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364). struct TokenApprovalRef { address value; } // ============================================================= // CONSTANTS // ============================================================= // Mask of an entry in packed address data. uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant _BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant _BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant _BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant _BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant _BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant _BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with {_mintERC2309}. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} // is required to cause an overflow, which is unrealistic. uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // STORAGE // ============================================================= // The next token ID to be minted. uint256 private _currentIndex; // The number of tokens burned. uint256 private _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. // See {_packedOwnershipOf} implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` mapping(uint256 => uint256) private _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) private _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => TokenApprovalRef) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // The amount of tokens minted above `_sequentialUpTo()`. // We call these spot mints (i.e. non-sequential mints). uint256 private _spotMinted; // ============================================================= // CONSTRUCTOR // ============================================================= constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); if (_sequentialUpTo() < _startTokenId()) _revert(SequentialUpToTooSmall.selector); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID for sequential mints. * * Override this function to change the starting token ID for sequential mints. * * Note: The value returned must never change after any tokens have been minted. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the maximum token ID (inclusive) for sequential mints. * * Override this function to return a value less than 2**256 - 1, * but greater than `_startTokenId()`, to enable spot (non-sequential) mints. * * Note: The value returned must never change after any tokens have been minted. */ function _sequentialUpTo() internal view virtual returns (uint256) { return type(uint256).max; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view virtual returns (uint256) { return _currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() public view virtual override returns (uint256 result) { // Counter underflow is impossible as `_burnCounter` cannot be incremented // more than `_currentIndex + _spotMinted - _startTokenId()` times. unchecked { // With spot minting, the intermediate `result` can be temporarily negative, // and the computation must be unchecked. result = _currentIndex - _burnCounter - _startTokenId(); if (_sequentialUpTo() != type(uint256).max) result += _spotMinted; } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256 result) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { result = _currentIndex - _startTokenId(); if (_sequentialUpTo() != type(uint256).max) result += _spotMinted; } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return _burnCounter; } /** * @dev Returns the total number of tokens that are spot-minted. */ function _totalSpotMinted() internal view virtual returns (uint256) { return _spotMinted; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) _revert(BalanceQueryForZeroAddress.selector); return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(_packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal virtual { uint256 packed = _packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); _packedAddressData[owner] = packed; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes // of the XOR of all function selectors in the interface. // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) _revert(URIQueryForNonexistentToken.selector); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : ''; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, it can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnerships[index]); } /** * @dev Returns whether the ownership slot at `index` is initialized. * An uninitialized slot does not necessarily mean that the slot has no owner. */ function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) { return _packedOwnerships[index] != 0; } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * @dev Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) { if (_startTokenId() <= tokenId) { packed = _packedOwnerships[tokenId]; if (tokenId > _sequentialUpTo()) { if (_packedOwnershipExists(packed)) return packed; _revert(OwnerQueryForNonexistentToken.selector); } // If the data at the starting slot does not exist, start the scan. if (packed == 0) { if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexistentToken.selector); // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `tokenId` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. for (;;) { unchecked { packed = _packedOwnerships[--tokenId]; } if (packed == 0) continue; if (packed & _BITMASK_BURNED == 0) return packed; // Otherwise, the token is burned, and we must revert. // This handles the case of batch burned tokens, where only the burned bit // of the starting slot is set, and remaining slots are left uninitialized. _revert(OwnerQueryForNonexistentToken.selector); } } // Otherwise, the data exists and we can skip the scan. // This is possible because we have already achieved the target condition. // This saves 2143 gas on transfers of initialized tokens. // If the token is not burned, return `packed`. Otherwise, revert. if (packed & _BITMASK_BURNED == 0) return packed; } _revert(OwnerQueryForNonexistentToken.selector); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. See {ERC721A-_approve}. * * Requirements: * * - The caller must own the token or be an approved operator. */ function approve(address to, uint256 tokenId) public payable virtual override { _approve(to, tokenId, true); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) _revert(ApprovalQueryForNonexistentToken.selector); return _tokenApprovals[tokenId].value; } /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) public virtual override { _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool result) { if (_startTokenId() <= tokenId) { if (tokenId > _sequentialUpTo()) return _packedOwnershipExists(_packedOwnerships[tokenId]); if (tokenId < _currentIndex) { uint256 packed; while ((packed = _packedOwnerships[tokenId]) == 0) --tokenId; result = packed & _BITMASK_BURNED == 0; } } } /** * @dev Returns whether `packed` represents a token that exists. */ function _packedOwnershipExists(uint256 packed) private pure returns (bool result) { assembly { // The following is equivalent to `owner != address(0) && burned == false`. // Symbolically tested. result := gt(and(packed, _BITMASK_ADDRESS), and(packed, _BITMASK_BURNED)) } } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`. assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approvedAddressSlot) } } // ============================================================= // TRANSFER OPERATIONS // ============================================================= /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) public payable virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean. from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS)); if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // We can directly increment and decrement the balances. --_packedAddressData[from]; // Updates: `balance -= 1`. ++_packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; assembly { // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. from, // `from`. toMasked, // `to`. tokenId // `tokenId`. ) } if (toMasked == 0) _revert(TransferToZeroAddress.selector); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public payable virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public payable virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { _revert(TransferToNonERC721ReceiverImplementer.selector); } } /** * @dev Hook that is called before a set of serially-ordered token IDs * are about to be transferred. This includes minting. * And also called before burning one token. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token IDs * have been transferred. This includes minting. * And also called after one token has been burned. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns whether the call correctly returned the expected magic value. */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns ( bytes4 retval ) { return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { _revert(TransferToNonERC721ReceiverImplementer.selector); } assembly { revert(add(32, reason), mload(reason)) } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (quantity == 0) _revert(MintZeroQuantity.selector); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; if (toMasked == 0) _revert(MintToZeroAddress.selector); uint256 end = startTokenId + quantity; uint256 tokenId = startTokenId; if (end - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector); do { assembly { // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. tokenId // `tokenId`. ) } // The `!=` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. } while (++tokenId != end); _currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (to == address(0)) _revert(MintToZeroAddress.selector); if (quantity == 0) _revert(MintZeroQuantity.selector); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); if (startTokenId + quantity - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); _currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = _currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { _revert(TransferToNonERC721ReceiverImplementer.selector); } } while (index < end); // This prevents reentrancy to `_safeMint`. // It does not prevent reentrancy to `_safeMintSpot`. if (_currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } /** * @dev Mints a single token at `tokenId`. * * Note: A spot-minted `tokenId` that has been burned can be re-minted again. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` must be greater than `_sequentialUpTo()`. * - `tokenId` must not exist. * * Emits a {Transfer} event for each mint. */ function _mintSpot(address to, uint256 tokenId) internal virtual { if (tokenId <= _sequentialUpTo()) _revert(SpotMintTokenIdTooSmall.selector); uint256 prevOwnershipPacked = _packedOwnerships[tokenId]; if (_packedOwnershipExists(prevOwnershipPacked)) _revert(TokenAlreadyExists.selector); _beforeTokenTransfers(address(0), to, tokenId, 1); // Overflows are incredibly unrealistic. // The `numberMinted` for `to` is incremented by 1, and has a max limit of 2**64 - 1. // `_spotMinted` is incremented by 1, and has a max limit of 2**256 - 1. unchecked { // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `true` (as `quantity == 1`). _packedOwnerships[tokenId] = _packOwnershipData( to, _nextInitializedFlag(1) | _nextExtraData(address(0), to, prevOwnershipPacked) ); // Updates: // - `balance += 1`. // - `numberMinted += 1`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += (1 << _BITPOS_NUMBER_MINTED) | 1; // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; if (toMasked == 0) _revert(MintToZeroAddress.selector); assembly { // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. tokenId // `tokenId`. ) } ++_spotMinted; } _afterTokenTransfers(address(0), to, tokenId, 1); } /** * @dev Safely mints a single token at `tokenId`. * * Note: A spot-minted `tokenId` that has been burned can be re-minted again. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}. * - `tokenId` must be greater than `_sequentialUpTo()`. * - `tokenId` must not exist. * * See {_mintSpot}. * * Emits a {Transfer} event. */ function _safeMintSpot( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mintSpot(to, tokenId); unchecked { if (to.code.length != 0) { uint256 currentSpotMinted = _spotMinted; if (!_checkContractOnERC721Received(address(0), to, tokenId, _data)) { _revert(TransferToNonERC721ReceiverImplementer.selector); } // This prevents reentrancy to `_safeMintSpot`. // It does not prevent reentrancy to `_safeMint`. if (_spotMinted != currentSpotMinted) revert(); } } } /** * @dev Equivalent to `_safeMintSpot(to, tokenId, '')`. */ function _safeMintSpot(address to, uint256 tokenId) internal virtual { _safeMintSpot(to, tokenId, ''); } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Equivalent to `_approve(to, tokenId, false)`. */ function _approve(address to, uint256 tokenId) internal virtual { _approve(to, tokenId, false); } /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - `tokenId` must exist. * * Emits an {Approval} event. */ function _approve( address to, uint256 tokenId, bool approvalCheck ) internal virtual { address owner = ownerOf(tokenId); if (approvalCheck && _msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { _revert(ApprovalCallerNotOwnerNorApproved.selector); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as `_burnCounter` cannot be exceed `_currentIndex + _spotMinted` times. unchecked { _burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = _packedOwnerships[index]; if (packed == 0) _revert(OwnershipNotInitializedForExtraData.selector); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); _packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _extraData( address from, address to, uint24 previousExtraData ) internal view virtual returns (uint24) {} /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString(uint256 value) internal pure virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. let m := add(mload(0x40), 0xa0) // Update the free memory pointer to allocate. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } /** * @dev For more efficient reverts. */ function _revert(bytes4 errorSelector) internal pure { assembly { mstore(0x00, errorSelector) revert(0x00, 0x04) } } } // File: @openzeppelin/contracts/utils/Context.sol // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } } // File: @openzeppelin/contracts/access/Ownable.sol // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } // File: @openzeppelin/contracts/utils/Counters.sol // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } } // File: @openzeppelin/contracts/utils/Panic.sol // OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol) pragma solidity ^0.8.20; /** * @dev Helper library for emitting standardized panic codes. * * ```solidity * contract Example { * using Panic for uint256; * * // Use any of the declared internal constants * function foo() { Panic.GENERIC.panic(); } * * // Alternatively * function foo() { Panic.panic(Panic.GENERIC); } * } * ``` * * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil]. * * _Available since v5.1._ */ // slither-disable-next-line unused-state library Panic { /// @dev generic / unspecified error uint256 internal constant GENERIC = 0x00; /// @dev used by the assert() builtin uint256 internal constant ASSERT = 0x01; /// @dev arithmetic underflow or overflow uint256 internal constant UNDER_OVERFLOW = 0x11; /// @dev division or modulo by zero uint256 internal constant DIVISION_BY_ZERO = 0x12; /// @dev enum conversion error uint256 internal constant ENUM_CONVERSION_ERROR = 0x21; /// @dev invalid encoding in storage uint256 internal constant STORAGE_ENCODING_ERROR = 0x22; /// @dev empty array pop uint256 internal constant EMPTY_ARRAY_POP = 0x31; /// @dev array out of bounds access uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32; /// @dev resource error (too large allocation or too large array) uint256 internal constant RESOURCE_ERROR = 0x41; /// @dev calling invalid internal function uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51; /// @dev Reverts with a panic code. Recommended to use with /// the internal constants with predefined codes. function panic(uint256 code) internal pure { assembly ("memory-safe") { mstore(0x00, 0x4e487b71) mstore(0x20, code) revert(0x1c, 0x24) } } } // File: @openzeppelin/contracts/utils/math/SafeCast.sol // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol) // This file was procedurally generated from scripts/generate/templates/SafeCast.js. pragma solidity ^0.8.20; /** * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeCast { /** * @dev Value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value); /** * @dev An int value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedIntToUint(int256 value); /** * @dev Value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedIntDowncast(uint8 bits, int256 value); /** * @dev An uint value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedUintToInt(uint256 value); /** * @dev Returns the downcasted uint248 from uint256, reverting on * overflow (when the input is greater than largest uint248). * * Counterpart to Solidity's `uint248` operator. * * Requirements: * * - input must fit into 248 bits */ function toUint248(uint256 value) internal pure returns (uint248) { if (value > type(uint248).max) { revert SafeCastOverflowedUintDowncast(248, value); } return uint248(value); } /** * @dev Returns the downcasted uint240 from uint256, reverting on * overflow (when the input is greater than largest uint240). * * Counterpart to Solidity's `uint240` operator. * * Requirements: * * - input must fit into 240 bits */ function toUint240(uint256 value) internal pure returns (uint240) { if (value > type(uint240).max) { revert SafeCastOverflowedUintDowncast(240, value); } return uint240(value); } /** * @dev Returns the downcasted uint232 from uint256, reverting on * overflow (when the input is greater than largest uint232). * * Counterpart to Solidity's `uint232` operator. * * Requirements: * * - input must fit into 232 bits */ function toUint232(uint256 value) internal pure returns (uint232) { if (value > type(uint232).max) { revert SafeCastOverflowedUintDowncast(232, value); } return uint232(value); } /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits */ function toUint224(uint256 value) internal pure returns (uint224) { if (value > type(uint224).max) { revert SafeCastOverflowedUintDowncast(224, value); } return uint224(value); } /** * @dev Returns the downcasted uint216 from uint256, reverting on * overflow (when the input is greater than largest uint216). * * Counterpart to Solidity's `uint216` operator. * * Requirements: * * - input must fit into 216 bits */ function toUint216(uint256 value) internal pure returns (uint216) { if (value > type(uint216).max) { revert SafeCastOverflowedUintDowncast(216, value); } return uint216(value); } /** * @dev Returns the downcasted uint208 from uint256, reverting on * overflow (when the input is greater than largest uint208). * * Counterpart to Solidity's `uint208` operator. * * Requirements: * * - input must fit into 208 bits */ function toUint208(uint256 value) internal pure returns (uint208) { if (value > type(uint208).max) { revert SafeCastOverflowedUintDowncast(208, value); } return uint208(value); } /** * @dev Returns the downcasted uint200 from uint256, reverting on * overflow (when the input is greater than largest uint200). * * Counterpart to Solidity's `uint200` operator. * * Requirements: * * - input must fit into 200 bits */ function toUint200(uint256 value) internal pure returns (uint200) { if (value > type(uint200).max) { revert SafeCastOverflowedUintDowncast(200, value); } return uint200(value); } /** * @dev Returns the downcasted uint192 from uint256, reverting on * overflow (when the input is greater than largest uint192). * * Counterpart to Solidity's `uint192` operator. * * Requirements: * * - input must fit into 192 bits */ function toUint192(uint256 value) internal pure returns (uint192) { if (value > type(uint192).max) { revert SafeCastOverflowedUintDowncast(192, value); } return uint192(value); } /** * @dev Returns the downcasted uint184 from uint256, reverting on * overflow (when the input is greater than largest uint184). * * Counterpart to Solidity's `uint184` operator. * * Requirements: * * - input must fit into 184 bits */ function toUint184(uint256 value) internal pure returns (uint184) { if (value > type(uint184).max) { revert SafeCastOverflowedUintDowncast(184, value); } return uint184(value); } /** * @dev Returns the downcasted uint176 from uint256, reverting on * overflow (when the input is greater than largest uint176). * * Counterpart to Solidity's `uint176` operator. * * Requirements: * * - input must fit into 176 bits */ function toUint176(uint256 value) internal pure returns (uint176) { if (value > type(uint176).max) { revert SafeCastOverflowedUintDowncast(176, value); } return uint176(value); } /** * @dev Returns the downcasted uint168 from uint256, reverting on * overflow (when the input is greater than largest uint168). * * Counterpart to Solidity's `uint168` operator. * * Requirements: * * - input must fit into 168 bits */ function toUint168(uint256 value) internal pure returns (uint168) { if (value > type(uint168).max) { revert SafeCastOverflowedUintDowncast(168, value); } return uint168(value); } /** * @dev Returns the downcasted uint160 from uint256, reverting on * overflow (when the input is greater than largest uint160). * * Counterpart to Solidity's `uint160` operator. * * Requirements: * * - input must fit into 160 bits */ function toUint160(uint256 value) internal pure returns (uint160) { if (value > type(uint160).max) { revert SafeCastOverflowedUintDowncast(160, value); } return uint160(value); } /** * @dev Returns the downcasted uint152 from uint256, reverting on * overflow (when the input is greater than largest uint152). * * Counterpart to Solidity's `uint152` operator. * * Requirements: * * - input must fit into 152 bits */ function toUint152(uint256 value) internal pure returns (uint152) { if (value > type(uint152).max) { revert SafeCastOverflowedUintDowncast(152, value); } return uint152(value); } /** * @dev Returns the downcasted uint144 from uint256, reverting on * overflow (when the input is greater than largest uint144). * * Counterpart to Solidity's `uint144` operator. * * Requirements: * * - input must fit into 144 bits */ function toUint144(uint256 value) internal pure returns (uint144) { if (value > type(uint144).max) { revert SafeCastOverflowedUintDowncast(144, value); } return uint144(value); } /** * @dev Returns the downcasted uint136 from uint256, reverting on * overflow (when the input is greater than largest uint136). * * Counterpart to Solidity's `uint136` operator. * * Requirements: * * - input must fit into 136 bits */ function toUint136(uint256 value) internal pure returns (uint136) { if (value > type(uint136).max) { revert SafeCastOverflowedUintDowncast(136, value); } return uint136(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { if (value > type(uint128).max) { revert SafeCastOverflowedUintDowncast(128, value); } return uint128(value); } /** * @dev Returns the downcasted uint120 from uint256, reverting on * overflow (when the input is greater than largest uint120). * * Counterpart to Solidity's `uint120` operator. * * Requirements: * * - input must fit into 120 bits */ function toUint120(uint256 value) internal pure returns (uint120) { if (value > type(uint120).max) { revert SafeCastOverflowedUintDowncast(120, value); } return uint120(value); } /** * @dev Returns the downcasted uint112 from uint256, reverting on * overflow (when the input is greater than largest uint112). * * Counterpart to Solidity's `uint112` operator. * * Requirements: * * - input must fit into 112 bits */ function toUint112(uint256 value) internal pure returns (uint112) { if (value > type(uint112).max) { revert SafeCastOverflowedUintDowncast(112, value); } return uint112(value); } /** * @dev Returns the downcasted uint104 from uint256, reverting on * overflow (when the input is greater than largest uint104). * * Counterpart to Solidity's `uint104` operator. * * Requirements: * * - input must fit into 104 bits */ function toUint104(uint256 value) internal pure returns (uint104) { if (value > type(uint104).max) { revert SafeCastOverflowedUintDowncast(104, value); } return uint104(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits */ function toUint96(uint256 value) internal pure returns (uint96) { if (value > type(uint96).max) { revert SafeCastOverflowedUintDowncast(96, value); } return uint96(value); } /** * @dev Returns the downcasted uint88 from uint256, reverting on * overflow (when the input is greater than largest uint88). * * Counterpart to Solidity's `uint88` operator. * * Requirements: * * - input must fit into 88 bits */ function toUint88(uint256 value) internal pure returns (uint88) { if (value > type(uint88).max) { revert SafeCastOverflowedUintDowncast(88, value); } return uint88(value); } /** * @dev Returns the downcasted uint80 from uint256, reverting on * overflow (when the input is greater than largest uint80). * * Counterpart to Solidity's `uint80` operator. * * Requirements: * * - input must fit into 80 bits */ function toUint80(uint256 value) internal pure returns (uint80) { if (value > type(uint80).max) { revert SafeCastOverflowedUintDowncast(80, value); } return uint80(value); } /** * @dev Returns the downcasted uint72 from uint256, reverting on * overflow (when the input is greater than largest uint72). * * Counterpart to Solidity's `uint72` operator. * * Requirements: * * - input must fit into 72 bits */ function toUint72(uint256 value) internal pure returns (uint72) { if (value > type(uint72).max) { revert SafeCastOverflowedUintDowncast(72, value); } return uint72(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { if (value > type(uint64).max) { revert SafeCastOverflowedUintDowncast(64, value); } return uint64(value); } /** * @dev Returns the downcasted uint56 from uint256, reverting on * overflow (when the input is greater than largest uint56). * * Counterpart to Solidity's `uint56` operator. * * Requirements: * * - input must fit into 56 bits */ function toUint56(uint256 value) internal pure returns (uint56) { if (value > type(uint56).max) { revert SafeCastOverflowedUintDowncast(56, value); } return uint56(value); } /** * @dev Returns the downcasted uint48 from uint256, reverting on * overflow (when the input is greater than largest uint48). * * Counterpart to Solidity's `uint48` operator. * * Requirements: * * - input must fit into 48 bits */ function toUint48(uint256 value) internal pure returns (uint48) { if (value > type(uint48).max) { revert SafeCastOverflowedUintDowncast(48, value); } return uint48(value); } /** * @dev Returns the downcasted uint40 from uint256, reverting on * overflow (when the input is greater than largest uint40). * * Counterpart to Solidity's `uint40` operator. * * Requirements: * * - input must fit into 40 bits */ function toUint40(uint256 value) internal pure returns (uint40) { if (value > type(uint40).max) { revert SafeCastOverflowedUintDowncast(40, value); } return uint40(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { if (value > type(uint32).max) { revert SafeCastOverflowedUintDowncast(32, value); } return uint32(value); } /** * @dev Returns the downcasted uint24 from uint256, reverting on * overflow (when the input is greater than largest uint24). * * Counterpart to Solidity's `uint24` operator. * * Requirements: * * - input must fit into 24 bits */ function toUint24(uint256 value) internal pure returns (uint24) { if (value > type(uint24).max) { revert SafeCastOverflowedUintDowncast(24, value); } return uint24(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { if (value > type(uint16).max) { revert SafeCastOverflowedUintDowncast(16, value); } return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits */ function toUint8(uint256 value) internal pure returns (uint8) { if (value > type(uint8).max) { revert SafeCastOverflowedUintDowncast(8, value); } return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { if (value < 0) { revert SafeCastOverflowedIntToUint(value); } return uint256(value); } /** * @dev Returns the downcasted int248 from int256, reverting on * overflow (when the input is less than smallest int248 or * greater than largest int248). * * Counterpart to Solidity's `int248` operator. * * Requirements: * * - input must fit into 248 bits */ function toInt248(int256 value) internal pure returns (int248 downcasted) { downcasted = int248(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(248, value); } } /** * @dev Returns the downcasted int240 from int256, reverting on * overflow (when the input is less than smallest int240 or * greater than largest int240). * * Counterpart to Solidity's `int240` operator. * * Requirements: * * - input must fit into 240 bits */ function toInt240(int256 value) internal pure returns (int240 downcasted) { downcasted = int240(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(240, value); } } /** * @dev Returns the downcasted int232 from int256, reverting on * overflow (when the input is less than smallest int232 or * greater than largest int232). * * Counterpart to Solidity's `int232` operator. * * Requirements: * * - input must fit into 232 bits */ function toInt232(int256 value) internal pure returns (int232 downcasted) { downcasted = int232(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(232, value); } } /** * @dev Returns the downcasted int224 from int256, reverting on * overflow (when the input is less than smallest int224 or * greater than largest int224). * * Counterpart to Solidity's `int224` operator. * * Requirements: * * - input must fit into 224 bits */ function toInt224(int256 value) internal pure returns (int224 downcasted) { downcasted = int224(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(224, value); } } /** * @dev Returns the downcasted int216 from int256, reverting on * overflow (when the input is less than smallest int216 or * greater than largest int216). * * Counterpart to Solidity's `int216` operator. * * Requirements: * * - input must fit into 216 bits */ function toInt216(int256 value) internal pure returns (int216 downcasted) { downcasted = int216(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(216, value); } } /** * @dev Returns the downcasted int208 from int256, reverting on * overflow (when the input is less than smallest int208 or * greater than largest int208). * * Counterpart to Solidity's `int208` operator. * * Requirements: * * - input must fit into 208 bits */ function toInt208(int256 value) internal pure returns (int208 downcasted) { downcasted = int208(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(208, value); } } /** * @dev Returns the downcasted int200 from int256, reverting on * overflow (when the input is less than smallest int200 or * greater than largest int200). * * Counterpart to Solidity's `int200` operator. * * Requirements: * * - input must fit into 200 bits */ function toInt200(int256 value) internal pure returns (int200 downcasted) { downcasted = int200(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(200, value); } } /** * @dev Returns the downcasted int192 from int256, reverting on * overflow (when the input is less than smallest int192 or * greater than largest int192). * * Counterpart to Solidity's `int192` operator. * * Requirements: * * - input must fit into 192 bits */ function toInt192(int256 value) internal pure returns (int192 downcasted) { downcasted = int192(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(192, value); } } /** * @dev Returns the downcasted int184 from int256, reverting on * overflow (when the input is less than smallest int184 or * greater than largest int184). * * Counterpart to Solidity's `int184` operator. * * Requirements: * * - input must fit into 184 bits */ function toInt184(int256 value) internal pure returns (int184 downcasted) { downcasted = int184(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(184, value); } } /** * @dev Returns the downcasted int176 from int256, reverting on * overflow (when the input is less than smallest int176 or * greater than largest int176). * * Counterpart to Solidity's `int176` operator. * * Requirements: * * - input must fit into 176 bits */ function toInt176(int256 value) internal pure returns (int176 downcasted) { downcasted = int176(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(176, value); } } /** * @dev Returns the downcasted int168 from int256, reverting on * overflow (when the input is less than smallest int168 or * greater than largest int168). * * Counterpart to Solidity's `int168` operator. * * Requirements: * * - input must fit into 168 bits */ function toInt168(int256 value) internal pure returns (int168 downcasted) { downcasted = int168(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(168, value); } } /** * @dev Returns the downcasted int160 from int256, reverting on * overflow (when the input is less than smallest int160 or * greater than largest int160). * * Counterpart to Solidity's `int160` operator. * * Requirements: * * - input must fit into 160 bits */ function toInt160(int256 value) internal pure returns (int160 downcasted) { downcasted = int160(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(160, value); } } /** * @dev Returns the downcasted int152 from int256, reverting on * overflow (when the input is less than smallest int152 or * greater than largest int152). * * Counterpart to Solidity's `int152` operator. * * Requirements: * * - input must fit into 152 bits */ function toInt152(int256 value) internal pure returns (int152 downcasted) { downcasted = int152(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(152, value); } } /** * @dev Returns the downcasted int144 from int256, reverting on * overflow (when the input is less than smallest int144 or * greater than largest int144). * * Counterpart to Solidity's `int144` operator. * * Requirements: * * - input must fit into 144 bits */ function toInt144(int256 value) internal pure returns (int144 downcasted) { downcasted = int144(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(144, value); } } /** * @dev Returns the downcasted int136 from int256, reverting on * overflow (when the input is less than smallest int136 or * greater than largest int136). * * Counterpart to Solidity's `int136` operator. * * Requirements: * * - input must fit into 136 bits */ function toInt136(int256 value) internal pure returns (int136 downcasted) { downcasted = int136(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(136, value); } } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits */ function toInt128(int256 value) internal pure returns (int128 downcasted) { downcasted = int128(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(128, value); } } /** * @dev Returns the downcasted int120 from int256, reverting on * overflow (when the input is less than smallest int120 or * greater than largest int120). * * Counterpart to Solidity's `int120` operator. * * Requirements: * * - input must fit into 120 bits */ function toInt120(int256 value) internal pure returns (int120 downcasted) { downcasted = int120(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(120, value); } } /** * @dev Returns the downcasted int112 from int256, reverting on * overflow (when the input is less than smallest int112 or * greater than largest int112). * * Counterpart to Solidity's `int112` operator. * * Requirements: * * - input must fit into 112 bits */ function toInt112(int256 value) internal pure returns (int112 downcasted) { downcasted = int112(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(112, value); } } /** * @dev Returns the downcasted int104 from int256, reverting on * overflow (when the input is less than smallest int104 or * greater than largest int104). * * Counterpart to Solidity's `int104` operator. * * Requirements: * * - input must fit into 104 bits */ function toInt104(int256 value) internal pure returns (int104 downcasted) { downcasted = int104(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(104, value); } } /** * @dev Returns the downcasted int96 from int256, reverting on * overflow (when the input is less than smallest int96 or * greater than largest int96). * * Counterpart to Solidity's `int96` operator. * * Requirements: * * - input must fit into 96 bits */ function toInt96(int256 value) internal pure returns (int96 downcasted) { downcasted = int96(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(96, value); } } /** * @dev Returns the downcasted int88 from int256, reverting on * overflow (when the input is less than smallest int88 or * greater than largest int88). * * Counterpart to Solidity's `int88` operator. * * Requirements: * * - input must fit into 88 bits */ function toInt88(int256 value) internal pure returns (int88 downcasted) { downcasted = int88(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(88, value); } } /** * @dev Returns the downcasted int80 from int256, reverting on * overflow (when the input is less than smallest int80 or * greater than largest int80). * * Counterpart to Solidity's `int80` operator. * * Requirements: * * - input must fit into 80 bits */ function toInt80(int256 value) internal pure returns (int80 downcasted) { downcasted = int80(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(80, value); } } /** * @dev Returns the downcasted int72 from int256, reverting on * overflow (when the input is less than smallest int72 or * greater than largest int72). * * Counterpart to Solidity's `int72` operator. * * Requirements: * * - input must fit into 72 bits */ function toInt72(int256 value) internal pure returns (int72 downcasted) { downcasted = int72(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(72, value); } } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits */ function toInt64(int256 value) internal pure returns (int64 downcasted) { downcasted = int64(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(64, value); } } /** * @dev Returns the downcasted int56 from int256, reverting on * overflow (when the input is less than smallest int56 or * greater than largest int56). * * Counterpart to Solidity's `int56` operator. * * Requirements: * * - input must fit into 56 bits */ function toInt56(int256 value) internal pure returns (int56 downcasted) { downcasted = int56(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(56, value); } } /** * @dev Returns the downcasted int48 from int256, reverting on * overflow (when the input is less than smallest int48 or * greater than largest int48). * * Counterpart to Solidity's `int48` operator. * * Requirements: * * - input must fit into 48 bits */ function toInt48(int256 value) internal pure returns (int48 downcasted) { downcasted = int48(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(48, value); } } /** * @dev Returns the downcasted int40 from int256, reverting on * overflow (when the input is less than smallest int40 or * greater than largest int40). * * Counterpart to Solidity's `int40` operator. * * Requirements: * * - input must fit into 40 bits */ function toInt40(int256 value) internal pure returns (int40 downcasted) { downcasted = int40(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(40, value); } } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits */ function toInt32(int256 value) internal pure returns (int32 downcasted) { downcasted = int32(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(32, value); } } /** * @dev Returns the downcasted int24 from int256, reverting on * overflow (when the input is less than smallest int24 or * greater than largest int24). * * Counterpart to Solidity's `int24` operator. * * Requirements: * * - input must fit into 24 bits */ function toInt24(int256 value) internal pure returns (int24 downcasted) { downcasted = int24(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(24, value); } } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits */ function toInt16(int256 value) internal pure returns (int16 downcasted) { downcasted = int16(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(16, value); } } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits */ function toInt8(int256 value) internal pure returns (int8 downcasted) { downcasted = int8(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(8, value); } } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive if (value > uint256(type(int256).max)) { revert SafeCastOverflowedUintToInt(value); } return int256(value); } /** * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump. */ function toUint(bool b) internal pure returns (uint256 u) { assembly ("memory-safe") { u := iszero(iszero(b)) } } } // File: @openzeppelin/contracts/utils/math/Math.sol // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an success flag (no overflow). */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow). */ function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow). */ function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a success flag (no division by zero). */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero). */ function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant. * * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone. * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute * one branch when needed, making this function more expensive. */ function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) { unchecked { // branchless ternary works because: // b ^ (a ^ b) == a // b ^ 0 == b return b ^ ((a ^ b) * SafeCast.toUint(condition)); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return ternary(a > b, a, b); } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return ternary(a < b, a, b); } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. Panic.panic(Panic.DIVISION_BY_ZERO); } // The following calculation ensures accurate ceiling division without overflow. // Since a is non-zero, (a - 1) / b will not overflow. // The largest possible result occurs when (a - 1) / b is type(uint256).max, // but the largest value we can obtain is type(uint256).max - 1, which happens // when a = type(uint256).max and b = 1. unchecked { return SafeCast.toUint(a > 0) * ((a - 1) / b + 1); } } /** * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2²⁵⁶ + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0. if (denominator <= prod1) { Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW)); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv ≡ 1 mod 2⁴. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2⁸ inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶ inverse *= 2 - denominator * inverse; // inverse mod 2³² inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴ inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸ inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶ // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2²⁵⁶. Since the preconditions guarantee that the outcome is // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @dev Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0); } /** * @dev Calculate the modular multiplicative inverse of a number in Z/nZ. * * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0. * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible. * * If the input value is not inversible, 0 is returned. * * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}. */ function invMod(uint256 a, uint256 n) internal pure returns (uint256) { unchecked { if (n == 0) return 0; // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version) // Used to compute integers x and y such that: ax + ny = gcd(a, n). // When the gcd is 1, then the inverse of a modulo n exists and it's x. // ax + ny = 1 // ax = 1 + (-y)n // ax ≡ 1 (mod n) # x is the inverse of a modulo n // If the remainder is 0 the gcd is n right away. uint256 remainder = a % n; uint256 gcd = n; // Therefore the initial coefficients are: // ax + ny = gcd(a, n) = n // 0a + 1n = n int256 x = 0; int256 y = 1; while (remainder != 0) { uint256 quotient = gcd / remainder; (gcd, remainder) = ( // The old remainder is the next gcd to try. remainder, // Compute the next remainder. // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd // where gcd is at most n (capped to type(uint256).max) gcd - remainder * quotient ); (x, y) = ( // Increment the coefficient of a. y, // Decrement the coefficient of n. // Can overflow, but the result is casted to uint256 so that the // next value of y is "wrapped around" to a value between 0 and n - 1. x - y * int256(quotient) ); } if (gcd != 1) return 0; // No inverse exists. return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative. } } /** * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`. * * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that * `a**(p-2)` is the modular multiplicative inverse of a in Fp. * * NOTE: this function does NOT check that `p` is a prime greater than `2`. */ function invModPrime(uint256 a, uint256 p) internal view returns (uint256) { unchecked { return Math.modExp(a, p - 2, p); } } /** * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m) * * Requirements: * - modulus can't be zero * - underlying staticcall to precompile must succeed * * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make * sure the chain you're using it on supports the precompiled contract for modular exponentiation * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, * the underlying function will succeed given the lack of a revert, but the result may be incorrectly * interpreted as 0. */ function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) { (bool success, uint256 result) = tryModExp(b, e, m); if (!success) { Panic.panic(Panic.DIVISION_BY_ZERO); } return result; } /** * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m). * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying * to operate modulo 0 or if the underlying precompile reverted. * * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack * of a revert, but the result may be incorrectly interpreted as 0. */ function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) { if (m == 0) return (false, 0); assembly ("memory-safe") { let ptr := mload(0x40) // | Offset | Content | Content (Hex) | // |-----------|------------|--------------------------------------------------------------------| // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x60:0x7f | value of b | 0x<.............................................................b> | // | 0x80:0x9f | value of e | 0x<.............................................................e> | // | 0xa0:0xbf | value of m | 0x<.............................................................m> | mstore(ptr, 0x20) mstore(add(ptr, 0x20), 0x20) mstore(add(ptr, 0x40), 0x20) mstore(add(ptr, 0x60), b) mstore(add(ptr, 0x80), e) mstore(add(ptr, 0xa0), m) // Given the result < m, it's guaranteed to fit in 32 bytes, // so we can use the memory scratch space located at offset 0. success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20) result := mload(0x00) } } /** * @dev Variant of {modExp} that supports inputs of arbitrary length. */ function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) { (bool success, bytes memory result) = tryModExp(b, e, m); if (!success) { Panic.panic(Panic.DIVISION_BY_ZERO); } return result; } /** * @dev Variant of {tryModExp} that supports inputs of arbitrary length. */ function tryModExp( bytes memory b, bytes memory e, bytes memory m ) internal view returns (bool success, bytes memory result) { if (_zeroBytes(m)) return (false, new bytes(0)); uint256 mLen = m.length; // Encode call args in result and move the free memory pointer result = abi.encodePacked(b.length, e.length, mLen, b, e, m); assembly ("memory-safe") { let dataPtr := add(result, 0x20) // Write result on top of args to avoid allocating extra memory. success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen) // Overwrite the length. // result.length > returndatasize() is guaranteed because returndatasize() == m.length mstore(result, mLen) // Set the memory pointer after the returned data. mstore(0x40, add(dataPtr, mLen)) } } /** * @dev Returns whether the provided byte array is zero. */ function _zeroBytes(bytes memory byteArray) private pure returns (bool) { for (uint256 i = 0; i < byteArray.length; ++i) { if (byteArray[i] != 0) { return false; } } return true; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * This method is based on Newton's method for computing square roots; the algorithm is restricted to only * using integer operations. */ function sqrt(uint256 a) internal pure returns (uint256) { unchecked { // Take care of easy edge cases when a == 0 or a == 1 if (a <= 1) { return a; } // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between // the current value as `ε_n = | x_n - sqrt(a) |`. // // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is // bigger than any uint256. // // By noticing that // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)` // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar // to the msb function. uint256 aa = a; uint256 xn = 1; if (aa >= (1 << 128)) { aa >>= 128; xn <<= 64; } if (aa >= (1 << 64)) { aa >>= 64; xn <<= 32; } if (aa >= (1 << 32)) { aa >>= 32; xn <<= 16; } if (aa >= (1 << 16)) { aa >>= 16; xn <<= 8; } if (aa >= (1 << 8)) { aa >>= 8; xn <<= 4; } if (aa >= (1 << 4)) { aa >>= 4; xn <<= 2; } if (aa >= (1 << 2)) { xn <<= 1; } // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1). // // We can refine our estimation by noticing that the middle of that interval minimizes the error. // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2). // This is going to be our x_0 (and ε_0) xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2) // From here, Newton's method give us: // x_{n+1} = (x_n + a / x_n) / 2 // // One should note that: // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a // = ((x_n² + a) / (2 * x_n))² - a // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²) // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²) // = (x_n² - a)² / (2 * x_n)² // = ((x_n² - a) / (2 * x_n))² // ≥ 0 // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n // // This gives us the proof of quadratic convergence of the sequence: // ε_{n+1} = | x_{n+1} - sqrt(a) | // = | (x_n + a / x_n) / 2 - sqrt(a) | // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) | // = | (x_n - sqrt(a))² / (2 * x_n) | // = | ε_n² / (2 * x_n) | // = ε_n² / | (2 * x_n) | // // For the first iteration, we have a special case where x_0 is known: // ε_1 = ε_0² / | (2 * x_0) | // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2))) // ≤ 2**(2*e-4) / (3 * 2**(e-1)) // ≤ 2**(e-3) / 3 // ≤ 2**(e-3-log2(3)) // ≤ 2**(e-4.5) // // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n: // ε_{n+1} = ε_n² / | (2 * x_n) | // ≤ (2**(e-k))² / (2 * 2**(e-1)) // ≤ 2**(2*e-2*k) / 2**e // ≤ 2**(e-2*k) xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5 xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9 xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18 xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36 xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72 // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either // sqrt(a) or sqrt(a) + 1. return xn - SafeCast.toUint(xn > a / xn); } } /** * @dev Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; uint256 exp; unchecked { exp = 128 * SafeCast.toUint(value > (1 << 128) - 1); value >>= exp; result += exp; exp = 64 * SafeCast.toUint(value > (1 << 64) - 1); value >>= exp; result += exp; exp = 32 * SafeCast.toUint(value > (1 << 32) - 1); value >>= exp; result += exp; exp = 16 * SafeCast.toUint(value > (1 << 16) - 1); value >>= exp; result += exp; exp = 8 * SafeCast.toUint(value > (1 << 8) - 1); value >>= exp; result += exp; exp = 4 * SafeCast.toUint(value > (1 << 4) - 1); value >>= exp; result += exp; exp = 2 * SafeCast.toUint(value > (1 << 2) - 1); value >>= exp; result += exp; result += SafeCast.toUint(value > 1); } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; uint256 isGt; unchecked { isGt = SafeCast.toUint(value > (1 << 128) - 1); value >>= isGt * 128; result += isGt * 16; isGt = SafeCast.toUint(value > (1 << 64) - 1); value >>= isGt * 64; result += isGt * 8; isGt = SafeCast.toUint(value > (1 << 32) - 1); value >>= isGt * 32; result += isGt * 4; isGt = SafeCast.toUint(value > (1 << 16) - 1); value >>= isGt * 16; result += isGt * 2; result += SafeCast.toUint(value > (1 << 8) - 1); } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } } // File: @openzeppelin/contracts/utils/math/SignedMath.sol // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant. * * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone. * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute * one branch when needed, making this function more expensive. */ function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) { unchecked { // branchless ternary works because: // b ^ (a ^ b) == a // b ^ 0 == b return b ^ ((a ^ b) * int256(SafeCast.toUint(condition))); } } /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return ternary(a > b, a, b); } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return ternary(a < b, a, b); } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // Formula from the "Bit Twiddling Hacks" by Sean Eron Anderson. // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift, // taking advantage of the most significant (or "sign" bit) in two's complement representation. // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result, // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative). int256 mask = n >> 255; // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it. return uint256((n + mask) ^ mask); } } } // File: @openzeppelin/contracts/utils/Strings.sol // OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol) pragma solidity ^0.8.20; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; assembly ("memory-safe") { ptr := add(buffer, add(32, length)) } while (true) { ptr--; assembly ("memory-safe") { mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal * representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH); } /** * @dev Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal * representation, according to EIP-55. */ function toChecksumHexString(address addr) internal pure returns (string memory) { bytes memory buffer = bytes(toHexString(addr)); // hash the hex part of buffer (skip length + 2 bytes, length 40) uint256 hashValue; assembly ("memory-safe") { hashValue := shr(96, keccak256(add(buffer, 0x22), 40)) } for (uint256 i = 41; i > 1; --i) { // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f) if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) { // case shift by xoring with 0x20 buffer[i] ^= 0x20; } hashValue >>= 4; } return string(buffer); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } } // File: contracts/Contract.sol pragma solidity ^0.8.20; contract ApeMonkeyByFredericGalvani is ERC721A, Ownable { using Counters for Counters.Counter; uint public constant MAX_SUPPLY = 10000000000000000000000000000000000000000000000; uint public constant MINT_PRICE = 0.0001 ether; uint256 private _flag = 0; string private _defTokenURI = "ipfs://bafybeibggsb4f3gz7ac5ag5toduv47u7qbl5zsqcotcjbwrzsnvkzr75im/"; string private _baseTokenURI = "ipfs://bafybeibggsb4f3gz7ac5ag5toduv47u7qbl5zsqcotcjbwrzsnvkzr75im/"; mapping(address => bool) private _hasMinted; mapping(uint256 => uint256) private amountToPrice; mapping(uint256 => string) private tokenIdToUri; event NewMint(address indexed msgSender, uint256 indexed mintQuantity); Counters.Counter private _tokenIdCounter; constructor() ERC721A("Miggles", "BRN") Ownable(msg.sender) { tokenIdToUri[0] = "ipfs://bafybeibggsb4f3gz7ac5ag5toduv47u7qbl5zsqcotcjbwrzsnvkzr75im/1.json"; tokenIdToUri[1] = "ipfs://bafybeibggsb4f3gz7ac5ag5toduv47u7qbl5zsqcotcjbwrzsnvkzr75im/2.json"; tokenIdToUri[2] = "ipfs://bafybeibggsb4f3gz7ac5ag5toduv47u7qbl5zsqcotcjbwrzsnvkzr75im/3.json"; tokenIdToUri[3] = "ipfs://bafybeibggsb4f3gz7ac5ag5toduv47u7qbl5zsqcotcjbwrzsnvkzr75im/3.json"; tokenIdToUri[4] = "ipfs://bafybeibggsb4f3gz7ac5ag5toduv47u7qbl5zsqcotcjbwrzsnvkzr75im/4.json"; } function _startTokenId() internal view override virtual returns (uint256) { return 1; } function transferOut(address _to) public onlyOwner { uint256 balance = address(this).balance; payable(_to).transfer(balance); } function changeTokenURIFlag(uint256 flag) external onlyOwner { _flag = flag; } function changeDefURI(string calldata _tokenURI) external onlyOwner { _defTokenURI = _tokenURI; } function changeURI(string calldata _tokenURI) external onlyOwner { _baseTokenURI = _tokenURI; } function _baseURI() internal view virtual override returns (string memory) { return _baseTokenURI; } function tokenURI(uint256 tokenId) public view override returns (string memory) { if (_flag == 0) { uint256 mediaNumber = tokenId % 5; string memory uri = tokenIdToUri[mediaNumber]; if (bytes(uri).length == 0) { return _defTokenURI; } return tokenIdToUri[mediaNumber]; } else { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); return string(abi.encodePacked(_baseTokenURI, Strings.toString(tokenId))); } } function ownerMint(uint256 quantity) public payable onlyOwner { require(totalSupply() + quantity <= MAX_SUPPLY, "ERC721: Exceeds maximum supply"); _safeMint(msg.sender, quantity); emit NewMint(msg.sender, quantity); } function mint(uint256 quantity) public payable { require(totalSupply() + quantity <= MAX_SUPPLY, "ERC721: Exceeds maximum supply"); require(msg.value >= MINT_PRICE, "ERC721: Price is 0.25 token"); _safeMint(msg.sender, quantity); emit NewMint(msg.sender, quantity); } }
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":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NotCompatibleWithSpotMints","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"SequentialMintExceedsLimit","type":"error"},{"inputs":[],"name":"SequentialUpToTooSmall","type":"error"},{"inputs":[],"name":"SpotMintTokenIdTooSmall","type":"error"},{"inputs":[],"name":"TokenAlreadyExists","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"msgSender","type":"address"},{"indexed":true,"internalType":"uint256","name":"mintQuantity","type":"uint256"}],"name":"NewMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_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":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"changeDefURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"flag","type":"uint256"}],"name":"changeTokenURIFlag","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"changeURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"ownerMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"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":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"transferOut","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040525f600a5560405180608001604052806043815260200161320c60439139600b908161002f919061060f565b5060405180608001604052806043815260200161320c60439139600c9081610057919061060f565b50348015610063575f80fd5b50336040518060400160405280600781526020017f4d6967676c6573000000000000000000000000000000000000000000000000008152506040518060400160405280600381526020017f42524e000000000000000000000000000000000000000000000000000000000081525081600290816100e0919061060f565b5080600390816100f0919061060f565b506100ff6102db60201b60201c565b5f819055506101126102db60201b60201c565b6101206102e360201b60201c565b101561013d5761013c63fed8210f60e01b61030a60201b60201c565b5b50505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036101af575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016101a6919061071d565b60405180910390fd5b6101be8161031260201b60201c565b5060405180608001604052806049815260200161332a60499139600f5f8081526020019081526020015f2090816101f5919061060f565b506040518060800160405280604981526020016132e160499139600f5f600181526020019081526020015f20908161022d919061060f565b5060405180608001604052806049815260200161329860499139600f5f600281526020019081526020015f209081610265919061060f565b5060405180608001604052806049815260200161329860499139600f5f600381526020019081526020015f20908161029d919061060f565b5060405180608001604052806049815260200161324f60499139600f5f600481526020019081526020015f2090816102d5919061060f565b50610736565b5f6001905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff905090565b805f5260045ffd5b5f60095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160095f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f81519050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061045057607f821691505b6020821081036104635761046261040c565b5b50919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026104c57fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8261048a565b6104cf868361048a565b95508019841693508086168417925050509392505050565b5f819050919050565b5f819050919050565b5f61051361050e610509846104e7565b6104f0565b6104e7565b9050919050565b5f819050919050565b61052c836104f9565b6105406105388261051a565b848454610496565b825550505050565b5f90565b610554610548565b61055f818484610523565b505050565b5b81811015610582576105775f8261054c565b600181019050610565565b5050565b601f8211156105c75761059881610469565b6105a18461047b565b810160208510156105b0578190505b6105c46105bc8561047b565b830182610564565b50505b505050565b5f82821c905092915050565b5f6105e75f19846008026105cc565b1980831691505092915050565b5f6105ff83836105d8565b9150826002028217905092915050565b610618826103d5565b67ffffffffffffffff811115610631576106306103df565b5b61063b8254610439565b610646828285610586565b5f60209050601f831160018114610677575f8415610665578287015190505b61066f85826105f4565b8655506106d6565b601f19841661068586610469565b5f5b828110156106ac57848901518255600182019150602085019450602081019050610687565b868310156106c957848901516106c5601f8916826105d8565b8355505b6001600288020188555050505b505050505050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610707826106de565b9050919050565b610717816106fd565b82525050565b5f6020820190506107305f83018461070e565b92915050565b612ac9806107435f395ff3fe608060405260043610610165575f3560e01c8063715018a6116100d0578063b88d4fde11610089578063e5e01c1111610063578063e5e01c11146104d3578063e985e9c5146104fb578063f19e75d414610537578063f2fde38b1461055357610165565b8063b88d4fde14610451578063c002d23d1461046d578063c87b56dd1461049757610165565b8063715018a61461037b5780638da5cb5b1461039157806395d89b41146103bb5780639894ba7c146103e5578063a0712d681461040d578063a22cb4651461042957610165565b806323b872dd1161012257806323b872dd1461027957806332cb6b0c1461029557806342842e0e146102bf578063528c06cc146102db5780636352211e1461030357806370a082311461033f57610165565b806301ffc9a71461016957806306fdde03146101a5578063081812fc146101cf578063095ea7b31461020b5780630e5c19191461022757806318160ddd1461024f575b5f80fd5b348015610174575f80fd5b5061018f600480360381019061018a9190611e1f565b61057b565b60405161019c9190611e64565b60405180910390f35b3480156101b0575f80fd5b506101b961060c565b6040516101c69190611eed565b60405180910390f35b3480156101da575f80fd5b506101f560048036038101906101f09190611f40565b61069c565b6040516102029190611faa565b60405180910390f35b61022560048036038101906102209190611fed565b6106f5565b005b348015610232575f80fd5b5061024d6004803603810190610248919061208c565b610705565b005b34801561025a575f80fd5b50610263610723565b60405161027091906120e6565b60405180910390f35b610293600480360381019061028e91906120ff565b61076e565b005b3480156102a0575f80fd5b506102a9610a19565b6040516102b691906120e6565b60405180910390f35b6102d960048036038101906102d491906120ff565b610a31565b005b3480156102e6575f80fd5b5061030160048036038101906102fc9190611f40565b610a50565b005b34801561030e575f80fd5b5061032960048036038101906103249190611f40565b610a62565b6040516103369190611faa565b60405180910390f35b34801561034a575f80fd5b506103656004803603810190610360919061214f565b610a73565b60405161037291906120e6565b60405180910390f35b348015610386575f80fd5b5061038f610b07565b005b34801561039c575f80fd5b506103a5610b1a565b6040516103b29190611faa565b60405180910390f35b3480156103c6575f80fd5b506103cf610b42565b6040516103dc9190611eed565b60405180910390f35b3480156103f0575f80fd5b5061040b6004803603810190610406919061214f565b610bd2565b005b61042760048036038101906104229190611f40565b610c26565b005b348015610434575f80fd5b5061044f600480360381019061044a91906121a4565b610d29565b005b61046b6004803603810190610466919061230a565b610e2f565b005b348015610478575f80fd5b50610481610e80565b60405161048e91906120e6565b60405180910390f35b3480156104a2575f80fd5b506104bd60048036038101906104b89190611f40565b610e8a565b6040516104ca9190611eed565b60405180910390f35b3480156104de575f80fd5b506104f960048036038101906104f4919061208c565b6110f6565b005b348015610506575f80fd5b50610521600480360381019061051c919061238a565b611114565b60405161052e9190611e64565b60405180910390f35b610551600480360381019061054c9190611f40565b6111a2565b005b34801561055e575f80fd5b506105796004803603810190610574919061214f565b611264565b005b5f6301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806105d557506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806106055750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b60606002805461061b906123f5565b80601f0160208091040260200160405190810160405280929190818152602001828054610647906123f5565b80156106925780601f1061066957610100808354040283529160200191610692565b820191905f5260205f20905b81548152906001019060200180831161067557829003601f168201915b5050505050905090565b5f6106a6826112e8565b6106bb576106ba63cf4700e460e01b61138b565b5b60065f8381526020019081526020015f205f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61070182826001611393565b5050565b61070d6114bd565b8181600b918261071e9291906125cc565b505050565b5f61072c611544565b6001545f54030390507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61075e61154c565b1461076b57600854810190505b90565b5f61077882611573565b905073ffffffffffffffffffffffffffffffffffffffff8473ffffffffffffffffffffffffffffffffffffffff161693508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107ed576107ec63a114810060e01b61138b565b5b5f806107f884611682565b9150915061080e81876108096116a5565b6116ac565b610839576108238661081e6116a5565b611114565b610838576108376359c896be60e01b61138b565b5b5b61084686868660016116ef565b8015610850575f82555b60055f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8154600190039190508190555060055f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815460010191905081905550610918856108f48888876116f5565b7c02000000000000000000000000000000000000000000000000000000001761171c565b60045f8681526020019081526020015f20819055505f7c0200000000000000000000000000000000000000000000000000000000841603610994575f6001850190505f60045f8381526020019081526020015f205403610992575f548114610991578360045f8381526020019081526020015f20819055505b5b505b5f73ffffffffffffffffffffffffffffffffffffffff8673ffffffffffffffffffffffffffffffffffffffff161690508481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a45f8103610a0357610a0263ea553b3460e01b61138b565b5b610a108787876001611746565b50505050505050565b7301c06a5ec5433c60ddaa16406f5a40000000000081565b610a4b83838360405180602001604052805f815250610e2f565b505050565b610a586114bd565b80600a8190555050565b5f610a6c82611573565b9050919050565b5f8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610ab857610ab7638f4eb60460e01b61138b565b5b67ffffffffffffffff60055f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054169050919050565b610b0f6114bd565b610b185f61174c565b565b5f60095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060038054610b51906123f5565b80601f0160208091040260200160405190810160405280929190818152602001828054610b7d906123f5565b8015610bc85780601f10610b9f57610100808354040283529160200191610bc8565b820191905f5260205f20905b815481529060010190602001808311610bab57829003601f168201915b5050505050905090565b610bda6114bd565b5f4790508173ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f19350505050158015610c21573d5f803e3d5ffd5b505050565b7301c06a5ec5433c60ddaa16406f5a40000000000081610c44610723565b610c4e91906126c6565b1115610c8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8690612743565b60405180910390fd5b655af3107a4000341015610cd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ccf906127ab565b60405180910390fd5b610ce2338261180f565b803373ffffffffffffffffffffffffffffffffffffffff167f52277f0b4a9b555c5aa96900a13546f972bda413737ec164aac947c87eec602460405160405180910390a350565b8060075f610d356116a5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16610dde6116a5565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051610e239190611e64565b60405180910390a35050565b610e3a84848461076e565b5f8373ffffffffffffffffffffffffffffffffffffffff163b14610e7a57610e648484848461182c565b610e7957610e7863d1a57ed660e01b61138b565b5b5b50505050565b655af3107a400081565b60605f600a540361107b575f600583610ea391906127f6565b90505f600f5f8381526020019081526020015f208054610ec2906123f5565b80601f0160208091040260200160405190810160405280929190818152602001828054610eee906123f5565b8015610f395780601f10610f1057610100808354040283529160200191610f39565b820191905f5260205f20905b815481529060010190602001808311610f1c57829003601f168201915b505050505090505f815103610fda57600b8054610f55906123f5565b80601f0160208091040260200160405190810160405280929190818152602001828054610f81906123f5565b8015610fcc5780601f10610fa357610100808354040283529160200191610fcc565b820191905f5260205f20905b815481529060010190602001808311610faf57829003601f168201915b5050505050925050506110f1565b600f5f8381526020019081526020015f208054610ff6906123f5565b80601f0160208091040260200160405190810160405280929190818152602001828054611022906123f5565b801561106d5780601f106110445761010080835404028352916020019161106d565b820191905f5260205f20905b81548152906001019060200180831161105057829003601f168201915b5050505050925050506110f1565b611084826112e8565b6110c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ba90612896565b60405180910390fd5b600c6110ce83611956565b6040516020016110df92919061296e565b60405160208183030381529060405290505b919050565b6110fe6114bd565b8181600c918261110f9291906125cc565b505050565b5f60075f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16905092915050565b6111aa6114bd565b7301c06a5ec5433c60ddaa16406f5a400000000000816111c8610723565b6111d291906126c6565b1115611213576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120a90612743565b60405180910390fd5b61121d338261180f565b803373ffffffffffffffffffffffffffffffffffffffff167f52277f0b4a9b555c5aa96900a13546f972bda413737ec164aac947c87eec602460405160405180910390a350565b61126c6114bd565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036112dc575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016112d39190611faa565b60405180910390fd5b6112e58161174c565b50565b5f816112f2611544565b11611385576112ff61154c565b8211156113275761132060045f8481526020019081526020015f2054611a20565b9050611386565b5f54821015611384575f5b5f60045f8581526020019081526020015f20549150810361135e578261135790612991565b9250611332565b5f7c01000000000000000000000000000000000000000000000000000000008216149150505b5b5b919050565b805f5260045ffd5b5f61139d83610a62565b90508180156113df57508073ffffffffffffffffffffffffffffffffffffffff166113c66116a5565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561140b576113f5816113f06116a5565b611114565b61140a5761140963cfb3b94260e01b61138b565b5b5b8360065f8581526020019081526020015f205f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a450505050565b6114c5611a60565b73ffffffffffffffffffffffffffffffffffffffff166114e3610b1a565b73ffffffffffffffffffffffffffffffffffffffff161461154257611506611a60565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016115399190611faa565b60405180910390fd5b565b5f6001905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff905090565b5f8161157d611544565b1161166c5760045f8381526020019081526020015f2054905061159e61154c565b8211156115c3576115ae81611a20565b61167d576115c263df2d9b4260e01b61138b565b5b5f8103611644575f5482106115e3576115e263df2d9b4260e01b61138b565b5b5b60045f836001900393508381526020019081526020015f205490505f81031561163f575f7c01000000000000000000000000000000000000000000000000000000008216031561167d5761163e63df2d9b4260e01b61138b565b5b6115e4565b5f7c01000000000000000000000000000000000000000000000000000000008216031561167d575b61167c63df2d9b4260e01b61138b565b5b919050565b5f805f60065f8581526020019081526020015f2090508092508254915050915091565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b5f8060e883901c905060e861170b868684611a67565b62ffffff16901b9150509392505050565b5f73ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b5f60095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160095f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b611828828260405180602001604052805f815250611a6f565b5050565b5f8373ffffffffffffffffffffffffffffffffffffffff1663150b7a026118516116a5565b8786866040518563ffffffff1660e01b81526004016118739493929190612a0a565b6020604051808303815f875af19250505080156118ae57506040513d601f19601f820116820180604052508101906118ab9190612a68565b60015b611903573d805f81146118dc576040519150601f19603f3d011682016040523d82523d5f602084013e6118e1565b606091505b505f8151036118fb576118fa63d1a57ed660e01b61138b565b5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b60605f600161196484611ae5565b0190505f8167ffffffffffffffff811115611982576119816121e6565b5b6040519080825280601f01601f1916602001820160405280156119b45781602001600182028036833780820191505090505b5090505f82602001820190505b600115611a15578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581611a0a57611a096127c9565b5b0494505f85036119c1575b819350505050919050565b5f7c0100000000000000000000000000000000000000000000000000000000821673ffffffffffffffffffffffffffffffffffffffff8316119050919050565b5f33905090565b5f9392505050565b611a798383611c36565b5f8373ffffffffffffffffffffffffffffffffffffffff163b14611ae0575f805490505f83820390505b611ab55f86838060010194508661182c565b611aca57611ac963d1a57ed660e01b61138b565b5b818110611aa357815f5414611add575f80fd5b50505b505050565b5f805f90507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310611b41577a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008381611b3757611b366127c9565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310611b7e576d04ee2d6d415b85acef81000000008381611b7457611b736127c9565b5b0492506020810190505b662386f26fc100008310611bad57662386f26fc100008381611ba357611ba26127c9565b5b0492506010810190505b6305f5e1008310611bd6576305f5e1008381611bcc57611bcb6127c9565b5b0492506008810190505b6127108310611bfb576127108381611bf157611bf06127c9565b5b0492506004810190505b60648310611c1e5760648381611c1457611c136127c9565b5b0492506002810190505b600a8310611c2d576001810190505b80915050919050565b5f805490505f8203611c5357611c5263b562e8dd60e01b61138b565b5b611c5f5f8483856116ef565b611c7d83611c6e5f865f6116f5565b611c7785611daa565b1761171c565b60045f8381526020019081526020015f2081905550600160406001901b17820260055f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505f73ffffffffffffffffffffffffffffffffffffffff8473ffffffffffffffffffffffffffffffffffffffff161690505f8103611d2e57611d2d632e07630060e01b61138b565b5b5f83830190505f839050611d4061154c565b600183031115611d5b57611d5a6381647e3a60e01b61138b565b5b5b80835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4818160010191508103611d5c57815f81905550505050611da55f848385611746565b505050565b5f6001821460e11b9050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611dfe81611dca565b8114611e08575f80fd5b50565b5f81359050611e1981611df5565b92915050565b5f60208284031215611e3457611e33611dc2565b5b5f611e4184828501611e0b565b91505092915050565b5f8115159050919050565b611e5e81611e4a565b82525050565b5f602082019050611e775f830184611e55565b92915050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611ebf82611e7d565b611ec98185611e87565b9350611ed9818560208601611e97565b611ee281611ea5565b840191505092915050565b5f6020820190508181035f830152611f058184611eb5565b905092915050565b5f819050919050565b611f1f81611f0d565b8114611f29575f80fd5b50565b5f81359050611f3a81611f16565b92915050565b5f60208284031215611f5557611f54611dc2565b5b5f611f6284828501611f2c565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611f9482611f6b565b9050919050565b611fa481611f8a565b82525050565b5f602082019050611fbd5f830184611f9b565b92915050565b611fcc81611f8a565b8114611fd6575f80fd5b50565b5f81359050611fe781611fc3565b92915050565b5f806040838503121561200357612002611dc2565b5b5f61201085828601611fd9565b925050602061202185828601611f2c565b9150509250929050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261204c5761204b61202b565b5b8235905067ffffffffffffffff8111156120695761206861202f565b5b60208301915083600182028301111561208557612084612033565b5b9250929050565b5f80602083850312156120a2576120a1611dc2565b5b5f83013567ffffffffffffffff8111156120bf576120be611dc6565b5b6120cb85828601612037565b92509250509250929050565b6120e081611f0d565b82525050565b5f6020820190506120f95f8301846120d7565b92915050565b5f805f6060848603121561211657612115611dc2565b5b5f61212386828701611fd9565b935050602061213486828701611fd9565b925050604061214586828701611f2c565b9150509250925092565b5f6020828403121561216457612163611dc2565b5b5f61217184828501611fd9565b91505092915050565b61218381611e4a565b811461218d575f80fd5b50565b5f8135905061219e8161217a565b92915050565b5f80604083850312156121ba576121b9611dc2565b5b5f6121c785828601611fd9565b92505060206121d885828601612190565b9150509250929050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61221c82611ea5565b810181811067ffffffffffffffff8211171561223b5761223a6121e6565b5b80604052505050565b5f61224d611db9565b90506122598282612213565b919050565b5f67ffffffffffffffff821115612278576122776121e6565b5b61228182611ea5565b9050602081019050919050565b828183375f83830152505050565b5f6122ae6122a98461225e565b612244565b9050828152602081018484840111156122ca576122c96121e2565b5b6122d584828561228e565b509392505050565b5f82601f8301126122f1576122f061202b565b5b813561230184826020860161229c565b91505092915050565b5f805f806080858703121561232257612321611dc2565b5b5f61232f87828801611fd9565b945050602061234087828801611fd9565b935050604061235187828801611f2c565b925050606085013567ffffffffffffffff81111561237257612371611dc6565b5b61237e878288016122dd565b91505092959194509250565b5f80604083850312156123a05761239f611dc2565b5b5f6123ad85828601611fd9565b92505060206123be85828601611fd9565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061240c57607f821691505b60208210810361241f5761241e6123c8565b5b50919050565b5f82905092915050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f6008830261248b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82612450565b6124958683612450565b95508019841693508086168417925050509392505050565b5f819050919050565b5f6124d06124cb6124c684611f0d565b6124ad565b611f0d565b9050919050565b5f819050919050565b6124e9836124b6565b6124fd6124f5826124d7565b84845461245c565b825550505050565b5f90565b612511612505565b61251c8184846124e0565b505050565b5b8181101561253f576125345f82612509565b600181019050612522565b5050565b601f821115612584576125558161242f565b61255e84612441565b8101602085101561256d578190505b61258161257985612441565b830182612521565b50505b505050565b5f82821c905092915050565b5f6125a45f1984600802612589565b1980831691505092915050565b5f6125bc8383612595565b9150826002028217905092915050565b6125d68383612425565b67ffffffffffffffff8111156125ef576125ee6121e6565b5b6125f982546123f5565b612604828285612543565b5f601f831160018114612631575f841561261f578287013590505b61262985826125b1565b865550612690565b601f19841661263f8661242f565b5f5b8281101561266657848901358255600182019150602085019450602081019050612641565b86831015612683578489013561267f601f891682612595565b8355505b6001600288020188555050505b50505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6126d082611f0d565b91506126db83611f0d565b92508282019050808211156126f3576126f2612699565b5b92915050565b7f4552433732313a2045786365656473206d6178696d756d20737570706c7900005f82015250565b5f61272d601e83611e87565b9150612738826126f9565b602082019050919050565b5f6020820190508181035f83015261275a81612721565b9050919050565b7f4552433732313a20507269636520697320302e323520746f6b656e00000000005f82015250565b5f612795601b83611e87565b91506127a082612761565b602082019050919050565b5f6020820190508181035f8301526127c281612789565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61280082611f0d565b915061280b83611f0d565b92508261281b5761281a6127c9565b5b828206905092915050565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f5f8201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b5f612880602f83611e87565b915061288b82612826565b604082019050919050565b5f6020820190508181035f8301526128ad81612874565b9050919050565b5f81905092915050565b5f81546128ca816123f5565b6128d481866128b4565b9450600182165f81146128ee576001811461290357612935565b60ff1983168652811515820286019350612935565b61290c8561242f565b5f5b8381101561292d5781548189015260018201915060208101905061290e565b838801955050505b50505092915050565b5f61294882611e7d565b61295281856128b4565b9350612962818560208601611e97565b80840191505092915050565b5f61297982856128be565b9150612985828461293e565b91508190509392505050565b5f61299b82611f0d565b91505f82036129ad576129ac612699565b5b600182039050919050565b5f81519050919050565b5f82825260208201905092915050565b5f6129dc826129b8565b6129e681856129c2565b93506129f6818560208601611e97565b6129ff81611ea5565b840191505092915050565b5f608082019050612a1d5f830187611f9b565b612a2a6020830186611f9b565b612a3760408301856120d7565b8181036060830152612a4981846129d2565b905095945050505050565b5f81519050612a6281611df5565b92915050565b5f60208284031215612a7d57612a7c611dc2565b5b5f612a8a84828501612a54565b9150509291505056fea264697066735822122011dd49e8360989662d392515d8b3d72cd66eafad1dace3a8e77a823a9198607c64736f6c63430008190033697066733a2f2f626166796265696267677362346633677a37616335616735746f6475763437753771626c357a7371636f74636a6277727a736e766b7a723735696d2f697066733a2f2f626166796265696267677362346633677a37616335616735746f6475763437753771626c357a7371636f74636a6277727a736e766b7a723735696d2f342e6a736f6e697066733a2f2f626166796265696267677362346633677a37616335616735746f6475763437753771626c357a7371636f74636a6277727a736e766b7a723735696d2f332e6a736f6e697066733a2f2f626166796265696267677362346633677a37616335616735746f6475763437753771626c357a7371636f74636a6277727a736e766b7a723735696d2f322e6a736f6e697066733a2f2f626166796265696267677362346633677a37616335616735746f6475763437753771626c357a7371636f74636a6277727a736e766b7a723735696d2f312e6a736f6e
Deployed Bytecode
0x608060405260043610610165575f3560e01c8063715018a6116100d0578063b88d4fde11610089578063e5e01c1111610063578063e5e01c11146104d3578063e985e9c5146104fb578063f19e75d414610537578063f2fde38b1461055357610165565b8063b88d4fde14610451578063c002d23d1461046d578063c87b56dd1461049757610165565b8063715018a61461037b5780638da5cb5b1461039157806395d89b41146103bb5780639894ba7c146103e5578063a0712d681461040d578063a22cb4651461042957610165565b806323b872dd1161012257806323b872dd1461027957806332cb6b0c1461029557806342842e0e146102bf578063528c06cc146102db5780636352211e1461030357806370a082311461033f57610165565b806301ffc9a71461016957806306fdde03146101a5578063081812fc146101cf578063095ea7b31461020b5780630e5c19191461022757806318160ddd1461024f575b5f80fd5b348015610174575f80fd5b5061018f600480360381019061018a9190611e1f565b61057b565b60405161019c9190611e64565b60405180910390f35b3480156101b0575f80fd5b506101b961060c565b6040516101c69190611eed565b60405180910390f35b3480156101da575f80fd5b506101f560048036038101906101f09190611f40565b61069c565b6040516102029190611faa565b60405180910390f35b61022560048036038101906102209190611fed565b6106f5565b005b348015610232575f80fd5b5061024d6004803603810190610248919061208c565b610705565b005b34801561025a575f80fd5b50610263610723565b60405161027091906120e6565b60405180910390f35b610293600480360381019061028e91906120ff565b61076e565b005b3480156102a0575f80fd5b506102a9610a19565b6040516102b691906120e6565b60405180910390f35b6102d960048036038101906102d491906120ff565b610a31565b005b3480156102e6575f80fd5b5061030160048036038101906102fc9190611f40565b610a50565b005b34801561030e575f80fd5b5061032960048036038101906103249190611f40565b610a62565b6040516103369190611faa565b60405180910390f35b34801561034a575f80fd5b506103656004803603810190610360919061214f565b610a73565b60405161037291906120e6565b60405180910390f35b348015610386575f80fd5b5061038f610b07565b005b34801561039c575f80fd5b506103a5610b1a565b6040516103b29190611faa565b60405180910390f35b3480156103c6575f80fd5b506103cf610b42565b6040516103dc9190611eed565b60405180910390f35b3480156103f0575f80fd5b5061040b6004803603810190610406919061214f565b610bd2565b005b61042760048036038101906104229190611f40565b610c26565b005b348015610434575f80fd5b5061044f600480360381019061044a91906121a4565b610d29565b005b61046b6004803603810190610466919061230a565b610e2f565b005b348015610478575f80fd5b50610481610e80565b60405161048e91906120e6565b60405180910390f35b3480156104a2575f80fd5b506104bd60048036038101906104b89190611f40565b610e8a565b6040516104ca9190611eed565b60405180910390f35b3480156104de575f80fd5b506104f960048036038101906104f4919061208c565b6110f6565b005b348015610506575f80fd5b50610521600480360381019061051c919061238a565b611114565b60405161052e9190611e64565b60405180910390f35b610551600480360381019061054c9190611f40565b6111a2565b005b34801561055e575f80fd5b506105796004803603810190610574919061214f565b611264565b005b5f6301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806105d557506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806106055750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b60606002805461061b906123f5565b80601f0160208091040260200160405190810160405280929190818152602001828054610647906123f5565b80156106925780601f1061066957610100808354040283529160200191610692565b820191905f5260205f20905b81548152906001019060200180831161067557829003601f168201915b5050505050905090565b5f6106a6826112e8565b6106bb576106ba63cf4700e460e01b61138b565b5b60065f8381526020019081526020015f205f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61070182826001611393565b5050565b61070d6114bd565b8181600b918261071e9291906125cc565b505050565b5f61072c611544565b6001545f54030390507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61075e61154c565b1461076b57600854810190505b90565b5f61077882611573565b905073ffffffffffffffffffffffffffffffffffffffff8473ffffffffffffffffffffffffffffffffffffffff161693508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107ed576107ec63a114810060e01b61138b565b5b5f806107f884611682565b9150915061080e81876108096116a5565b6116ac565b610839576108238661081e6116a5565b611114565b610838576108376359c896be60e01b61138b565b5b5b61084686868660016116ef565b8015610850575f82555b60055f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8154600190039190508190555060055f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f815460010191905081905550610918856108f48888876116f5565b7c02000000000000000000000000000000000000000000000000000000001761171c565b60045f8681526020019081526020015f20819055505f7c0200000000000000000000000000000000000000000000000000000000841603610994575f6001850190505f60045f8381526020019081526020015f205403610992575f548114610991578360045f8381526020019081526020015f20819055505b5b505b5f73ffffffffffffffffffffffffffffffffffffffff8673ffffffffffffffffffffffffffffffffffffffff161690508481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a45f8103610a0357610a0263ea553b3460e01b61138b565b5b610a108787876001611746565b50505050505050565b7301c06a5ec5433c60ddaa16406f5a40000000000081565b610a4b83838360405180602001604052805f815250610e2f565b505050565b610a586114bd565b80600a8190555050565b5f610a6c82611573565b9050919050565b5f8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610ab857610ab7638f4eb60460e01b61138b565b5b67ffffffffffffffff60055f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054169050919050565b610b0f6114bd565b610b185f61174c565b565b5f60095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060038054610b51906123f5565b80601f0160208091040260200160405190810160405280929190818152602001828054610b7d906123f5565b8015610bc85780601f10610b9f57610100808354040283529160200191610bc8565b820191905f5260205f20905b815481529060010190602001808311610bab57829003601f168201915b5050505050905090565b610bda6114bd565b5f4790508173ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f19350505050158015610c21573d5f803e3d5ffd5b505050565b7301c06a5ec5433c60ddaa16406f5a40000000000081610c44610723565b610c4e91906126c6565b1115610c8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8690612743565b60405180910390fd5b655af3107a4000341015610cd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ccf906127ab565b60405180910390fd5b610ce2338261180f565b803373ffffffffffffffffffffffffffffffffffffffff167f52277f0b4a9b555c5aa96900a13546f972bda413737ec164aac947c87eec602460405160405180910390a350565b8060075f610d356116a5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16610dde6116a5565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051610e239190611e64565b60405180910390a35050565b610e3a84848461076e565b5f8373ffffffffffffffffffffffffffffffffffffffff163b14610e7a57610e648484848461182c565b610e7957610e7863d1a57ed660e01b61138b565b5b5b50505050565b655af3107a400081565b60605f600a540361107b575f600583610ea391906127f6565b90505f600f5f8381526020019081526020015f208054610ec2906123f5565b80601f0160208091040260200160405190810160405280929190818152602001828054610eee906123f5565b8015610f395780601f10610f1057610100808354040283529160200191610f39565b820191905f5260205f20905b815481529060010190602001808311610f1c57829003601f168201915b505050505090505f815103610fda57600b8054610f55906123f5565b80601f0160208091040260200160405190810160405280929190818152602001828054610f81906123f5565b8015610fcc5780601f10610fa357610100808354040283529160200191610fcc565b820191905f5260205f20905b815481529060010190602001808311610faf57829003601f168201915b5050505050925050506110f1565b600f5f8381526020019081526020015f208054610ff6906123f5565b80601f0160208091040260200160405190810160405280929190818152602001828054611022906123f5565b801561106d5780601f106110445761010080835404028352916020019161106d565b820191905f5260205f20905b81548152906001019060200180831161105057829003601f168201915b5050505050925050506110f1565b611084826112e8565b6110c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ba90612896565b60405180910390fd5b600c6110ce83611956565b6040516020016110df92919061296e565b60405160208183030381529060405290505b919050565b6110fe6114bd565b8181600c918261110f9291906125cc565b505050565b5f60075f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16905092915050565b6111aa6114bd565b7301c06a5ec5433c60ddaa16406f5a400000000000816111c8610723565b6111d291906126c6565b1115611213576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120a90612743565b60405180910390fd5b61121d338261180f565b803373ffffffffffffffffffffffffffffffffffffffff167f52277f0b4a9b555c5aa96900a13546f972bda413737ec164aac947c87eec602460405160405180910390a350565b61126c6114bd565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036112dc575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016112d39190611faa565b60405180910390fd5b6112e58161174c565b50565b5f816112f2611544565b11611385576112ff61154c565b8211156113275761132060045f8481526020019081526020015f2054611a20565b9050611386565b5f54821015611384575f5b5f60045f8581526020019081526020015f20549150810361135e578261135790612991565b9250611332565b5f7c01000000000000000000000000000000000000000000000000000000008216149150505b5b5b919050565b805f5260045ffd5b5f61139d83610a62565b90508180156113df57508073ffffffffffffffffffffffffffffffffffffffff166113c66116a5565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561140b576113f5816113f06116a5565b611114565b61140a5761140963cfb3b94260e01b61138b565b5b5b8360065f8581526020019081526020015f205f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a450505050565b6114c5611a60565b73ffffffffffffffffffffffffffffffffffffffff166114e3610b1a565b73ffffffffffffffffffffffffffffffffffffffff161461154257611506611a60565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016115399190611faa565b60405180910390fd5b565b5f6001905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff905090565b5f8161157d611544565b1161166c5760045f8381526020019081526020015f2054905061159e61154c565b8211156115c3576115ae81611a20565b61167d576115c263df2d9b4260e01b61138b565b5b5f8103611644575f5482106115e3576115e263df2d9b4260e01b61138b565b5b5b60045f836001900393508381526020019081526020015f205490505f81031561163f575f7c01000000000000000000000000000000000000000000000000000000008216031561167d5761163e63df2d9b4260e01b61138b565b5b6115e4565b5f7c01000000000000000000000000000000000000000000000000000000008216031561167d575b61167c63df2d9b4260e01b61138b565b5b919050565b5f805f60065f8581526020019081526020015f2090508092508254915050915091565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b5f8060e883901c905060e861170b868684611a67565b62ffffff16901b9150509392505050565b5f73ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b5f60095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160095f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b611828828260405180602001604052805f815250611a6f565b5050565b5f8373ffffffffffffffffffffffffffffffffffffffff1663150b7a026118516116a5565b8786866040518563ffffffff1660e01b81526004016118739493929190612a0a565b6020604051808303815f875af19250505080156118ae57506040513d601f19601f820116820180604052508101906118ab9190612a68565b60015b611903573d805f81146118dc576040519150601f19603f3d011682016040523d82523d5f602084013e6118e1565b606091505b505f8151036118fb576118fa63d1a57ed660e01b61138b565b5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b60605f600161196484611ae5565b0190505f8167ffffffffffffffff811115611982576119816121e6565b5b6040519080825280601f01601f1916602001820160405280156119b45781602001600182028036833780820191505090505b5090505f82602001820190505b600115611a15578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581611a0a57611a096127c9565b5b0494505f85036119c1575b819350505050919050565b5f7c0100000000000000000000000000000000000000000000000000000000821673ffffffffffffffffffffffffffffffffffffffff8316119050919050565b5f33905090565b5f9392505050565b611a798383611c36565b5f8373ffffffffffffffffffffffffffffffffffffffff163b14611ae0575f805490505f83820390505b611ab55f86838060010194508661182c565b611aca57611ac963d1a57ed660e01b61138b565b5b818110611aa357815f5414611add575f80fd5b50505b505050565b5f805f90507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310611b41577a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008381611b3757611b366127c9565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310611b7e576d04ee2d6d415b85acef81000000008381611b7457611b736127c9565b5b0492506020810190505b662386f26fc100008310611bad57662386f26fc100008381611ba357611ba26127c9565b5b0492506010810190505b6305f5e1008310611bd6576305f5e1008381611bcc57611bcb6127c9565b5b0492506008810190505b6127108310611bfb576127108381611bf157611bf06127c9565b5b0492506004810190505b60648310611c1e5760648381611c1457611c136127c9565b5b0492506002810190505b600a8310611c2d576001810190505b80915050919050565b5f805490505f8203611c5357611c5263b562e8dd60e01b61138b565b5b611c5f5f8483856116ef565b611c7d83611c6e5f865f6116f5565b611c7785611daa565b1761171c565b60045f8381526020019081526020015f2081905550600160406001901b17820260055f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505f73ffffffffffffffffffffffffffffffffffffffff8473ffffffffffffffffffffffffffffffffffffffff161690505f8103611d2e57611d2d632e07630060e01b61138b565b5b5f83830190505f839050611d4061154c565b600183031115611d5b57611d5a6381647e3a60e01b61138b565b5b5b80835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4818160010191508103611d5c57815f81905550505050611da55f848385611746565b505050565b5f6001821460e11b9050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611dfe81611dca565b8114611e08575f80fd5b50565b5f81359050611e1981611df5565b92915050565b5f60208284031215611e3457611e33611dc2565b5b5f611e4184828501611e0b565b91505092915050565b5f8115159050919050565b611e5e81611e4a565b82525050565b5f602082019050611e775f830184611e55565b92915050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611ebf82611e7d565b611ec98185611e87565b9350611ed9818560208601611e97565b611ee281611ea5565b840191505092915050565b5f6020820190508181035f830152611f058184611eb5565b905092915050565b5f819050919050565b611f1f81611f0d565b8114611f29575f80fd5b50565b5f81359050611f3a81611f16565b92915050565b5f60208284031215611f5557611f54611dc2565b5b5f611f6284828501611f2c565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611f9482611f6b565b9050919050565b611fa481611f8a565b82525050565b5f602082019050611fbd5f830184611f9b565b92915050565b611fcc81611f8a565b8114611fd6575f80fd5b50565b5f81359050611fe781611fc3565b92915050565b5f806040838503121561200357612002611dc2565b5b5f61201085828601611fd9565b925050602061202185828601611f2c565b9150509250929050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261204c5761204b61202b565b5b8235905067ffffffffffffffff8111156120695761206861202f565b5b60208301915083600182028301111561208557612084612033565b5b9250929050565b5f80602083850312156120a2576120a1611dc2565b5b5f83013567ffffffffffffffff8111156120bf576120be611dc6565b5b6120cb85828601612037565b92509250509250929050565b6120e081611f0d565b82525050565b5f6020820190506120f95f8301846120d7565b92915050565b5f805f6060848603121561211657612115611dc2565b5b5f61212386828701611fd9565b935050602061213486828701611fd9565b925050604061214586828701611f2c565b9150509250925092565b5f6020828403121561216457612163611dc2565b5b5f61217184828501611fd9565b91505092915050565b61218381611e4a565b811461218d575f80fd5b50565b5f8135905061219e8161217a565b92915050565b5f80604083850312156121ba576121b9611dc2565b5b5f6121c785828601611fd9565b92505060206121d885828601612190565b9150509250929050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61221c82611ea5565b810181811067ffffffffffffffff8211171561223b5761223a6121e6565b5b80604052505050565b5f61224d611db9565b90506122598282612213565b919050565b5f67ffffffffffffffff821115612278576122776121e6565b5b61228182611ea5565b9050602081019050919050565b828183375f83830152505050565b5f6122ae6122a98461225e565b612244565b9050828152602081018484840111156122ca576122c96121e2565b5b6122d584828561228e565b509392505050565b5f82601f8301126122f1576122f061202b565b5b813561230184826020860161229c565b91505092915050565b5f805f806080858703121561232257612321611dc2565b5b5f61232f87828801611fd9565b945050602061234087828801611fd9565b935050604061235187828801611f2c565b925050606085013567ffffffffffffffff81111561237257612371611dc6565b5b61237e878288016122dd565b91505092959194509250565b5f80604083850312156123a05761239f611dc2565b5b5f6123ad85828601611fd9565b92505060206123be85828601611fd9565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061240c57607f821691505b60208210810361241f5761241e6123c8565b5b50919050565b5f82905092915050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f6008830261248b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82612450565b6124958683612450565b95508019841693508086168417925050509392505050565b5f819050919050565b5f6124d06124cb6124c684611f0d565b6124ad565b611f0d565b9050919050565b5f819050919050565b6124e9836124b6565b6124fd6124f5826124d7565b84845461245c565b825550505050565b5f90565b612511612505565b61251c8184846124e0565b505050565b5b8181101561253f576125345f82612509565b600181019050612522565b5050565b601f821115612584576125558161242f565b61255e84612441565b8101602085101561256d578190505b61258161257985612441565b830182612521565b50505b505050565b5f82821c905092915050565b5f6125a45f1984600802612589565b1980831691505092915050565b5f6125bc8383612595565b9150826002028217905092915050565b6125d68383612425565b67ffffffffffffffff8111156125ef576125ee6121e6565b5b6125f982546123f5565b612604828285612543565b5f601f831160018114612631575f841561261f578287013590505b61262985826125b1565b865550612690565b601f19841661263f8661242f565b5f5b8281101561266657848901358255600182019150602085019450602081019050612641565b86831015612683578489013561267f601f891682612595565b8355505b6001600288020188555050505b50505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6126d082611f0d565b91506126db83611f0d565b92508282019050808211156126f3576126f2612699565b5b92915050565b7f4552433732313a2045786365656473206d6178696d756d20737570706c7900005f82015250565b5f61272d601e83611e87565b9150612738826126f9565b602082019050919050565b5f6020820190508181035f83015261275a81612721565b9050919050565b7f4552433732313a20507269636520697320302e323520746f6b656e00000000005f82015250565b5f612795601b83611e87565b91506127a082612761565b602082019050919050565b5f6020820190508181035f8301526127c281612789565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61280082611f0d565b915061280b83611f0d565b92508261281b5761281a6127c9565b5b828206905092915050565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f5f8201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b5f612880602f83611e87565b915061288b82612826565b604082019050919050565b5f6020820190508181035f8301526128ad81612874565b9050919050565b5f81905092915050565b5f81546128ca816123f5565b6128d481866128b4565b9450600182165f81146128ee576001811461290357612935565b60ff1983168652811515820286019350612935565b61290c8561242f565b5f5b8381101561292d5781548189015260018201915060208101905061290e565b838801955050505b50505092915050565b5f61294882611e7d565b61295281856128b4565b9350612962818560208601611e97565b80840191505092915050565b5f61297982856128be565b9150612985828461293e565b91508190509392505050565b5f61299b82611f0d565b91505f82036129ad576129ac612699565b5b600182039050919050565b5f81519050919050565b5f82825260208201905092915050565b5f6129dc826129b8565b6129e681856129c2565b93506129f6818560208601611e97565b6129ff81611ea5565b840191505092915050565b5f608082019050612a1d5f830187611f9b565b612a2a6020830186611f9b565b612a3760408301856120d7565b8181036060830152612a4981846129d2565b905095945050505050565b5f81519050612a6281611df5565b92915050565b5f60208284031215612a7d57612a7c611dc2565b5b5f612a8a84828501612a54565b9150509291505056fea264697066735822122011dd49e8360989662d392515d8b3d72cd66eafad1dace3a8e77a823a9198607c64736f6c63430008190033
Deployed Bytecode Sourcemap
140419:3255:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20690:639;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;21592:100;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;28832:227;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;28549:124;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;142168:111;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;16794:573;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;33104:3523;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;140524:81;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;36723:193;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;142070:92;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;22994:152;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;18518:242;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;64254:103;;;;;;;;;;;;;:::i;:::-;;63579:87;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;21768:104;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;141912:150;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;143363:308;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;29399:234;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;37514:416;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;140612:46;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;142524:574;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;142285:109;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;29790:164;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;143106:249;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;64512:220;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;20690:639;20775:4;21114:10;21099:25;;:11;:25;;;;:102;;;;21191:10;21176:25;;:11;:25;;;;21099:102;:179;;;;21268:10;21253:25;;:11;:25;;;;21099:179;21079:199;;20690:639;;;:::o;21592:100::-;21646:13;21679:5;21672:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21592:100;:::o;28832:227::-;28908:7;28933:16;28941:7;28933;:16::i;:::-;28928:73;;28951:50;28959:41;;;28951:7;:50::i;:::-;28928:73;29021:15;:24;29037:7;29021:24;;;;;;;;;;;:30;;;;;;;;;;;;29014:37;;28832:227;;;:::o;28549:124::-;28638:27;28647:2;28651:7;28660:4;28638:8;:27::i;:::-;28549:124;;:::o;142168:111::-;63465:13;:11;:13::i;:::-;142262:9:::1;;142247:12;:24;;;;;;;:::i;:::-;;142168:111:::0;;:::o;16794:573::-;16855:14;17253:15;:13;:15::i;:::-;17238:12;;17222:13;;:28;:46;17213:55;;17308:17;17287;:15;:17::i;:::-;:38;17283:65;;17337:11;;17327:21;;;;17283:65;16794:573;:::o;33104:3523::-;33246:27;33276;33295:7;33276:18;:27::i;:::-;33246:57;;12736:14;33447:4;33431:22;;:41;33408:66;;33532:4;33491:45;;33507:19;33491:45;;;33487:95;;33538:44;33546:35;;;33538:7;:44::i;:::-;33487:95;33596:27;33625:23;33652:35;33679:7;33652:26;:35::i;:::-;33595:92;;;;33787:68;33812:15;33829:4;33835:19;:17;:19::i;:::-;33787:24;:68::i;:::-;33782:189;;33875:43;33892:4;33898:19;:17;:19::i;:::-;33875:16;:43::i;:::-;33870:101;;33920:51;33928:42;;;33920:7;:51::i;:::-;33870:101;33782:189;33984:43;34006:4;34012:2;34016:7;34025:1;33984:21;:43::i;:::-;34120:15;34117:160;;;34260:1;34239:19;34232:30;34117:160;34657:18;:24;34676:4;34657:24;;;;;;;;;;;;;;;;34655:26;;;;;;;;;;;;34726:18;:22;34745:2;34726:22;;;;;;;;;;;;;;;;34724:24;;;;;;;;;;;35048:146;35085:2;35134:45;35149:4;35155:2;35159:19;35134:14;:45::i;:::-;12334:8;35106:73;35048:18;:146::i;:::-;35019:17;:26;35037:7;35019:26;;;;;;;;;;;:175;;;;35365:1;12334:8;35314:19;:47;:52;35310:627;;35387:19;35419:1;35409:7;:11;35387:33;;35576:1;35542:17;:30;35560:11;35542:30;;;;;;;;;;;;:35;35538:384;;35680:13;;35665:11;:28;35661:242;;35860:19;35827:17;:30;35845:11;35827:30;;;;;;;;;;;:52;;;;35661:242;35538:384;35368:569;35310:627;36050:16;12736:14;36085:2;36069:20;;:39;36050:58;;36449:7;36413:8;36379:4;36321:25;36266:1;36209;36186:299;36522:1;36510:8;:13;36506:58;;36525:39;36533:30;;;36525:7;:39::i;:::-;36506:58;36577:42;36598:4;36604:2;36608:7;36617:1;36577:20;:42::i;:::-;33235:3392;;;;33104:3523;;;:::o;140524:81::-;140558:47;140524:81;:::o;36723:193::-;36869:39;36886:4;36892:2;36896:7;36869:39;;;;;;;;;;;;:16;:39::i;:::-;36723:193;;;:::o;142070:92::-;63465:13;:11;:13::i;:::-;142150:4:::1;142142:5;:12;;;;142070:92:::0;:::o;22994:152::-;23066:7;23109:27;23128:7;23109:18;:27::i;:::-;23086:52;;22994:152;;;:::o;18518:242::-;18590:7;18631:1;18614:19;;:5;:19;;;18610:69;;18635:44;18643:35;;;18635:7;:44::i;:::-;18610:69;11278:13;18697:18;:25;18716:5;18697:25;;;;;;;;;;;;;;;;:55;18690:62;;18518:242;;;:::o;64254:103::-;63465:13;:11;:13::i;:::-;64319:30:::1;64346:1;64319:18;:30::i;:::-;64254:103::o:0;63579:87::-;63625:7;63652:6;;;;;;;;;;;63645:13;;63579:87;:::o;21768:104::-;21824:13;21857:7;21850:14;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21768:104;:::o;141912:150::-;63465:13;:11;:13::i;:::-;141974:15:::1;141992:21;141974:39;;142032:3;142024:21;;:30;142046:7;142024:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;141963:99;141912:150:::0;:::o;143363:308::-;140558:47;143445:8;143429:13;:11;:13::i;:::-;:24;;;;:::i;:::-;:38;;143421:81;;;;;;;;;;;;:::i;:::-;;;;;;;;;140646:12;143521:9;:23;;143513:63;;;;;;;;;;;;:::i;:::-;;;;;;;;;143587:31;143597:10;143609:8;143587:9;:31::i;:::-;143654:8;143642:10;143634:29;;;;;;;;;;;;143363:308;:::o;29399:234::-;29546:8;29494:18;:39;29513:19;:17;:19::i;:::-;29494:39;;;;;;;;;;;;;;;:49;29534:8;29494:49;;;;;;;;;;;;;;;;:60;;;;;;;;;;;;;;;;;;29606:8;29570:55;;29585:19;:17;:19::i;:::-;29570:55;;;29616:8;29570:55;;;;;;:::i;:::-;;;;;;;;29399:234;;:::o;37514:416::-;37689:31;37702:4;37708:2;37712:7;37689:12;:31::i;:::-;37753:1;37735:2;:14;;;:19;37731:192;;37774:56;37805:4;37811:2;37815:7;37824:5;37774:30;:56::i;:::-;37769:154;;37851:56;37859:47;;;37851:7;:56::i;:::-;37769:154;37731:192;37514:416;;;;:::o;140612:46::-;140646:12;140612:46;:::o;142524:574::-;142589:13;142628:1;142619:5;;:10;142615:476;;142646:19;142678:1;142668:7;:11;;;;:::i;:::-;142646:33;;142694:17;142714:12;:25;142727:11;142714:25;;;;;;;;;;;142694:45;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;142779:1;142764:3;142758:17;:22;142754:82;;142808:12;142801:19;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;142754:82;142857:12;:25;142870:11;142857:25;;;;;;;;;;;142850:32;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;142615:476;142923:16;142931:7;142923;:16::i;:::-;142915:76;;;;;;;;;;;;:::i;:::-;;;;;;;;;143037:13;143052:25;143069:7;143052:16;:25::i;:::-;143020:58;;;;;;;;;:::i;:::-;;;;;;;;;;;;;143006:73;;142524:574;;;;:::o;142285:109::-;63465:13;:11;:13::i;:::-;142377:9:::1;;142361:13;:25;;;;;;;:::i;:::-;;142285:109:::0;;:::o;29790:164::-;29887:4;29911:18;:25;29930:5;29911:25;;;;;;;;;;;;;;;:35;29937:8;29911:35;;;;;;;;;;;;;;;;;;;;;;;;;29904:42;;29790:164;;;;:::o;143106:249::-;63465:13;:11;:13::i;:::-;140558:47:::1;143203:8;143187:13;:11;:13::i;:::-;:24;;;;:::i;:::-;:38;;143179:81;;;;;;;;;;;;:::i;:::-;;;;;;;;;143271:31;143281:10;143293:8;143271:9;:31::i;:::-;143338:8;143326:10;143318:29;;;;;;;;;;;;143106:249:::0;:::o;64512:220::-;63465:13;:11;:13::i;:::-;64617:1:::1;64597:22;;:8;:22;;::::0;64593:93:::1;;64671:1;64643:31;;;;;;;;;;;:::i;:::-;;;;;;;;64593:93;64696:28;64715:8;64696:18;:28::i;:::-;64512:220:::0;:::o;30212:475::-;30277:11;30324:7;30305:15;:13;:15::i;:::-;:26;30301:379;;30362:17;:15;:17::i;:::-;30352:7;:27;30348:90;;;30388:50;30411:17;:26;30429:7;30411:26;;;;;;;;;;;;30388:22;:50::i;:::-;30381:57;;;;30348:90;30469:13;;30459:7;:23;30455:214;;;30503:14;30536:60;30584:1;30553:17;:26;30571:7;30553:26;;;;;;;;;;;;30544:35;;;30543:42;30536:60;;30587:9;;;;:::i;:::-;;;30536:60;;;30652:1;12054:8;30624:6;:24;:29;30615:38;;30484:185;30455:214;30301:379;30212:475;;;;:::o;60721:165::-;60822:13;60816:4;60809:27;60863:4;60857;60850:18;52136:474;52265:13;52281:16;52289:7;52281;:16::i;:::-;52265:32;;52314:13;:45;;;;;52354:5;52331:28;;:19;:17;:19::i;:::-;:28;;;;52314:45;52310:201;;;52379:44;52396:5;52403:19;:17;:19::i;:::-;52379:16;:44::i;:::-;52374:137;;52444:51;52452:42;;;52444:7;:51::i;:::-;52374:137;52310:201;52556:2;52523:15;:24;52539:7;52523:24;;;;;;;;;;;:30;;;:35;;;;;;;;;;;;;;;;;;52594:7;52590:2;52574:28;;52583:5;52574:28;;;;;;;;;;;;52254:356;52136:474;;;:::o;63744:166::-;63815:12;:10;:12::i;:::-;63804:23;;:7;:5;:7::i;:::-;:23;;;63800:103;;63878:12;:10;:12::i;:::-;63851:40;;;;;;;;;;;:::i;:::-;;;;;;;;63800:103;63744:166::o;141805:101::-;141870:7;141897:1;141890:8;;141805:101;:::o;16292:110::-;16350:7;16377:17;16370:24;;16292:110;:::o;24479:2213::-;24546:14;24596:7;24577:15;:13;:15::i;:::-;:26;24573:2054;;24629:17;:26;24647:7;24629:26;;;;;;;;;;;;24620:35;;24686:17;:15;:17::i;:::-;24676:7;:27;24672:183;;;24728:30;24751:6;24728:22;:30::i;:::-;24760:13;24724:49;24792:47;24800:38;;;24792:7;:47::i;:::-;24672:183;24966:1;24956:6;:11;24952:1292;;25003:13;;24992:7;:24;24988:77;;25018:47;25026:38;;;25018:7;:47::i;:::-;24988:77;25622:607;25700:17;:28;25718:9;;;;;;;25700:28;;;;;;;;;;;;25691:37;;25788:1;25778:6;:11;25774:25;25791:8;25774:25;25854:1;12054:8;25826:6;:24;:29;25822:48;25857:13;25822:48;26162:47;26170:38;;;26162:7;:47::i;:::-;25622:607;;;24952:1292;26599:1;12054:8;26571:6;:24;:29;26567:48;26602:13;26567:48;24573:2054;26637:47;26645:38;;;26637:7;:47::i;:::-;24479:2213;;;;:::o;31999:485::-;32101:27;32130:23;32171:38;32212:15;:24;32228:7;32212:24;;;;;;;;;;;32171:65;;32389:18;32366:41;;32446:19;32440:26;32421:45;;32351:126;31999:485;;;:::o;58702:105::-;58762:7;58789:10;58782:17;;58702:105;:::o;31227:659::-;31376:11;31541:16;31534:5;31530:28;31521:37;;31701:16;31690:9;31686:32;31673:45;;31851:15;31840:9;31837:30;31829:5;31818:9;31815:20;31812:56;31802:66;;31227:659;;;;;:::o;38592:159::-;;;;;:::o;58011:311::-;58146:7;58166:16;12458:3;58192:19;:41;;58166:68;;12458:3;58260:31;58271:4;58277:2;58281:9;58260:10;:31::i;:::-;58252:40;;:62;;58245:69;;;58011:311;;;;;:::o;27240:450::-;27320:14;27488:16;27481:5;27477:28;27468:37;;27665:5;27651:11;27626:23;27622:41;27619:52;27612:5;27609:63;27599:73;;27240:450;;;;:::o;39416:158::-;;;;;:::o;64892:191::-;64966:16;64985:6;;;;;;;;;;;64966:25;;65011:8;65002:6;;:17;;;;;;;;;;;;;;;;;;65066:8;65035:40;;65056:8;65035:40;;;;;;;;;;;;64955:128;64892:191;:::o;47330:112::-;47407:27;47417:2;47421:8;47407:27;;;;;;;;;;;;:9;:27::i;:::-;47330:112;;:::o;40014:691::-;40177:4;40223:2;40198:45;;;40244:19;:17;:19::i;:::-;40265:4;40271:7;40280:5;40198:88;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;40194:504;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;40498:1;40481:6;:13;:18;40477:115;;40520:56;40528:47;;;40520:7;:56::i;:::-;40477:115;40664:6;40658:13;40649:6;40645:2;40641:15;40634:38;40194:504;40367:54;;;40357:64;;;:6;:64;;;;40350:71;;;40014:691;;;;;;:::o;136954:650::-;137010:13;137061:14;137098:1;137078:17;137089:5;137078:10;:17::i;:::-;:21;137061:38;;137114:20;137148:6;137137:18;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;137114:41;;137170:11;137267:6;137263:2;137259:15;137251:6;137247:28;137240:35;;137304:254;137311:4;137304:254;;;137336:5;;;;;;;;137442:10;137437:2;137430:5;137426:14;137421:32;137416:3;137408:46;137500:2;137491:11;;;;;;:::i;:::-;;;;;137534:1;137525:5;:10;137304:254;137521:21;137304:254;137579:6;137572:13;;;;;136954:650;;;:::o;30783:335::-;30853:11;31083:15;31075:6;31071:28;31052:16;31044:6;31040:29;31037:63;31027:73;;30783:335;;;:::o;61588:98::-;61641:7;61668:10;61661:17;;61588:98;:::o;57712:147::-;57849:6;57712:147;;;;;:::o;46459:787::-;46590:19;46596:2;46600:8;46590:5;:19::i;:::-;46669:1;46651:2;:14;;;:19;46647:581;;46691:11;46705:13;;46691:27;;46737:13;46759:8;46753:3;:14;46737:30;;46786:242;46817:62;46856:1;46860:2;46864:7;;;;;;46873:5;46817:30;:62::i;:::-;46812:176;;46908:56;46916:47;;;46908:7;:56::i;:::-;46812:176;47023:3;47015:5;:11;46786:242;;47199:3;47182:13;;:20;47178:34;;47204:8;;;47178:34;46672:556;;46647:581;46459:787;;;:::o;130599:948::-;130652:7;130672:14;130689:1;130672:18;;130739:8;130730:5;:17;130726:106;;130777:8;130768:17;;;;;;:::i;:::-;;;;;130814:2;130804:12;;;;130726:106;130859:8;130850:5;:17;130846:106;;130897:8;130888:17;;;;;;:::i;:::-;;;;;130934:2;130924:12;;;;130846:106;130979:8;130970:5;:17;130966:106;;131017:8;131008:17;;;;;;:::i;:::-;;;;;131054:2;131044:12;;;;130966:106;131099:7;131090:5;:16;131086:103;;131136:7;131127:16;;;;;;:::i;:::-;;;;;131172:1;131162:11;;;;131086:103;131216:7;131207:5;:16;131203:103;;131253:7;131244:16;;;;;;:::i;:::-;;;;;131289:1;131279:11;;;;131203:103;131333:7;131324:5;:16;131320:103;;131370:7;131361:16;;;;;;:::i;:::-;;;;;131406:1;131396:11;;;;131320:103;131450:7;131441:5;:16;131437:68;;131488:1;131478:11;;;;131437:68;131533:6;131526:13;;;130599:948;;;:::o;41167:2399::-;41240:20;41263:13;;41240:36;;41303:1;41291:8;:13;41287:53;;41306:34;41314:25;;;41306:7;:34::i;:::-;41287:53;41353:61;41383:1;41387:2;41391:12;41405:8;41353:21;:61::i;:::-;41887:139;41924:2;41978:33;42001:1;42005:2;42009:1;41978:14;:33::i;:::-;41945:30;41966:8;41945:20;:30::i;:::-;:66;41887:18;:139::i;:::-;41853:17;:31;41871:12;41853:31;;;;;;;;;;;:173;;;;42313:1;11416:2;42283:1;:26;;42282:32;42270:8;:45;42244:18;:22;42263:2;42244:22;;;;;;;;;;;;;;;;:71;;;;;;;;;;;42426:16;12736:14;42461:2;42445:20;;:39;42426:58;;42517:1;42505:8;:13;42501:54;;42520:35;42528:26;;;42520:7;:35::i;:::-;42501:54;42572:11;42601:8;42586:12;:23;42572:37;;42624:15;42642:12;42624:30;;42685:17;:15;:17::i;:::-;42681:1;42675:3;:7;:27;42671:77;;;42704:44;42712:35;;;42704:7;:44::i;:::-;42671:77;42765:676;43184:7;43140:8;43095:1;43029:25;42966:1;42901;42870:358;43436:3;43423:9;;;;;;:16;42765:676;;43473:3;43457:13;:19;;;;41602:1886;;;43498:60;43527:1;43531:2;43535:12;43549:8;43498:20;:60::i;:::-;41229:2337;41167:2399;;:::o;27792:324::-;27862:14;28095:1;28085:8;28082:15;28056:24;28052:46;28042:56;;27792:324;;;:::o;7:75:1:-;40:6;73:2;67:9;57:19;;7:75;:::o;88:117::-;197:1;194;187:12;211:117;320:1;317;310:12;334:149;370:7;410:66;403:5;399:78;388:89;;334:149;;;:::o;489:120::-;561:23;578:5;561:23;:::i;:::-;554:5;551:34;541:62;;599:1;596;589:12;541:62;489:120;:::o;615:137::-;660:5;698:6;685:20;676:29;;714:32;740:5;714:32;:::i;:::-;615:137;;;;:::o;758:327::-;816:6;865:2;853:9;844:7;840:23;836:32;833:119;;;871:79;;:::i;:::-;833:119;991:1;1016:52;1060:7;1051:6;1040:9;1036:22;1016:52;:::i;:::-;1006:62;;962:116;758:327;;;;:::o;1091:90::-;1125:7;1168:5;1161:13;1154:21;1143:32;;1091:90;;;:::o;1187:109::-;1268:21;1283:5;1268:21;:::i;:::-;1263:3;1256:34;1187:109;;:::o;1302:210::-;1389:4;1427:2;1416:9;1412:18;1404:26;;1440:65;1502:1;1491:9;1487:17;1478:6;1440:65;:::i;:::-;1302:210;;;;:::o;1518:99::-;1570:6;1604:5;1598:12;1588:22;;1518:99;;;:::o;1623:169::-;1707:11;1741:6;1736:3;1729:19;1781:4;1776:3;1772:14;1757:29;;1623:169;;;;:::o;1798:139::-;1887:6;1882:3;1877;1871:23;1928:1;1919:6;1914:3;1910:16;1903:27;1798:139;;;:::o;1943:102::-;1984:6;2035:2;2031:7;2026:2;2019:5;2015:14;2011:28;2001:38;;1943:102;;;:::o;2051:377::-;2139:3;2167:39;2200:5;2167:39;:::i;:::-;2222:71;2286:6;2281:3;2222:71;:::i;:::-;2215:78;;2302:65;2360:6;2355:3;2348:4;2341:5;2337:16;2302:65;:::i;:::-;2392:29;2414:6;2392:29;:::i;:::-;2387:3;2383:39;2376:46;;2143:285;2051:377;;;;:::o;2434:313::-;2547:4;2585:2;2574:9;2570:18;2562:26;;2634:9;2628:4;2624:20;2620:1;2609:9;2605:17;2598:47;2662:78;2735:4;2726:6;2662:78;:::i;:::-;2654:86;;2434:313;;;;:::o;2753:77::-;2790:7;2819:5;2808:16;;2753:77;;;:::o;2836:122::-;2909:24;2927:5;2909:24;:::i;:::-;2902:5;2899:35;2889:63;;2948:1;2945;2938:12;2889:63;2836:122;:::o;2964:139::-;3010:5;3048:6;3035:20;3026:29;;3064:33;3091:5;3064:33;:::i;:::-;2964:139;;;;:::o;3109:329::-;3168:6;3217:2;3205:9;3196:7;3192:23;3188:32;3185:119;;;3223:79;;:::i;:::-;3185:119;3343:1;3368:53;3413:7;3404:6;3393:9;3389:22;3368:53;:::i;:::-;3358:63;;3314:117;3109:329;;;;:::o;3444:126::-;3481:7;3521:42;3514:5;3510:54;3499:65;;3444:126;;;:::o;3576:96::-;3613:7;3642:24;3660:5;3642:24;:::i;:::-;3631:35;;3576:96;;;:::o;3678:118::-;3765:24;3783:5;3765:24;:::i;:::-;3760:3;3753:37;3678:118;;:::o;3802:222::-;3895:4;3933:2;3922:9;3918:18;3910:26;;3946:71;4014:1;4003:9;3999:17;3990:6;3946:71;:::i;:::-;3802:222;;;;:::o;4030:122::-;4103:24;4121:5;4103:24;:::i;:::-;4096:5;4093:35;4083:63;;4142:1;4139;4132:12;4083:63;4030:122;:::o;4158:139::-;4204:5;4242:6;4229:20;4220:29;;4258:33;4285:5;4258:33;:::i;:::-;4158:139;;;;:::o;4303:474::-;4371:6;4379;4428:2;4416:9;4407:7;4403:23;4399:32;4396:119;;;4434:79;;:::i;:::-;4396:119;4554:1;4579:53;4624:7;4615:6;4604:9;4600:22;4579:53;:::i;:::-;4569:63;;4525:117;4681:2;4707:53;4752:7;4743:6;4732:9;4728:22;4707:53;:::i;:::-;4697:63;;4652:118;4303:474;;;;;:::o;4783:117::-;4892:1;4889;4882:12;4906:117;5015:1;5012;5005:12;5029:117;5138:1;5135;5128:12;5166:553;5224:8;5234:6;5284:3;5277:4;5269:6;5265:17;5261:27;5251:122;;5292:79;;:::i;:::-;5251:122;5405:6;5392:20;5382:30;;5435:18;5427:6;5424:30;5421:117;;;5457:79;;:::i;:::-;5421:117;5571:4;5563:6;5559:17;5547:29;;5625:3;5617:4;5609:6;5605:17;5595:8;5591:32;5588:41;5585:128;;;5632:79;;:::i;:::-;5585:128;5166:553;;;;;:::o;5725:529::-;5796:6;5804;5853:2;5841:9;5832:7;5828:23;5824:32;5821:119;;;5859:79;;:::i;:::-;5821:119;6007:1;5996:9;5992:17;5979:31;6037:18;6029:6;6026:30;6023:117;;;6059:79;;:::i;:::-;6023:117;6172:65;6229:7;6220:6;6209:9;6205:22;6172:65;:::i;:::-;6154:83;;;;5950:297;5725:529;;;;;:::o;6260:118::-;6347:24;6365:5;6347:24;:::i;:::-;6342:3;6335:37;6260:118;;:::o;6384:222::-;6477:4;6515:2;6504:9;6500:18;6492:26;;6528:71;6596:1;6585:9;6581:17;6572:6;6528:71;:::i;:::-;6384:222;;;;:::o;6612:619::-;6689:6;6697;6705;6754:2;6742:9;6733:7;6729:23;6725:32;6722:119;;;6760:79;;:::i;:::-;6722:119;6880:1;6905:53;6950:7;6941:6;6930:9;6926:22;6905:53;:::i;:::-;6895:63;;6851:117;7007:2;7033:53;7078:7;7069:6;7058:9;7054:22;7033:53;:::i;:::-;7023:63;;6978:118;7135:2;7161:53;7206:7;7197:6;7186:9;7182:22;7161:53;:::i;:::-;7151:63;;7106:118;6612:619;;;;;:::o;7237:329::-;7296:6;7345:2;7333:9;7324:7;7320:23;7316:32;7313:119;;;7351:79;;:::i;:::-;7313:119;7471:1;7496:53;7541:7;7532:6;7521:9;7517:22;7496:53;:::i;:::-;7486:63;;7442:117;7237:329;;;;:::o;7572:116::-;7642:21;7657:5;7642:21;:::i;:::-;7635:5;7632:32;7622:60;;7678:1;7675;7668:12;7622:60;7572:116;:::o;7694:133::-;7737:5;7775:6;7762:20;7753:29;;7791:30;7815:5;7791:30;:::i;:::-;7694:133;;;;:::o;7833:468::-;7898:6;7906;7955:2;7943:9;7934:7;7930:23;7926:32;7923:119;;;7961:79;;:::i;:::-;7923:119;8081:1;8106:53;8151:7;8142:6;8131:9;8127:22;8106:53;:::i;:::-;8096:63;;8052:117;8208:2;8234:50;8276:7;8267:6;8256:9;8252:22;8234:50;:::i;:::-;8224:60;;8179:115;7833:468;;;;;:::o;8307:117::-;8416:1;8413;8406:12;8430:180;8478:77;8475:1;8468:88;8575:4;8572:1;8565:15;8599:4;8596:1;8589:15;8616:281;8699:27;8721:4;8699:27;:::i;:::-;8691:6;8687:40;8829:6;8817:10;8814:22;8793:18;8781:10;8778:34;8775:62;8772:88;;;8840:18;;:::i;:::-;8772:88;8880:10;8876:2;8869:22;8659:238;8616:281;;:::o;8903:129::-;8937:6;8964:20;;:::i;:::-;8954:30;;8993:33;9021:4;9013:6;8993:33;:::i;:::-;8903:129;;;:::o;9038:307::-;9099:4;9189:18;9181:6;9178:30;9175:56;;;9211:18;;:::i;:::-;9175:56;9249:29;9271:6;9249:29;:::i;:::-;9241:37;;9333:4;9327;9323:15;9315:23;;9038:307;;;:::o;9351:148::-;9449:6;9444:3;9439;9426:30;9490:1;9481:6;9476:3;9472:16;9465:27;9351:148;;;:::o;9505:423::-;9582:5;9607:65;9623:48;9664:6;9623:48;:::i;:::-;9607:65;:::i;:::-;9598:74;;9695:6;9688:5;9681:21;9733:4;9726:5;9722:16;9771:3;9762:6;9757:3;9753:16;9750:25;9747:112;;;9778:79;;:::i;:::-;9747:112;9868:54;9915:6;9910:3;9905;9868:54;:::i;:::-;9588:340;9505:423;;;;;:::o;9947:338::-;10002:5;10051:3;10044:4;10036:6;10032:17;10028:27;10018:122;;10059:79;;:::i;:::-;10018:122;10176:6;10163:20;10201:78;10275:3;10267:6;10260:4;10252:6;10248:17;10201:78;:::i;:::-;10192:87;;10008:277;9947:338;;;;:::o;10291:943::-;10386:6;10394;10402;10410;10459:3;10447:9;10438:7;10434:23;10430:33;10427:120;;;10466:79;;:::i;:::-;10427:120;10586:1;10611:53;10656:7;10647:6;10636:9;10632:22;10611:53;:::i;:::-;10601:63;;10557:117;10713:2;10739:53;10784:7;10775:6;10764:9;10760:22;10739:53;:::i;:::-;10729:63;;10684:118;10841:2;10867:53;10912:7;10903:6;10892:9;10888:22;10867:53;:::i;:::-;10857:63;;10812:118;10997:2;10986:9;10982:18;10969:32;11028:18;11020:6;11017:30;11014:117;;;11050:79;;:::i;:::-;11014:117;11155:62;11209:7;11200:6;11189:9;11185:22;11155:62;:::i;:::-;11145:72;;10940:287;10291:943;;;;;;;:::o;11240:474::-;11308:6;11316;11365:2;11353:9;11344:7;11340:23;11336:32;11333:119;;;11371:79;;:::i;:::-;11333:119;11491:1;11516:53;11561:7;11552:6;11541:9;11537:22;11516:53;:::i;:::-;11506:63;;11462:117;11618:2;11644:53;11689:7;11680:6;11669:9;11665:22;11644:53;:::i;:::-;11634:63;;11589:118;11240:474;;;;;:::o;11720:180::-;11768:77;11765:1;11758:88;11865:4;11862:1;11855:15;11889:4;11886:1;11879:15;11906:320;11950:6;11987:1;11981:4;11977:12;11967:22;;12034:1;12028:4;12024:12;12055:18;12045:81;;12111:4;12103:6;12099:17;12089:27;;12045:81;12173:2;12165:6;12162:14;12142:18;12139:38;12136:84;;12192:18;;:::i;:::-;12136:84;11957:269;11906:320;;;:::o;12232:97::-;12291:6;12319:3;12309:13;;12232:97;;;;:::o;12335:141::-;12384:4;12407:3;12399:11;;12430:3;12427:1;12420:14;12464:4;12461:1;12451:18;12443:26;;12335:141;;;:::o;12482:93::-;12519:6;12566:2;12561;12554:5;12550:14;12546:23;12536:33;;12482:93;;;:::o;12581:107::-;12625:8;12675:5;12669:4;12665:16;12644:37;;12581:107;;;;:::o;12694:393::-;12763:6;12813:1;12801:10;12797:18;12836:97;12866:66;12855:9;12836:97;:::i;:::-;12954:39;12984:8;12973:9;12954:39;:::i;:::-;12942:51;;13026:4;13022:9;13015:5;13011:21;13002:30;;13075:4;13065:8;13061:19;13054:5;13051:30;13041:40;;12770:317;;12694:393;;;;;:::o;13093:60::-;13121:3;13142:5;13135:12;;13093:60;;;:::o;13159:142::-;13209:9;13242:53;13260:34;13269:24;13287:5;13269:24;:::i;:::-;13260:34;:::i;:::-;13242:53;:::i;:::-;13229:66;;13159:142;;;:::o;13307:75::-;13350:3;13371:5;13364:12;;13307:75;;;:::o;13388:269::-;13498:39;13529:7;13498:39;:::i;:::-;13559:91;13608:41;13632:16;13608:41;:::i;:::-;13600:6;13593:4;13587:11;13559:91;:::i;:::-;13553:4;13546:105;13464:193;13388:269;;;:::o;13663:73::-;13708:3;13663:73;:::o;13742:189::-;13819:32;;:::i;:::-;13860:65;13918:6;13910;13904:4;13860:65;:::i;:::-;13795:136;13742:189;;:::o;13937:186::-;13997:120;14014:3;14007:5;14004:14;13997:120;;;14068:39;14105:1;14098:5;14068:39;:::i;:::-;14041:1;14034:5;14030:13;14021:22;;13997:120;;;13937:186;;:::o;14129:543::-;14230:2;14225:3;14222:11;14219:446;;;14264:38;14296:5;14264:38;:::i;:::-;14348:29;14366:10;14348:29;:::i;:::-;14338:8;14334:44;14531:2;14519:10;14516:18;14513:49;;;14552:8;14537:23;;14513:49;14575:80;14631:22;14649:3;14631:22;:::i;:::-;14621:8;14617:37;14604:11;14575:80;:::i;:::-;14234:431;;14219:446;14129:543;;;:::o;14678:117::-;14732:8;14782:5;14776:4;14772:16;14751:37;;14678:117;;;;:::o;14801:169::-;14845:6;14878:51;14926:1;14922:6;14914:5;14911:1;14907:13;14878:51;:::i;:::-;14874:56;14959:4;14953;14949:15;14939:25;;14852:118;14801:169;;;;:::o;14975:295::-;15051:4;15197:29;15222:3;15216:4;15197:29;:::i;:::-;15189:37;;15259:3;15256:1;15252:11;15246:4;15243:21;15235:29;;14975:295;;;;:::o;15275:1403::-;15399:44;15439:3;15434;15399:44;:::i;:::-;15508:18;15500:6;15497:30;15494:56;;;15530:18;;:::i;:::-;15494:56;15574:38;15606:4;15600:11;15574:38;:::i;:::-;15659:67;15719:6;15711;15705:4;15659:67;:::i;:::-;15753:1;15782:2;15774:6;15771:14;15799:1;15794:632;;;;16470:1;16487:6;16484:84;;;16543:9;16538:3;16534:19;16521:33;16512:42;;16484:84;16594:67;16654:6;16647:5;16594:67;:::i;:::-;16588:4;16581:81;16443:229;15764:908;;15794:632;15846:4;15842:9;15834:6;15830:22;15880:37;15912:4;15880:37;:::i;:::-;15939:1;15953:215;15967:7;15964:1;15961:14;15953:215;;;16053:9;16048:3;16044:19;16031:33;16023:6;16016:49;16104:1;16096:6;16092:14;16082:24;;16151:2;16140:9;16136:18;16123:31;;15990:4;15987:1;15983:12;15978:17;;15953:215;;;16196:6;16187:7;16184:19;16181:186;;;16261:9;16256:3;16252:19;16239:33;16304:48;16346:4;16338:6;16334:17;16323:9;16304:48;:::i;:::-;16296:6;16289:64;16204:163;16181:186;16413:1;16409;16401:6;16397:14;16393:22;16387:4;16380:36;15801:625;;;15764:908;;15374:1304;;;15275:1403;;;:::o;16684:180::-;16732:77;16729:1;16722:88;16829:4;16826:1;16819:15;16853:4;16850:1;16843:15;16870:191;16910:3;16929:20;16947:1;16929:20;:::i;:::-;16924:25;;16963:20;16981:1;16963:20;:::i;:::-;16958:25;;17006:1;17003;16999:9;16992:16;;17027:3;17024:1;17021:10;17018:36;;;17034:18;;:::i;:::-;17018:36;16870:191;;;;:::o;17067:180::-;17207:32;17203:1;17195:6;17191:14;17184:56;17067:180;:::o;17253:366::-;17395:3;17416:67;17480:2;17475:3;17416:67;:::i;:::-;17409:74;;17492:93;17581:3;17492:93;:::i;:::-;17610:2;17605:3;17601:12;17594:19;;17253:366;;;:::o;17625:419::-;17791:4;17829:2;17818:9;17814:18;17806:26;;17878:9;17872:4;17868:20;17864:1;17853:9;17849:17;17842:47;17906:131;18032:4;17906:131;:::i;:::-;17898:139;;17625:419;;;:::o;18050:177::-;18190:29;18186:1;18178:6;18174:14;18167:53;18050:177;:::o;18233:366::-;18375:3;18396:67;18460:2;18455:3;18396:67;:::i;:::-;18389:74;;18472:93;18561:3;18472:93;:::i;:::-;18590:2;18585:3;18581:12;18574:19;;18233:366;;;:::o;18605:419::-;18771:4;18809:2;18798:9;18794:18;18786:26;;18858:9;18852:4;18848:20;18844:1;18833:9;18829:17;18822:47;18886:131;19012:4;18886:131;:::i;:::-;18878:139;;18605:419;;;:::o;19030:180::-;19078:77;19075:1;19068:88;19175:4;19172:1;19165:15;19199:4;19196:1;19189:15;19216:176;19248:1;19265:20;19283:1;19265:20;:::i;:::-;19260:25;;19299:20;19317:1;19299:20;:::i;:::-;19294:25;;19338:1;19328:35;;19343:18;;:::i;:::-;19328:35;19384:1;19381;19377:9;19372:14;;19216:176;;;;:::o;19398:234::-;19538:34;19534:1;19526:6;19522:14;19515:58;19607:17;19602:2;19594:6;19590:15;19583:42;19398:234;:::o;19638:366::-;19780:3;19801:67;19865:2;19860:3;19801:67;:::i;:::-;19794:74;;19877:93;19966:3;19877:93;:::i;:::-;19995:2;19990:3;19986:12;19979:19;;19638:366;;;:::o;20010:419::-;20176:4;20214:2;20203:9;20199:18;20191:26;;20263:9;20257:4;20253:20;20249:1;20238:9;20234:17;20227:47;20291:131;20417:4;20291:131;:::i;:::-;20283:139;;20010:419;;;:::o;20435:148::-;20537:11;20574:3;20559:18;;20435:148;;;;:::o;20613:874::-;20716:3;20753:5;20747:12;20782:36;20808:9;20782:36;:::i;:::-;20834:89;20916:6;20911:3;20834:89;:::i;:::-;20827:96;;20954:1;20943:9;20939:17;20970:1;20965:166;;;;21145:1;21140:341;;;;20932:549;;20965:166;21049:4;21045:9;21034;21030:25;21025:3;21018:38;21111:6;21104:14;21097:22;21089:6;21085:35;21080:3;21076:45;21069:52;;20965:166;;21140:341;21207:38;21239:5;21207:38;:::i;:::-;21267:1;21281:154;21295:6;21292:1;21289:13;21281:154;;;21369:7;21363:14;21359:1;21354:3;21350:11;21343:35;21419:1;21410:7;21406:15;21395:26;;21317:4;21314:1;21310:12;21305:17;;21281:154;;;21464:6;21459:3;21455:16;21448:23;;21147:334;;20932:549;;20720:767;;20613:874;;;;:::o;21493:390::-;21599:3;21627:39;21660:5;21627:39;:::i;:::-;21682:89;21764:6;21759:3;21682:89;:::i;:::-;21675:96;;21780:65;21838:6;21833:3;21826:4;21819:5;21815:16;21780:65;:::i;:::-;21870:6;21865:3;21861:16;21854:23;;21603:280;21493:390;;;;:::o;21889:429::-;22066:3;22088:92;22176:3;22167:6;22088:92;:::i;:::-;22081:99;;22197:95;22288:3;22279:6;22197:95;:::i;:::-;22190:102;;22309:3;22302:10;;21889:429;;;;;:::o;22324:171::-;22363:3;22386:24;22404:5;22386:24;:::i;:::-;22377:33;;22432:4;22425:5;22422:15;22419:41;;22440:18;;:::i;:::-;22419:41;22487:1;22480:5;22476:13;22469:20;;22324:171;;;:::o;22501:98::-;22552:6;22586:5;22580:12;22570:22;;22501:98;;;:::o;22605:168::-;22688:11;22722:6;22717:3;22710:19;22762:4;22757:3;22753:14;22738:29;;22605:168;;;;:::o;22779:373::-;22865:3;22893:38;22925:5;22893:38;:::i;:::-;22947:70;23010:6;23005:3;22947:70;:::i;:::-;22940:77;;23026:65;23084:6;23079:3;23072:4;23065:5;23061:16;23026:65;:::i;:::-;23116:29;23138:6;23116:29;:::i;:::-;23111:3;23107:39;23100:46;;22869:283;22779:373;;;;:::o;23158:640::-;23353:4;23391:3;23380:9;23376:19;23368:27;;23405:71;23473:1;23462:9;23458:17;23449:6;23405:71;:::i;:::-;23486:72;23554:2;23543:9;23539:18;23530:6;23486:72;:::i;:::-;23568;23636:2;23625:9;23621:18;23612:6;23568:72;:::i;:::-;23687:9;23681:4;23677:20;23672:2;23661:9;23657:18;23650:48;23715:76;23786:4;23777:6;23715:76;:::i;:::-;23707:84;;23158:640;;;;;;;:::o;23804:141::-;23860:5;23891:6;23885:13;23876:22;;23907:32;23933:5;23907:32;:::i;:::-;23804:141;;;;:::o;23951:349::-;24020:6;24069:2;24057:9;24048:7;24044:23;24040:32;24037:119;;;24075:79;;:::i;:::-;24037:119;24195:1;24220:63;24275:7;24266:6;24255:9;24251:22;24220:63;:::i;:::-;24210:73;;24166:127;23951:349;;;;:::o
Swarm Source
ipfs://11dd49e8360989662d392515d8b3d72cd66eafad1dace3a8e77a823a9198607c
[ 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.