ERC-721
Overview
Max Total Supply
0 AINS
Holders
9
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 AINSLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
AINS
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // https://ains.domains pragma solidity ^0.8.20; // Importing OpenZeppelin's standard implementations for ERC721, Ownable, and ERC2981 import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/interfaces/IERC2981.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import {StringUtils} from "./libraries/StringUtils.sol"; import {Base64} from "./libraries/Base64.sol"; // AINS contract declaration inheriting ERC721 for NFTs, Ownable for ownership, and ERC2981 for royalties contract AINS is ERC721URIStorage, Ownable, ERC2981 { using Counters for Counters.Counter; // Counter utility for token IDs Counters.Counter private _tokenIds; // Internal counter for token IDs string public tld; // Top-level domain (TLD) managed by the contract // SVG parts for the NFT image, to be combined with domain names string svgPartOne = '<svg width="300" height="300" xmlns="http://www.w3.org/2000/svg"> <defs> <linearGradient id="customGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" style="stop-color:#FFA2FF; stop-opacity:1" /> <stop offset="50%" style="stop-color:#AE6CFF; stop-opacity:1" /> <stop offset="100%" style="stop-color:#8852FF; stop-opacity:1" /> </linearGradient> </defs> <rect width="300" height="300" fill="url(#customGradient)" /> <text x="50%" y="50%" fill="black" font-family="Arial" font-size="25" font-weight="bold" text-anchor="middle" dominant-baseline="middle">'; string svgPartTwo = "</text></svg>"; // Mappings for domain management mapping(string => address) public domains; // Domain name to owner address mapping(string => string) public records; // Domain name to additional records mapping(uint256 => string) public names; // Token ID to domain name mapping(address => string[]) private _ownedNames; // Owner address to list of owned domain names mapping(address => string) private _primaryDomain; // Owner address to primary domain name // Events for logging changes event DomainRegistered(address indexed owner, string name, uint256 tokenId); event PriceChanged(uint256 newPriceOneChar, uint256 newPriceTwoChar, uint256 newPriceThreeChar, uint256 newPriceFourSixChar, uint256 newPriceOthers); event RecordUpdated(string indexed name, string record); // Pricing based on the length of domain names uint256 public priceOneChar = 0; // Price for one-character domains uint256 public priceTwoChar = 0; // Price for two-character domains uint256 public priceThreeChar = 0; // Price for three-character domains uint256 public priceFourChar = 0; // Price for four-character domains uint256 public priceOthers = 0; // Price for all other domains // Constructor to initialize the contract with the specified top-level domain constructor(string memory _tld) payable ERC721("AI Name Service", "AINS") { tld = _tld; // Setting the top-level domain _setDefaultRoyalty(owner(), 500); // Setting a default royalty of 5% } // Function to allow domain owners to set their primary domain function setPrimaryDomain(string calldata name) external { require(domains[name] == msg.sender, "You do not own this domain"); require(_ownedNames[msg.sender].length > 0, "You do not own any domains"); _primaryDomain[msg.sender] = name; } // Function to get the primary domain of an owner function getPrimaryDomain(address _owner) external view returns (string memory) { return _primaryDomain[_owner]; } // Override of ERC165's supportsInterface to include ERC2981 function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC2981) returns (bool) { return super.supportsInterface(interfaceId); } // Function to allow the contract owner to withdraw ETH function withdraw(uint256 amount) external onlyOwner { require(address(this).balance >= amount, "Insufficient balance in contract"); payable(owner()).transfer(amount); } // Function to set pricing for domain registration function setPrices(uint256 _priceOneChar, uint256 _priceTwoChar, uint256 _priceThreeChar, uint256 _priceFourChar, uint256 _priceOthers) external onlyOwner { priceOneChar = _priceOneChar; priceTwoChar = _priceTwoChar; priceThreeChar = _priceThreeChar; priceFourChar = _priceFourChar; priceOthers = _priceOthers; emit PriceChanged(_priceOneChar, _priceTwoChar, _priceThreeChar, _priceFourChar, _priceOthers); } // Function for registering a new domain function register(string calldata name) external payable { require(domains[name] == address(0), "Domain already registered"); require(valid(name), "Invalid name"); require(check(name), "Invalid characters in name"); uint256 _price = price(name); require(msg.value >= _price, "Not enough ETH paid"); string memory _name = string(abi.encodePacked(name, ".", tld)); string memory finalSvg = string(abi.encodePacked(svgPartOne, _name, svgPartTwo)); uint256 newRecordId = _tokenIds.current(); string memory strLen = Strings.toString(bytes(name).length); string memory json = Base64.encode( bytes( string( abi.encodePacked( '{"name": "', _name, '", "description": "AI Name Service - .ai Web3 Domains", "image": "data:image/svg+xml;base64,', Base64.encode(bytes(finalSvg)), '","length":"', strLen, '"}' ) ) ) ); string memory finalTokenUri = string(abi.encodePacked("data:application/json;base64,", json)); _safeMint(msg.sender, newRecordId); _setTokenURI(newRecordId, finalTokenUri); domains[name] = msg.sender; names[newRecordId] = name; _ownedNames[msg.sender].push(name); _tokenIds.increment(); emit DomainRegistered(msg.sender, name, newRecordId); } // Function to calculate the price of a domain based on its length function price(string calldata name) public view returns (uint256) { uint256 len = StringUtils.strlen(name); require(len > 0 && len <= 50, "Invalid name length"); if (len == 1) { return priceOneChar; } else if (len == 2) { return priceTwoChar; } else if (len == 3) { return priceThreeChar; } else if (len >= 4 && len <= 6) { return priceFourChar; } else { return priceOthers; } } // Function to allow a domain owner to set a record for their domain. function setRecord(string calldata name, string calldata record) external { require(domains[name] == msg.sender, "You do not own this domain"); records[name] = record; emit RecordUpdated(name, record); } // Public function to reset the record of a domain. function resetRecord(string memory name) public { require(domains[name] == msg.sender, "Only domain owner can reset record"); _resetRecord(name); } // External function to get the record associated with a domain name. function getRecord(string calldata name) external view returns (string memory) { return records[name]; } // External function to get the count of domains owned by an address. function getOwnedDomainsCount(address _owner) external view returns (uint256) { return _ownedNames[_owner].length; } // External function to get a domain by the owner's address and an index. function getDomainByOwnerAndIndex(address _owner, uint256 index) external view returns (string memory) { require(index < _ownedNames[_owner].length, "Index out of bounds"); return _ownedNames[_owner][index]; } // Internal function to check the validity of a domain name. function valid(string calldata name) public pure returns (bool) { // Domain name must be between 1 and 50 characters. return StringUtils.strlen(name) >= 1 && StringUtils.strlen(name) <= 50; } // Internal function to check for invalid characters in a domain name. function check(string memory str) public pure returns (bool) { if (bytes(str).length > 50) return false; bytes memory strBytes = bytes(str); for (uint i = 0; i < strBytes.length; i++) { bytes1 charByte = strBytes[i]; // Reject uppercase letters and ensure only alphanumeric and certain special characters are used. if (charByte >= 0x41 && charByte <= 0x5A) return false; if (!((charByte >= 0x61 && charByte <= 0x7A) || (charByte >= 0x30 && charByte <= 0x39) || (charByte == 0x24) || (charByte > 0x7F))) { return false; } } return true; } //override function function transferFrom(address from, address to, uint256 tokenId) public override { super.transferFrom(from, to, tokenId); _updateOwnedNames(from, to, tokenId); _resetPrimaryDomainIfTransferred(from, names[tokenId]); _resetRecord(names[tokenId]); string memory domainName = names[tokenId]; domains[domainName] = to; // Update the domain's owner in the mapping } //override function function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public override { super.safeTransferFrom(from, to, tokenId, _data); _updateOwnedNames(from, to, tokenId); _resetPrimaryDomainIfTransferred(from, names[tokenId]); _resetRecord(names[tokenId]); string memory domainName = names[tokenId]; domains[domainName] = to; // Update the domain's owner in the mapping } function _resetRecord(string memory name) internal { if (domains[name] != address(0)) { records[name] = ""; emit RecordUpdated(name, ""); } } function _updateOwnedNames(address from, address to, uint256 tokenId) private { _removeName(from, names[tokenId]); _ownedNames[to].push(names[tokenId]); } //update owner function _removeName(address _owner, string memory nameToRemove) private { uint256 length = _ownedNames[_owner].length; for (uint256 i = 0; i < length; i++) { if (keccak256(bytes(_ownedNames[_owner][i])) == keccak256(bytes(nameToRemove))) { _ownedNames[_owner][i] = _ownedNames[_owner][length - 1]; _ownedNames[_owner].pop(); break; } } } //reset primary domain when transferred function _resetPrimaryDomainIfTransferred(address from, string memory name) private { if (keccak256(bytes(_primaryDomain[from])) == keccak256(bytes(name))) { _primaryDomain[from] = ""; } } //fetch names by owner function getNamesByOwner(address _owner) public view returns (string[] memory) { return _ownedNames[_owner]; } //fetch address with name function getAddress(string calldata name) public view returns (address) { return domains[name]; } //fetch all names function getAllNames() public view returns (string[] memory) { string[] memory allNames = new string[](_tokenIds.current()); for (uint256 i = 0; i < _tokenIds.current(); i++) { allNames[i] = names[i]; } return allNames; } //check if name exists function nameExists(string calldata name) public view returns (bool) { return domains[name] != address(0); } }
// 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.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.2) (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 = _ownerOf(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 or 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 or 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 or 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 the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @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 _ownerOf(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, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @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, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @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. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual {} /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such * that `ownerOf(tokenId)` is `a`. */ // solhint-disable-next-line func-name-mixedcase function __unsafe_increaseBalance(address account, uint256 amount) internal { _balances[account] += amount; } }
// 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 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.8.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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * 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 (last updated v4.8.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 functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or 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 { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // 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 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 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.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _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) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { 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] = _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 pragma solidity >=0.8.10; /// @title Base64 /// @author Brecht Devos - <[email protected]> /// @notice Provides functions for encoding/decoding base64 library Base64 { string internal constant TABLE_ENCODE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; bytes internal constant TABLE_DECODE = hex"0000000000000000000000000000000000000000000000000000000000000000" hex"00000000000000000000003e0000003f3435363738393a3b3c3d000000000000" hex"00000102030405060708090a0b0c0d0e0f101112131415161718190000000000" hex"001a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132330000000000"; function encode(bytes memory data) internal pure returns (string memory) { if (data.length == 0) return ""; // load the table into memory string memory table = TABLE_ENCODE; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((data.length + 2) / 3); // add some extra buffer at the end required for the writing string memory result = new string(encodedLen + 32); assembly { // set the actual output length mstore(result, encodedLen) // prepare the lookup table let tablePtr := add(table, 1) // input ptr let dataPtr := data let endPtr := add(dataPtr, mload(data)) // result ptr, jump over length let resultPtr := add(result, 32) // run over the input, 3 bytes at a time for { } lt(dataPtr, endPtr) { } { // read 3 bytes dataPtr := add(dataPtr, 3) let input := mload(dataPtr) // write 4 characters mstore8( resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))) ) resultPtr := add(resultPtr, 1) mstore8( resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))) ) resultPtr := add(resultPtr, 1) mstore8( resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))) ) resultPtr := add(resultPtr, 1) mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F)))) resultPtr := add(resultPtr, 1) } // padding with '=' switch mod(mload(data), 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } } return result; } function decode(string memory _data) internal pure returns (bytes memory) { bytes memory data = bytes(_data); if (data.length == 0) return new bytes(0); require(data.length % 4 == 0, "invalid base64 decoder input"); // load the table into memory bytes memory table = TABLE_DECODE; // every 4 characters represent 3 bytes uint256 decodedLen = (data.length / 4) * 3; // add some extra buffer at the end required for the writing bytes memory result = new bytes(decodedLen + 32); assembly { // padding with '=' let lastBytes := mload(add(data, mload(data))) if eq(and(lastBytes, 0xFF), 0x3d) { decodedLen := sub(decodedLen, 1) if eq(and(lastBytes, 0xFFFF), 0x3d3d) { decodedLen := sub(decodedLen, 1) } } // set the actual output length mstore(result, decodedLen) // prepare the lookup table let tablePtr := add(table, 1) // input ptr let dataPtr := data let endPtr := add(dataPtr, mload(data)) // result ptr, jump over length let resultPtr := add(result, 32) // run over the input, 4 characters at a time for { } lt(dataPtr, endPtr) { } { // read 4 characters dataPtr := add(dataPtr, 4) let input := mload(dataPtr) // write 3 bytes let output := add( add( shl( 18, and( mload(add(tablePtr, and(shr(24, input), 0xFF))), 0xFF ) ), shl( 12, and( mload(add(tablePtr, and(shr(16, input), 0xFF))), 0xFF ) ) ), add( shl( 6, and( mload(add(tablePtr, and(shr(8, input), 0xFF))), 0xFF ) ), and(mload(add(tablePtr, and(input, 0xFF))), 0xFF) ) ) mstore(resultPtr, shl(232, output)) resultPtr := add(resultPtr, 3) } } return result; } }
// SPDX-License-Identifier: MIT // Source: // https://github.com/ensdomains/ens-contracts/blob/master/contracts/ethregistrar/StringUtils.sol pragma solidity >=0.8.10; library StringUtils { /** * @dev Returns the length of a given string * * @param s The string to measure the length of * @return The length of the input string */ function strlen(string memory s) internal pure returns (uint256) { uint256 len; uint256 i = 0; uint256 bytelength = bytes(s).length; for (len = 0; i < bytelength; len++) { bytes1 b = bytes(s)[i]; if (b < 0x80) { i += 1; } else if (b < 0xE0) { i += 2; } else if (b < 0xF0) { i += 3; } else if (b < 0xF8) { i += 4; } else if (b < 0xFC) { i += 5; } else { i += 6; } } return len; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"_tld","type":"string"}],"stateMutability":"payable","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":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"DomainRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newPriceOneChar","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPriceTwoChar","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPriceThreeChar","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPriceFourSixChar","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPriceOthers","type":"uint256"}],"name":"PriceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"record","type":"string"}],"name":"RecordUpdated","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":"string","name":"str","type":"string"}],"name":"check","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"domains","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"getAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllNames","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getDomainByOwnerAndIndex","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"getNamesByOwner","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"getOwnedDomainsCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"getPrimaryDomain","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"getRecord","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"nameExists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"names","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":[{"internalType":"string","name":"name","type":"string"}],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceFourChar","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceOneChar","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceOthers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceThreeChar","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceTwoChar","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"records","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"register","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"resetRecord","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","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":"uint256","name":"_priceOneChar","type":"uint256"},{"internalType":"uint256","name":"_priceTwoChar","type":"uint256"},{"internalType":"uint256","name":"_priceThreeChar","type":"uint256"},{"internalType":"uint256","name":"_priceFourChar","type":"uint256"},{"internalType":"uint256","name":"_priceOthers","type":"uint256"}],"name":"setPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"setPrimaryDomain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"record","type":"string"}],"name":"setRecord","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":[],"name":"tld","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":"string","name":"name","type":"string"}],"name":"valid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6102e06040526102366080818152906200429060a039600c906200002490826200034b565b5060408051808201909152600d8082526c1e17ba32bc3a1f1e17b9bb339f60991b6020830152906200005790826200034b565b5060006013556000601455600060155560006016556000601755604051620044c6380380620044c6833981016040819052620000939162000417565b6040518060400160405280600f81526020016e4149204e616d65205365727669636560881b8152506040518060400160405280600481526020016341494e5360e01b8152508160009081620000e991906200034b565b506001620000f882826200034b565b505050620001156200010f6200014b60201b60201c565b6200014f565b600b6200012382826200034b565b50620001446200013b6007546001600160a01b031690565b6101f4620001a1565b50620004ec565b3390565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6127106001600160601b0382161115620002155760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b0382166200026d5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c69642072656365697665720000000000000060448201526064016200020c565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600855565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620002d157607f821691505b602082108103620002f257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200034657600081815260208120601f850160051c81016020861015620003215750805b601f850160051c820191505b8181101562000342578281556001016200032d565b5050505b505050565b81516001600160401b03811115620003675762000367620002a6565b6200037f81620003788454620002bc565b84620002f8565b602080601f831160018114620003b757600084156200039e5750858301515b600019600386901b1c1916600185901b17855562000342565b600085815260208120601f198616915b82811015620003e857888601518255948401946001909101908401620003c7565b5085821015620004075787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208083850312156200042b57600080fd5b82516001600160401b03808211156200044357600080fd5b818501915085601f8301126200045857600080fd5b8151818111156200046d576200046d620002a6565b604051601f8201601f19908116603f01168101908382118183101715620004985762000498620002a6565b816040528281528886848701011115620004b157600080fd5b600093505b82841015620004d55784840186015181850187015292850192620004b6565b600086848301015280965050505050505092915050565b613d9480620004fc6000396000f3fe60806040526004361061025c5760003560e01c806375a765ac11610144578063bf40fac1116100b6578063e985e9c51161007a578063e985e9c51461074e578063f2c298be14610797578063f2fde38b146107aa578063f3fb9a38146107ca578063fb825e5f146107ea578063fe2c6198146107ff57600080fd5b8063bf40fac1146106ae578063c1880a98146106ce578063c604b84a146106ee578063c87b56dd1461070e578063cc637afe1461072e57600080fd5b8063a22cb46511610108578063a22cb46514610602578063b3643cdf14610622578063b6f921ad14610638578063b88d4fde14610658578063bbac5e5914610678578063be4addb11461068e57600080fd5b806375a765ac146105625780637bc6ec1a1461058f5780638da5cb5b146105af57806395d89b41146105cd5780639791c097146105e257600080fd5b80632bfa8768116101dd5780634622ab03116101a15780634622ab03146104ad578063541e771d146104cd5780636352211e146104ed5780636b9a0ee91461050d57806370a082311461052d578063715018a61461054d57600080fd5b80632bfa87681461042c5780632d551432146104425780632e1a7d4d1461045757806342842e0e14610477578063437b243b1461049757600080fd5b806311dd88451161022457806311dd88451461033657806323b872dd1461035657806323c886d91461037657806326449235146103ac5780632a55205a146103ed57600080fd5b806301ffc9a71461026157806306103fd91461029657806306fdde03146102ba578063081812fc146102dc578063095ea7b314610314575b600080fd5b34801561026d57600080fd5b5061028161027c3660046130de565b61081f565b60405190151581526020015b60405180910390f35b3480156102a257600080fd5b506102ac60135481565b60405190815260200161028d565b3480156102c657600080fd5b506102cf610830565b60405161028d919061314b565b3480156102e857600080fd5b506102fc6102f736600461315e565b6108c2565b6040516001600160a01b03909116815260200161028d565b34801561032057600080fd5b5061033461032f366004613193565b6108e9565b005b34801561034257600080fd5b506102cf6103513660046131ff565b610a03565b34801561036257600080fd5b50610334610371366004613241565b610ab6565b34801561038257600080fd5b506102ac61039136600461327d565b6001600160a01b031660009081526011602052604090205490565b3480156103b857600080fd5b506102fc6103c7366004613324565b8051602081830181018051600e825292820191909301209152546001600160a01b031681565b3480156103f957600080fd5b5061040d61040836600461336d565b610cee565b604080516001600160a01b03909316835260208301919091520161028d565b34801561043857600080fd5b506102ac60165481565b34801561044e57600080fd5b506102cf610d9c565b34801561046357600080fd5b5061033461047236600461315e565b610e2a565b34801561048357600080fd5b50610334610492366004613241565b610ec0565b3480156104a357600080fd5b506102ac60145481565b3480156104b957600080fd5b506102cf6104c836600461315e565b610edb565b3480156104d957600080fd5b506102cf6104e8366004613324565b610ef4565b3480156104f957600080fd5b506102fc61050836600461315e565b610f18565b34801561051957600080fd5b506103346105283660046131ff565b610f78565b34801561053957600080fd5b506102ac61054836600461327d565b611070565b34801561055957600080fd5b506103346110f6565b34801561056e57600080fd5b5061058261057d36600461327d565b61110a565b60405161028d919061338f565b34801561059b57600080fd5b506103346105aa3660046133f1565b6111f9565b3480156105bb57600080fd5b506007546001600160a01b03166102fc565b3480156105d957600080fd5b506102cf611270565b3480156105ee57600080fd5b506102816105fd3660046131ff565b61127f565b34801561060e57600080fd5b5061033461061d36600461342c565b611316565b34801561062e57600080fd5b506102ac60175481565b34801561064457600080fd5b50610281610653366004613324565b611321565b34801561066457600080fd5b50610334610673366004613468565b611453565b34801561068457600080fd5b506102ac60155481565b34801561069a57600080fd5b506102cf6106a9366004613193565b611587565b3480156106ba57600080fd5b506102fc6106c93660046131ff565b611626565b3480156106da57600080fd5b506103346106e93660046134e4565b61165b565b3480156106fa57600080fd5b506102cf61070936600461327d565b611764565b34801561071a57600080fd5b506102cf61072936600461315e565b611810565b34801561073a57600080fd5b506102816107493660046131ff565b611920565b34801561075a57600080fd5b50610281610769366004613550565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6103346107a53660046131ff565b611961565b3480156107b657600080fd5b506103346107c536600461327d565b611cc8565b3480156107d657600080fd5b506103346107e5366004613324565b611d41565b3480156107f657600080fd5b50610582611dd5565b34801561080b57600080fd5b506102ac61081a3660046131ff565b611f0a565b600061082a82612002565b92915050565b60606000805461083f90613583565b80601f016020809104026020016040519081016040528092919081815260200182805461086b90613583565b80156108b85780601f1061088d576101008083540402835291602001916108b8565b820191906000526020600020905b81548152906001019060200180831161089b57829003601f168201915b5050505050905090565b60006108cd82612027565b506000908152600460205260409020546001600160a01b031690565b60006108f482610f18565b9050806001600160a01b0316836001600160a01b0316036109665760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061098257506109828133610769565b6109f45760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000606482015260840161095d565b6109fe8383612086565b505050565b6060600f8383604051610a179291906135b7565b90815260200160405180910390208054610a3090613583565b80601f0160208091040260200160405190810160405280929190818152602001828054610a5c90613583565b8015610aa95780601f10610a7e57610100808354040283529160200191610aa9565b820191906000526020600020905b815481529060010190602001808311610a8c57829003601f168201915b5050505050905092915050565b610ac18383836120f4565b610acc838383612125565b60008181526010602052604090208054610b6e918591610aeb90613583565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1790613583565b8015610b645780601f10610b3957610100808354040283529160200191610b64565b820191906000526020600020905b815481529060010190602001808311610b4757829003601f168201915b505050505061220f565b60008181526010602052604090208054610c0f9190610b8c90613583565b80601f0160208091040260200160405190810160405280929190818152602001828054610bb890613583565b8015610c055780601f10610bda57610100808354040283529160200191610c05565b820191906000526020600020905b815481529060010190602001808311610be857829003601f168201915b5050505050612286565b60008181526010602052604081208054610c2890613583565b80601f0160208091040260200160405190810160405280929190818152602001828054610c5490613583565b8015610ca15780601f10610c7657610100808354040283529160200191610ca1565b820191906000526020600020905b815481529060010190602001808311610c8457829003601f168201915b5050505050905082600e82604051610cb991906135c7565b90815260405190819003602001902080546001600160a01b03929092166001600160a01b031990921691909117905550505050565b60008281526009602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610d635750604080518082019091526008546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610d82906001600160601b0316876135f9565b610d8c9190613610565b91519350909150505b9250929050565b600b8054610da990613583565b80601f0160208091040260200160405190810160405280929190818152602001828054610dd590613583565b8015610e225780601f10610df757610100808354040283529160200191610e22565b820191906000526020600020905b815481529060010190602001808311610e0557829003601f168201915b505050505081565b610e3261234c565b80471015610e825760405162461bcd60e51b815260206004820181905260248201527f496e73756666696369656e742062616c616e636520696e20636f6e7472616374604482015260640161095d565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610ebc573d6000803e3d6000fd5b5050565b6109fe83838360405180602001604052806000815250611453565b60106020526000908152604090208054610da990613583565b8051602081830181018051600f8252928201919093012091528054610da990613583565b6000818152600260205260408120546001600160a01b03168061082a5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161095d565b336001600160a01b0316600e8383604051610f949291906135b7565b908152604051908190036020019020546001600160a01b031614610ffa5760405162461bcd60e51b815260206004820152601a60248201527f596f7520646f206e6f74206f776e207468697320646f6d61696e000000000000604482015260640161095d565b336000908152601160205260409020546110565760405162461bcd60e51b815260206004820152601a60248201527f596f7520646f206e6f74206f776e20616e7920646f6d61696e73000000000000604482015260640161095d565b3360009081526012602052604090206109fe828483613695565b60006001600160a01b0382166110da5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b606482015260840161095d565b506001600160a01b031660009081526003602052604090205490565b6110fe61234c565b61110860006123a6565b565b6001600160a01b0381166000908152601160209081526040808320805482518185028101850190935280835260609492939192909184015b828210156111ee57838290600052602060002001805461116190613583565b80601f016020809104026020016040519081016040528092919081815260200182805461118d90613583565b80156111da5780601f106111af576101008083540402835291602001916111da565b820191906000526020600020905b8154815290600101906020018083116111bd57829003601f168201915b505050505081526020019060010190611142565b505050509050919050565b61120161234c565b60138590556014849055601583905560168290556017819055604080518681526020810186905290810184905260608101839052608081018290527f99f8a5ff5c266e5eb99b4da9d73f1ae952c96ce55b36b9ba440cb204b69c4b8a9060a00160405180910390a15050505050565b60606001805461083f90613583565b600060016112c284848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506123f892505050565b1015801561130f5750603261130c84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506123f892505050565b11155b9392505050565b610ebc3383836124fb565b600060328251111561133557506000919050565b8160005b815181101561144957600082828151811061135657611356613750565b01602001516001600160f81b0319169050604160f81b81108015906113895750602d60f91b6001600160f81b0319821611155b1561139957506000949350505050565b606160f81b6001600160f81b03198216108015906113c55750603d60f91b6001600160f81b0319821611155b806113f75750600360fc1b6001600160f81b03198216108015906113f75750603960f81b6001600160f81b0319821611155b8061140f5750600960fa1b6001600160f81b03198216145b806114275750607f60f81b6001600160f81b03198216115b61143657506000949350505050565b508061144181613766565b915050611339565b5060019392505050565b61145f848484846125c9565b61146a848484612125565b60008281526010602052604090208054611489918691610aeb90613583565b600082815260106020526040902080546114a79190610b8c90613583565b600082815260106020526040812080546114c090613583565b80601f01602080910402602001604051908101604052809291908181526020018280546114ec90613583565b80156115395780601f1061150e57610100808354040283529160200191611539565b820191906000526020600020905b81548152906001019060200180831161151c57829003601f168201915b5050505050905083600e8260405161155191906135c7565b90815260405190819003602001902080546001600160a01b03929092166001600160a01b03199092169190911790555050505050565b6001600160a01b03821660009081526011602052604090205460609082106115e75760405162461bcd60e51b8152602060048201526013602482015272496e646578206f7574206f6620626f756e647360681b604482015260640161095d565b6001600160a01b038316600090815260116020526040902080548390811061161157611611613750565b906000526020600020018054610a3090613583565b6000600e838360405161163a9291906135b7565b908152604051908190036020019020546001600160a01b0316905092915050565b336001600160a01b0316600e85856040516116779291906135b7565b908152604051908190036020019020546001600160a01b0316146116dd5760405162461bcd60e51b815260206004820152601a60248201527f596f7520646f206e6f74206f776e207468697320646f6d61696e000000000000604482015260640161095d565b8181600f86866040516116f19291906135b7565b9081526020016040518091039020918261170c929190613695565b50838360405161171d9291906135b7565b60405180910390207fa32b92311d4910d53fdddcf93a238419a815906305d579caf8d933aacd39f64083836040516117569291906137a8565b60405180910390a250505050565b6001600160a01b038116600090815260126020526040902080546060919061178b90613583565b80601f01602080910402602001604051908101604052809291908181526020018280546117b790613583565b80156118045780601f106117d957610100808354040283529160200191611804565b820191906000526020600020905b8154815290600101906020018083116117e757829003601f168201915b50505050509050919050565b606061181b82612027565b6000828152600660205260408120805461183490613583565b80601f016020809104026020016040519081016040528092919081815260200182805461186090613583565b80156118ad5780601f10611882576101008083540402835291602001916118ad565b820191906000526020600020905b81548152906001019060200180831161189057829003601f168201915b5050505050905060006118cb60408051602081019091526000815290565b905080516000036118dd575092915050565b81511561190f5780826040516020016118f79291906137bc565b60405160208183030381529060405292505050919050565b611918846125fb565b949350505050565b6000806001600160a01b0316600e848460405161193e9291906135b7565b908152604051908190036020019020546001600160a01b03161415905092915050565b60006001600160a01b0316600e838360405161197e9291906135b7565b908152604051908190036020019020546001600160a01b0316146119e45760405162461bcd60e51b815260206004820152601960248201527f446f6d61696e20616c7265616479207265676973746572656400000000000000604482015260640161095d565b6119ee828261127f565b611a295760405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964206e616d6560a01b604482015260640161095d565b611a6882828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061132192505050565b611ab45760405162461bcd60e51b815260206004820152601a60248201527f496e76616c6964206368617261637465727320696e206e616d65000000000000604482015260640161095d565b6000611ac08383611f0a565b905080341015611b085760405162461bcd60e51b8152602060048201526013602482015272139bdd08195b9bdd59da08115512081c185a59606a1b604482015260640161095d565b60008383600b604051602001611b209392919061385e565b60405160208183030381529060405290506000600c82600d604051602001611b4a93929190613885565b60405160208183030381529060405290506000611b66600a5490565b90506000611b738661266e565b90506000611bab85611b8486612701565b84604051602001611b97939291906138b8565b604051602081830303815290604052612701565b9050600081604051602001611bc091906139b0565b6040516020818303038152906040529050611bdb3385612866565b611be58482612880565b33600e8a8a604051611bf89291906135b7565b908152604080516020928190038301902080546001600160a01b0319166001600160a01b0394909416939093179092556000868152601090915220611c3e898b83613695565b5033600090815260116020908152604082208054600181018255908352912001611c69898b83613695565b50611c78600a80546001019055565b336001600160a01b03167f939473682d97589f386b75d5ed902de6e714d125d816c3e0f4d45a89a98322928a8a87604051611cb5939291906139f5565b60405180910390a2505050505050505050565b611cd061234c565b6001600160a01b038116611d355760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161095d565b611d3e816123a6565b50565b336001600160a01b0316600e82604051611d5b91906135c7565b908152604051908190036020019020546001600160a01b031614611dcc5760405162461bcd60e51b815260206004820152602260248201527f4f6e6c7920646f6d61696e206f776e65722063616e207265736574207265636f6044820152611c9960f21b606482015260840161095d565b611d3e81612286565b60606000611de2600a5490565b67ffffffffffffffff811115611dfa57611dfa613298565b604051908082528060200260200182016040528015611e2d57816020015b6060815260200190600190039081611e185790505b50905060005b600a54811015611f045760008181526010602052604090208054611e5690613583565b80601f0160208091040260200160405190810160405280929190818152602001828054611e8290613583565b8015611ecf5780601f10611ea457610100808354040283529160200191611ecf565b820191906000526020600020905b815481529060010190602001808311611eb257829003601f168201915b5050505050828281518110611ee657611ee6613750565b60200260200101819052508080611efc90613766565b915050611e33565b50919050565b600080611f4c84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506123f892505050565b9050600081118015611f5f575060328111155b611fa15760405162461bcd60e51b8152602060048201526013602482015272092dcecc2d8d2c840dcc2daca40d8cadccee8d606b1b604482015260640161095d565b80600103611fb357505060135461082a565b80600203611fc557505060145461082a565b80600303611fd757505060155461082a565b60048110158015611fe9575060068111155b15611ff857505060165461082a565b505060175461082a565b60006001600160e01b0319821663152a902d60e11b148061082a575061082a82612913565b6000818152600260205260409020546001600160a01b0316611d3e5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161095d565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906120bb82610f18565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6120fe3382612963565b61211a5760405162461bcd60e51b815260040161095d90613a19565b6109fe8383836129e1565b600081815260106020526040902080546121c791859161214490613583565b80601f016020809104026020016040519081016040528092919081815260200182805461217090613583565b80156121bd5780601f10612192576101008083540402835291602001916121bd565b820191906000526020600020905b8154815290600101906020018083116121a057829003601f168201915b5050505050612b45565b6001600160a01b038216600090815260116020908152604080832084845260108352908320815460018101835591845291909220909101906122099082613a66565b50505050565b808051906020012060126000846001600160a01b03166001600160a01b031681526020019081526020016000206040516122499190613b3d565b604051809103902003610ebc57604080516020808201835260008083526001600160a01b0386168152601290915291909120906109fe9082613b49565b60006001600160a01b0316600e826040516122a191906135c7565b908152604051908190036020019020546001600160a01b031614611d3e5760405180602001604052806000815250600f826040516122df91906135c7565b908152602001604051809103902090816122f99190613b49565b508060405161230891906135c7565b604080519182900382206020808452600090840152917fa32b92311d4910d53fdddcf93a238419a815906305d579caf8d933aacd39f640910160405180910390a250565b6007546001600160a01b031633146111085760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161095d565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8051600090819081905b808210156124f257600085838151811061241e5761241e613750565b01602001516001600160f81b0319169050600160ff1b81101561244d57612446600184613bfb565b92506124df565b600760fd1b6001600160f81b03198216101561246e57612446600284613bfb565b600f60fc1b6001600160f81b03198216101561248f57612446600384613bfb565b601f60fb1b6001600160f81b0319821610156124b057612446600484613bfb565b603f60fa1b6001600160f81b0319821610156124d157612446600584613bfb565b6124dc600684613bfb565b92505b50826124ea81613766565b935050612402565b50909392505050565b816001600160a01b0316836001600160a01b03160361255c5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161095d565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6125d33383612963565b6125ef5760405162461bcd60e51b815260040161095d90613a19565b61220984848484612cb0565b606061260682612027565b600061261d60408051602081019091526000815290565b9050600081511161263d576040518060200160405280600081525061130f565b806126478461266e565b6040516020016126589291906137bc565b6040516020818303038152906040529392505050565b6060600061267b83612ce3565b600101905060008167ffffffffffffffff81111561269b5761269b613298565b6040519080825280601f01601f1916602001820160405280156126c5576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846126cf57509392505050565b6060815160000361272057505060408051602081019091526000815290565b6000604051806060016040528060408152602001613d1f604091399050600060038451600261274f9190613bfb565b6127599190613610565b6127649060046135f9565b90506000612773826020613bfb565b67ffffffffffffffff81111561278b5761278b613298565b6040519080825280601f01601f1916602001820160405280156127b5576020820181803683370190505b509050818152600183018586518101602084015b81831015612821576003830192508251603f8160121c168501518253600182019150603f81600c1c168501518253600182019150603f8160061c168501518253600182019150603f81168501518253506001016127c9565b60038951066001811461283b576002811461284c57612858565b613d3d60f01b600119830152612858565b603d60f81b6000198301525b509398975050505050505050565b610ebc828260405180602001604052806000815250612dbb565b6000828152600260205260409020546001600160a01b03166128fb5760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b606482015260840161095d565b60008281526006602052604090206109fe8282613b49565b60006001600160e01b031982166380ac58cd60e01b148061294457506001600160e01b03198216635b5e139f60e01b145b8061082a57506301ffc9a760e01b6001600160e01b031983161461082a565b60008061296f83610f18565b9050806001600160a01b0316846001600160a01b031614806129b657506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806119185750836001600160a01b03166129cf846108c2565b6001600160a01b031614949350505050565b826001600160a01b03166129f482610f18565b6001600160a01b031614612a1a5760405162461bcd60e51b815260040161095d90613c0e565b6001600160a01b038216612a7c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161095d565b826001600160a01b0316612a8f82610f18565b6001600160a01b031614612ab55760405162461bcd60e51b815260040161095d90613c0e565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b038216600090815260116020526040812054905b8181101561220957828051906020012060116000866001600160a01b03166001600160a01b031681526020019081526020016000208281548110612ba657612ba6613750565b90600052602060002001604051612bbd9190613b3d565b604051809103902003612c9e576001600160a01b0384166000908152601160205260409020612bed600184613c53565b81548110612bfd57612bfd613750565b9060005260206000200160116000866001600160a01b03166001600160a01b031681526020019081526020016000208281548110612c3d57612c3d613750565b906000526020600020019081612c539190613a66565b506001600160a01b0384166000908152601160205260409020805480612c7b57612c7b613c66565b600190038181906000526020600020016000612c97919061307a565b9055612209565b80612ca881613766565b915050612b60565b612cbb8484846129e1565b612cc784848484612dee565b6122095760405162461bcd60e51b815260040161095d90613c7c565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612d225772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612d4e576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612d6c57662386f26fc10000830492506010015b6305f5e1008310612d84576305f5e100830492506008015b6127108310612d9857612710830492506004015b60648310612daa576064830492506002015b600a831061082a5760010192915050565b612dc58383612eef565b612dd26000848484612dee565b6109fe5760405162461bcd60e51b815260040161095d90613c7c565b60006001600160a01b0384163b15612ee457604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612e32903390899088908890600401613cce565b6020604051808303816000875af1925050508015612e6d575060408051601f3d908101601f19168201909252612e6a91810190613d01565b60015b612eca573d808015612e9b576040519150601f19603f3d011682016040523d82523d6000602084013e612ea0565b606091505b508051600003612ec25760405162461bcd60e51b815260040161095d90613c7c565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611918565b506001949350505050565b6001600160a01b038216612f455760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161095d565b6000818152600260205260409020546001600160a01b031615612faa5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161095d565b6000818152600260205260409020546001600160a01b03161561300f5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161095d565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b50805461308690613583565b6000825580601f10613096575050565b601f016020900490600052602060002090810190611d3e91905b808211156130c457600081556001016130b0565b5090565b6001600160e01b031981168114611d3e57600080fd5b6000602082840312156130f057600080fd5b813561130f816130c8565b60005b838110156131165781810151838201526020016130fe565b50506000910152565b600081518084526131378160208601602086016130fb565b601f01601f19169290920160200192915050565b60208152600061130f602083018461311f565b60006020828403121561317057600080fd5b5035919050565b80356001600160a01b038116811461318e57600080fd5b919050565b600080604083850312156131a657600080fd5b6131af83613177565b946020939093013593505050565b60008083601f8401126131cf57600080fd5b50813567ffffffffffffffff8111156131e757600080fd5b602083019150836020828501011115610d9557600080fd5b6000806020838503121561321257600080fd5b823567ffffffffffffffff81111561322957600080fd5b613235858286016131bd565b90969095509350505050565b60008060006060848603121561325657600080fd5b61325f84613177565b925061326d60208501613177565b9150604084013590509250925092565b60006020828403121561328f57600080fd5b61130f82613177565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156132c9576132c9613298565b604051601f8501601f19908116603f011681019082821181831017156132f1576132f1613298565b8160405280935085815286868601111561330a57600080fd5b858560208301376000602087830101525050509392505050565b60006020828403121561333657600080fd5b813567ffffffffffffffff81111561334d57600080fd5b8201601f8101841361335e57600080fd5b611918848235602084016132ae565b6000806040838503121561338057600080fd5b50508035926020909101359150565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156133e457603f198886030184526133d285835161311f565b945092850192908501906001016133b6565b5092979650505050505050565b600080600080600060a0868803121561340957600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b6000806040838503121561343f57600080fd5b61344883613177565b91506020830135801515811461345d57600080fd5b809150509250929050565b6000806000806080858703121561347e57600080fd5b61348785613177565b935061349560208601613177565b925060408501359150606085013567ffffffffffffffff8111156134b857600080fd5b8501601f810187136134c957600080fd5b6134d8878235602084016132ae565b91505092959194509250565b600080600080604085870312156134fa57600080fd5b843567ffffffffffffffff8082111561351257600080fd5b61351e888389016131bd565b9096509450602087013591508082111561353757600080fd5b50613544878288016131bd565b95989497509550505050565b6000806040838503121561356357600080fd5b61356c83613177565b915061357a60208401613177565b90509250929050565b600181811c9082168061359757607f821691505b602082108103611f0457634e487b7160e01b600052602260045260246000fd5b8183823760009101908152919050565b600082516135d98184602087016130fb565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761082a5761082a6135e3565b60008261362d57634e487b7160e01b600052601260045260246000fd5b500490565b601f8211156109fe57600081815260208120601f850160051c810160208610156136595750805b601f850160051c820191505b8181101561367857828155600101613665565b505050505050565b600019600383901b1c191660019190911b1790565b67ffffffffffffffff8311156136ad576136ad613298565b6136c1836136bb8354613583565b83613632565b6000601f8411600181146136ef57600085156136dd5750838201355b6136e78682613680565b845550613749565b600083815260209020601f19861690835b828110156137205786850135825560209485019460019092019101613700565b508682101561373d5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b634e487b7160e01b600052603260045260246000fd5b600060018201613778576137786135e3565b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208152600061191860208301848661377f565b600083516137ce8184602088016130fb565b8351908301906137e28183602088016130fb565b01949350505050565b600081546137f881613583565b60018281168015613810576001811461382557613854565b60ff1984168752821515830287019450613854565b8560005260208060002060005b8581101561384b5781548a820152908401908201613832565b50505082870194505b5050505092915050565b828482376000838201601760f91b815261387b60018201856137eb565b9695505050505050565b600061389182866137eb565b84516138a18183602089016130fb565b6138ad818301866137eb565b979650505050505050565b693d913730b6b2911d101160b11b815283516000906138de81600a8501602089016130fb565b7f222c20226465736372697074696f6e223a20224149204e616d65205365727669600a918401918201527f6365202d202e6169205765623320446f6d61696e73222c2022696d616765223a602a8201527f2022646174613a696d6167652f7376672b786d6c3b6261736536342c00000000604a82015284516139678160668401602089016130fb565b6b1116113632b733ba34111d1160a11b6066929091019182015283516139948160728401602088016130fb565b61227d60f01b6072929091019182015260740195945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000008152600082516139e881601d8501602087016130fb565b91909101601d0192915050565b604081526000613a0960408301858761377f565b9050826020830152949350505050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b818103613a71575050565b613a7b8254613583565b67ffffffffffffffff811115613a9357613a93613298565b613aa781613aa18454613583565b84613632565b6000601f821160018114613ad55760008315613ac35750848201545b613acd8482613680565b855550613749565b600085815260209020601f19841690600086815260209020845b83811015613b0f5782860154825560019586019590910190602001613aef565b5085831015613b2d5781850154600019600388901b60f8161c191681555b5050505050600190811b01905550565b600061130f82846137eb565b815167ffffffffffffffff811115613b6357613b63613298565b613b7181613aa18454613583565b602080601f831160018114613ba05760008415613b8e5750858301515b613b988582613680565b865550613678565b600085815260208120601f198616915b82811015613bcf57888601518255948401946001909101908401613bb0565b5085821015613b2d57939096015160001960f8600387901b161c19169092555050600190811b01905550565b8082018082111561082a5761082a6135e3565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b8181038181111561082a5761082a6135e3565b634e487b7160e01b600052603160045260246000fd5b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061387b9083018461311f565b600060208284031215613d1357600080fd5b815161130f816130c856fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212205aef6a8819df88b6651d58ecfd3e132a83c3ddf20ed964633786451a0cc3704e64736f6c634300081400333c7376672077696474683d2233303022206865696768743d223330302220786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f737667223e203c646566733e203c6c696e6561724772616469656e742069643d22637573746f6d4772616469656e74222078313d223025222079313d223025222078323d2231303025222079323d2231303025223e203c73746f70206f66667365743d22302522207374796c653d2273746f702d636f6c6f723a234646413246463b2073746f702d6f7061636974793a3122202f3e203c73746f70206f66667365743d2235302522207374796c653d2273746f702d636f6c6f723a234145364346463b2073746f702d6f7061636974793a3122202f3e203c73746f70206f66667365743d223130302522207374796c653d2273746f702d636f6c6f723a233838353246463b2073746f702d6f7061636974793a3122202f3e203c2f6c696e6561724772616469656e743e203c2f646566733e203c726563742077696474683d2233303022206865696768743d22333030222066696c6c3d2275726c2823637573746f6d4772616469656e742922202f3e203c7465787420783d223530252220793d22353025222066696c6c3d22626c61636b2220666f6e742d66616d696c793d22417269616c2220666f6e742d73697a653d2232352220666f6e742d7765696768743d22626f6c642220746578742d616e63686f723d226d6964646c652220646f6d696e616e742d626173656c696e653d226d6964646c65223e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000026169000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x60806040526004361061025c5760003560e01c806375a765ac11610144578063bf40fac1116100b6578063e985e9c51161007a578063e985e9c51461074e578063f2c298be14610797578063f2fde38b146107aa578063f3fb9a38146107ca578063fb825e5f146107ea578063fe2c6198146107ff57600080fd5b8063bf40fac1146106ae578063c1880a98146106ce578063c604b84a146106ee578063c87b56dd1461070e578063cc637afe1461072e57600080fd5b8063a22cb46511610108578063a22cb46514610602578063b3643cdf14610622578063b6f921ad14610638578063b88d4fde14610658578063bbac5e5914610678578063be4addb11461068e57600080fd5b806375a765ac146105625780637bc6ec1a1461058f5780638da5cb5b146105af57806395d89b41146105cd5780639791c097146105e257600080fd5b80632bfa8768116101dd5780634622ab03116101a15780634622ab03146104ad578063541e771d146104cd5780636352211e146104ed5780636b9a0ee91461050d57806370a082311461052d578063715018a61461054d57600080fd5b80632bfa87681461042c5780632d551432146104425780632e1a7d4d1461045757806342842e0e14610477578063437b243b1461049757600080fd5b806311dd88451161022457806311dd88451461033657806323b872dd1461035657806323c886d91461037657806326449235146103ac5780632a55205a146103ed57600080fd5b806301ffc9a71461026157806306103fd91461029657806306fdde03146102ba578063081812fc146102dc578063095ea7b314610314575b600080fd5b34801561026d57600080fd5b5061028161027c3660046130de565b61081f565b60405190151581526020015b60405180910390f35b3480156102a257600080fd5b506102ac60135481565b60405190815260200161028d565b3480156102c657600080fd5b506102cf610830565b60405161028d919061314b565b3480156102e857600080fd5b506102fc6102f736600461315e565b6108c2565b6040516001600160a01b03909116815260200161028d565b34801561032057600080fd5b5061033461032f366004613193565b6108e9565b005b34801561034257600080fd5b506102cf6103513660046131ff565b610a03565b34801561036257600080fd5b50610334610371366004613241565b610ab6565b34801561038257600080fd5b506102ac61039136600461327d565b6001600160a01b031660009081526011602052604090205490565b3480156103b857600080fd5b506102fc6103c7366004613324565b8051602081830181018051600e825292820191909301209152546001600160a01b031681565b3480156103f957600080fd5b5061040d61040836600461336d565b610cee565b604080516001600160a01b03909316835260208301919091520161028d565b34801561043857600080fd5b506102ac60165481565b34801561044e57600080fd5b506102cf610d9c565b34801561046357600080fd5b5061033461047236600461315e565b610e2a565b34801561048357600080fd5b50610334610492366004613241565b610ec0565b3480156104a357600080fd5b506102ac60145481565b3480156104b957600080fd5b506102cf6104c836600461315e565b610edb565b3480156104d957600080fd5b506102cf6104e8366004613324565b610ef4565b3480156104f957600080fd5b506102fc61050836600461315e565b610f18565b34801561051957600080fd5b506103346105283660046131ff565b610f78565b34801561053957600080fd5b506102ac61054836600461327d565b611070565b34801561055957600080fd5b506103346110f6565b34801561056e57600080fd5b5061058261057d36600461327d565b61110a565b60405161028d919061338f565b34801561059b57600080fd5b506103346105aa3660046133f1565b6111f9565b3480156105bb57600080fd5b506007546001600160a01b03166102fc565b3480156105d957600080fd5b506102cf611270565b3480156105ee57600080fd5b506102816105fd3660046131ff565b61127f565b34801561060e57600080fd5b5061033461061d36600461342c565b611316565b34801561062e57600080fd5b506102ac60175481565b34801561064457600080fd5b50610281610653366004613324565b611321565b34801561066457600080fd5b50610334610673366004613468565b611453565b34801561068457600080fd5b506102ac60155481565b34801561069a57600080fd5b506102cf6106a9366004613193565b611587565b3480156106ba57600080fd5b506102fc6106c93660046131ff565b611626565b3480156106da57600080fd5b506103346106e93660046134e4565b61165b565b3480156106fa57600080fd5b506102cf61070936600461327d565b611764565b34801561071a57600080fd5b506102cf61072936600461315e565b611810565b34801561073a57600080fd5b506102816107493660046131ff565b611920565b34801561075a57600080fd5b50610281610769366004613550565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6103346107a53660046131ff565b611961565b3480156107b657600080fd5b506103346107c536600461327d565b611cc8565b3480156107d657600080fd5b506103346107e5366004613324565b611d41565b3480156107f657600080fd5b50610582611dd5565b34801561080b57600080fd5b506102ac61081a3660046131ff565b611f0a565b600061082a82612002565b92915050565b60606000805461083f90613583565b80601f016020809104026020016040519081016040528092919081815260200182805461086b90613583565b80156108b85780601f1061088d576101008083540402835291602001916108b8565b820191906000526020600020905b81548152906001019060200180831161089b57829003601f168201915b5050505050905090565b60006108cd82612027565b506000908152600460205260409020546001600160a01b031690565b60006108f482610f18565b9050806001600160a01b0316836001600160a01b0316036109665760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061098257506109828133610769565b6109f45760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000606482015260840161095d565b6109fe8383612086565b505050565b6060600f8383604051610a179291906135b7565b90815260200160405180910390208054610a3090613583565b80601f0160208091040260200160405190810160405280929190818152602001828054610a5c90613583565b8015610aa95780601f10610a7e57610100808354040283529160200191610aa9565b820191906000526020600020905b815481529060010190602001808311610a8c57829003601f168201915b5050505050905092915050565b610ac18383836120f4565b610acc838383612125565b60008181526010602052604090208054610b6e918591610aeb90613583565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1790613583565b8015610b645780601f10610b3957610100808354040283529160200191610b64565b820191906000526020600020905b815481529060010190602001808311610b4757829003601f168201915b505050505061220f565b60008181526010602052604090208054610c0f9190610b8c90613583565b80601f0160208091040260200160405190810160405280929190818152602001828054610bb890613583565b8015610c055780601f10610bda57610100808354040283529160200191610c05565b820191906000526020600020905b815481529060010190602001808311610be857829003601f168201915b5050505050612286565b60008181526010602052604081208054610c2890613583565b80601f0160208091040260200160405190810160405280929190818152602001828054610c5490613583565b8015610ca15780601f10610c7657610100808354040283529160200191610ca1565b820191906000526020600020905b815481529060010190602001808311610c8457829003601f168201915b5050505050905082600e82604051610cb991906135c7565b90815260405190819003602001902080546001600160a01b03929092166001600160a01b031990921691909117905550505050565b60008281526009602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610d635750604080518082019091526008546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610d82906001600160601b0316876135f9565b610d8c9190613610565b91519350909150505b9250929050565b600b8054610da990613583565b80601f0160208091040260200160405190810160405280929190818152602001828054610dd590613583565b8015610e225780601f10610df757610100808354040283529160200191610e22565b820191906000526020600020905b815481529060010190602001808311610e0557829003601f168201915b505050505081565b610e3261234c565b80471015610e825760405162461bcd60e51b815260206004820181905260248201527f496e73756666696369656e742062616c616e636520696e20636f6e7472616374604482015260640161095d565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610ebc573d6000803e3d6000fd5b5050565b6109fe83838360405180602001604052806000815250611453565b60106020526000908152604090208054610da990613583565b8051602081830181018051600f8252928201919093012091528054610da990613583565b6000818152600260205260408120546001600160a01b03168061082a5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161095d565b336001600160a01b0316600e8383604051610f949291906135b7565b908152604051908190036020019020546001600160a01b031614610ffa5760405162461bcd60e51b815260206004820152601a60248201527f596f7520646f206e6f74206f776e207468697320646f6d61696e000000000000604482015260640161095d565b336000908152601160205260409020546110565760405162461bcd60e51b815260206004820152601a60248201527f596f7520646f206e6f74206f776e20616e7920646f6d61696e73000000000000604482015260640161095d565b3360009081526012602052604090206109fe828483613695565b60006001600160a01b0382166110da5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b606482015260840161095d565b506001600160a01b031660009081526003602052604090205490565b6110fe61234c565b61110860006123a6565b565b6001600160a01b0381166000908152601160209081526040808320805482518185028101850190935280835260609492939192909184015b828210156111ee57838290600052602060002001805461116190613583565b80601f016020809104026020016040519081016040528092919081815260200182805461118d90613583565b80156111da5780601f106111af576101008083540402835291602001916111da565b820191906000526020600020905b8154815290600101906020018083116111bd57829003601f168201915b505050505081526020019060010190611142565b505050509050919050565b61120161234c565b60138590556014849055601583905560168290556017819055604080518681526020810186905290810184905260608101839052608081018290527f99f8a5ff5c266e5eb99b4da9d73f1ae952c96ce55b36b9ba440cb204b69c4b8a9060a00160405180910390a15050505050565b60606001805461083f90613583565b600060016112c284848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506123f892505050565b1015801561130f5750603261130c84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506123f892505050565b11155b9392505050565b610ebc3383836124fb565b600060328251111561133557506000919050565b8160005b815181101561144957600082828151811061135657611356613750565b01602001516001600160f81b0319169050604160f81b81108015906113895750602d60f91b6001600160f81b0319821611155b1561139957506000949350505050565b606160f81b6001600160f81b03198216108015906113c55750603d60f91b6001600160f81b0319821611155b806113f75750600360fc1b6001600160f81b03198216108015906113f75750603960f81b6001600160f81b0319821611155b8061140f5750600960fa1b6001600160f81b03198216145b806114275750607f60f81b6001600160f81b03198216115b61143657506000949350505050565b508061144181613766565b915050611339565b5060019392505050565b61145f848484846125c9565b61146a848484612125565b60008281526010602052604090208054611489918691610aeb90613583565b600082815260106020526040902080546114a79190610b8c90613583565b600082815260106020526040812080546114c090613583565b80601f01602080910402602001604051908101604052809291908181526020018280546114ec90613583565b80156115395780601f1061150e57610100808354040283529160200191611539565b820191906000526020600020905b81548152906001019060200180831161151c57829003601f168201915b5050505050905083600e8260405161155191906135c7565b90815260405190819003602001902080546001600160a01b03929092166001600160a01b03199092169190911790555050505050565b6001600160a01b03821660009081526011602052604090205460609082106115e75760405162461bcd60e51b8152602060048201526013602482015272496e646578206f7574206f6620626f756e647360681b604482015260640161095d565b6001600160a01b038316600090815260116020526040902080548390811061161157611611613750565b906000526020600020018054610a3090613583565b6000600e838360405161163a9291906135b7565b908152604051908190036020019020546001600160a01b0316905092915050565b336001600160a01b0316600e85856040516116779291906135b7565b908152604051908190036020019020546001600160a01b0316146116dd5760405162461bcd60e51b815260206004820152601a60248201527f596f7520646f206e6f74206f776e207468697320646f6d61696e000000000000604482015260640161095d565b8181600f86866040516116f19291906135b7565b9081526020016040518091039020918261170c929190613695565b50838360405161171d9291906135b7565b60405180910390207fa32b92311d4910d53fdddcf93a238419a815906305d579caf8d933aacd39f64083836040516117569291906137a8565b60405180910390a250505050565b6001600160a01b038116600090815260126020526040902080546060919061178b90613583565b80601f01602080910402602001604051908101604052809291908181526020018280546117b790613583565b80156118045780601f106117d957610100808354040283529160200191611804565b820191906000526020600020905b8154815290600101906020018083116117e757829003601f168201915b50505050509050919050565b606061181b82612027565b6000828152600660205260408120805461183490613583565b80601f016020809104026020016040519081016040528092919081815260200182805461186090613583565b80156118ad5780601f10611882576101008083540402835291602001916118ad565b820191906000526020600020905b81548152906001019060200180831161189057829003601f168201915b5050505050905060006118cb60408051602081019091526000815290565b905080516000036118dd575092915050565b81511561190f5780826040516020016118f79291906137bc565b60405160208183030381529060405292505050919050565b611918846125fb565b949350505050565b6000806001600160a01b0316600e848460405161193e9291906135b7565b908152604051908190036020019020546001600160a01b03161415905092915050565b60006001600160a01b0316600e838360405161197e9291906135b7565b908152604051908190036020019020546001600160a01b0316146119e45760405162461bcd60e51b815260206004820152601960248201527f446f6d61696e20616c7265616479207265676973746572656400000000000000604482015260640161095d565b6119ee828261127f565b611a295760405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964206e616d6560a01b604482015260640161095d565b611a6882828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061132192505050565b611ab45760405162461bcd60e51b815260206004820152601a60248201527f496e76616c6964206368617261637465727320696e206e616d65000000000000604482015260640161095d565b6000611ac08383611f0a565b905080341015611b085760405162461bcd60e51b8152602060048201526013602482015272139bdd08195b9bdd59da08115512081c185a59606a1b604482015260640161095d565b60008383600b604051602001611b209392919061385e565b60405160208183030381529060405290506000600c82600d604051602001611b4a93929190613885565b60405160208183030381529060405290506000611b66600a5490565b90506000611b738661266e565b90506000611bab85611b8486612701565b84604051602001611b97939291906138b8565b604051602081830303815290604052612701565b9050600081604051602001611bc091906139b0565b6040516020818303038152906040529050611bdb3385612866565b611be58482612880565b33600e8a8a604051611bf89291906135b7565b908152604080516020928190038301902080546001600160a01b0319166001600160a01b0394909416939093179092556000868152601090915220611c3e898b83613695565b5033600090815260116020908152604082208054600181018255908352912001611c69898b83613695565b50611c78600a80546001019055565b336001600160a01b03167f939473682d97589f386b75d5ed902de6e714d125d816c3e0f4d45a89a98322928a8a87604051611cb5939291906139f5565b60405180910390a2505050505050505050565b611cd061234c565b6001600160a01b038116611d355760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161095d565b611d3e816123a6565b50565b336001600160a01b0316600e82604051611d5b91906135c7565b908152604051908190036020019020546001600160a01b031614611dcc5760405162461bcd60e51b815260206004820152602260248201527f4f6e6c7920646f6d61696e206f776e65722063616e207265736574207265636f6044820152611c9960f21b606482015260840161095d565b611d3e81612286565b60606000611de2600a5490565b67ffffffffffffffff811115611dfa57611dfa613298565b604051908082528060200260200182016040528015611e2d57816020015b6060815260200190600190039081611e185790505b50905060005b600a54811015611f045760008181526010602052604090208054611e5690613583565b80601f0160208091040260200160405190810160405280929190818152602001828054611e8290613583565b8015611ecf5780601f10611ea457610100808354040283529160200191611ecf565b820191906000526020600020905b815481529060010190602001808311611eb257829003601f168201915b5050505050828281518110611ee657611ee6613750565b60200260200101819052508080611efc90613766565b915050611e33565b50919050565b600080611f4c84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506123f892505050565b9050600081118015611f5f575060328111155b611fa15760405162461bcd60e51b8152602060048201526013602482015272092dcecc2d8d2c840dcc2daca40d8cadccee8d606b1b604482015260640161095d565b80600103611fb357505060135461082a565b80600203611fc557505060145461082a565b80600303611fd757505060155461082a565b60048110158015611fe9575060068111155b15611ff857505060165461082a565b505060175461082a565b60006001600160e01b0319821663152a902d60e11b148061082a575061082a82612913565b6000818152600260205260409020546001600160a01b0316611d3e5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161095d565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906120bb82610f18565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6120fe3382612963565b61211a5760405162461bcd60e51b815260040161095d90613a19565b6109fe8383836129e1565b600081815260106020526040902080546121c791859161214490613583565b80601f016020809104026020016040519081016040528092919081815260200182805461217090613583565b80156121bd5780601f10612192576101008083540402835291602001916121bd565b820191906000526020600020905b8154815290600101906020018083116121a057829003601f168201915b5050505050612b45565b6001600160a01b038216600090815260116020908152604080832084845260108352908320815460018101835591845291909220909101906122099082613a66565b50505050565b808051906020012060126000846001600160a01b03166001600160a01b031681526020019081526020016000206040516122499190613b3d565b604051809103902003610ebc57604080516020808201835260008083526001600160a01b0386168152601290915291909120906109fe9082613b49565b60006001600160a01b0316600e826040516122a191906135c7565b908152604051908190036020019020546001600160a01b031614611d3e5760405180602001604052806000815250600f826040516122df91906135c7565b908152602001604051809103902090816122f99190613b49565b508060405161230891906135c7565b604080519182900382206020808452600090840152917fa32b92311d4910d53fdddcf93a238419a815906305d579caf8d933aacd39f640910160405180910390a250565b6007546001600160a01b031633146111085760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161095d565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8051600090819081905b808210156124f257600085838151811061241e5761241e613750565b01602001516001600160f81b0319169050600160ff1b81101561244d57612446600184613bfb565b92506124df565b600760fd1b6001600160f81b03198216101561246e57612446600284613bfb565b600f60fc1b6001600160f81b03198216101561248f57612446600384613bfb565b601f60fb1b6001600160f81b0319821610156124b057612446600484613bfb565b603f60fa1b6001600160f81b0319821610156124d157612446600584613bfb565b6124dc600684613bfb565b92505b50826124ea81613766565b935050612402565b50909392505050565b816001600160a01b0316836001600160a01b03160361255c5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161095d565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6125d33383612963565b6125ef5760405162461bcd60e51b815260040161095d90613a19565b61220984848484612cb0565b606061260682612027565b600061261d60408051602081019091526000815290565b9050600081511161263d576040518060200160405280600081525061130f565b806126478461266e565b6040516020016126589291906137bc565b6040516020818303038152906040529392505050565b6060600061267b83612ce3565b600101905060008167ffffffffffffffff81111561269b5761269b613298565b6040519080825280601f01601f1916602001820160405280156126c5576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846126cf57509392505050565b6060815160000361272057505060408051602081019091526000815290565b6000604051806060016040528060408152602001613d1f604091399050600060038451600261274f9190613bfb565b6127599190613610565b6127649060046135f9565b90506000612773826020613bfb565b67ffffffffffffffff81111561278b5761278b613298565b6040519080825280601f01601f1916602001820160405280156127b5576020820181803683370190505b509050818152600183018586518101602084015b81831015612821576003830192508251603f8160121c168501518253600182019150603f81600c1c168501518253600182019150603f8160061c168501518253600182019150603f81168501518253506001016127c9565b60038951066001811461283b576002811461284c57612858565b613d3d60f01b600119830152612858565b603d60f81b6000198301525b509398975050505050505050565b610ebc828260405180602001604052806000815250612dbb565b6000828152600260205260409020546001600160a01b03166128fb5760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b606482015260840161095d565b60008281526006602052604090206109fe8282613b49565b60006001600160e01b031982166380ac58cd60e01b148061294457506001600160e01b03198216635b5e139f60e01b145b8061082a57506301ffc9a760e01b6001600160e01b031983161461082a565b60008061296f83610f18565b9050806001600160a01b0316846001600160a01b031614806129b657506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806119185750836001600160a01b03166129cf846108c2565b6001600160a01b031614949350505050565b826001600160a01b03166129f482610f18565b6001600160a01b031614612a1a5760405162461bcd60e51b815260040161095d90613c0e565b6001600160a01b038216612a7c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161095d565b826001600160a01b0316612a8f82610f18565b6001600160a01b031614612ab55760405162461bcd60e51b815260040161095d90613c0e565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b038216600090815260116020526040812054905b8181101561220957828051906020012060116000866001600160a01b03166001600160a01b031681526020019081526020016000208281548110612ba657612ba6613750565b90600052602060002001604051612bbd9190613b3d565b604051809103902003612c9e576001600160a01b0384166000908152601160205260409020612bed600184613c53565b81548110612bfd57612bfd613750565b9060005260206000200160116000866001600160a01b03166001600160a01b031681526020019081526020016000208281548110612c3d57612c3d613750565b906000526020600020019081612c539190613a66565b506001600160a01b0384166000908152601160205260409020805480612c7b57612c7b613c66565b600190038181906000526020600020016000612c97919061307a565b9055612209565b80612ca881613766565b915050612b60565b612cbb8484846129e1565b612cc784848484612dee565b6122095760405162461bcd60e51b815260040161095d90613c7c565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612d225772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612d4e576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612d6c57662386f26fc10000830492506010015b6305f5e1008310612d84576305f5e100830492506008015b6127108310612d9857612710830492506004015b60648310612daa576064830492506002015b600a831061082a5760010192915050565b612dc58383612eef565b612dd26000848484612dee565b6109fe5760405162461bcd60e51b815260040161095d90613c7c565b60006001600160a01b0384163b15612ee457604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612e32903390899088908890600401613cce565b6020604051808303816000875af1925050508015612e6d575060408051601f3d908101601f19168201909252612e6a91810190613d01565b60015b612eca573d808015612e9b576040519150601f19603f3d011682016040523d82523d6000602084013e612ea0565b606091505b508051600003612ec25760405162461bcd60e51b815260040161095d90613c7c565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611918565b506001949350505050565b6001600160a01b038216612f455760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161095d565b6000818152600260205260409020546001600160a01b031615612faa5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161095d565b6000818152600260205260409020546001600160a01b03161561300f5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161095d565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b50805461308690613583565b6000825580601f10613096575050565b601f016020900490600052602060002090810190611d3e91905b808211156130c457600081556001016130b0565b5090565b6001600160e01b031981168114611d3e57600080fd5b6000602082840312156130f057600080fd5b813561130f816130c8565b60005b838110156131165781810151838201526020016130fe565b50506000910152565b600081518084526131378160208601602086016130fb565b601f01601f19169290920160200192915050565b60208152600061130f602083018461311f565b60006020828403121561317057600080fd5b5035919050565b80356001600160a01b038116811461318e57600080fd5b919050565b600080604083850312156131a657600080fd5b6131af83613177565b946020939093013593505050565b60008083601f8401126131cf57600080fd5b50813567ffffffffffffffff8111156131e757600080fd5b602083019150836020828501011115610d9557600080fd5b6000806020838503121561321257600080fd5b823567ffffffffffffffff81111561322957600080fd5b613235858286016131bd565b90969095509350505050565b60008060006060848603121561325657600080fd5b61325f84613177565b925061326d60208501613177565b9150604084013590509250925092565b60006020828403121561328f57600080fd5b61130f82613177565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156132c9576132c9613298565b604051601f8501601f19908116603f011681019082821181831017156132f1576132f1613298565b8160405280935085815286868601111561330a57600080fd5b858560208301376000602087830101525050509392505050565b60006020828403121561333657600080fd5b813567ffffffffffffffff81111561334d57600080fd5b8201601f8101841361335e57600080fd5b611918848235602084016132ae565b6000806040838503121561338057600080fd5b50508035926020909101359150565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156133e457603f198886030184526133d285835161311f565b945092850192908501906001016133b6565b5092979650505050505050565b600080600080600060a0868803121561340957600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b6000806040838503121561343f57600080fd5b61344883613177565b91506020830135801515811461345d57600080fd5b809150509250929050565b6000806000806080858703121561347e57600080fd5b61348785613177565b935061349560208601613177565b925060408501359150606085013567ffffffffffffffff8111156134b857600080fd5b8501601f810187136134c957600080fd5b6134d8878235602084016132ae565b91505092959194509250565b600080600080604085870312156134fa57600080fd5b843567ffffffffffffffff8082111561351257600080fd5b61351e888389016131bd565b9096509450602087013591508082111561353757600080fd5b50613544878288016131bd565b95989497509550505050565b6000806040838503121561356357600080fd5b61356c83613177565b915061357a60208401613177565b90509250929050565b600181811c9082168061359757607f821691505b602082108103611f0457634e487b7160e01b600052602260045260246000fd5b8183823760009101908152919050565b600082516135d98184602087016130fb565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761082a5761082a6135e3565b60008261362d57634e487b7160e01b600052601260045260246000fd5b500490565b601f8211156109fe57600081815260208120601f850160051c810160208610156136595750805b601f850160051c820191505b8181101561367857828155600101613665565b505050505050565b600019600383901b1c191660019190911b1790565b67ffffffffffffffff8311156136ad576136ad613298565b6136c1836136bb8354613583565b83613632565b6000601f8411600181146136ef57600085156136dd5750838201355b6136e78682613680565b845550613749565b600083815260209020601f19861690835b828110156137205786850135825560209485019460019092019101613700565b508682101561373d5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b634e487b7160e01b600052603260045260246000fd5b600060018201613778576137786135e3565b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208152600061191860208301848661377f565b600083516137ce8184602088016130fb565b8351908301906137e28183602088016130fb565b01949350505050565b600081546137f881613583565b60018281168015613810576001811461382557613854565b60ff1984168752821515830287019450613854565b8560005260208060002060005b8581101561384b5781548a820152908401908201613832565b50505082870194505b5050505092915050565b828482376000838201601760f91b815261387b60018201856137eb565b9695505050505050565b600061389182866137eb565b84516138a18183602089016130fb565b6138ad818301866137eb565b979650505050505050565b693d913730b6b2911d101160b11b815283516000906138de81600a8501602089016130fb565b7f222c20226465736372697074696f6e223a20224149204e616d65205365727669600a918401918201527f6365202d202e6169205765623320446f6d61696e73222c2022696d616765223a602a8201527f2022646174613a696d6167652f7376672b786d6c3b6261736536342c00000000604a82015284516139678160668401602089016130fb565b6b1116113632b733ba34111d1160a11b6066929091019182015283516139948160728401602088016130fb565b61227d60f01b6072929091019182015260740195945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000008152600082516139e881601d8501602087016130fb565b91909101601d0192915050565b604081526000613a0960408301858761377f565b9050826020830152949350505050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b818103613a71575050565b613a7b8254613583565b67ffffffffffffffff811115613a9357613a93613298565b613aa781613aa18454613583565b84613632565b6000601f821160018114613ad55760008315613ac35750848201545b613acd8482613680565b855550613749565b600085815260209020601f19841690600086815260209020845b83811015613b0f5782860154825560019586019590910190602001613aef565b5085831015613b2d5781850154600019600388901b60f8161c191681555b5050505050600190811b01905550565b600061130f82846137eb565b815167ffffffffffffffff811115613b6357613b63613298565b613b7181613aa18454613583565b602080601f831160018114613ba05760008415613b8e5750858301515b613b988582613680565b865550613678565b600085815260208120601f198616915b82811015613bcf57888601518255948401946001909101908401613bb0565b5085821015613b2d57939096015160001960f8600387901b161c19169092555050600190811b01905550565b8082018082111561082a5761082a6135e3565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b8181038181111561082a5761082a6135e3565b634e487b7160e01b600052603160045260246000fd5b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061387b9083018461311f565b600060208284031215613d1357600080fd5b815161130f816130c856fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212205aef6a8819df88b6651d58ecfd3e132a83c3ddf20ed964633786451a0cc3704e64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000026169000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _tld (string): ai
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [2] : 6169000000000000000000000000000000000000000000000000000000000000
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.