Feature Tip: Add private address tag to any address under My Name Tag !
ERC-721
Overview
Max Total Supply
0 TXS
Holders
9
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
2 TXSLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
STUDIOMARKETV2
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)
/** *Submitted for verification at Etherscan.io on 2022-05-03 */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; import '@openzeppelin/contracts/utils/Counters.sol'; import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol'; contract STUDIOMARKETV2 is ReentrancyGuard, ERC721URIStorage, Ownable { using Counters for Counters.Counter; Counters.Counter private _tokenIds; Counters.Counter private _itemsSold; ///listing percentage is multiplied by 10 to support dynamic percentage update /// @dev get atual percentage by dividing value with 10 uint256 listingPercentage = 25; bool _takeFees = true; bool _tokenActive = false; mapping(uint256 => MarketItem) private idToMarketItem; struct MarketItem { uint256 tokenId; address payable seller; address payable owner; address payable creator; uint256 price; uint256 tokens; address[] rAddress; uint256[] rFee; bool sold; } event MarketItemCreated(uint256 indexed tokenId, address seller, address owner, address creator, uint256 price, bool sold); event MarketItemListed(uint256 tokenId, address seller, uint256 price, uint256 tokens); event MarketItemRemoved(uint256 indexed tokenId); event TokenTransferred(address indexed previousOwner, address indexed newOwner, uint256 indexed tokenId); constructor() ERC721('XSTUDIO', 'TXS') {} /* Updates the listing price of the contract */ function updateListingPrice(uint256 _listingPrice) public onlyOwner { //validate _listingPrice value require(_listingPrice <= 500, 'Value Overflow: Stated Value Is Above 50 percent'); listingPercentage = _listingPrice; } /* Returns the listing price of the contract */ function getListingPrice() public view returns (uint256) { return listingPercentage; } /** * @dev Private function because it simply calculates commission and pays out accordingly. * Inputs & other validation likely will come from somewhere else in the contract. * * Handles All the payments and fees distribution * * Note: Numbers are multiplied by 10 in order to calculate dynamic tradefee percentages and avert solidity fixed integer issues */ function takeCommission( address seller, address platform, uint256 amountPaid, uint256 commissionPercentage, address[] memory _royaltyAddress, uint256[] memory _royaltyFee ) private { //validate royalty value require(_royaltyAddress.length == _royaltyFee.length, 'Royalty Addresses And Fees Must Be Same Length'); uint256 totalPayment = amountPaid; // divide by 1000 because commission percentage is expressed as a uint * 10 uint256 platformFee = (totalPayment * commissionPercentage) / 1000; amountPaid -= platformFee; payable(platform).transfer(platformFee); if (_royaltyAddress.length == 0) { payable(seller).transfer(amountPaid); } else { for (uint256 i = 0; i < _royaltyAddress.length; i++) { if (_royaltyFee[i] > 0) { // divide by 1000 because commission percentage is expressed as a uint * 10 uint256 royalPercent = (_royaltyFee[i] * totalPayment) / 1000; amountPaid -= royalPercent; payable(_royaltyAddress[i]).transfer(royalPercent); } } payable(seller).transfer(amountPaid); } } function takeTokenCommission( address seller, address platform, uint256 tokens, uint256 commissionPercentage, address[] memory _royaltyAddress, uint256[] memory _royaltyFee, address tokenContract ) private { //validate royalty value require(_royaltyAddress.length == _royaltyFee.length, 'Royalty Addresses And Fees Must Be Same Length'); // divide by 1000 because commission percentage is expressed as a uint * 10 uint256 platformFee = (tokens * commissionPercentage) / 1000; if (_takeFees == true) { tokens -= platformFee; IERC20(tokenContract).transferFrom(msg.sender, platform, platformFee); } //distribute tokens if takefees is true if (_royaltyAddress.length == 0) { IERC20(tokenContract).transferFrom(msg.sender, seller, tokens); } else { for (uint256 i = 0; i < _royaltyAddress.length; i++) { if (_royaltyFee[i] > 0) { // divide by 1000 because commission percentage is expressed as a uint * 10 uint256 royalPercent = (_royaltyFee[i] * tokens) / 1000; tokens -= royalPercent; IERC20(tokenContract).transferFrom(seller,_royaltyAddress[i], royalPercent); tokens -= _royaltyFee[i]; } } IERC20(tokenContract).transferFrom(msg.sender, seller, tokens); } } function royaltyFee(uint256 tokenId) external view returns (address[] memory, uint256[] memory) { address[] memory addr = idToMarketItem[tokenId].rAddress; uint256[] memory fee = idToMarketItem[tokenId].rFee; return (addr, fee); } /* Creates the sale of a marketplace item */ /* Transfers ownership of the item, as well as funds between parties */ function mintTokenTXS( string memory tokenURI, address creator, uint256 price, uint256 tokens, address[] memory _royaltyAddress, uint256[] memory _royaltyFee, address tokenContract ) public nonReentrant { require(tokens <= IERC20(tokenContract).balanceOf(msg.sender), 'not enough tokens'); require(tokens > 0, 'Token Price Must Be Greater Than Zero'); require(price > 0, 'Price must be at least 1 wei'); _tokenIds.increment(); uint256 newTokenId = _tokenIds.current(); _mint(msg.sender, newTokenId); _setTokenURI(newTokenId, tokenURI); _itemsSold.increment(); idToMarketItem[newTokenId] = MarketItem(newTokenId, payable(creator), payable(msg.sender), payable(creator), price, tokens, _royaltyAddress, _royaltyFee , false); //finish transaction and transfer token takeTokenCommission(creator, owner(), tokens, listingPercentage, _royaltyAddress, _royaltyFee, tokenContract); emit MarketItemCreated(newTokenId, address(this), msg.sender, creator, price, false); } /* Mints a token and lists it in the marketplace */ function mintToken( string memory tokenURI, address creator, uint256 price, uint256 tokens, address[] memory _royaltyAddress, uint256[] memory _royaltyFee ) public payable nonReentrant { require(price > 0, 'Price must be at least 1 wei'); require(msg.value == price, 'Please submit the asking price in order to complete the purchase'); if (_tokenActive == true) { require(tokens > 0, 'Token Price Must Be Greater Than Zero'); } _tokenIds.increment(); uint256 newTokenId = _tokenIds.current(); _mint(msg.sender, newTokenId); _setTokenURI(newTokenId, tokenURI); _itemsSold.increment(); idToMarketItem[newTokenId] = MarketItem(newTokenId, payable(creator), payable(msg.sender), payable(creator), price, tokens, _royaltyAddress, _royaltyFee, false); takeCommission(creator, owner(), price, listingPercentage, _royaltyAddress, _royaltyFee); emit MarketItemCreated(newTokenId, address(this), msg.sender, creator, price, false); } /* Creates the sale of a marketplace item */ /* Transfers ownership of the item, as well as funds between parties */ function buyToken(uint256 tokenId) public payable nonReentrant { uint256 price = idToMarketItem[tokenId].price; address[] memory _royaltyAddress = idToMarketItem[tokenId].rAddress; uint256[] memory _royaltyFee = idToMarketItem[tokenId].rFee; address seller = idToMarketItem[tokenId].seller; require(msg.value == price, 'Please submit the asking price in order to complete the purchase'); idToMarketItem[tokenId].owner = payable(msg.sender); idToMarketItem[tokenId].sold = true; idToMarketItem[tokenId].seller = payable(address(this)); _itemsSold.increment(); _transfer(address(this), msg.sender, tokenId); //finish transaction and pay respective parties takeCommission(seller, owner(), price, listingPercentage, _royaltyAddress, _royaltyFee); //emit market sales event emit TokenTransferred(seller, msg.sender, tokenId); } /* allows someone to purchase a listed token */ function buyTokenTXS(uint256 tokenId, address tokenContract) public nonReentrant { uint256 tokens = idToMarketItem[tokenId].tokens; address seller = idToMarketItem[tokenId].seller; address[] memory _royaltyAddress = idToMarketItem[tokenId].rAddress; uint256[] memory _royaltyFee = idToMarketItem[tokenId].rFee; require(tokens <= IERC20(tokenContract).balanceOf(msg.sender), 'not enough tokens'); require(tokens > 0, 'token option is not active for this asset yet!'); idToMarketItem[tokenId].sold = false; idToMarketItem[tokenId].owner = payable(msg.sender); idToMarketItem[tokenId].seller = payable(address(this)); _itemsSold.increment(); _transfer(address(this), msg.sender, tokenId); //finish transaction and transfer token takeTokenCommission(seller, owner(), tokens, listingPercentage, _royaltyAddress, _royaltyFee, tokenContract); //emit market sales event emit TokenTransferred(seller, msg.sender, tokenId); } /* allows someone to resell a token they have purchased */ function resellToken( uint256 tokenId, uint256 price, uint256 tokens ) public nonReentrant { require(idToMarketItem[tokenId].owner == msg.sender, 'Only item owner can perform this operation'); require(price > 0, 'Price must be at least 1 wei'); if (_tokenActive == true) { require(tokens > 0, 'Token Price Must Be Greater Than Zero'); } idToMarketItem[tokenId].sold = false; idToMarketItem[tokenId].price = price; idToMarketItem[tokenId].tokens = tokens; idToMarketItem[tokenId].seller = payable(msg.sender); idToMarketItem[tokenId].owner = payable(address(this)); _itemsSold.decrement(); _transfer(msg.sender, address(this), tokenId); //emit market item add event emit MarketItemListed(tokenId, msg.sender, price, tokens); } // allows user to change the price of a listed token function changePrice( uint256 tokenId, uint256 _price, uint256 _tokens ) public { require(idToMarketItem[tokenId].seller == msg.sender, 'Only item owner can perform this operation'); if (_tokenActive == true) { require(_tokens > 0, 'Token Price Must Be Greater Than Zero'); } idToMarketItem[tokenId].price = _price; idToMarketItem[tokenId].tokens = _tokens; } /* allows someone to remove a token from the market */ function delistItem(uint256 tokenId) public { require(idToMarketItem[tokenId].seller == msg.sender, 'Only item owner can perform this operation'); idToMarketItem[tokenId].sold = false; idToMarketItem[tokenId].seller = payable(address(this)); idToMarketItem[tokenId].owner = payable(msg.sender); _itemsSold.increment(); _transfer(address(this), msg.sender, tokenId); //emit item removal event emit MarketItemRemoved(tokenId); } /* Returns all unsold market items */ function fetchMarketItems() public view returns (MarketItem[] memory) { uint256 itemCount = _tokenIds.current(); uint256 unsoldItemCount = _tokenIds.current() - _itemsSold.current(); uint256 currentIndex = 0; MarketItem[] memory items = new MarketItem[](unsoldItemCount); for (uint256 i = 0; i < itemCount; i++) { if (idToMarketItem[i + 1].owner == address(this)) { uint256 currentId = i + 1; MarketItem storage currentItem = idToMarketItem[currentId]; items[currentIndex] = currentItem; currentIndex += 1; } } return items; } /* Returns only items that a user has purchased */ function fetchMyNFTs() public view returns (MarketItem[] memory) { uint256 totalItemCount = _tokenIds.current(); uint256 itemCount = 0; uint256 currentIndex = 0; for (uint256 i = 0; i < totalItemCount; i++) { if (idToMarketItem[i + 1].owner == msg.sender) { itemCount += 1; } } MarketItem[] memory items = new MarketItem[](itemCount); for (uint256 i = 0; i < totalItemCount; i++) { if (idToMarketItem[i + 1].owner == msg.sender) { uint256 currentId = i + 1; MarketItem storage currentItem = idToMarketItem[currentId]; items[currentIndex] = currentItem; currentIndex += 1; } } return items; } /* Returns only items a user has listed */ function fetchItemsListed() public view returns (MarketItem[] memory) { uint256 totalItemCount = _tokenIds.current(); uint256 itemCount = 0; uint256 currentIndex = 0; for (uint256 i = 0; i < totalItemCount; i++) { if (idToMarketItem[i + 1].seller == msg.sender) { itemCount += 1; } } MarketItem[] memory items = new MarketItem[](itemCount); for (uint256 i = 0; i < totalItemCount; i++) { if (idToMarketItem[i + 1].seller == msg.sender) { uint256 currentId = i + 1; MarketItem storage currentItem = idToMarketItem[currentId]; items[currentIndex] = currentItem; currentIndex += 1; } } return items; } function getMarketItem(uint256 marketItemId) public view returns (MarketItem memory) { return idToMarketItem[marketItemId]; } //Use this in case Coins are sent to the contract by mistake function rescueETH(uint256 weiAmount) external onlyOwner { require(address(this).balance >= weiAmount, "insufficient Token balance"); payable(msg.sender).transfer(weiAmount); } function rescueAnyERC20Tokens( address _tokenAddr, address _to, uint256 _amount ) public onlyOwner { IERC20(_tokenAddr).transfer(_to, _amount); } receive() external payable {} //override ownership renounce function from ownable contract function renounceOwnership() public pure override(Ownable) { revert('Unfortunately you cannot renounce Ownership of this contract!'); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// 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 // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/extensions/ERC721URIStorage.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; /** * @dev ERC721 token with storage based token URI management. */ abstract contract ERC721URIStorage is ERC721 { using Strings for uint256; // Optional mapping for token URIs mapping(uint256 => string) private _tokenURIs; /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory _tokenURI = _tokenURIs[tokenId]; string memory base = _baseURI(); // If there is no base URI, return the token URI. if (bytes(base).length == 0) { return _tokenURI; } // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked). if (bytes(_tokenURI).length > 0) { return string(abi.encodePacked(base, _tokenURI)); } return super.tokenURI(tokenId); } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { require(_exists(tokenId), "ERC721URIStorage: URI set of nonexistent token"); _tokenURIs[tokenId] = _tokenURI; } /** * @dev See {ERC721-_burn}. This override additionally checks to see if a * token-specific URI was set for the token, and if so, it deletes the token URI from * the storage mapping. */ function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); if (bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } } }
// 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.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
{ "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":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"seller","type":"address"},{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"creator","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"bool","name":"sold","type":"bool"}],"name":"MarketItemCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"seller","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokens","type":"uint256"}],"name":"MarketItemListed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"MarketItemRemoved","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":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenTransferred","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":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"buyToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"tokenContract","type":"address"}],"name":"buyTokenTXS","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"uint256","name":"_tokens","type":"uint256"}],"name":"changePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"delistItem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fetchItemsListed","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address payable","name":"seller","type":"address"},{"internalType":"address payable","name":"owner","type":"address"},{"internalType":"address payable","name":"creator","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"tokens","type":"uint256"},{"internalType":"address[]","name":"rAddress","type":"address[]"},{"internalType":"uint256[]","name":"rFee","type":"uint256[]"},{"internalType":"bool","name":"sold","type":"bool"}],"internalType":"struct STUDIOMARKETV2.MarketItem[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fetchMarketItems","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address payable","name":"seller","type":"address"},{"internalType":"address payable","name":"owner","type":"address"},{"internalType":"address payable","name":"creator","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"tokens","type":"uint256"},{"internalType":"address[]","name":"rAddress","type":"address[]"},{"internalType":"uint256[]","name":"rFee","type":"uint256[]"},{"internalType":"bool","name":"sold","type":"bool"}],"internalType":"struct STUDIOMARKETV2.MarketItem[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fetchMyNFTs","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address payable","name":"seller","type":"address"},{"internalType":"address payable","name":"owner","type":"address"},{"internalType":"address payable","name":"creator","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"tokens","type":"uint256"},{"internalType":"address[]","name":"rAddress","type":"address[]"},{"internalType":"uint256[]","name":"rFee","type":"uint256[]"},{"internalType":"bool","name":"sold","type":"bool"}],"internalType":"struct STUDIOMARKETV2.MarketItem[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getListingPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"marketItemId","type":"uint256"}],"name":"getMarketItem","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address payable","name":"seller","type":"address"},{"internalType":"address payable","name":"owner","type":"address"},{"internalType":"address payable","name":"creator","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"tokens","type":"uint256"},{"internalType":"address[]","name":"rAddress","type":"address[]"},{"internalType":"uint256[]","name":"rFee","type":"uint256[]"},{"internalType":"bool","name":"sold","type":"bool"}],"internalType":"struct STUDIOMARKETV2.MarketItem","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"tokenURI","type":"string"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"tokens","type":"uint256"},{"internalType":"address[]","name":"_royaltyAddress","type":"address[]"},{"internalType":"uint256[]","name":"_royaltyFee","type":"uint256[]"}],"name":"mintToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"tokenURI","type":"string"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"tokens","type":"uint256"},{"internalType":"address[]","name":"_royaltyAddress","type":"address[]"},{"internalType":"uint256[]","name":"_royaltyFee","type":"uint256[]"},{"internalType":"address","name":"tokenContract","type":"address"}],"name":"mintTokenTXS","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddr","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"rescueAnyERC20Tokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"weiAmount","type":"uint256"}],"name":"rescueETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"tokens","type":"uint256"}],"name":"resellToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"royaltyFee","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"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":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"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":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_listingPrice","type":"uint256"}],"name":"updateListingPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040526019600b55600c805461ffff191660011790553480156200002457600080fd5b5060408051808201825260078152665853545544494f60c81b60208083019182528351808501909452600384526254585360e81b9084015260016000819055825192939262000074929062000103565b5080516200008a90600290602084019062000103565b505050620000a7620000a1620000ad60201b60201c565b620000b1565b620001e6565b3390565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200011190620001a9565b90600052602060002090601f01602090048101928262000135576000855562000180565b82601f106200015057805160ff191683800117855562000180565b8280016001018555821562000180579182015b828111156200018057825182559160200191906001019062000163565b506200018e92915062000192565b5090565b5b808211156200018e576000815560010162000193565b600181811c90821680620001be57607f821691505b60208210811415620001e057634e487b7160e01b600052602260045260246000fd5b50919050565b61402c80620001f66000396000f3fe6080604052600436106101e75760003560e01c8063715018a611610102578063b88d4fde11610095578063c87b56dd11610064578063c87b56dd14610578578063e985e9c514610598578063ea31247a146105e1578063f2fde38b1461060157600080fd5b8063b88d4fde146104ea578063bdbd735b1461050a578063c57dc2351461051d578063c7be7a491461054b57600080fd5b806395d89b41116100d157806395d89b41146104755780639e252f001461048a578063a22cb465146104aa578063ae677aa3146104ca57600080fd5b8063715018a614610402578063799e5a76146104175780637af0d9e2146104375780638da5cb5b1461045757600080fd5b8063202e37401161017a57806342842e0e1161014957806342842e0e1461038d57806345f8fa80146103ad5780636352211e146103c257806370a08231146103e257600080fd5b8063202e37401461032557806323b872dd1461033a5780632d296bf11461035a57806340e2b4b81461036d57600080fd5b80630d65df9b116101b65780630d65df9b146102a45780630f08efe0146102c457806310061631146102e657806312e855851461030657600080fd5b806301ffc9a7146101f357806306fdde0314610228578063081812fc1461024a578063095ea7b31461028257600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b5061021361020e366004613742565b610621565b60405190151581526020015b60405180910390f35b34801561023457600080fd5b5061023d610673565b60405161021f9190613bd4565b34801561025657600080fd5b5061026a6102653660046138da565b610705565b6040516001600160a01b03909116815260200161021f565b34801561028e57600080fd5b506102a261029d3660046136fd565b61072c565b005b3480156102b057600080fd5b506102a26102bf366004613613565b610847565b3480156102d057600080fd5b506102d96108d7565b60405161021f9190613b73565b3480156102f257600080fd5b506102a26103013660046138da565b610b37565b34801561031257600080fd5b50600b545b60405190815260200161021f565b34801561033157600080fd5b506102d9610bf6565b34801561034657600080fd5b506102a2610355366004613613565b610e94565b6102a26103683660046138da565b610ec5565b34801561037957600080fd5b506102a261038836600461392c565b6110c7565b34801561039957600080fd5b506102a26103a8366004613613565b611153565b3480156103b957600080fd5b506102d961116e565b3480156103ce57600080fd5b5061026a6103dd3660046138da565b61140c565b3480156103ee57600080fd5b506103176103fd3660046135c7565b61146c565b34801561040e57600080fd5b506102a26114f2565b34801561042357600080fd5b506102a261043236600461390a565b611560565b34801561044357600080fd5b506102a2610452366004613821565b611857565b34801561046357600080fd5b506008546001600160a01b031661026a565b34801561048157600080fd5b5061023d611b40565b34801561049657600080fd5b506102a26104a53660046138da565b611b4f565b3480156104b657600080fd5b506102a26104c53660046136c7565b611bd8565b3480156104d657600080fd5b506102a26104e53660046138da565b611be3565b3480156104f657600080fd5b506102a261050536600461364e565b611c5b565b6102a261051836600461377a565b611c8d565b34801561052957600080fd5b5061053d6105383660046138da565b611eeb565b60405161021f929190613b45565b34801561055757600080fd5b5061056b6105663660046138da565b611fd4565b60405161021f9190613e30565b34801561058457600080fd5b5061023d6105933660046138da565b61210a565b3480156105a457600080fd5b506102136105b33660046135e1565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b3480156105ed57600080fd5b506102a26105fc36600461392c565b61221b565b34801561060d57600080fd5b506102a261061c3660046135c7565b612383565b60006001600160e01b031982166380ac58cd60e01b148061065257506001600160e01b03198216635b5e139f60e01b145b8061066d57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606001805461068290613f26565b80601f01602080910402602001604051908101604052809291908181526020018280546106ae90613f26565b80156106fb5780601f106106d0576101008083540402835291602001916106fb565b820191906000526020600020905b8154815290600101906020018083116106de57829003601f168201915b5050505050905090565b6000610710826123fc565b506000908152600560205260409020546001600160a01b031690565b60006107378261140c565b9050806001600160a01b0316836001600160a01b031614156107aa5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806107c657506107c681336105b3565b6108385760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c000060648201526084016107a1565b610842838361245b565b505050565b61084f6124c9565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401602060405180830381600087803b15801561089957600080fd5b505af11580156108ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d19190613726565b50505050565b606060006108e460095490565b905060006108f1600a5490565b6009546108fe9190613ee3565b90506000808267ffffffffffffffff81111561092a57634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561096357816020015b6109506132d0565b8152602001906001900390816109485790505b50905060005b84811015610b2e5730600d6000610981846001613e98565b81526020810191909152604001600020600201546001600160a01b03161415610b1c5760006109b1826001613e98565b6000818152600d60209081526040918290208251610120810184528154815260018201546001600160a01b03908116828501526002830154811682860152600383015416606082015260048201546080820152600582015460a082015260068201805485518186028101860190965280865295965091949093859360c0860193919290830182828015610a6d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a4f575b5050505050815260200160078201805480602002602001604051908101604052809291908181526020018280548015610ac557602002820191906000526020600020905b815481526020019060010190808311610ab1575b50505091835250506008919091015460ff1615156020909101528451859087908110610b0157634e487b7160e01b600052603260045260246000fd5b6020908102919091010152610b17600186613e98565b945050505b80610b2681613f61565b915050610969565b50949350505050565b6000818152600d60205260409020600101546001600160a01b03163314610b705760405162461bcd60e51b81526004016107a190613ce5565b6000818152600d6020526040902060088101805460ff191690556001810180546001600160a01b031990811630179091556002909101805490911633179055610bbd600a80546001019055565b610bc8303383612525565b60405181907fd371e668750cb458fa9a55e99ade07ce913d63ab733d6e30fe303723e106cf9690600090a250565b60606000610c0360095490565b905060008060005b83811015610c665733600d6000610c23846001613e98565b81526020810191909152604001600020600201546001600160a01b03161415610c5457610c51600184613e98565b92505b80610c5e81613f61565b915050610c0b565b5060008267ffffffffffffffff811115610c9057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610cc957816020015b610cb66132d0565b815260200190600190039081610cae5790505b50905060005b84811015610b2e5733600d6000610ce7846001613e98565b81526020810191909152604001600020600201546001600160a01b03161415610e82576000610d17826001613e98565b6000818152600d60209081526040918290208251610120810184528154815260018201546001600160a01b03908116828501526002830154811682860152600383015416606082015260048201546080820152600582015460a082015260068201805485518186028101860190965280865295965091949093859360c0860193919290830182828015610dd357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610db5575b5050505050815260200160078201805480602002602001604051908101604052809291908181526020018280548015610e2b57602002820191906000526020600020905b815481526020019060010190808311610e17575b50505091835250506008919091015460ff1615156020909101528451859087908110610e6757634e487b7160e01b600052603260045260246000fd5b6020908102919091010152610e7d600186613e98565b945050505b80610e8c81613f61565b915050610ccf565b610e9e33826126c1565b610eba5760405162461bcd60e51b81526004016107a190613d74565b610842838383612525565b60026000541415610ee85760405162461bcd60e51b81526004016107a190613dc2565b60026000908155818152600d60209081526040808320600481015460069091018054835181860281018601909452808452919493909190830182828015610f5857602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610f3a575b505050505090506000600d6000858152602001908152602001600020600701805480602002602001604051908101604052809291908181526020018280548015610fc157602002820191906000526020600020905b815481526020019060010190808311610fad575b5050506000878152600d6020526040902060010154929350506001600160a01b0390911690503484146110065760405162461bcd60e51b81526004016107a190613c87565b6000858152600d602052604090206002810180546001600160a01b0319908116331790915560088201805460ff19166001908117909155909101805490911630179055611057600a80546001019055565b611062303387612525565b611083816110786008546001600160a01b031690565b86600b54878761273f565b604051859033906001600160a01b038416907f9c8515990fd8c61431c4ac8db9b81475f90c292a1dda77731e56c22e64fc764390600090a450506001600055505050565b6000838152600d60205260409020600101546001600160a01b031633146111005760405162461bcd60e51b81526004016107a190613ce5565b600c5460ff6101009091041615156001141561113657600081116111365760405162461bcd60e51b81526004016107a190613d2f565b6000928352600d6020526040909220600481019190915560050155565b61084283838360405180602001604052806000815250611c5b565b6060600061117b60095490565b905060008060005b838110156111de5733600d600061119b846001613e98565b81526020810191909152604001600020600101546001600160a01b031614156111cc576111c9600184613e98565b92505b806111d681613f61565b915050611183565b5060008267ffffffffffffffff81111561120857634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561124157816020015b61122e6132d0565b8152602001906001900390816112265790505b50905060005b84811015610b2e5733600d600061125f846001613e98565b81526020810191909152604001600020600101546001600160a01b031614156113fa57600061128f826001613e98565b6000818152600d60209081526040918290208251610120810184528154815260018201546001600160a01b03908116828501526002830154811682860152600383015416606082015260048201546080820152600582015460a082015260068201805485518186028101860190965280865295965091949093859360c086019391929083018282801561134b57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161132d575b50505050508152602001600782018054806020026020016040519081016040528092919081815260200182805480156113a357602002820191906000526020600020905b81548152602001906001019080831161138f575b50505091835250506008919091015460ff16151560209091015284518590879081106113df57634e487b7160e01b600052603260045260246000fd5b60209081029190910101526113f5600186613e98565b945050505b8061140481613f61565b915050611247565b6000818152600360205260408120546001600160a01b03168061066d5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016107a1565b60006001600160a01b0382166114d65760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016107a1565b506001600160a01b031660009081526004602052604090205490565b60405162461bcd60e51b815260206004820152603d60248201527f556e666f7274756e6174656c7920796f752063616e6e6f742072656e6f756e6360448201527f65204f776e657273686970206f66207468697320636f6e74726163742100000060648201526084016107a1565b600260005414156115835760405162461bcd60e51b81526004016107a190613dc2565b60026000908155828152600d60209081526040808320600581015460018201546006909201805484518187028101870190955280855291956001600160a01b039093169492939290919083018282801561160657602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116115e8575b505050505090506000600d600087815260200190815260200160002060070180548060200260200160405190810160405280929190818152602001828054801561166f57602002820191906000526020600020905b81548152602001906001019080831161165b575b50506040516370a0823160e01b815233600482015293945050506001600160a01b038716916370a08231915060240160206040518083038186803b1580156116b657600080fd5b505afa1580156116ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ee91906138f2565b8411156117315760405162461bcd60e51b81526020600482015260116024820152706e6f7420656e6f75676820746f6b656e7360781b60448201526064016107a1565b600084116117985760405162461bcd60e51b815260206004820152602e60248201527f746f6b656e206f7074696f6e206973206e6f742061637469766520666f72207460448201526d686973206173736574207965742160901b60648201526084016107a1565b6000868152600d6020526040902060088101805460ff191690556002810180546001600160a01b0319908116331790915560019091018054909116301790556117e5600a80546001019055565b6117f0303388612525565b611812836118066008546001600160a01b031690565b86600b5486868b612946565b604051869033906001600160a01b038616907f9c8515990fd8c61431c4ac8db9b81475f90c292a1dda77731e56c22e64fc764390600090a45050600160005550505050565b6002600054141561187a5760405162461bcd60e51b81526004016107a190613dc2565b60026000556040516370a0823160e01b81523360048201526001600160a01b038216906370a082319060240160206040518083038186803b1580156118be57600080fd5b505afa1580156118d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f691906138f2565b84111561193a5760405162461bcd60e51b81526020600482015260126024820152716e6f7420656e6f7567682020746f6b656e7360701b60448201526064016107a1565b6000841161195a5760405162461bcd60e51b81526004016107a190613d2f565b6000851161197a5760405162461bcd60e51b81526004016107a190613df9565b611988600980546001019055565b600061199360095490565b905061199f3382612cae565b6119a98189612df0565b6119b7600a80546001019055565b60408051610120810182528281526001600160a01b03808a1660208084018281523385870190815260608601938452608086018d815260a087018d815260c088018d815260e089018d905260006101008a018190528b8152600d8752999099208851815593516001850180549189166001600160a01b0319928316179055925160028501805491891691851691909117905594516003840180549190971692169190911790945592516004840155905160058301559251805192939192611a849260068501920190613339565b5060e08201518051611aa091600784019160209091019061339e565b5061010091909101516008918201805460ff191691151591909117905554611ad99088906001600160a01b031687600b54888888612946565b604080513081523360208201526001600160a01b038916818301526060810188905260006080820152905182917fd6b5a2ea507e15741fd76fed025e0dfe9294bea94de5e3359d76d718efd991bd919081900360a00190a250506001600055505050505050565b60606002805461068290613f26565b611b576124c9565b80471015611ba75760405162461bcd60e51b815260206004820152601a60248201527f696e73756666696369656e7420546f6b656e2062616c616e636500000000000060448201526064016107a1565b604051339082156108fc029083906000818181858888f19350505050158015611bd4573d6000803e3d6000fd5b5050565b611bd4338383612e8a565b611beb6124c9565b6101f4811115611c565760405162461bcd60e51b815260206004820152603060248201527f56616c7565204f766572666c6f773a205374617465642056616c75652049732060448201526f10589bdd99480d4c081c195c98d95b9d60821b60648201526084016107a1565b600b55565b611c6533836126c1565b611c815760405162461bcd60e51b81526004016107a190613d74565b6108d184848484612f59565b60026000541415611cb05760405162461bcd60e51b81526004016107a190613dc2565b600260005583611cd25760405162461bcd60e51b81526004016107a190613df9565b833414611cf15760405162461bcd60e51b81526004016107a190613c87565b600c5460ff61010090910416151560011415611d275760008311611d275760405162461bcd60e51b81526004016107a190613d2f565b611d35600980546001019055565b6000611d4060095490565b9050611d4c3382612cae565b611d568188612df0565b611d64600a80546001019055565b60408051610120810182528281526001600160a01b0380891660208084018281523385870190815260608601938452608086018c815260a087018c815260c088018c815260e089018c905260006101008a018190528b8152600d8752999099208851815593516001850180549189166001600160a01b0319928316179055925160028501805491891691851691909117905594516003840180549190971692169190911790945592516004840155905160058301559251805192939192611e319260068501920190613339565b5060e08201518051611e4d91600784019160209091019061339e565b5061010091909101516008918201805460ff191691151591909117905554611e859087906001600160a01b031687600b54878761273f565b604080513081523360208201526001600160a01b038816818301526060810187905260006080820152905182917fd6b5a2ea507e15741fd76fed025e0dfe9294bea94de5e3359d76d718efd991bd919081900360a00190a2505060016000555050505050565b6060806000600d6000858152602001908152602001600020600601805480602002602001604051908101604052809291908181526020018280548015611f5a57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611f3c575b505050505090506000600d6000868152602001908152602001600020600701805480602002602001604051908101604052809291908181526020018280548015611fc357602002820191906000526020600020905b815481526020019060010190808311611faf575b509599939850929650505050505050565b611fdc6132d0565b6000828152600d60209081526040918290208251610120810184528154815260018201546001600160a01b03908116828501526002830154811682860152600383015416606082015260048201546080820152600582015460a08201526006820180548551818602810186019096528086529194929360c0860193929083018282801561209257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612074575b50505050508152602001600782018054806020026020016040519081016040528092919081815260200182805480156120ea57602002820191906000526020600020905b8154815260200190600101908083116120d6575b50505091835250506008919091015460ff16151560209091015292915050565b6060612115826123fc565b6000828152600760205260408120805461212e90613f26565b80601f016020809104026020016040519081016040528092919081815260200182805461215a90613f26565b80156121a75780601f1061217c576101008083540402835291602001916121a7565b820191906000526020600020905b81548152906001019060200180831161218a57829003601f168201915b5050505050905060006121c560408051602081019091526000815290565b90508051600014156121d8575092915050565b81511561220a5780826040516020016121f2929190613ab5565b60405160208183030381529060405292505050919050565b61221384612f8c565b949350505050565b6002600054141561223e5760405162461bcd60e51b81526004016107a190613dc2565b60026000818155848152600d6020526040902001546001600160a01b0316331461227a5760405162461bcd60e51b81526004016107a190613ce5565b6000821161229a5760405162461bcd60e51b81526004016107a190613df9565b600c5460ff610100909104161515600114156122d057600081116122d05760405162461bcd60e51b81526004016107a190613d2f565b6000838152600d6020526040902060088101805460ff1916905560048101839055600581018290556001810180546001600160a01b031990811633179091556002909101805490911630179055612327600a613000565b612332333085612525565b60408051848152336020820152908101839052606081018290527f0271793d77743469d9f68cc69a18d0e9f736c1b37dd0653d263cbb82408eb9489060800160405180910390a15050600160005550565b61238b6124c9565b6001600160a01b0381166123f05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107a1565b6123f981613057565b50565b6000818152600360205260409020546001600160a01b03166123f95760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016107a1565b600081815260056020526040902080546001600160a01b0319166001600160a01b03841690811790915581906124908261140c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6008546001600160a01b031633146125235760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107a1565b565b826001600160a01b03166125388261140c565b6001600160a01b03161461259c5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016107a1565b6001600160a01b0382166125fe5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016107a1565b61260960008261245b565b6001600160a01b0383166000908152600460205260408120805460019290612632908490613ee3565b90915550506001600160a01b0382166000908152600460205260408120805460019290612660908490613e98565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000806126cd8361140c565b9050806001600160a01b0316846001600160a01b0316148061271457506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b806122135750836001600160a01b031661272d84610705565b6001600160a01b031614949350505050565b80518251146127605760405162461bcd60e51b81526004016107a190613c39565b8360006103e86127708684613ec4565b61277a9190613eb0565b90506127868187613ee3565b6040519096506001600160a01b0388169082156108fc029083906000818181858888f193505050501580156127bf573d6000803e3d6000fd5b508351612802576040516001600160a01b0389169087156108fc029088906000818181858888f193505050501580156127fc573d6000803e3d6000fd5b5061293c565b60005b845181101561290357600084828151811061283057634e487b7160e01b600052603260045260246000fd5b602002602001015111156128f15760006103e88486848151811061286457634e487b7160e01b600052603260045260246000fd5b60200260200101516128769190613ec4565b6128809190613eb0565b905061288c8189613ee3565b97508582815181106128ae57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166108fc829081150290604051600060405180830381858888f193505050501580156128ee573d6000803e3d6000fd5b50505b806128fb81613f61565b915050612805565b506040516001600160a01b0389169087156108fc029088906000818181858888f1935050505015801561293a573d6000803e3d6000fd5b505b5050505050505050565b81518351146129675760405162461bcd60e51b81526004016107a190613c39565b60006103e86129768688613ec4565b6129809190613eb0565b600c5490915060ff16151560011415612a245761299d8187613ee3565b6040516323b872dd60e01b81529096506001600160a01b038316906323b872dd906129d09033908b908690600401613ae4565b602060405180830381600087803b1580156129ea57600080fd5b505af11580156129fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a229190613726565b505b8351612aac576040516323b872dd60e01b81526001600160a01b038316906323b872dd90612a5a9033908c908b90600401613ae4565b602060405180830381600087803b158015612a7457600080fd5b505af1158015612a88573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127fc9190613726565b60005b8451811015612c2b576000848281518110612ada57634e487b7160e01b600052603260045260246000fd5b60200260200101511115612c195760006103e888868481518110612b0e57634e487b7160e01b600052603260045260246000fd5b6020026020010151612b209190613ec4565b612b2a9190613eb0565b9050612b368189613ee3565b9750836001600160a01b03166323b872dd8b888581518110612b6857634e487b7160e01b600052603260045260246000fd5b6020026020010151846040518463ffffffff1660e01b8152600401612b8f93929190613ae4565b602060405180830381600087803b158015612ba957600080fd5b505af1158015612bbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612be19190613726565b50848281518110612c0257634e487b7160e01b600052603260045260246000fd5b602002602001015188612c159190613ee3565b9750505b80612c2381613f61565b915050612aaf565b506040516323b872dd60e01b81526001600160a01b038316906323b872dd90612c5c9033908c908b90600401613ae4565b602060405180830381600087803b158015612c7657600080fd5b505af1158015612c8a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293a9190613726565b6001600160a01b038216612d045760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016107a1565b6000818152600360205260409020546001600160a01b031615612d695760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016107a1565b6001600160a01b0382166000908152600460205260408120805460019290612d92908490613e98565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000828152600360205260409020546001600160a01b0316612e6b5760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b60648201526084016107a1565b60008281526007602090815260409091208251610842928401906133d9565b816001600160a01b0316836001600160a01b03161415612eec5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016107a1565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612f64848484612525565b612f70848484846130a9565b6108d15760405162461bcd60e51b81526004016107a190613be7565b6060612f97826123fc565b6000612fae60408051602081019091526000815290565b90506000815111612fce5760405180602001604052806000815250612ff9565b80612fd8846131b6565b604051602001612fe9929190613ab5565b6040516020818303038152906040525b9392505050565b80548061304f5760405162461bcd60e51b815260206004820152601b60248201527f436f756e7465723a2064656372656d656e74206f766572666c6f77000000000060448201526064016107a1565b600019019055565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006001600160a01b0384163b156131ab57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906130ed903390899088908890600401613b08565b602060405180830381600087803b15801561310757600080fd5b505af1925050508015613137575060408051601f3d908101601f191682019092526131349181019061375e565b60015b613191573d808015613165576040519150601f19603f3d011682016040523d82523d6000602084013e61316a565b606091505b5080516131895760405162461bcd60e51b81526004016107a190613be7565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612213565b506001949350505050565b6060816131da5750506040805180820190915260018152600360fc1b602082015290565b8160005b811561320457806131ee81613f61565b91506131fd9050600a83613eb0565b91506131de565b60008167ffffffffffffffff81111561322d57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015613257576020820181803683370190505b5090505b84156122135761326c600183613ee3565b9150613279600a86613f7c565b613284906030613e98565b60f81b8183815181106132a757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506132c9600a86613eb0565b945061325b565b6040518061012001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160608152602001606081526020016000151581525090565b82805482825590600052602060002090810192821561338e579160200282015b8281111561338e57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190613359565b5061339a92915061344c565b5090565b82805482825590600052602060002090810192821561338e579160200282015b8281111561338e5782518255916020019190600101906133be565b8280546133e590613f26565b90600052602060002090601f016020900481019282613407576000855561338e565b82601f1061342057805160ff191683800117855561338e565b8280016001018555821561338e579182018281111561338e5782518255916020019190600101906133be565b5b8082111561339a576000815560010161344d565b600067ffffffffffffffff83111561347b5761347b613fbc565b61348e601f8401601f1916602001613e43565b90508281528383830111156134a257600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b03811681146134d057600080fd5b919050565b600082601f8301126134e5578081fd5b813560206134fa6134f583613e74565b613e43565b80838252828201915082860187848660051b8901011115613519578586fd5b855b8581101561353e5761352c826134b9565b8452928401929084019060010161351b565b5090979650505050505050565b600082601f83011261355b578081fd5b8135602061356b6134f583613e74565b80838252828201915082860187848660051b890101111561358a578586fd5b855b8581101561353e5781358452928401929084019060010161358c565b600082601f8301126135b8578081fd5b612ff983833560208501613461565b6000602082840312156135d8578081fd5b612ff9826134b9565b600080604083850312156135f3578081fd5b6135fc836134b9565b915061360a602084016134b9565b90509250929050565b600080600060608486031215613627578081fd5b613630846134b9565b925061363e602085016134b9565b9150604084013590509250925092565b60008060008060808587031215613663578081fd5b61366c856134b9565b935061367a602086016134b9565b925060408501359150606085013567ffffffffffffffff81111561369c578182fd5b8501601f810187136136ac578182fd5b6136bb87823560208401613461565b91505092959194509250565b600080604083850312156136d9578182fd5b6136e2836134b9565b915060208301356136f281613fd2565b809150509250929050565b6000806040838503121561370f578182fd5b613718836134b9565b946020939093013593505050565b600060208284031215613737578081fd5b8151612ff981613fd2565b600060208284031215613753578081fd5b8135612ff981613fe0565b60006020828403121561376f578081fd5b8151612ff981613fe0565b60008060008060008060c08789031215613792578384fd5b863567ffffffffffffffff808211156137a9578586fd5b6137b58a838b016135a8565b97506137c360208a016134b9565b9650604089013595506060890135945060808901359150808211156137e6578384fd5b6137f28a838b016134d5565b935060a0890135915080821115613807578283fd5b5061381489828a0161354b565b9150509295509295509295565b600080600080600080600060e0888a03121561383b578485fd5b873567ffffffffffffffff80821115613852578687fd5b61385e8b838c016135a8565b985061386c60208b016134b9565b975060408a0135965060608a0135955060808a013591508082111561388f578283fd5b61389b8b838c016134d5565b945060a08a01359150808211156138b0578283fd5b506138bd8a828b0161354b565b9250506138cc60c089016134b9565b905092959891949750929550565b6000602082840312156138eb578081fd5b5035919050565b600060208284031215613903578081fd5b5051919050565b6000806040838503121561391c578182fd5b8235915061360a602084016134b9565b600080600060608486031215613940578081fd5b505081359360208301359350604090920135919050565b6000815180845260208085019450808401835b8381101561398f5781516001600160a01b03168752958201959082019060010161396a565b509495945050505050565b6000815180845260208085019450808401835b8381101561398f578151875295820195908201906001016139ad565b600081518084526139e1816020860160208601613efa565b601f01601f19169290920160200192915050565b6000610120825184526020830151613a1860208601826001600160a01b03169052565b506040830151613a3360408601826001600160a01b03169052565b506060830151613a4e60608601826001600160a01b03169052565b506080830151608085015260a083015160a085015260c08301518160c0860152613a7a82860182613957565b91505060e083015184820360e0860152613a94828261399a565b91505061010080840151613aab8287018215159052565b5090949350505050565b60008351613ac7818460208801613efa565b835190830190613adb818360208801613efa565b01949350505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613b3b908301846139c9565b9695505050505050565b604081526000613b586040830185613957565b8281036020840152613b6a818561399a565b95945050505050565b6000602080830181845280855180835260408601915060408160051b8701019250838701855b82811015613bc757603f19888603018452613bb58583516139f5565b94509285019290850190600101613b99565b5092979650505050505050565b602081526000612ff960208301846139c9565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602e908201527f526f79616c74792041646472657373657320416e642046656573204d7573742060408201526d084ca40a6c2daca4098cadccee8d60931b606082015260800190565b602080825260409082018190527f506c65617365207375626d6974207468652061736b696e672070726963652069908201527f6e206f7264657220746f20636f6d706c65746520746865207075726368617365606082015260800190565b6020808252602a908201527f4f6e6c79206974656d206f776e65722063616e20706572666f726d20746869736040820152691037b832b930ba34b7b760b11b606082015260800190565b60208082526025908201527f546f6b656e205072696365204d7573742042652047726561746572205468616e604082015264205a65726f60d81b606082015260800190565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601c908201527f5072696365206d757374206265206174206c6561737420312077656900000000604082015260600190565b602081526000612ff960208301846139f5565b604051601f8201601f1916810167ffffffffffffffff81118282101715613e6c57613e6c613fbc565b604052919050565b600067ffffffffffffffff821115613e8e57613e8e613fbc565b5060051b60200190565b60008219821115613eab57613eab613f90565b500190565b600082613ebf57613ebf613fa6565b500490565b6000816000190483118215151615613ede57613ede613f90565b500290565b600082821015613ef557613ef5613f90565b500390565b60005b83811015613f15578181015183820152602001613efd565b838111156108d15750506000910152565b600181811c90821680613f3a57607f821691505b60208210811415613f5b57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613f7557613f75613f90565b5060010190565b600082613f8b57613f8b613fa6565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146123f957600080fd5b6001600160e01b0319811681146123f957600080fdfea26469706673582212202a8d1c07a235f20d7b6bedda52d01b7ddfab2f55c92ede455bb0cd3e61acb90264736f6c63430008040033
Deployed Bytecode
0x6080604052600436106101e75760003560e01c8063715018a611610102578063b88d4fde11610095578063c87b56dd11610064578063c87b56dd14610578578063e985e9c514610598578063ea31247a146105e1578063f2fde38b1461060157600080fd5b8063b88d4fde146104ea578063bdbd735b1461050a578063c57dc2351461051d578063c7be7a491461054b57600080fd5b806395d89b41116100d157806395d89b41146104755780639e252f001461048a578063a22cb465146104aa578063ae677aa3146104ca57600080fd5b8063715018a614610402578063799e5a76146104175780637af0d9e2146104375780638da5cb5b1461045757600080fd5b8063202e37401161017a57806342842e0e1161014957806342842e0e1461038d57806345f8fa80146103ad5780636352211e146103c257806370a08231146103e257600080fd5b8063202e37401461032557806323b872dd1461033a5780632d296bf11461035a57806340e2b4b81461036d57600080fd5b80630d65df9b116101b65780630d65df9b146102a45780630f08efe0146102c457806310061631146102e657806312e855851461030657600080fd5b806301ffc9a7146101f357806306fdde0314610228578063081812fc1461024a578063095ea7b31461028257600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b5061021361020e366004613742565b610621565b60405190151581526020015b60405180910390f35b34801561023457600080fd5b5061023d610673565b60405161021f9190613bd4565b34801561025657600080fd5b5061026a6102653660046138da565b610705565b6040516001600160a01b03909116815260200161021f565b34801561028e57600080fd5b506102a261029d3660046136fd565b61072c565b005b3480156102b057600080fd5b506102a26102bf366004613613565b610847565b3480156102d057600080fd5b506102d96108d7565b60405161021f9190613b73565b3480156102f257600080fd5b506102a26103013660046138da565b610b37565b34801561031257600080fd5b50600b545b60405190815260200161021f565b34801561033157600080fd5b506102d9610bf6565b34801561034657600080fd5b506102a2610355366004613613565b610e94565b6102a26103683660046138da565b610ec5565b34801561037957600080fd5b506102a261038836600461392c565b6110c7565b34801561039957600080fd5b506102a26103a8366004613613565b611153565b3480156103b957600080fd5b506102d961116e565b3480156103ce57600080fd5b5061026a6103dd3660046138da565b61140c565b3480156103ee57600080fd5b506103176103fd3660046135c7565b61146c565b34801561040e57600080fd5b506102a26114f2565b34801561042357600080fd5b506102a261043236600461390a565b611560565b34801561044357600080fd5b506102a2610452366004613821565b611857565b34801561046357600080fd5b506008546001600160a01b031661026a565b34801561048157600080fd5b5061023d611b40565b34801561049657600080fd5b506102a26104a53660046138da565b611b4f565b3480156104b657600080fd5b506102a26104c53660046136c7565b611bd8565b3480156104d657600080fd5b506102a26104e53660046138da565b611be3565b3480156104f657600080fd5b506102a261050536600461364e565b611c5b565b6102a261051836600461377a565b611c8d565b34801561052957600080fd5b5061053d6105383660046138da565b611eeb565b60405161021f929190613b45565b34801561055757600080fd5b5061056b6105663660046138da565b611fd4565b60405161021f9190613e30565b34801561058457600080fd5b5061023d6105933660046138da565b61210a565b3480156105a457600080fd5b506102136105b33660046135e1565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b3480156105ed57600080fd5b506102a26105fc36600461392c565b61221b565b34801561060d57600080fd5b506102a261061c3660046135c7565b612383565b60006001600160e01b031982166380ac58cd60e01b148061065257506001600160e01b03198216635b5e139f60e01b145b8061066d57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606001805461068290613f26565b80601f01602080910402602001604051908101604052809291908181526020018280546106ae90613f26565b80156106fb5780601f106106d0576101008083540402835291602001916106fb565b820191906000526020600020905b8154815290600101906020018083116106de57829003601f168201915b5050505050905090565b6000610710826123fc565b506000908152600560205260409020546001600160a01b031690565b60006107378261140c565b9050806001600160a01b0316836001600160a01b031614156107aa5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806107c657506107c681336105b3565b6108385760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c000060648201526084016107a1565b610842838361245b565b505050565b61084f6124c9565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401602060405180830381600087803b15801561089957600080fd5b505af11580156108ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d19190613726565b50505050565b606060006108e460095490565b905060006108f1600a5490565b6009546108fe9190613ee3565b90506000808267ffffffffffffffff81111561092a57634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561096357816020015b6109506132d0565b8152602001906001900390816109485790505b50905060005b84811015610b2e5730600d6000610981846001613e98565b81526020810191909152604001600020600201546001600160a01b03161415610b1c5760006109b1826001613e98565b6000818152600d60209081526040918290208251610120810184528154815260018201546001600160a01b03908116828501526002830154811682860152600383015416606082015260048201546080820152600582015460a082015260068201805485518186028101860190965280865295965091949093859360c0860193919290830182828015610a6d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a4f575b5050505050815260200160078201805480602002602001604051908101604052809291908181526020018280548015610ac557602002820191906000526020600020905b815481526020019060010190808311610ab1575b50505091835250506008919091015460ff1615156020909101528451859087908110610b0157634e487b7160e01b600052603260045260246000fd5b6020908102919091010152610b17600186613e98565b945050505b80610b2681613f61565b915050610969565b50949350505050565b6000818152600d60205260409020600101546001600160a01b03163314610b705760405162461bcd60e51b81526004016107a190613ce5565b6000818152600d6020526040902060088101805460ff191690556001810180546001600160a01b031990811630179091556002909101805490911633179055610bbd600a80546001019055565b610bc8303383612525565b60405181907fd371e668750cb458fa9a55e99ade07ce913d63ab733d6e30fe303723e106cf9690600090a250565b60606000610c0360095490565b905060008060005b83811015610c665733600d6000610c23846001613e98565b81526020810191909152604001600020600201546001600160a01b03161415610c5457610c51600184613e98565b92505b80610c5e81613f61565b915050610c0b565b5060008267ffffffffffffffff811115610c9057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610cc957816020015b610cb66132d0565b815260200190600190039081610cae5790505b50905060005b84811015610b2e5733600d6000610ce7846001613e98565b81526020810191909152604001600020600201546001600160a01b03161415610e82576000610d17826001613e98565b6000818152600d60209081526040918290208251610120810184528154815260018201546001600160a01b03908116828501526002830154811682860152600383015416606082015260048201546080820152600582015460a082015260068201805485518186028101860190965280865295965091949093859360c0860193919290830182828015610dd357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610db5575b5050505050815260200160078201805480602002602001604051908101604052809291908181526020018280548015610e2b57602002820191906000526020600020905b815481526020019060010190808311610e17575b50505091835250506008919091015460ff1615156020909101528451859087908110610e6757634e487b7160e01b600052603260045260246000fd5b6020908102919091010152610e7d600186613e98565b945050505b80610e8c81613f61565b915050610ccf565b610e9e33826126c1565b610eba5760405162461bcd60e51b81526004016107a190613d74565b610842838383612525565b60026000541415610ee85760405162461bcd60e51b81526004016107a190613dc2565b60026000908155818152600d60209081526040808320600481015460069091018054835181860281018601909452808452919493909190830182828015610f5857602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610f3a575b505050505090506000600d6000858152602001908152602001600020600701805480602002602001604051908101604052809291908181526020018280548015610fc157602002820191906000526020600020905b815481526020019060010190808311610fad575b5050506000878152600d6020526040902060010154929350506001600160a01b0390911690503484146110065760405162461bcd60e51b81526004016107a190613c87565b6000858152600d602052604090206002810180546001600160a01b0319908116331790915560088201805460ff19166001908117909155909101805490911630179055611057600a80546001019055565b611062303387612525565b611083816110786008546001600160a01b031690565b86600b54878761273f565b604051859033906001600160a01b038416907f9c8515990fd8c61431c4ac8db9b81475f90c292a1dda77731e56c22e64fc764390600090a450506001600055505050565b6000838152600d60205260409020600101546001600160a01b031633146111005760405162461bcd60e51b81526004016107a190613ce5565b600c5460ff6101009091041615156001141561113657600081116111365760405162461bcd60e51b81526004016107a190613d2f565b6000928352600d6020526040909220600481019190915560050155565b61084283838360405180602001604052806000815250611c5b565b6060600061117b60095490565b905060008060005b838110156111de5733600d600061119b846001613e98565b81526020810191909152604001600020600101546001600160a01b031614156111cc576111c9600184613e98565b92505b806111d681613f61565b915050611183565b5060008267ffffffffffffffff81111561120857634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561124157816020015b61122e6132d0565b8152602001906001900390816112265790505b50905060005b84811015610b2e5733600d600061125f846001613e98565b81526020810191909152604001600020600101546001600160a01b031614156113fa57600061128f826001613e98565b6000818152600d60209081526040918290208251610120810184528154815260018201546001600160a01b03908116828501526002830154811682860152600383015416606082015260048201546080820152600582015460a082015260068201805485518186028101860190965280865295965091949093859360c086019391929083018282801561134b57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161132d575b50505050508152602001600782018054806020026020016040519081016040528092919081815260200182805480156113a357602002820191906000526020600020905b81548152602001906001019080831161138f575b50505091835250506008919091015460ff16151560209091015284518590879081106113df57634e487b7160e01b600052603260045260246000fd5b60209081029190910101526113f5600186613e98565b945050505b8061140481613f61565b915050611247565b6000818152600360205260408120546001600160a01b03168061066d5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016107a1565b60006001600160a01b0382166114d65760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016107a1565b506001600160a01b031660009081526004602052604090205490565b60405162461bcd60e51b815260206004820152603d60248201527f556e666f7274756e6174656c7920796f752063616e6e6f742072656e6f756e6360448201527f65204f776e657273686970206f66207468697320636f6e74726163742100000060648201526084016107a1565b600260005414156115835760405162461bcd60e51b81526004016107a190613dc2565b60026000908155828152600d60209081526040808320600581015460018201546006909201805484518187028101870190955280855291956001600160a01b039093169492939290919083018282801561160657602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116115e8575b505050505090506000600d600087815260200190815260200160002060070180548060200260200160405190810160405280929190818152602001828054801561166f57602002820191906000526020600020905b81548152602001906001019080831161165b575b50506040516370a0823160e01b815233600482015293945050506001600160a01b038716916370a08231915060240160206040518083038186803b1580156116b657600080fd5b505afa1580156116ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ee91906138f2565b8411156117315760405162461bcd60e51b81526020600482015260116024820152706e6f7420656e6f75676820746f6b656e7360781b60448201526064016107a1565b600084116117985760405162461bcd60e51b815260206004820152602e60248201527f746f6b656e206f7074696f6e206973206e6f742061637469766520666f72207460448201526d686973206173736574207965742160901b60648201526084016107a1565b6000868152600d6020526040902060088101805460ff191690556002810180546001600160a01b0319908116331790915560019091018054909116301790556117e5600a80546001019055565b6117f0303388612525565b611812836118066008546001600160a01b031690565b86600b5486868b612946565b604051869033906001600160a01b038616907f9c8515990fd8c61431c4ac8db9b81475f90c292a1dda77731e56c22e64fc764390600090a45050600160005550505050565b6002600054141561187a5760405162461bcd60e51b81526004016107a190613dc2565b60026000556040516370a0823160e01b81523360048201526001600160a01b038216906370a082319060240160206040518083038186803b1580156118be57600080fd5b505afa1580156118d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f691906138f2565b84111561193a5760405162461bcd60e51b81526020600482015260126024820152716e6f7420656e6f7567682020746f6b656e7360701b60448201526064016107a1565b6000841161195a5760405162461bcd60e51b81526004016107a190613d2f565b6000851161197a5760405162461bcd60e51b81526004016107a190613df9565b611988600980546001019055565b600061199360095490565b905061199f3382612cae565b6119a98189612df0565b6119b7600a80546001019055565b60408051610120810182528281526001600160a01b03808a1660208084018281523385870190815260608601938452608086018d815260a087018d815260c088018d815260e089018d905260006101008a018190528b8152600d8752999099208851815593516001850180549189166001600160a01b0319928316179055925160028501805491891691851691909117905594516003840180549190971692169190911790945592516004840155905160058301559251805192939192611a849260068501920190613339565b5060e08201518051611aa091600784019160209091019061339e565b5061010091909101516008918201805460ff191691151591909117905554611ad99088906001600160a01b031687600b54888888612946565b604080513081523360208201526001600160a01b038916818301526060810188905260006080820152905182917fd6b5a2ea507e15741fd76fed025e0dfe9294bea94de5e3359d76d718efd991bd919081900360a00190a250506001600055505050505050565b60606002805461068290613f26565b611b576124c9565b80471015611ba75760405162461bcd60e51b815260206004820152601a60248201527f696e73756666696369656e7420546f6b656e2062616c616e636500000000000060448201526064016107a1565b604051339082156108fc029083906000818181858888f19350505050158015611bd4573d6000803e3d6000fd5b5050565b611bd4338383612e8a565b611beb6124c9565b6101f4811115611c565760405162461bcd60e51b815260206004820152603060248201527f56616c7565204f766572666c6f773a205374617465642056616c75652049732060448201526f10589bdd99480d4c081c195c98d95b9d60821b60648201526084016107a1565b600b55565b611c6533836126c1565b611c815760405162461bcd60e51b81526004016107a190613d74565b6108d184848484612f59565b60026000541415611cb05760405162461bcd60e51b81526004016107a190613dc2565b600260005583611cd25760405162461bcd60e51b81526004016107a190613df9565b833414611cf15760405162461bcd60e51b81526004016107a190613c87565b600c5460ff61010090910416151560011415611d275760008311611d275760405162461bcd60e51b81526004016107a190613d2f565b611d35600980546001019055565b6000611d4060095490565b9050611d4c3382612cae565b611d568188612df0565b611d64600a80546001019055565b60408051610120810182528281526001600160a01b0380891660208084018281523385870190815260608601938452608086018c815260a087018c815260c088018c815260e089018c905260006101008a018190528b8152600d8752999099208851815593516001850180549189166001600160a01b0319928316179055925160028501805491891691851691909117905594516003840180549190971692169190911790945592516004840155905160058301559251805192939192611e319260068501920190613339565b5060e08201518051611e4d91600784019160209091019061339e565b5061010091909101516008918201805460ff191691151591909117905554611e859087906001600160a01b031687600b54878761273f565b604080513081523360208201526001600160a01b038816818301526060810187905260006080820152905182917fd6b5a2ea507e15741fd76fed025e0dfe9294bea94de5e3359d76d718efd991bd919081900360a00190a2505060016000555050505050565b6060806000600d6000858152602001908152602001600020600601805480602002602001604051908101604052809291908181526020018280548015611f5a57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611f3c575b505050505090506000600d6000868152602001908152602001600020600701805480602002602001604051908101604052809291908181526020018280548015611fc357602002820191906000526020600020905b815481526020019060010190808311611faf575b509599939850929650505050505050565b611fdc6132d0565b6000828152600d60209081526040918290208251610120810184528154815260018201546001600160a01b03908116828501526002830154811682860152600383015416606082015260048201546080820152600582015460a08201526006820180548551818602810186019096528086529194929360c0860193929083018282801561209257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612074575b50505050508152602001600782018054806020026020016040519081016040528092919081815260200182805480156120ea57602002820191906000526020600020905b8154815260200190600101908083116120d6575b50505091835250506008919091015460ff16151560209091015292915050565b6060612115826123fc565b6000828152600760205260408120805461212e90613f26565b80601f016020809104026020016040519081016040528092919081815260200182805461215a90613f26565b80156121a75780601f1061217c576101008083540402835291602001916121a7565b820191906000526020600020905b81548152906001019060200180831161218a57829003601f168201915b5050505050905060006121c560408051602081019091526000815290565b90508051600014156121d8575092915050565b81511561220a5780826040516020016121f2929190613ab5565b60405160208183030381529060405292505050919050565b61221384612f8c565b949350505050565b6002600054141561223e5760405162461bcd60e51b81526004016107a190613dc2565b60026000818155848152600d6020526040902001546001600160a01b0316331461227a5760405162461bcd60e51b81526004016107a190613ce5565b6000821161229a5760405162461bcd60e51b81526004016107a190613df9565b600c5460ff610100909104161515600114156122d057600081116122d05760405162461bcd60e51b81526004016107a190613d2f565b6000838152600d6020526040902060088101805460ff1916905560048101839055600581018290556001810180546001600160a01b031990811633179091556002909101805490911630179055612327600a613000565b612332333085612525565b60408051848152336020820152908101839052606081018290527f0271793d77743469d9f68cc69a18d0e9f736c1b37dd0653d263cbb82408eb9489060800160405180910390a15050600160005550565b61238b6124c9565b6001600160a01b0381166123f05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107a1565b6123f981613057565b50565b6000818152600360205260409020546001600160a01b03166123f95760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016107a1565b600081815260056020526040902080546001600160a01b0319166001600160a01b03841690811790915581906124908261140c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6008546001600160a01b031633146125235760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107a1565b565b826001600160a01b03166125388261140c565b6001600160a01b03161461259c5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016107a1565b6001600160a01b0382166125fe5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016107a1565b61260960008261245b565b6001600160a01b0383166000908152600460205260408120805460019290612632908490613ee3565b90915550506001600160a01b0382166000908152600460205260408120805460019290612660908490613e98565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000806126cd8361140c565b9050806001600160a01b0316846001600160a01b0316148061271457506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b806122135750836001600160a01b031661272d84610705565b6001600160a01b031614949350505050565b80518251146127605760405162461bcd60e51b81526004016107a190613c39565b8360006103e86127708684613ec4565b61277a9190613eb0565b90506127868187613ee3565b6040519096506001600160a01b0388169082156108fc029083906000818181858888f193505050501580156127bf573d6000803e3d6000fd5b508351612802576040516001600160a01b0389169087156108fc029088906000818181858888f193505050501580156127fc573d6000803e3d6000fd5b5061293c565b60005b845181101561290357600084828151811061283057634e487b7160e01b600052603260045260246000fd5b602002602001015111156128f15760006103e88486848151811061286457634e487b7160e01b600052603260045260246000fd5b60200260200101516128769190613ec4565b6128809190613eb0565b905061288c8189613ee3565b97508582815181106128ae57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166108fc829081150290604051600060405180830381858888f193505050501580156128ee573d6000803e3d6000fd5b50505b806128fb81613f61565b915050612805565b506040516001600160a01b0389169087156108fc029088906000818181858888f1935050505015801561293a573d6000803e3d6000fd5b505b5050505050505050565b81518351146129675760405162461bcd60e51b81526004016107a190613c39565b60006103e86129768688613ec4565b6129809190613eb0565b600c5490915060ff16151560011415612a245761299d8187613ee3565b6040516323b872dd60e01b81529096506001600160a01b038316906323b872dd906129d09033908b908690600401613ae4565b602060405180830381600087803b1580156129ea57600080fd5b505af11580156129fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a229190613726565b505b8351612aac576040516323b872dd60e01b81526001600160a01b038316906323b872dd90612a5a9033908c908b90600401613ae4565b602060405180830381600087803b158015612a7457600080fd5b505af1158015612a88573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127fc9190613726565b60005b8451811015612c2b576000848281518110612ada57634e487b7160e01b600052603260045260246000fd5b60200260200101511115612c195760006103e888868481518110612b0e57634e487b7160e01b600052603260045260246000fd5b6020026020010151612b209190613ec4565b612b2a9190613eb0565b9050612b368189613ee3565b9750836001600160a01b03166323b872dd8b888581518110612b6857634e487b7160e01b600052603260045260246000fd5b6020026020010151846040518463ffffffff1660e01b8152600401612b8f93929190613ae4565b602060405180830381600087803b158015612ba957600080fd5b505af1158015612bbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612be19190613726565b50848281518110612c0257634e487b7160e01b600052603260045260246000fd5b602002602001015188612c159190613ee3565b9750505b80612c2381613f61565b915050612aaf565b506040516323b872dd60e01b81526001600160a01b038316906323b872dd90612c5c9033908c908b90600401613ae4565b602060405180830381600087803b158015612c7657600080fd5b505af1158015612c8a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293a9190613726565b6001600160a01b038216612d045760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016107a1565b6000818152600360205260409020546001600160a01b031615612d695760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016107a1565b6001600160a01b0382166000908152600460205260408120805460019290612d92908490613e98565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000828152600360205260409020546001600160a01b0316612e6b5760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b60648201526084016107a1565b60008281526007602090815260409091208251610842928401906133d9565b816001600160a01b0316836001600160a01b03161415612eec5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016107a1565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612f64848484612525565b612f70848484846130a9565b6108d15760405162461bcd60e51b81526004016107a190613be7565b6060612f97826123fc565b6000612fae60408051602081019091526000815290565b90506000815111612fce5760405180602001604052806000815250612ff9565b80612fd8846131b6565b604051602001612fe9929190613ab5565b6040516020818303038152906040525b9392505050565b80548061304f5760405162461bcd60e51b815260206004820152601b60248201527f436f756e7465723a2064656372656d656e74206f766572666c6f77000000000060448201526064016107a1565b600019019055565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006001600160a01b0384163b156131ab57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906130ed903390899088908890600401613b08565b602060405180830381600087803b15801561310757600080fd5b505af1925050508015613137575060408051601f3d908101601f191682019092526131349181019061375e565b60015b613191573d808015613165576040519150601f19603f3d011682016040523d82523d6000602084013e61316a565b606091505b5080516131895760405162461bcd60e51b81526004016107a190613be7565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612213565b506001949350505050565b6060816131da5750506040805180820190915260018152600360fc1b602082015290565b8160005b811561320457806131ee81613f61565b91506131fd9050600a83613eb0565b91506131de565b60008167ffffffffffffffff81111561322d57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015613257576020820181803683370190505b5090505b84156122135761326c600183613ee3565b9150613279600a86613f7c565b613284906030613e98565b60f81b8183815181106132a757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506132c9600a86613eb0565b945061325b565b6040518061012001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160608152602001606081526020016000151581525090565b82805482825590600052602060002090810192821561338e579160200282015b8281111561338e57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190613359565b5061339a92915061344c565b5090565b82805482825590600052602060002090810192821561338e579160200282015b8281111561338e5782518255916020019190600101906133be565b8280546133e590613f26565b90600052602060002090601f016020900481019282613407576000855561338e565b82601f1061342057805160ff191683800117855561338e565b8280016001018555821561338e579182018281111561338e5782518255916020019190600101906133be565b5b8082111561339a576000815560010161344d565b600067ffffffffffffffff83111561347b5761347b613fbc565b61348e601f8401601f1916602001613e43565b90508281528383830111156134a257600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b03811681146134d057600080fd5b919050565b600082601f8301126134e5578081fd5b813560206134fa6134f583613e74565b613e43565b80838252828201915082860187848660051b8901011115613519578586fd5b855b8581101561353e5761352c826134b9565b8452928401929084019060010161351b565b5090979650505050505050565b600082601f83011261355b578081fd5b8135602061356b6134f583613e74565b80838252828201915082860187848660051b890101111561358a578586fd5b855b8581101561353e5781358452928401929084019060010161358c565b600082601f8301126135b8578081fd5b612ff983833560208501613461565b6000602082840312156135d8578081fd5b612ff9826134b9565b600080604083850312156135f3578081fd5b6135fc836134b9565b915061360a602084016134b9565b90509250929050565b600080600060608486031215613627578081fd5b613630846134b9565b925061363e602085016134b9565b9150604084013590509250925092565b60008060008060808587031215613663578081fd5b61366c856134b9565b935061367a602086016134b9565b925060408501359150606085013567ffffffffffffffff81111561369c578182fd5b8501601f810187136136ac578182fd5b6136bb87823560208401613461565b91505092959194509250565b600080604083850312156136d9578182fd5b6136e2836134b9565b915060208301356136f281613fd2565b809150509250929050565b6000806040838503121561370f578182fd5b613718836134b9565b946020939093013593505050565b600060208284031215613737578081fd5b8151612ff981613fd2565b600060208284031215613753578081fd5b8135612ff981613fe0565b60006020828403121561376f578081fd5b8151612ff981613fe0565b60008060008060008060c08789031215613792578384fd5b863567ffffffffffffffff808211156137a9578586fd5b6137b58a838b016135a8565b97506137c360208a016134b9565b9650604089013595506060890135945060808901359150808211156137e6578384fd5b6137f28a838b016134d5565b935060a0890135915080821115613807578283fd5b5061381489828a0161354b565b9150509295509295509295565b600080600080600080600060e0888a03121561383b578485fd5b873567ffffffffffffffff80821115613852578687fd5b61385e8b838c016135a8565b985061386c60208b016134b9565b975060408a0135965060608a0135955060808a013591508082111561388f578283fd5b61389b8b838c016134d5565b945060a08a01359150808211156138b0578283fd5b506138bd8a828b0161354b565b9250506138cc60c089016134b9565b905092959891949750929550565b6000602082840312156138eb578081fd5b5035919050565b600060208284031215613903578081fd5b5051919050565b6000806040838503121561391c578182fd5b8235915061360a602084016134b9565b600080600060608486031215613940578081fd5b505081359360208301359350604090920135919050565b6000815180845260208085019450808401835b8381101561398f5781516001600160a01b03168752958201959082019060010161396a565b509495945050505050565b6000815180845260208085019450808401835b8381101561398f578151875295820195908201906001016139ad565b600081518084526139e1816020860160208601613efa565b601f01601f19169290920160200192915050565b6000610120825184526020830151613a1860208601826001600160a01b03169052565b506040830151613a3360408601826001600160a01b03169052565b506060830151613a4e60608601826001600160a01b03169052565b506080830151608085015260a083015160a085015260c08301518160c0860152613a7a82860182613957565b91505060e083015184820360e0860152613a94828261399a565b91505061010080840151613aab8287018215159052565b5090949350505050565b60008351613ac7818460208801613efa565b835190830190613adb818360208801613efa565b01949350505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613b3b908301846139c9565b9695505050505050565b604081526000613b586040830185613957565b8281036020840152613b6a818561399a565b95945050505050565b6000602080830181845280855180835260408601915060408160051b8701019250838701855b82811015613bc757603f19888603018452613bb58583516139f5565b94509285019290850190600101613b99565b5092979650505050505050565b602081526000612ff960208301846139c9565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602e908201527f526f79616c74792041646472657373657320416e642046656573204d7573742060408201526d084ca40a6c2daca4098cadccee8d60931b606082015260800190565b602080825260409082018190527f506c65617365207375626d6974207468652061736b696e672070726963652069908201527f6e206f7264657220746f20636f6d706c65746520746865207075726368617365606082015260800190565b6020808252602a908201527f4f6e6c79206974656d206f776e65722063616e20706572666f726d20746869736040820152691037b832b930ba34b7b760b11b606082015260800190565b60208082526025908201527f546f6b656e205072696365204d7573742042652047726561746572205468616e604082015264205a65726f60d81b606082015260800190565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601c908201527f5072696365206d757374206265206174206c6561737420312077656900000000604082015260600190565b602081526000612ff960208301846139f5565b604051601f8201601f1916810167ffffffffffffffff81118282101715613e6c57613e6c613fbc565b604052919050565b600067ffffffffffffffff821115613e8e57613e8e613fbc565b5060051b60200190565b60008219821115613eab57613eab613f90565b500190565b600082613ebf57613ebf613fa6565b500490565b6000816000190483118215151615613ede57613ede613f90565b500290565b600082821015613ef557613ef5613f90565b500390565b60005b83811015613f15578181015183820152602001613efd565b838111156108d15750506000910152565b600181811c90821680613f3a57607f821691505b60208210811415613f5b57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613f7557613f75613f90565b5060010190565b600082613f8b57613f8b613fa6565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146123f957600080fd5b6001600160e01b0319811681146123f957600080fdfea26469706673582212202a8d1c07a235f20d7b6bedda52d01b7ddfab2f55c92ede455bb0cd3e61acb90264736f6c63430008040033
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.