CRC-721
Overview
Max Total Supply
788 Bundle
Holders
396
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract
Balance
2 BundleLoading...
Loading
Loading...
Loading
Loading...
Loading
Contract Name:
Bundle
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import "erc721a/contracts/ERC721A.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./IBundle2.sol"; import "./conduit/ConduitLib.sol"; abstract contract Market { function cancelActive(address _nft, uint256 _id, address _seller) virtual external; function transferBulkServer(address[] calldata _tokens, uint256[] calldata _ids, address _from, address _to) virtual public; function makeListingServer(address _seller, address _nft, uint256 _id, uint256 _price) virtual external; } contract Bundle is IBundle2, IERC1155Receiver, ERC721A, ReentrancyGuard, Ownable { using ERC165Checker for address; mapping(uint256 => address[]) bundleAddresses; mapping(uint256 => uint256[]) bundleIds; string private uri = "data:application/json;base64,eyJuYW1lIiA6ICJORlQgQnVuZGxlIiwgImRlc2NyaXB0aW9uIiA6ICJNYWRlIGJ5IGh0dHBzOi8vYXBwLmViaXN1c2JheS5jb20ifQ=="; Market marketContract; constructor(address _market) ERC721A("NFT Bundle", "Bundle"){ marketContract = Market(_market); } function wrapAndList(address[] calldata _tokens, uint256[] calldata _ids, string calldata _name, string calldata _desc, uint256 _price) external{ uint _id = _wrap(_tokens, _ids, _name, _desc); if(!isApprovedForAll(msg.sender, address(marketContract))){ setApprovalForAll(address(marketContract), true); } marketContract.makeListingServer(msg.sender, address(this), _id, _price); } function _wrap(address[] calldata _tokens, uint256[] calldata _ids, string calldata _name, string calldata _desc) private returns(uint){ uint256 _tokenId = _nextTokenId(); _mint(msg.sender, 1); bundleAddresses[_tokenId] = _tokens; bundleIds[_tokenId] = _ids; wrapBundle(msg.sender, address(this), _tokenId); emit BundleCreated(_tokenId, _tokens, _ids, _name, _desc); return _tokenId; } function wrap(address[] calldata _tokens, uint256[] calldata _ids, string calldata _name, string calldata _desc) external override{ _wrap(_tokens, _ids, _name, _desc); } function wrapBundle(address _from, address _to, uint256 _tokenId) private { uint256[] memory _ids = bundleIds[_tokenId]; address[] memory _tokens = bundleAddresses[_tokenId]; uint256 len = _tokens.length; require(len == _ids.length, "invalid length"); marketContract.transferBulkServer(_tokens, _ids, _from, _to); for (uint256 i = 0; i < len; i ++) { address _token = _tokens[i]; uint _id = _ids[i]; require(!isBundle(_token), "no recursive wrap"); marketContract.cancelActive(_token, _id, msg.sender); } } function unWrapBundle(address _to, uint256 _tokenId) private nonReentrant { uint256[] memory _ids = bundleIds[_tokenId]; address[] memory _tokens = bundleAddresses[_tokenId]; uint256 len = _tokens.length; for(uint i = 0; i < len; i++){ if (isERC1155(_tokens[i])) { IERC1155(_tokens[i]).safeTransferFrom(address(this), _to, _ids[i], 1, ""); } else if (isERC721(_tokens[i])) { IERC721(_tokens[i]).transferFrom(address(this), _to, _ids[i]); } } } function contents(uint256 _id) external view override returns (address[] memory, uint[] memory) { return (bundleAddresses[_id], bundleIds[_id]); } function unwrap(uint _tokenId) external override { require(ownerOf(_tokenId) == msg.sender, "not owner"); marketContract.cancelActive(address(this), _tokenId, msg.sender); _burn(_tokenId); unWrapBundle(msg.sender, _tokenId); delete bundleAddresses[_tokenId]; delete bundleIds[_tokenId]; emit BundleDestroyed(_tokenId); } function tokenURI(uint256 _tokenId) public view override returns (string memory) { require(_exists(_tokenId),"ERC721Metadata: URI query for nonexistent token"); return uri; } function isERC721(address _contract) internal view returns(bool){ return _contract.supportsInterface(type(IERC721).interfaceId); } function isERC1155(address _contract) internal view returns(bool){ return _contract.supportsInterface(type(IERC1155).interfaceId); } function isBundle(address _contract) internal view returns(bool){ return _contract.supportsInterface(type(IBundle2).interfaceId); } function onERC1155Received( address operator, address, uint256, uint256, bytes calldata ) external virtual override returns (bytes4) { require(operator == address(marketContract), "invalid operator"); return IERC1155Receiver.onERC1155Received.selector; } function onERC1155BatchReceived( address, address, uint256[] calldata, uint256[] calldata, bytes calldata ) external virtual override returns (bytes4) { revert("batches not accepted"); } function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721A) returns (bool){ return interfaceId == type(IBundle2).interfaceId || ERC721A.supportsInterface(interfaceId); } function setUri(string calldata _uri) external onlyOwner{ uri = _uri; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364). struct TokenApprovalRef { address value; } // ============================================================= // CONSTANTS // ============================================================= // Mask of an entry in packed address data. uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant _BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant _BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant _BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant _BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant _BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant _BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with {_mintERC2309}. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} // is required to cause an overflow, which is unrealistic. uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // STORAGE // ============================================================= // The next token ID to be minted. uint256 private _currentIndex; // The number of tokens burned. uint256 private _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. // See {_packedOwnershipOf} implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` mapping(uint256 => uint256) private _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) private _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => TokenApprovalRef) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // ============================================================= // CONSTRUCTOR // ============================================================= constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID. * To change the starting token ID, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view virtual returns (uint256) { return _currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() public view virtual override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than `_currentIndex - _startTokenId()` times. unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { return _currentIndex - _startTokenId(); } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return _burnCounter; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(_packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal virtual { uint256 packed = _packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); _packedAddressData[owner] = packed; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes // of the XOR of all function selectors in the interface. // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _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 Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr) if (curr < _currentIndex) { uint256 packed = _packedOwnerships[curr]; // If not burned. if (packed & _BITMASK_BURNED == 0) { // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `curr` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. while (packed == 0) { packed = _packedOwnerships[--curr]; } return packed; } } } revert OwnerQueryForNonexistentToken(); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) public payable virtual override { address owner = ownerOf(tokenId); if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId].value; } /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) public virtual override { _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && // If within bounds, _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned. } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`. assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approvedAddressSlot) } } // ============================================================= // TRANSFER OPERATIONS // ============================================================= /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) public payable virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // We can directly increment and decrement the balances. --_packedAddressData[from]; // Updates: `balance -= 1`. ++_packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public payable virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public payable virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @dev Hook that is called before a set of serially-ordered token IDs * are about to be transferred. This includes minting. * And also called before burning one token. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token IDs * have been transferred. This includes minting. * And also called after one token has been burned. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns whether the call correctly returned the expected magic value. */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns ( bytes4 retval ) { return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); uint256 toMasked; uint256 end = startTokenId + quantity; // Use assembly to loop and emit the `Transfer` event for gas savings. // The duplicated `log4` removes an extra check and reduces stack juggling. // The assembly, together with the surrounding Solidity code, have been // delicately arranged to nudge the compiler into producing optimized opcodes. assembly { // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. toMasked := and(to, _BITMASK_ADDRESS) // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. startTokenId // `tokenId`. ) // The `iszero(eq(,))` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. // The compiler will optimize the `iszero` away for performance. for { let tokenId := add(startTokenId, 1) } iszero(eq(tokenId, end)) { tokenId := add(tokenId, 1) } { // Emit the `Transfer` event. Similar to above. log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId) } } if (toMasked == 0) revert MintToZeroAddress(); _currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); _currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = _currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (index < end); // Reentrancy protection. if (_currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = _packedOwnerships[index]; if (packed == 0) revert OwnershipNotInitializedForExtraData(); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); _packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _extraData( address from, address to, uint24 previousExtraData ) internal view virtual returns (uint24) {} /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString(uint256 value) internal pure virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. let m := add(mload(0x40), 0xa0) // Update the free memory pointer to allocate. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @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 have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.2) (utils/introspection/ERC165Checker.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Library used to query support of an interface declared via {IERC165}. * * Note that these functions return the actual result of the query: they do not * `revert` if an interface is not supported. It is up to the caller to decide * what to do in these cases. */ library ERC165Checker { // As per the EIP-165 spec, no interface should ever match 0xffffffff bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff; /** * @dev Returns true if `account` supports the {IERC165} interface, */ function supportsERC165(address account) internal view returns (bool) { // Any contract that implements ERC165 must explicitly indicate support of // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid return _supportsERC165Interface(account, type(IERC165).interfaceId) && !_supportsERC165Interface(account, _INTERFACE_ID_INVALID); } /** * @dev Returns true if `account` supports the interface defined by * `interfaceId`. Support for {IERC165} itself is queried automatically. * * See {IERC165-supportsInterface}. */ function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) { // query support of both ERC165 as per the spec and support of _interfaceId return supportsERC165(account) && _supportsERC165Interface(account, interfaceId); } /** * @dev Returns a boolean array where each value corresponds to the * interfaces passed in and whether they're supported or not. This allows * you to batch check interfaces for a contract where your expectation * is that some interfaces may not be supported. * * See {IERC165-supportsInterface}. * * _Available since v3.4._ */ function getSupportedInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool[] memory) { // an array of booleans corresponding to interfaceIds and whether they're supported or not bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length); // query support of ERC165 itself if (supportsERC165(account)) { // query support of each interface in interfaceIds for (uint256 i = 0; i < interfaceIds.length; i++) { interfaceIdsSupported[i] = _supportsERC165Interface(account, interfaceIds[i]); } } return interfaceIdsSupported; } /** * @dev Returns true if `account` supports all the interfaces defined in * `interfaceIds`. Support for {IERC165} itself is queried automatically. * * Batch-querying can lead to gas savings by skipping repeated checks for * {IERC165} support. * * See {IERC165-supportsInterface}. */ function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) { // query support of ERC165 itself if (!supportsERC165(account)) { return false; } // query support of each interface in _interfaceIds for (uint256 i = 0; i < interfaceIds.length; i++) { if (!_supportsERC165Interface(account, interfaceIds[i])) { return false; } } // all interfaces supported return true; } /** * @notice Query if a contract implements an interface, does not check ERC165 support * @param account The address of the contract to query for support of an interface * @param interfaceId The interface identifier, as specified in ERC-165 * @return true if the contract at account indicates support of the interface with * identifier interfaceId, false otherwise * @dev Assumes that account contains a contract that supports ERC165, otherwise * the behavior of this method is undefined. This precondition can be checked * with {supportsERC165}. * Interface identification is specified in ERC-165. */ function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) { // prepare call bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId); // perform static call bool success; uint256 returnSize; uint256 returnValue; assembly { success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20) returnSize := returndatasize() returnValue := mload(0x00) } return success && returnSize >= 0x20 && returnValue > 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev 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 { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface IBundle2 { event BundleCreated(uint indexed id, address[] contracts, uint[] ids, string name, string desc); event BundleDestroyed(uint indexed id) ; function wrap(address[] calldata _tokens, uint256[] calldata _ids, string calldata _name, string calldata desc) external; function contents(uint256 _id) external view returns (address[] memory, uint[] memory); function unwrap(uint _id) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; enum ConduitItemType { NATIVE, // unused ERC20, ERC721, ERC1155 } struct ConduitTransfer { ConduitItemType itemType; address token; address from; address to; uint256 identifier; uint256 amount; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721A { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the * ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitializedForExtraData(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables * (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, * checking first that contract recipients are aware of the ERC721 protocol * to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move * this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external payable; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Transfers `tokenId` from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} * whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external payable; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) external view returns (bool); // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_market","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"contracts","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"desc","type":"string"}],"name":"BundleCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"BundleDestroyed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"contents","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"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":"string","name":"_uri","type":"string"}],"name":"setUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"unwrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_desc","type":"string"}],"name":"wrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_desc","type":"string"},{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"wrapAndList","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
61014060405260856080818152906200273360a03980516200002a91600c9160209091019062000150565b503480156200003857600080fd5b50604051620027b8380380620027b88339810160408190526200005b91620001f6565b604080518082018252600a8152694e46542042756e646c6560b01b60208083019182528351808501909452600684526542756e646c6560d01b908401528151919291620000ab9160029162000150565b508051620000c190600390602084019062000150565b506000805550506001600855620000d833620000fe565b600d80546001600160a01b0319166001600160a01b039290921691909117905562000263565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200015e9062000226565b90600052602060002090601f016020900481019282620001825760008555620001cd565b82601f106200019d57805160ff1916838001178555620001cd565b82800160010185558215620001cd579182015b82811115620001cd578251825591602001919060010190620001b0565b50620001db929150620001df565b5090565b5b80821115620001db5760008155600101620001e0565b60006020828403121562000208578081fd5b81516001600160a01b03811681146200021f578182fd5b9392505050565b600181811c908216806200023b57607f821691505b602082108114156200025d57634e487b7160e01b600052602260045260246000fd5b50919050565b6124c080620002736000396000f3fe60806040526004361061014b5760003560e01c80638da5cb5b116100b6578063bc197c811161006f578063bc197c8114610386578063c87b56dd146103bf578063de0e9a3e146103df578063e985e9c5146103ff578063f23a6e6114610448578063f2fde38b1461046857600080fd5b80638da5cb5b146102d257806395d89b41146102f05780639b642de114610305578063a22cb46514610325578063b5ecf91214610345578063b88d4fde1461037357600080fd5b806323b872dd1161010857806323b872dd1461023757806342842e0e1461024a5780636352211e1461025d5780636740aa621461027d57806370a082311461029d578063715018a6146102bd57600080fd5b806301ffc9a71461015057806306fdde0314610185578063081812fc146101a7578063095ea7b3146101df57806310104595146101f457806318160ddd14610214575b600080fd5b34801561015c57600080fd5b5061017061016b3660046120e2565b610488565b60405190151581526020015b60405180910390f35b34801561019157600080fd5b5061019a6104b3565b60405161017c91906123c9565b3480156101b357600080fd5b506101c76101c236600461215a565b610545565b6040516001600160a01b03909116815260200161017c565b6101f26101ed366004611f54565b610589565b005b34801561020057600080fd5b506101f261020f36600461201b565b610629565b34801561022057600080fd5b50600154600054035b60405190815260200161017c565b6101f2610245366004611d94565b610700565b6101f2610258366004611d94565b610889565b34801561026957600080fd5b506101c761027836600461215a565b6108a9565b34801561028957600080fd5b506101f2610298366004611f7d565b6108b4565b3480156102a957600080fd5b506102296102b8366004611c91565b6108cf565b3480156102c957600080fd5b506101f261091e565b3480156102de57600080fd5b506009546001600160a01b03166101c7565b3480156102fc57600080fd5b5061019a610932565b34801561031157600080fd5b506101f261032036600461211a565b610941565b34801561033157600080fd5b506101f2610340366004611f1a565b610955565b34801561035157600080fd5b5061036561036036600461215a565b6109c1565b60405161017c929190612351565b6101f2610381366004611dcf565b610a90565b34801561039257600080fd5b506103a66103a1366004611cdd565b610ada565b6040516001600160e01b0319909116815260200161017c565b3480156103cb57600080fd5b5061019a6103da36600461215a565b610b21565b3480156103eb57600080fd5b506101f26103fa36600461215a565b610c22565b34801561040b57600080fd5b5061017061041a366004611cab565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b34801561045457600080fd5b506103a6610463366004611ea4565b610d47565b34801561047457600080fd5b506101f2610483366004611c91565b610dad565b60006001600160e01b0319821663065164a760e11b14806104ad57506104ad82610e26565b92915050565b6060600280546104c2906123dc565b80601f01602080910402602001604051908101604052809291908181526020018280546104ee906123dc565b801561053b5780601f106105105761010080835404028352916020019161053b565b820191906000526020600020905b81548152906001019060200180831161051e57829003601f168201915b5050505050905090565b600061055082610e74565b61056d576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610594826108a9565b9050336001600160a01b038216146105cd576105b0813361041a565b6105cd576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600061063b8a8a8a8a8a8a8a8a610e9b565b600d543360009081526007602090815260408083206001600160a01b039094168352929052205490915060ff1661068357600d54610683906001600160a01b03166001610955565b600d54604051635ee32fef60e01b815233600482015230602482015260448101839052606481018490526001600160a01b0390911690635ee32fef90608401600060405180830381600087803b1580156106dc57600080fd5b505af11580156106f0573d6000803e3d6000fd5b5050505050505050505050505050565b600061070b82610f46565b9050836001600160a01b0316816001600160a01b03161461073e5760405162a1148160e81b815260040160405180910390fd5b6000828152600660205260409020805461076a8187335b6001600160a01b039081169116811491141790565b61079557610778863361041a565b61079557604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0385166107bc57604051633a954ecd60e21b815260040160405180910390fd5b80156107c757600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040902055600160e11b831661085257600184016000818152600460205260409020546108505760005481146108505760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b031660008051602061246b83398151915260405160405180910390a4505050505050565b6108a483838360405180602001604052806000815250610a90565b505050565b60006104ad82610f46565b6108c48888888888888888610e9b565b505050505050505050565b60006001600160a01b0382166108f8576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b610926610fae565b6109306000611008565b565b6060600380546104c2906123dc565b610949610fae565b6108a4600c8383611aa7565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000818152600a60209081526040808320600b835292819020835482518185028101850190935280835260609485949093918491830182828015610a2e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a10575b5050505050915080805480602002602001604051908101604052809291908181526020018280548015610a8057602002820191906000526020600020905b815481526020019060010190808311610a6c575b5050505050905091509150915091565b610a9b848484610700565b6001600160a01b0383163b15610ad457610ab78484848461105a565b610ad4576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b60405162461bcd60e51b815260206004820152601460248201527318985d18da195cc81b9bdd081858d8d95c1d195960621b60448201526000906064015b60405180910390fd5b6060610b2c82610e74565b610b905760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b18565b600c8054610b9d906123dc565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc9906123dc565b8015610c165780601f10610beb57610100808354040283529160200191610c16565b820191906000526020600020905b815481529060010190602001808311610bf957829003601f168201915b50505050509050919050565b33610c2c826108a9565b6001600160a01b031614610c6e5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610b18565b600d5460405163dfa3d77360e01b8152306004820152602481018390523360448201526001600160a01b039091169063dfa3d77390606401600060405180830381600087803b158015610cc057600080fd5b505af1158015610cd4573d6000803e3d6000fd5b50505050610ce181611151565b610ceb338261115c565b6000818152600a60205260408120610d0291611b2b565b6000818152600b60205260408120610d1991611b2b565b60405181907f0e0c25745e742567b4c6a72c8ec05b377f188ef1b7fe11711fdd579a533921f090600090a250565b600d546000906001600160a01b03888116911614610d9a5760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b21037b832b930ba37b960811b6044820152606401610b18565b5063f23a6e6160e01b9695505050505050565b610db5610fae565b6001600160a01b038116610e1a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b18565b610e2381611008565b50565b60006301ffc9a760e01b6001600160e01b031983161480610e5757506380ac58cd60e01b6001600160e01b03198316145b806104ad5750506001600160e01b031916635b5e139f60e01b1490565b60008054821080156104ad575050600090815260046020526040902054600160e01b161590565b600080610ea760005490565b9050610eb43360016114c8565b6000818152600a60205260409020610ecd908b8b611b49565b506000818152600b60205260409020610ee7908989611b9c565b50610ef333308361159b565b807f69347b2a9baaf85902362f6ab4575189284cf72a71d6cb43ff7a7b201baec2708b8b8b8b8b8b8b8b604051610f31989796959493929190612297565b60405180910390a29998505050505050505050565b600081600054811015610f9557600081815260046020526040902054600160e01b8116610f93575b80610f8c575060001901600081815260046020526040902054610f6e565b9392505050565b505b604051636f96cda160e11b815260040160405180910390fd5b6009546001600160a01b031633146109305760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b18565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061108f90339089908890889060040161225a565b602060405180830381600087803b1580156110a957600080fd5b505af19250505080156110d9575060408051601f3d908101601f191682019092526110d6918101906120fe565b60015b611134573d808015611107576040519150601f19603f3d011682016040523d82523d6000602084013e61110c565b606091505b50805161112c576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b610e2381600061184e565b600260085414156111af5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b18565b60026008556000818152600b602090815260408083208054825181850281018501909352808352919290919083018282801561120a57602002820191906000526020600020905b8154815260200190600101908083116111f6575b505050505090506000600a600084815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561127a57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161125c575b505083519394506000925050505b818110156114bb576112c08382815181106112b357634e487b7160e01b600052603260045260246000fd5b602002602001015161197f565b156113a9578281815181106112e557634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031663f242432a308887858151811061131d57634e487b7160e01b600052603260045260246000fd5b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526001606482015260a06084820152600060a482015260c401600060405180830381600087803b15801561138c57600080fd5b505af11580156113a0573d6000803e3d6000fd5b505050506114a9565b6113d98382815181106113cc57634e487b7160e01b600052603260045260246000fd5b602002602001015161199b565b156114a9578281815181106113fe57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166323b872dd308887858151811061143657634e487b7160e01b600052603260045260246000fd5b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b15801561149057600080fd5b505af11580156114a4573d6000803e3d6000fd5b505050505b806114b381612417565b915050611288565b5050600160085550505050565b600054816114e95760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b1783179055828401908390839060008051602061246b8339815191528180a4600183015b818114611574578083600060008051602061246b833981519152600080a460010161154e565b508161159257604051622e076360e81b815260040160405180910390fd5b60005550505050565b6000818152600b60209081526040808320805482518185028101850190935280835291929091908301828280156115f157602002820191906000526020600020905b8154815260200190600101908083116115dd575b505050505090506000600a600084815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561166157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611643575b50505050509050600081519050825181146116af5760405162461bcd60e51b815260206004820152600e60248201526d0d2dcecc2d8d2c840d8cadccee8d60931b6044820152606401610b18565b600d54604051631747466d60e21b81526001600160a01b0390911690635d1d19b4906116e590859087908b908b9060040161237f565b600060405180830381600087803b1580156116ff57600080fd5b505af1158015611713573d6000803e3d6000fd5b5050505060005b8181101561184557600083828151811061174457634e487b7160e01b600052603260045260246000fd5b60200260200101519050600085838151811061177057634e487b7160e01b600052603260045260246000fd5b60200260200101519050611783826119b7565b156117c45760405162461bcd60e51b815260206004820152601160248201527006e6f20726563757273697665207772617607c1b6044820152606401610b18565b600d5460405163dfa3d77360e01b81526001600160a01b038481166004830152602482018490523360448301529091169063dfa3d77390606401600060405180830381600087803b15801561181857600080fd5b505af115801561182c573d6000803e3d6000fd5b505050505050808061183d90612417565b91505061171a565b50505050505050565b600061185983610f46565b90508060008061187786600090815260066020526040902080549091565b9150915084156118b75761188c818433610755565b6118b75761189a833361041a565b6118b757604051632ce44b5f60e11b815260040160405180910390fd5b80156118c257600082555b6001600160a01b038316600081815260056020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b17600360e01b17600087815260046020526040902055600160e11b841661194957600186016000818152600460205260409020546119475760005481146119475760008181526004602052604090208590555b505b60405186906000906001600160a01b0386169060008051602061246b833981519152908390a45050600180548101905550505050565b60006104ad6001600160a01b038316636cdb3d1360e11b6119cf565b60006104ad6001600160a01b0383166380ac58cd60e01b6119cf565b60006104ad6001600160a01b03831663065164a760e11b5b60006119da836119eb565b8015610f8c5750610f8c8383611a1e565b60006119fe826301ffc9a760e01b611a1e565b80156104ad5750611a17826001600160e01b0319611a1e565b1592915050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d91506000519050828015611a90575060208210155b8015611a9c5750600081115b979650505050505050565b828054611ab3906123dc565b90600052602060002090601f016020900481019282611ad55760008555611b1b565b82601f10611aee5782800160ff19823516178555611b1b565b82800160010185558215611b1b579182015b82811115611b1b578235825591602001919060010190611b00565b50611b27929150611bd6565b5090565b5080546000825590600052602060002090810190610e239190611bd6565b828054828255906000526020600020908101928215611b1b579160200282015b82811115611b1b5781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190611b69565b828054828255906000526020600020908101928215611b1b5791602002820182811115611b1b578235825591602001919060010190611b00565b5b80821115611b275760008155600101611bd7565b80356001600160a01b0381168114611c0257600080fd5b919050565b60008083601f840112611c18578081fd5b50813567ffffffffffffffff811115611c2f578182fd5b6020830191508360208260051b8501011115611c4a57600080fd5b9250929050565b60008083601f840112611c62578182fd5b50813567ffffffffffffffff811115611c79578182fd5b602083019150836020828501011115611c4a57600080fd5b600060208284031215611ca2578081fd5b610f8c82611beb565b60008060408385031215611cbd578081fd5b611cc683611beb565b9150611cd460208401611beb565b90509250929050565b60008060008060008060008060a0898b031215611cf8578384fd5b611d0189611beb565b9750611d0f60208a01611beb565b9650604089013567ffffffffffffffff80821115611d2b578586fd5b611d378c838d01611c07565b909850965060608b0135915080821115611d4f578586fd5b611d5b8c838d01611c07565b909650945060808b0135915080821115611d73578384fd5b50611d808b828c01611c51565b999c989b5096995094979396929594505050565b600080600060608486031215611da8578283fd5b611db184611beb565b9250611dbf60208501611beb565b9150604084013590509250925092565b60008060008060808587031215611de4578384fd5b611ded85611beb565b9350611dfb60208601611beb565b925060408501359150606085013567ffffffffffffffff80821115611e1e578283fd5b818701915087601f830112611e31578283fd5b813581811115611e4357611e4361243e565b604051601f8201601f19908116603f01168101908382118183101715611e6b57611e6b61243e565b816040528281528a6020848701011115611e83578586fd5b82602086016020830137918201602001949094529598949750929550505050565b60008060008060008060a08789031215611ebc578182fd5b611ec587611beb565b9550611ed360208801611beb565b94506040870135935060608701359250608087013567ffffffffffffffff811115611efc578283fd5b611f0889828a01611c51565b979a9699509497509295939492505050565b60008060408385031215611f2c578182fd5b611f3583611beb565b915060208301358015158114611f49578182fd5b809150509250929050565b60008060408385031215611f66578182fd5b611f6f83611beb565b946020939093013593505050565b6000806000806000806000806080898b031215611f98578384fd5b883567ffffffffffffffff80821115611faf578586fd5b611fbb8c838d01611c07565b909a50985060208b0135915080821115611fd3578586fd5b611fdf8c838d01611c07565b909850965060408b0135915080821115611ff7578586fd5b6120038c838d01611c51565b909650945060608b0135915080821115611d73578384fd5b600080600080600080600080600060a08a8c031215612038578283fd5b893567ffffffffffffffff8082111561204f578485fd5b61205b8d838e01611c07565b909b50995060208c0135915080821115612073578485fd5b61207f8d838e01611c07565b909950975060408c0135915080821115612097578485fd5b6120a38d838e01611c51565b909750955060608c01359150808211156120bb578485fd5b506120c88c828d01611c51565b9a9d999c50979a9699959894979660800135949350505050565b6000602082840312156120f3578081fd5b8135610f8c81612454565b60006020828403121561210f578081fd5b8151610f8c81612454565b6000806020838503121561212c578182fd5b823567ffffffffffffffff811115612142578283fd5b61214e85828601611c51565b90969095509350505050565b60006020828403121561216b578081fd5b5035919050565b6000815180845260208085019450808401835b838110156121aa5781516001600160a01b031687529582019590820190600101612185565b509495945050505050565b6000815180845260208085019450808401835b838110156121aa578151875295820195908201906001016121c8565b600081518084526020825b8281101561220a5784810182015186820183015281016121ef565b8281111561221a57838284880101525b5080601f19601f8401168601019250505092915050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061228d908301846121e4565b9695505050505050565b6080808252810188905260008960a08301825b8b8110156122e1576122d0826122bf85611beb565b6001600160a01b0316815260200190565b6020939093019291506001016122aa565b5083810360208501528881526001600160fb1b03891115612300578283fd5b8860051b9150818a6020830137016020818101838152848303909101604085015261232c81888a612231565b9150508281036060840152612342818587612231565b9b9a5050505050505050505050565b6040815260006123646040830185612172565b828103602084015261237681856121b5565b95945050505050565b6080815260006123926080830187612172565b82810360208401526123a481876121b5565b6001600160a01b03958616604085015293909416606090920191909152509392505050565b602081526000610f8c60208301846121e4565b600181811c908216806123f057607f821691505b6020821081141561241157634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561243757634e487b7160e01b81526011600452602481fd5b5060010190565b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114610e2357600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220f4a6684e3c3444cb63b09114f2cfc76a7e917c9de1daf29cf1f5cdceb8b2f4b564736f6c63430008040033646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c65794a755957316c4969413649434a4f526c5167516e56755a47786c49697767496d526c63324e7961584230615739754969413649434a4e5957526c49474a35494768306448427a4f693876595842774c6d566961584e3163324a686553356a6232306966513d3d0000000000000000000000007a3cdb2364f92369a602cae81167d0679087e6a3
Deployed Bytecode
0x60806040526004361061014b5760003560e01c80638da5cb5b116100b6578063bc197c811161006f578063bc197c8114610386578063c87b56dd146103bf578063de0e9a3e146103df578063e985e9c5146103ff578063f23a6e6114610448578063f2fde38b1461046857600080fd5b80638da5cb5b146102d257806395d89b41146102f05780639b642de114610305578063a22cb46514610325578063b5ecf91214610345578063b88d4fde1461037357600080fd5b806323b872dd1161010857806323b872dd1461023757806342842e0e1461024a5780636352211e1461025d5780636740aa621461027d57806370a082311461029d578063715018a6146102bd57600080fd5b806301ffc9a71461015057806306fdde0314610185578063081812fc146101a7578063095ea7b3146101df57806310104595146101f457806318160ddd14610214575b600080fd5b34801561015c57600080fd5b5061017061016b3660046120e2565b610488565b60405190151581526020015b60405180910390f35b34801561019157600080fd5b5061019a6104b3565b60405161017c91906123c9565b3480156101b357600080fd5b506101c76101c236600461215a565b610545565b6040516001600160a01b03909116815260200161017c565b6101f26101ed366004611f54565b610589565b005b34801561020057600080fd5b506101f261020f36600461201b565b610629565b34801561022057600080fd5b50600154600054035b60405190815260200161017c565b6101f2610245366004611d94565b610700565b6101f2610258366004611d94565b610889565b34801561026957600080fd5b506101c761027836600461215a565b6108a9565b34801561028957600080fd5b506101f2610298366004611f7d565b6108b4565b3480156102a957600080fd5b506102296102b8366004611c91565b6108cf565b3480156102c957600080fd5b506101f261091e565b3480156102de57600080fd5b506009546001600160a01b03166101c7565b3480156102fc57600080fd5b5061019a610932565b34801561031157600080fd5b506101f261032036600461211a565b610941565b34801561033157600080fd5b506101f2610340366004611f1a565b610955565b34801561035157600080fd5b5061036561036036600461215a565b6109c1565b60405161017c929190612351565b6101f2610381366004611dcf565b610a90565b34801561039257600080fd5b506103a66103a1366004611cdd565b610ada565b6040516001600160e01b0319909116815260200161017c565b3480156103cb57600080fd5b5061019a6103da36600461215a565b610b21565b3480156103eb57600080fd5b506101f26103fa36600461215a565b610c22565b34801561040b57600080fd5b5061017061041a366004611cab565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b34801561045457600080fd5b506103a6610463366004611ea4565b610d47565b34801561047457600080fd5b506101f2610483366004611c91565b610dad565b60006001600160e01b0319821663065164a760e11b14806104ad57506104ad82610e26565b92915050565b6060600280546104c2906123dc565b80601f01602080910402602001604051908101604052809291908181526020018280546104ee906123dc565b801561053b5780601f106105105761010080835404028352916020019161053b565b820191906000526020600020905b81548152906001019060200180831161051e57829003601f168201915b5050505050905090565b600061055082610e74565b61056d576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610594826108a9565b9050336001600160a01b038216146105cd576105b0813361041a565b6105cd576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600061063b8a8a8a8a8a8a8a8a610e9b565b600d543360009081526007602090815260408083206001600160a01b039094168352929052205490915060ff1661068357600d54610683906001600160a01b03166001610955565b600d54604051635ee32fef60e01b815233600482015230602482015260448101839052606481018490526001600160a01b0390911690635ee32fef90608401600060405180830381600087803b1580156106dc57600080fd5b505af11580156106f0573d6000803e3d6000fd5b5050505050505050505050505050565b600061070b82610f46565b9050836001600160a01b0316816001600160a01b03161461073e5760405162a1148160e81b815260040160405180910390fd5b6000828152600660205260409020805461076a8187335b6001600160a01b039081169116811491141790565b61079557610778863361041a565b61079557604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0385166107bc57604051633a954ecd60e21b815260040160405180910390fd5b80156107c757600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040902055600160e11b831661085257600184016000818152600460205260409020546108505760005481146108505760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b031660008051602061246b83398151915260405160405180910390a4505050505050565b6108a483838360405180602001604052806000815250610a90565b505050565b60006104ad82610f46565b6108c48888888888888888610e9b565b505050505050505050565b60006001600160a01b0382166108f8576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b610926610fae565b6109306000611008565b565b6060600380546104c2906123dc565b610949610fae565b6108a4600c8383611aa7565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000818152600a60209081526040808320600b835292819020835482518185028101850190935280835260609485949093918491830182828015610a2e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a10575b5050505050915080805480602002602001604051908101604052809291908181526020018280548015610a8057602002820191906000526020600020905b815481526020019060010190808311610a6c575b5050505050905091509150915091565b610a9b848484610700565b6001600160a01b0383163b15610ad457610ab78484848461105a565b610ad4576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b60405162461bcd60e51b815260206004820152601460248201527318985d18da195cc81b9bdd081858d8d95c1d195960621b60448201526000906064015b60405180910390fd5b6060610b2c82610e74565b610b905760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b18565b600c8054610b9d906123dc565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc9906123dc565b8015610c165780601f10610beb57610100808354040283529160200191610c16565b820191906000526020600020905b815481529060010190602001808311610bf957829003601f168201915b50505050509050919050565b33610c2c826108a9565b6001600160a01b031614610c6e5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610b18565b600d5460405163dfa3d77360e01b8152306004820152602481018390523360448201526001600160a01b039091169063dfa3d77390606401600060405180830381600087803b158015610cc057600080fd5b505af1158015610cd4573d6000803e3d6000fd5b50505050610ce181611151565b610ceb338261115c565b6000818152600a60205260408120610d0291611b2b565b6000818152600b60205260408120610d1991611b2b565b60405181907f0e0c25745e742567b4c6a72c8ec05b377f188ef1b7fe11711fdd579a533921f090600090a250565b600d546000906001600160a01b03888116911614610d9a5760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b21037b832b930ba37b960811b6044820152606401610b18565b5063f23a6e6160e01b9695505050505050565b610db5610fae565b6001600160a01b038116610e1a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b18565b610e2381611008565b50565b60006301ffc9a760e01b6001600160e01b031983161480610e5757506380ac58cd60e01b6001600160e01b03198316145b806104ad5750506001600160e01b031916635b5e139f60e01b1490565b60008054821080156104ad575050600090815260046020526040902054600160e01b161590565b600080610ea760005490565b9050610eb43360016114c8565b6000818152600a60205260409020610ecd908b8b611b49565b506000818152600b60205260409020610ee7908989611b9c565b50610ef333308361159b565b807f69347b2a9baaf85902362f6ab4575189284cf72a71d6cb43ff7a7b201baec2708b8b8b8b8b8b8b8b604051610f31989796959493929190612297565b60405180910390a29998505050505050505050565b600081600054811015610f9557600081815260046020526040902054600160e01b8116610f93575b80610f8c575060001901600081815260046020526040902054610f6e565b9392505050565b505b604051636f96cda160e11b815260040160405180910390fd5b6009546001600160a01b031633146109305760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b18565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061108f90339089908890889060040161225a565b602060405180830381600087803b1580156110a957600080fd5b505af19250505080156110d9575060408051601f3d908101601f191682019092526110d6918101906120fe565b60015b611134573d808015611107576040519150601f19603f3d011682016040523d82523d6000602084013e61110c565b606091505b50805161112c576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b610e2381600061184e565b600260085414156111af5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b18565b60026008556000818152600b602090815260408083208054825181850281018501909352808352919290919083018282801561120a57602002820191906000526020600020905b8154815260200190600101908083116111f6575b505050505090506000600a600084815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561127a57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161125c575b505083519394506000925050505b818110156114bb576112c08382815181106112b357634e487b7160e01b600052603260045260246000fd5b602002602001015161197f565b156113a9578281815181106112e557634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031663f242432a308887858151811061131d57634e487b7160e01b600052603260045260246000fd5b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526001606482015260a06084820152600060a482015260c401600060405180830381600087803b15801561138c57600080fd5b505af11580156113a0573d6000803e3d6000fd5b505050506114a9565b6113d98382815181106113cc57634e487b7160e01b600052603260045260246000fd5b602002602001015161199b565b156114a9578281815181106113fe57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166323b872dd308887858151811061143657634e487b7160e01b600052603260045260246000fd5b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b15801561149057600080fd5b505af11580156114a4573d6000803e3d6000fd5b505050505b806114b381612417565b915050611288565b5050600160085550505050565b600054816114e95760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b1783179055828401908390839060008051602061246b8339815191528180a4600183015b818114611574578083600060008051602061246b833981519152600080a460010161154e565b508161159257604051622e076360e81b815260040160405180910390fd5b60005550505050565b6000818152600b60209081526040808320805482518185028101850190935280835291929091908301828280156115f157602002820191906000526020600020905b8154815260200190600101908083116115dd575b505050505090506000600a600084815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561166157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611643575b50505050509050600081519050825181146116af5760405162461bcd60e51b815260206004820152600e60248201526d0d2dcecc2d8d2c840d8cadccee8d60931b6044820152606401610b18565b600d54604051631747466d60e21b81526001600160a01b0390911690635d1d19b4906116e590859087908b908b9060040161237f565b600060405180830381600087803b1580156116ff57600080fd5b505af1158015611713573d6000803e3d6000fd5b5050505060005b8181101561184557600083828151811061174457634e487b7160e01b600052603260045260246000fd5b60200260200101519050600085838151811061177057634e487b7160e01b600052603260045260246000fd5b60200260200101519050611783826119b7565b156117c45760405162461bcd60e51b815260206004820152601160248201527006e6f20726563757273697665207772617607c1b6044820152606401610b18565b600d5460405163dfa3d77360e01b81526001600160a01b038481166004830152602482018490523360448301529091169063dfa3d77390606401600060405180830381600087803b15801561181857600080fd5b505af115801561182c573d6000803e3d6000fd5b505050505050808061183d90612417565b91505061171a565b50505050505050565b600061185983610f46565b90508060008061187786600090815260066020526040902080549091565b9150915084156118b75761188c818433610755565b6118b75761189a833361041a565b6118b757604051632ce44b5f60e11b815260040160405180910390fd5b80156118c257600082555b6001600160a01b038316600081815260056020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b17600360e01b17600087815260046020526040902055600160e11b841661194957600186016000818152600460205260409020546119475760005481146119475760008181526004602052604090208590555b505b60405186906000906001600160a01b0386169060008051602061246b833981519152908390a45050600180548101905550505050565b60006104ad6001600160a01b038316636cdb3d1360e11b6119cf565b60006104ad6001600160a01b0383166380ac58cd60e01b6119cf565b60006104ad6001600160a01b03831663065164a760e11b5b60006119da836119eb565b8015610f8c5750610f8c8383611a1e565b60006119fe826301ffc9a760e01b611a1e565b80156104ad5750611a17826001600160e01b0319611a1e565b1592915050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d91506000519050828015611a90575060208210155b8015611a9c5750600081115b979650505050505050565b828054611ab3906123dc565b90600052602060002090601f016020900481019282611ad55760008555611b1b565b82601f10611aee5782800160ff19823516178555611b1b565b82800160010185558215611b1b579182015b82811115611b1b578235825591602001919060010190611b00565b50611b27929150611bd6565b5090565b5080546000825590600052602060002090810190610e239190611bd6565b828054828255906000526020600020908101928215611b1b579160200282015b82811115611b1b5781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190611b69565b828054828255906000526020600020908101928215611b1b5791602002820182811115611b1b578235825591602001919060010190611b00565b5b80821115611b275760008155600101611bd7565b80356001600160a01b0381168114611c0257600080fd5b919050565b60008083601f840112611c18578081fd5b50813567ffffffffffffffff811115611c2f578182fd5b6020830191508360208260051b8501011115611c4a57600080fd5b9250929050565b60008083601f840112611c62578182fd5b50813567ffffffffffffffff811115611c79578182fd5b602083019150836020828501011115611c4a57600080fd5b600060208284031215611ca2578081fd5b610f8c82611beb565b60008060408385031215611cbd578081fd5b611cc683611beb565b9150611cd460208401611beb565b90509250929050565b60008060008060008060008060a0898b031215611cf8578384fd5b611d0189611beb565b9750611d0f60208a01611beb565b9650604089013567ffffffffffffffff80821115611d2b578586fd5b611d378c838d01611c07565b909850965060608b0135915080821115611d4f578586fd5b611d5b8c838d01611c07565b909650945060808b0135915080821115611d73578384fd5b50611d808b828c01611c51565b999c989b5096995094979396929594505050565b600080600060608486031215611da8578283fd5b611db184611beb565b9250611dbf60208501611beb565b9150604084013590509250925092565b60008060008060808587031215611de4578384fd5b611ded85611beb565b9350611dfb60208601611beb565b925060408501359150606085013567ffffffffffffffff80821115611e1e578283fd5b818701915087601f830112611e31578283fd5b813581811115611e4357611e4361243e565b604051601f8201601f19908116603f01168101908382118183101715611e6b57611e6b61243e565b816040528281528a6020848701011115611e83578586fd5b82602086016020830137918201602001949094529598949750929550505050565b60008060008060008060a08789031215611ebc578182fd5b611ec587611beb565b9550611ed360208801611beb565b94506040870135935060608701359250608087013567ffffffffffffffff811115611efc578283fd5b611f0889828a01611c51565b979a9699509497509295939492505050565b60008060408385031215611f2c578182fd5b611f3583611beb565b915060208301358015158114611f49578182fd5b809150509250929050565b60008060408385031215611f66578182fd5b611f6f83611beb565b946020939093013593505050565b6000806000806000806000806080898b031215611f98578384fd5b883567ffffffffffffffff80821115611faf578586fd5b611fbb8c838d01611c07565b909a50985060208b0135915080821115611fd3578586fd5b611fdf8c838d01611c07565b909850965060408b0135915080821115611ff7578586fd5b6120038c838d01611c51565b909650945060608b0135915080821115611d73578384fd5b600080600080600080600080600060a08a8c031215612038578283fd5b893567ffffffffffffffff8082111561204f578485fd5b61205b8d838e01611c07565b909b50995060208c0135915080821115612073578485fd5b61207f8d838e01611c07565b909950975060408c0135915080821115612097578485fd5b6120a38d838e01611c51565b909750955060608c01359150808211156120bb578485fd5b506120c88c828d01611c51565b9a9d999c50979a9699959894979660800135949350505050565b6000602082840312156120f3578081fd5b8135610f8c81612454565b60006020828403121561210f578081fd5b8151610f8c81612454565b6000806020838503121561212c578182fd5b823567ffffffffffffffff811115612142578283fd5b61214e85828601611c51565b90969095509350505050565b60006020828403121561216b578081fd5b5035919050565b6000815180845260208085019450808401835b838110156121aa5781516001600160a01b031687529582019590820190600101612185565b509495945050505050565b6000815180845260208085019450808401835b838110156121aa578151875295820195908201906001016121c8565b600081518084526020825b8281101561220a5784810182015186820183015281016121ef565b8281111561221a57838284880101525b5080601f19601f8401168601019250505092915050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061228d908301846121e4565b9695505050505050565b6080808252810188905260008960a08301825b8b8110156122e1576122d0826122bf85611beb565b6001600160a01b0316815260200190565b6020939093019291506001016122aa565b5083810360208501528881526001600160fb1b03891115612300578283fd5b8860051b9150818a6020830137016020818101838152848303909101604085015261232c81888a612231565b9150508281036060840152612342818587612231565b9b9a5050505050505050505050565b6040815260006123646040830185612172565b828103602084015261237681856121b5565b95945050505050565b6080815260006123926080830187612172565b82810360208401526123a481876121b5565b6001600160a01b03958616604085015293909416606090920191909152509392505050565b602081526000610f8c60208301846121e4565b600181811c908216806123f057607f821691505b6020821081141561241157634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561243757634e487b7160e01b81526011600452602481fd5b5060010190565b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114610e2357600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220f4a6684e3c3444cb63b09114f2cfc76a7e917c9de1daf29cf1f5cdceb8b2f4b564736f6c63430008040033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000007a3cdb2364f92369a602cae81167d0679087e6a3
-----Decoded View---------------
Arg [0] : _market (address): 0x7a3CdB2364f92369a602CAE81167d0679087e6a3
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000007a3cdb2364f92369a602cae81167d0679087e6a3
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.